#P2669. [NOIP 2015 普及组] 金币
[NOIP 2015 普及组] 金币
Description
The king pays his loyal knight in gold coins. On day 1, the knight receives 1 coin; then for the next two days (days 2 and 3), he receives 2 coins per day; then for the next three days (days 4, 5, and 6), he receives 3 coins per day; then for the next four days (days 7, 8, 9, and 10), he receives 4 coins per day; and so on. This payment pattern continues indefinitely: after receiving coins per day for consecutive days, the knight will receive coins per day for the next consecutive days.
Please compute how many coins the knight has received in the first days.
Input Format
A positive integer , representing the number of days of coin distribution.
Output Format
A positive integer, the number of coins the knight receives.
6
14
1000
29820
Hint
[Sample 1 Explanation]
On day 1 the knight receives 1 coin; on days 2 and 3, he receives 2 coins per day; on days 4, 5, and 6, he receives 3 coins per day. Therefore the total is coins.
Constraints: For 100% of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号