#P2535. Integer Summations
Integer Summations
Integer Summations
Given a positive integer n, you need to compute two summations:
1. The sum of the first n natural numbers:
$$S_1=\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$
2. The sum of the squares of the first n natural numbers:
$$S_2=\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}$$
Output the two results separated by a single space.
inputFormat
A single positive integer n.
outputFormat
Print the sum of the first n natural numbers and the sum of the squares of the first n natural numbers separated by a space.
sample
1
1 1