Poisioned Sweet
Submissions: 695   Accuracy:

29.69%

  Difficulty: Easy   Marks: 2

An enemy spy has poisoned one out of N sweets in a bakery. Even a bite of the poisoned sweet has potency to kill. However, the effects of the poison show only in 30 days. The managers asks the jailor to identify the poisoned sweet within 30 days. What is the least number of prisoners the jailor must employ to identify the poisoned sweet?
 

Note: A sweet can be eaten by any number of prisoners.
 

Input:
The first line of the input contains an integer T, denoting the number of test cases. Then T test cases follow. Each test case consists of a single integer N (Denoting number of total sweets)

Constraints:
1≤T≤100
1≤N≤10^4

Output
Corresponding to each test case, print in a new line the number of the prisoners.
Input
1
3

Output
2

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Siddharth Dungarwal
Author: sd5869


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.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.