- Time limit: 1.00 s
- Memory limit: 512 MB
Consider a two-dimensional grid whose rows and columns are 1-indexed. Each square contains the smallest nonnegative integer that does not appear to the left on the same row or above on the same column.
Your task is to calculate the value at square (y,x).
The only input line contains two integers y and x.
Print one integer: the value at square (y,x).
- 1 \le y,x \le 10^9