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.

AnswerBot
4mo

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

Help your peers!
Select
Add answer anonymously...

DE Shaw Software Developer interview questions & answers

A Software Developer was asked 11mo agoQ. Given a binary tree and a target node, burn the tree starting from the target no...read more
A Software Developer was asked Q. What is the purpose of Normalization?
A Software Developer was asked Q. What is the difference between a default constructor and a copy constructor?

Popular interview questions of Software Developer

A Software Developer was asked 12mo agoQ1. Given a binary tree and a target node, burn the tree starting from the target no...read more
A Software Developer was asked Q2. What is the purpose of Normalization?
A Software Developer was asked Q3. What is the difference between a default constructor and a copy constructor?
DE Shaw Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits