#t325. 求和

求和

Summation

Problem Background

Special for beginners, ^_^

Problem Description

Write a recursive function that computes the sum 1+2+⋯+n1 + 2 + \cdots + n.

$$sum(n)= \begin{cases} 1, &n=1\\ n+sum(n-1), &n>1 \end{cases}$$

Input Format

One integer n  (1≤n≤104)n\;(1\le n \le 10^4).

Output Format

Output the sum 1+2+⋯+n1+2+\cdots +n.

Sample Input

4

Sample Output

10

Constraints

1 second, 1024 KiB for each test case.