Dominoes are tile pieces used in various games. A domino piece consists of two squares. Each square is marked with dots, but may or may not be marked with dots. The number of dots is determined by the size of the set. In a domino set of size N, the number of dots is greater than or equal to 0 and less than or equal to N. If two dominoes have the same number of dots, they are equal. For example, a domino with 2 dots and 8 dots is the same as a domino with 8 dots and 2 dots.
A domino set of size N contains all possible dominoes with N or fewer or equal points, and each domino is unique. The following is a domino set of size 2.
After receiving N as input, write a program that calculates how many dots are in a domino set of size N.
The first line contains the size N of the domino set (1 ≤ N ≤ 1000).
Print the number of dots printed on a set of dominoes of size N.
2
12
3
30
15
2040
| 編號 | 身分 | 題目 | 主題 | 人氣 | 發表日期 |
|
沒有發現任何「解題報告」
|
|||||