People of Turing Town are capable of nothing less than magic and that is why the 3 main units of coinage are the Bronze Knuts, Silver Sickles and Gold Galleons. 29 knuts make a sickle and 17 sickles make a galleon. Given ‘K’ knuts, convert this into galleons, sickles and knuts by first converting as many knuts as possible to galleons and then the remaining knuts to as many sickles as possible. Display the output in the format shown below.
No. of galleons, sickles and knuts.
0 <= K <= 10000
Time Limit – 1 sec
Input: 533 Output: 1 galleons 1 sickles 11 knuts
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.