We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Hi, I have solved the question but finding it difficult to match the answeres using the modulo operator.
My question is to understand the right usage of the modulo operator. For example, consider the fibonacci series mentioned in the problem description. [n=2, k=6, [13,8], [1,1]] First, we will find F(4) using the recurrance equation. But in the recurrance equation, i have the term 10^9 + 7. So how do i find F(4) with F(5), F(6), C(1) and C(2) and the modulo operator.
Without the modulo operator, F(4) = ( F(6) - ((F(5)*C(1)) / C(2).
As i'am new to Competetive programming, i am unable to print the right answer using the modulo operator. Any help/suggestions will be greatly appreciated.
Thanks
Pavan
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Seed
You are viewing a single comment's thread. Return to all comments →
Hi, I have solved the question but finding it difficult to match the answeres using the modulo operator.
My question is to understand the right usage of the modulo operator. For example, consider the fibonacci series mentioned in the problem description. [n=2, k=6, [13,8], [1,1]] First, we will find F(4) using the recurrance equation. But in the recurrance equation, i have the term 10^9 + 7. So how do i find F(4) with F(5), F(6), C(1) and C(2) and the modulo operator. Without the modulo operator, F(4) = ( F(6) - ((F(5)*C(1)) / C(2).
As i'am new to Competetive programming, i am unable to print the right answer using the modulo operator. Any help/suggestions will be greatly appreciated.
Thanks
Pavan