| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 147 | 133 | 111 | 94.068% |
In Japan, the multiplication table below is learned in elementary schools.
Such a table with 9ドル \times 9$ items, called kuku in Japanese, is not necessarily a world standard. In some cultures, 12ドル \times 12$ or 20ドル \times 20$ tables are learned.
Interestingly, the total of all the 9ドル \times 9$ items in the kuku table is 2025ドル,ドル which happens to be this year. Are there any other interesting cases like this?
Your task is to compute, for a given integer $n,ドル the sum of all the items in an $n \times n$ multiplication table. More specifically, find $$\displaystyle\sum_{a=1}^n \sum_{b=1}^n ab\text{.}$$
The input consists of at most 100ドル$ test cases. Each test case is a line containing one integer $n$ (1ドル ≤ n ≤ 100$).
The end of the input is indicated by a line consisting only of a zero.
For each test case, output the value of $$\displaystyle\sum_{a=1}^n \sum_{b=1}^n ab$$ in a line.
9 1 2 100 0
2025 1 9 25502500
ICPC > Regionals > Asia Pacific > Japan > Japan Domestic Contest > 2025 Japan Domestic Contest A번