#P5722. 【深基4.例11】数列求和

【深基4.例11】数列求和

Problem Description

Compute the value of 1+2+3++(n1)+n1+2+3+\cdots+(n-1)+n, where the positive integer nn is no more than 100. Since you are not as smart as Gauss, you are not allowed to use the arithmetic sequence sum formula to get the answer directly.

Input Format

Input a positive integer nn.

Output Format

Output a positive integer representing the final sum.

100
5050

Hint

Constraints: 1n1001 \leq n \leq 100.

Translated by ChatGPT 5