|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||28||6||6||31.579%|
Prof. Ossama Ismail, the ACPC regional contest director, has decided one year that when making the financial plan for the ACPC he would first give each team the same maximum amount of money (each team will get the amount A, where A is as maximum as possible), and then he would spend any remaining money on other needs of the contest. Note that our fund raising team is quite good and so we had risen a substantially large amount of money. Given the fund and the number of teams, can you help him to find out how much money would be spent on other needs of the contest?
Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases (1 ≤ T ≤ 100). Followed by T lines, each test case is a single line containing two integer N and X where N is the available fund (N is a positive integer without leading zeros and can consist of up to one million digits) and X is the number of teams. (1 ≤ X ≤ 107)
For each test case print a single line containing “Case n:” (without the quotes) where n is the test case number (starting from 1) followed by a space then R which is the money left to spend on other needs of the contest.
2 10 3 500 220
Case 1: 1 Case 2: 60