Coins of 1, 3 and 4
Using unlimited coins of denominations 1, 3 and 4, print the minimum number of coins summing to exactly N.
Input: one integer N.
Output: the minimum coin count.
Constraints:
- 0 ≤ N ≤ 106
Sample Tests
Input 1
6
Output 1
2
Input 2
0
Output 2
0
Discussion (opens after you solve — no spoilers before)
No comments yet.