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

24325번 - Making Change 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB103868389.247%

문제

Anakin Skywalker is leaving Tatoonie, but before he can go he must program a droid to do his old job of making change for customers at Watto’s junk business. Given the price of an item and the payment determine the correct change using \50,ドル \20,ドル \10,ドル \5,ドル and \1ドル bills. You don’t have to worry about change, because Watto always keeps the change.

입력

A positive integer, n, on the first line indicating the number of data sets to follow. Each data set will consist of two positive numbers. The first is the cost to the customer and the second is the payment made by the customer. The payment will always be greater than the cost.

출력

For each data set print the correct change on one line using the format

v-50,ドル w-20,ドル x-10,ドル y-5,ドル z-1ドル

where v, w, x, y, z are the number of bills needed to make the correct change. Of course, the correct change will always use larger bills when possible (i.e., 1-\5ドル not 5-\1ドル)

제한

예제 입력 1

3
1894.77 2000.00
77.15 100.40
25.50 100.00

예제 출력 1

2-50,ドル 0-20,ドル 0-10,ドル 1-5,ドル 0-1ドル
0-50,ドル 1-20,ドル 0-10,ドル 0-5,ドル 3-1ドル
1-50,ドル 1-20,ドル 0-10,ドル 0-5,ドル 4-1ドル

힌트

출처

School > PLU High School Programming Contest > PLU 2011 > Advanced 5번

School > PLU High School Programming Contest > PLU 2011 > Novice 9번

Olympiad > Canadian Computing Competition & Olympiad > 2007 > CCO 2007 5번

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

출처

대학교 대회

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

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