B. Stairs SOLUTION CODEFORCES

Stairs SOLUTION

Jett is drained subsequent to pulverizing the town and she needs to have a rest. She enjoys high places, that is the reason for having a rest she needs to get high and she chose to make flights of stairs.

Flight of stairs is a squared figure that comprises of square cells. Every flight of stairs comprises of a discretionary number of steps. On the off chance that a flight of stairs has n steps, at that point it is made of n sections, the main segment is 1 cell high, the subsequent segment is 2 cells high, … , the n-th segment if n cells high. The most reduced cells of all steps must be in a similar line.

A flight of stairs with n steps is called pleasant, on the off chance that it might be secured by n disjoint squares made of cells. All squares ought to completely comprise of cells of a flight of stairs.

This is the means by which a decent secured flight of stairs with 7 steps resembles:

Discover the maximal number of various decent flights of stairs, that can be manufactured, utilizing close to x cells, altogether. No cell can be utilized more than once.

Information

The primary line contains a solitary whole number t (1≤t≤1000) — the quantity of experiments.

The portrayal of each experiment contains a solitary whole number x (1≤x≤1018) — the quantity of cells for building flights of stairs.

Yield

For each experiment yield a solitary whole number — the quantity of various pleasant flights of stairs, that can be fabricated, utilizing not more than x cells, altogether.

Model

input

4

1

8

6

1000000000000000000

output

1

2

1

30

Note

In the principal experiment, it is conceivable to manufacture just a single flight of stairs, that comprises of 1 step. It’s pleasant. That is the reason the appropriate response is 1.

In the subsequent experiment, it is conceivable to construct two distinctive pleasant flights of stairs: one comprises of 1 step, and another comprises of 3 steps. This will cost 7 cells. For this situation, there is one cell left, yet it is unimaginable to expect to utilize it for building any decent flights of stairs, that have not been manufactured at this point. That is the reason the appropriate response is 2.

In the third experiment, it is conceivable to manufacture just one of two decent flights of stairs: with 1 step or with 3 steps. In the main case, there will be 5 cells left, that might be utilized uniquely to fabricate a flight of stairs with 2 steps. This flight of stairs isn’t decent, and Jett just forms pleasant flights of stairs. That is the reason for this situation the appropriate response is 1. On the off chance that Jett fabricates a flight of stairs with 3 steps, at that point there are no more cells left, so the appropriate response is 1 once more.

Related : 

Leave a Comment

close
error: Content is protected !!