아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Just like pickle

시간 제한1초메모리 제한1024 MB

요약
목표 좌표 x가 주어질 때, 0에서 시작해 길이 2^k인 점프(방향은 자유)만으로 도달하는 최소 횟수를 구한다.
난이도

보통10점 중 4점

유형
비트 연산, 그리디, 수학
정답자
아직 제출이 없습니다

문제

Grasshopper is standing on a line at a point with coordinate 00. In one turn it can choose any non-negative integer number kk and jump to the left or to the right to the distance 2k2^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 00 to the point with coordinate xx.

입력

The first line contains a single integer tt --- a number of test cases (1≤t≤100,0001 \le t \le 100\\,000).

Each test case consists of a single line, that contains a single integer xx --- coordinate of a target point for the grasshopper (−1018≤x≤1018-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

  1. 예제 1

    입력
    5
    1
    -4
    0
    -7
    239
    
    예상 출력
    1
    1
    0
    2
    3