Displacing Particles
시간 제한1초메모리 제한1024 MB
한 변의 길이가 2^N인 정사각형의 중심에서 시작해 네 꼭짓점 중 하나로 거리를 절반씩 줄여 나갈 때, 점 (x, y)에 도달하는 최소 횟수를 구한다.
문제
A square has its vertices at the coordinates , , , . Each vertex has an attractor. A particle is placed initially at position . Each attractor can be activated individually, any number of times. When an attractor at position is activated, if a particle is at position , it will be moved to the midpoint between and .
Given and a point , calculate the least number of times you have to activate the attractors so that the particle ends up at position .
입력
The input consists of a single line containing three integers , and , such that and .
출력
Print a single line, containing the least number of times you have to active the attractors.