NEWCURR - New Currency Shopping
Imagine that you have only one rupee and two rupee coin with you. Given a sum “n” to pay to the shopkeeper using only these 2 coins, in how many ways can it be done? Since the answer can be pretty large, print the answer modulo “12345678901”. Also, the order in which the coins were given matter.
The first line contains the number of test cases ‘t’. Then t lines follow, each having a number ‘n’.
For each number ‘n’ output the corresponding answer, after modulo operation.
@Francky How did you to get to the editorial ?
Taking modulo after every operation, still the answer overflows. Do we have to multiply using arrays? MODULO is very large, MOD*MOD overflowsLast edit: 2016-01-30 14:05:34
There are many such problems ; moved to tutorial.