| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 459 | 407 | 370 | 89.372% |
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번