Given two positive integers, a and b. You have to concatenate all the integers from a to b (inclusive) to form a very, very large number. Calculate this number modulo p.
There are multiple test cases.
Each test case consists of a single line containing the three intergers - a, b and p, listed in this order.
Input is terminated by EOF (End of File).
1 <= a <= b <= 1018.
1 <= p <= 109.
Total number of test cases is around 1000.
For each test case, output one line - the answer.
1 9 17 9 12 23
1 12
Migrated from old NTUJ.
CodeCraft 2010
No. | Testdata Range | Score |
---|