#K63662. Fibonacci Number and Cumulative Sum
Fibonacci Number and Cumulative Sum
Fibonacci Number and Cumulative Sum
Given a non-negative integer \(n\), compute the \(n\)th Fibonacci number \(F(n)\) and the sum of the first \(n\) Fibonacci numbers. The Fibonacci sequence is defined as:
\[ F(0)=0,\quad F(1)=1,\quad F(n)=F(n-1)+F(n-2) \text{ for } n \geq 2 \]
Let \(S(n)\) represent the sum of the first \(n\) Fibonacci numbers, i.e., \[ S(n)=F(0)+F(1)+\cdots+F(n)\]
Your task is to read an integer \(n\) from standard input and output two numbers: \(F(n)\) and \(S(n)\), separated by a space.
inputFormat
The input consists of a single line containing a non-negative integer \(n\) \((0 \leq n \leq 10^5)\). You can assume that \(n\) is small enough that the Fibonacci numbers and their sum will fit within a 64-bit integer.
outputFormat
Output a single line with two integers separated by a space: the \(n\)th Fibonacci number \(F(n)\) and the sum \(S(n)\) of the first \(n\) Fibonacci numbers.
## sample0
0 0
</p>