CF226C Anniversary
Description
There are less than 60 years left till the 900-th birthday anniversary of a famous Italian mathematician Leonardo Fibonacci. Of course, such important anniversary needs much preparations.
Dima is sure that it'll be great to learn to solve the following problem by the Big Day: You're given a set $ A $ , consisting of numbers $ l $ , $ l+1 $ , $ l+2 $ , $ ... $ , $ r $ ; let's consider all its $ k $ -element subsets; for each such subset let's find the largest common divisor of Fibonacci numbers with indexes, determined by the subset elements. Among all found common divisors, Dima is interested in the largest one.
Dima asked to remind you that Fibonacci numbers are elements of a numeric sequence, where $ F_{1}=1 $ , $ F_{2}=1 $ , $ F_{n}=F_{n-1}+F_{n-2} $ for $ n>=3 $ .
Dima has more than half a century ahead to solve the given task, but you only have two hours. Count the residue from dividing the sought largest common divisor by $ m $ .
Input Format
N/A
Output Format
N/A