| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 29 | 23 | 20 | 95.238% |
A square has its vertices at the coordinates $(0, 0),ドル $(0, 2^N),ドル $(2^N , 2^N ),ドル $(2^N , 0)$. Each vertex has an attractor. A particle is placed initially at position $(2^{N-1} , 2^{N-1})$. Each attractor can be activated individually, any number of times. When an attractor at position $(i, j)$ is activated, if a particle is at position $(p, q),ドル it will be moved to the midpoint between $(i, j)$ and $(p, q)$.
Given $N$ and a point $(x, y),ドル calculate the least number of times you have to activate the attractors so that the particle ends up at position $(x, y)$.
The input consists of a single line containing three integers $N,ドル $x$ and $y,ドル such that 1ドル ≤ N ≤ 20$ and 0ドル < x, y < 2^N$.
Print a single line, containing the least number of times you have to active the attractors.
1 1 1
0
4 12 4
1
4 3 1
3