You are viewing a single comment's thread. Return to all comments →
What does this part mean But instead of printing complete answer you have to print answer modulo 109+7.
But instead of printing complete answer you have to print answer modulo 109+7.
Also the explaination of test case 2 is not related to how actually the method should be solved, there would be no way of discovering such pattern of 2^a and 3^a
Hi, as the output can be very large (exceeding the limits of 64 bits integer) modulo operation common way to check the correctness of output.
It is only a explanation that first series is power of two, while second is power of three. You don't have to find such patter.
Thank you very much ismailmarmoush and abhiranjan :) you guys saved my day.
Also, 10^9+7 wasn't chosen randomly.
It could be any prime number.