Logo
(追記) (追記ここまで)

27186번 - Just like pickle 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB37201252.174%

문제

Grasshopper is standing on a line at a point with coordinate 0ドル$. In one turn it can choose any non-negative integer number $k$ and jump to the left or to the right to the distance 2ドル^k$.

Help it to find out what is the minimum number of turns it has to do in order to move from the point with coordinate 0ドル$ to the point with coordinate $x$.

입력

The first line contains a single integer $t$ --- a number of test cases (1ドル \le t \le 100,000円$).

Each test case consists of a single line, that contains a single integer $x$ --- coordinate of a target point for the grasshopper ($-10^{18} \le x \le 10^{18}$).

출력

For each test case output a single integer --- the minimum number of turns that the grasshopper has to do.

제한

예제 입력 1

5
1
-4
0
-7
239

예제 출력 1

1
1
0
2
3

힌트

출처

Olympiad > Russian Olympiad in Informatics > Russia High School Programming Contest > Russia High School Programming Contest 2022 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /