[NOIP 2015 普及组] 金币
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Background
NOIP 2015 Junior T1.
Problem 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