F - Fibonacci Squared

Languages: C, C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
4 2 3 5 7
Output
14 38 182 633
Input
4 10 100 1000 10000
Output
3233 568233175 98340106 623251609

Hints