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.

Put 1 candy in first packet.

Put 2 candies in second packet.

Put 1 candy in third packet.

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.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

devsinghindra | 80 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 443 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.