Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Conscription
Description Windy has a country, and he wants to build an army to protect his country. He has picked up Input The first line of input is the number of test case. y and _{i}d._{i}There is a blank line before each test case. 1 ≤ N0 ≤ y < _{i}M0 < d < 10000_{i}Output For each test case output the answer in a single line. Sample Input 2 5 5 8 4 3 6831 1 3 4583 0 0 6592 0 1 3063 3 3 4975 1 3 2049 4 2 2104 2 2 781 5 5 10 2 4 9820 3 2 6236 3 1 8864 2 4 8326 2 0 5156 2 0 1463 4 1 2439 0 4 4373 3 4 8889 2 4 3133 Sample Output 71071 54223 Source POJ Monthly Contest – 2009.04.05, windy7926778 |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator