Logo
(追記) (追記ここまで)

10696번 - Prof. Ossama 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB54225521345.708%

문제

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.

제한

예제 입력 1

2
10 3
500 220

예제 출력 1

Case 1: 1
Case 2: 60

힌트

출처

ICPC > Regionals > Africa and Arab > Arab Collegiate Programming Contest > Tunisian Collegiate Programming Contest > TCPC 2013 H번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /