Given ‘N’ = 2
On Day 1 = 1
On Day 2 = 2
Total Amount = 1 + 2 = 3.
Therefore the answer is 3.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first and the only line of each test case contains a single integer ‘N’,that is the number of days.
For each test case, print the total amount of money after N days.
The output of each test case will be printed in a separate line.
1 <= T <= 10
1 <= N <= 5000
Where ‘T’ is the total number of test cases, and N is the number of days.
Time limit: 1sec.
The main idea is to loop from 1 to ‘N’ and add 1 coin more than we did yesterday and every time we complete a week, set the coin value to the number of weeks that have passed.
The main idea is to observe that for every fullweek we complete we add an extra rupee than we did last monday.Therefore formulate the problem as taught below: