Money Saving in Bank Problem
Harshit wants to save up money for his first car by depositing money daily in the Ninja bank with a specific increment strategy.
Starting with 1 rupee on the first Monday, the amount increases by 1 rupee each day from Tuesday to Sunday. Each new Monday starts with an additional rupee more than the previous Monday's deposit.
Your task is to calculate the total money Harshit will have at the end of the Nth day given a positive integer N.
Input:
The first line contains a single integer T, the number of test cases.
For each test case, a single integer N is provided denoting the number of days.
Output:
For each test case, output the total amount of money accumulated after N days.
Print each result on a new line.
Example:
Input:
2
2
5
Output:
3
15
Constraints:
- 1 ≤ T ≤ 10
- 1 ≤ N ≤ 5000
- Time limit: 1 second
Note:
For the given test cases:
With N = 2, Harshit deposits 1 on Day 1 and 2 on Day 2, totaling 3 rupees.
With N = 5, his total deposits are 1 on Day 1, 2 on Day 2, 3 on Day 3, 4 on Day 4, and 5 on Day 5, totaling 15 rupees.
Calculate the total money accumulated by Harshit in Ninja bank after N days with a specific increment strategy.
Start with 1 rupee on the first Monday and increase by 1 rupee each day from Tuesday to S...read more
Top DE Shaw Software Developer interview questions & answers
Popular interview questions of Software Developer
Top HR questions asked in DE Shaw Software Developer
Reviews
Interviews
Salaries
Users/Month