#C13438. Fibonacci Number Computation

    ID: 42976 Type: Default 1000ms 256MiB

Fibonacci Number Computation

Fibonacci Number Computation

Given a positive integer \(n\), compute the \(n\)th Fibonacci number using two methods: an iterative approach and a recursive approach. The Fibonacci sequence is defined as follows:

\(F_1 = 1, F_2 = 1,\) and for \(n \ge 3\), \(F_n = F_{n-1} + F_{n-2}\).

Your task is to read the integer from standard input (stdin) and output two lines to standard output (stdout): the first line should be the result computed using the iterative method, and the second line should be the result computed using the recursive method. If the input is not a positive integer, output the error message "n must be a positive integer".

inputFormat

The input consists of a single line containing a positive integer \(n\), which represents the position in the Fibonacci sequence.

outputFormat

The output should contain two lines. The first line is the \(n\)th Fibonacci number computed iteratively, and the second line is the \(n\)th Fibonacci number computed recursively.

## sample
1
1

1

</p>