import java.io.*;
import java.util.*;
public class MoneyCount {
private void doIt() {
for( ; ; ) {
try {
int[] a = { 10000, 5000, 2000, 1000, 500, 200, 100, 50, 25, 10, 5, 1, };
int[] b = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, };
double d
= Double.
parseDouble(br.
readLine()); int num = (int)(d * 100);
if(num == 0) { break; }
int sz = a.length;
for(int i=0; i<sz; i++) {
if(num >= a[i]) {
b[i] = num / a[i];
num -= a[i] * b[i];
}
}
for(int i=0; i<sz; i++) {
if(a[i] >= 100) {
System.
out.
printf("$%3d: %3d枚\n", a
[i
] / 100, b
[i
]); } else {
System.
out.
printf("c%3d: %3d枚\n", a
[i
], b
[i
]); }
}
ex.printStackTrace();
ex.printStackTrace();
}
}
if(br
!= null) { try { br.
close(); } catch(Exception ex
) {} } }
public static void main
(String[] args
) { new MoneyCount().doIt();
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwpwdWJsaWMgY2xhc3MgTW9uZXlDb3VudCB7CiAgICBwcml2YXRlIHZvaWQgZG9JdCgpIHsKICAgICAgICBCdWZmZXJlZFJlYWRlciBiciA9IG51bGw7CiAgICAgICAgZm9yKCA7IDsgKSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBpbnRbXSBhID0geyAxMDAwMCwgNTAwMCwgMjAwMCwgMTAwMCwgNTAwLCAyMDAsIDEwMCwgNTAsIDI1LCAxMCwgNSwgMSwgfTsKICAgICAgICAgICAgICAgIGludFtdIGIgPSB7ICAgICAwLCAgICAwLCAgICAwLCAgICAwLCAgIDAsICAgMCwgICAwLCAgMCwgIDAsICAwLCAwLCAwLCB9OwogICAgICAgICAgICAgICAgYnIgPSBuZXcgQnVmZmVyZWRSZWFkZXIobmV3IElucHV0U3RyZWFtUmVhZGVyKFN5c3RlbS5pbikpOwogICAgICAgICAgICAgICAgZG91YmxlIGQgPSBEb3VibGUucGFyc2VEb3VibGUoYnIucmVhZExpbmUoKSk7CiAgICAgICAgICAgICAgICBpbnQgbnVtID0gKGludCkoZCAqIDEwMCk7CiAgICAgICAgICAgICAgICBpZihudW0gPT0gMCkgeyBicmVhazsgfQogICAgICAgICAgICAgICAgaWYobnVtIDwgMCB8fCBudW0gIT0gZCAqIDEwMCkgeyB0aHJvdyBuZXcgTnVtYmVyRm9ybWF0RXhjZXB0aW9uKCk7IH0KICAgICAgICAgICAgICAgIGludCBzeiA9IGEubGVuZ3RoOwogICAgICAgICAgICAgICAgZm9yKGludCBpPTA7IGk8c3o7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGlmKG51bSA+PSBhW2ldKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJbaV0gPSBudW0gLyBhW2ldOwogICAgICAgICAgICAgICAgICAgICAgICBudW0gLT0gYVtpXSAqIGJbaV07CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZm9yKGludCBpPTA7IGk8c3o7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGlmKGFbaV0gPj0gMTAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRmKCIkJTNkOiAlM2TmnppcbiIsIGFbaV0gLyAxMDAsIGJbaV0pOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRmKCJjJTNkOiAlM2TmnppcbiIsIGFbaV0sIGJbaV0pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBjYXRjaChOdW1iZXJGb3JtYXRFeGNlcHRpb24gZXgpIHsKICAgICAgICAgICAgICAgIGV4LnByaW50U3RhY2tUcmFjZSgpOwogICAgICAgICAgICB9IGNhdGNoKElPRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICAgICBleC5wcmludFN0YWNrVHJhY2UoKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZihiciAhPSBudWxsKSB7IHRyeSB7IGJyLmNsb3NlKCk7IH0gY2F0Y2goRXhjZXB0aW9uIGV4KSB7fSB9CiAgICB9CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgbmV3IE1vbmV5Q291bnQoKS5kb0l0KCk7CiAgICB9Cn0=