Playing With Numbers
Time Limit: 0.5 sec
The Problem
Mouri loves to play with numbers. She randomly writes a number to a page that can be 5,8 or 100 whatever she wishes. Then she tries to find the 2nd number that is related to first number applying any law and then place it later to the first. Thus in case of 3rd, 4th continues. One day suddenly a trick came to her mind.
The trick is you will be given some numbers starting from first of a series. Then a position will be said to you. You have to find out the number of that position maintaining given law of series. The series is 2, 3, 5, 6, 8, 9, . . .
The Input
In the first line there will be a positive integer T (T<=100) that is the test case. In the next T lines there will be A positive integer N (1<=N<=100000000) in each line.
The Output
For every Test case you have to print the required answer with the case number like that “Case 1: output”. Cases have to be printed without quotation.
Sample Input
2
3
10000
Sample Output
Case 1: 5
Case 2: 15000
Online Practice Contest 2 [School & College Level]
Problem Setter: Sumaia Bristy (Mentor of NHSPC)