Forgot Password ?
New password will be sent to following email id
Problem Code : CUPCAKES
2 2 5
Time Limit :
C , C++ , Java , Python 2
Login to submit your response.
Now that Chotu has finished baking and frosting his cupcakes, it's time to package them. Chotu has N cupcakes, and needs to decide how many cupcakes to place in each package. Each package must contain the same number of cupcakes. Chotu will choose an integer A between 1 and N, inclusive, and place exactly A cupcakes into each package. Chotu makes as many packages as possible. Chotu then gets to eat the remaining cupcakes. Chotu enjoys eating cupcakes very much. Help Chotu choose the package size A that will let him eat as many cupcakes as possible.
Input begins with an integer <b>T</b>, the number of test cases. Each test case consists of a single integer N, the number of cupcakes.
For each test case, output the package size that will maximize the number of leftover cupcakes. If multiple package sizes will result in the same number of leftover cupcakes, print the largest such size.
1<= <b>T</b><=1000<br> 1<=<b>N</b><=100000000