13 人解决,18 人已尝试。
13 份提交通过,共有 47 份提交。
5.6 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
In a strange shop, it has a very strange rule:
If the cost is $n$ yuan, you have $m$ yuan in hand and pay for it using $q$ yuan $(n \le q \le m)$, so he should return $r=(q-n)$ yuan to you,but he refuses to sell it if you can’t show him $r$ yuan in your hand.
Now, you want to know the minmum coins you should bring with if you only know what you buy cost is no more than $n$ yuan. The value of coin can be any positive integers.
Input starts with an integer $T$, denoting the number of test cases.
Each test case has an integer $n$ $(1 \le n \le 2~147~483~647$) in a single line.
For each case, print the case number and the result.
3 1 2 5
Case 1: 1 Case 2: 2 Case 3: 3