0

Fibonacci Sequence modulo M
Given integers \$a,b,m, k, n\$ and array \$F = (f_1, f_2,...,f_n)\$ defined as:
\begin{cases}
f_1 = \text{a}\\
f_2 = \text{b}\\
f_i = (f_{i-1} + f_{i-2}) \text{ mod m},∀i > 2
\end{cases}
When \$F\$ array is sorted into a non-decreasing sequence, your task is to find th...