#K3186. Fibonacci Fruit Baskets
Fibonacci Fruit Baskets
Fibonacci Fruit Baskets
In this problem, you are given an integer ( n ) and are required to complete two tasks:
-
Compute the first ( n ) Fibonacci numbers defined by the recurrence: ( F_1 = 1, F_2 = 1 ) and ( F_i = F_{i-1} + F_{i-2} ) for ( i \geq 3 ).
-
Calculate the minimum and maximum weight of a fruit basket. The minimum weight is defined as ( n \times 1 ) (each fruit weighing 1), and the maximum weight is defined by the sum of the first ( n ) Fibonacci numbers, i.e., ( \sum_{i=1}^{n} F_i ).
Your task is to print the Fibonacci sequence on the first line (numbers separated by a single space) and on the second line print the minimum and maximum weights separated by a space.
inputFormat
The input consists of a single integer ( n ) ((1 \leq n \leq 10^5)).
outputFormat
Output two lines. The first line contains the first ( n ) Fibonacci numbers separated by spaces. The second line contains two integers representing the minimum weight (( n )) and the maximum weight (( \sum_{i=1}^{n} F_i )) of the fruit basket, separated by a space.## sample
1
1
1 1
</p>