Ishaan has N candies with him. He wants to put them in packets. He can put 1 candy in the first packet, 2 candies in the second packet, 4 candies in the third and so on.

Calculate the minimum number of packets he needs to store all the candies if he fills the packets starting from the first packet.

**Input : **

First line of input contains a single integer T denoting the number of test cases.

The only line of each test case contains an integer N.

**Output : **

For each test case, print the required answer in a new line.

**Constraints :**

1 <= T <= 200

1 <= N <= 10^15

**Example :
Input : **

3

2

4

7

2

3

3

**Explanation :
Case 1 :**

Put 1 candy in first packet.

Put 1 candy in second packet.

**Case 2 :**

Put 1 candy in first packet.

Put 2 candies in second packet.

Put 1 candy in third packet.

**Case 3 : **

Put 1 candy in first packet.

Put 2 candies in second packet.

Put 4 candy in third packet.

Author: goyalanubhav11

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

SashaV | 220 |

VivSisMMM | 216 |

GustavoMéndez | 210 |

GHJKL | 196 |

d_Coder00 | 189 |

Pulkit__Sharma__ | 742 |

Anirban166 | 677 |

Found_me | 598 |

abducodes | 590 |

Sathvik Avasarala | 518 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4559 |

Login to report an issue on this page.