#t281. 面值组合
面值组合
Denomination Combinations
Problem Background
Special for beginners, ^_^
Problem Description
Use -jiao, -jiao, and -jiao coupons to make up jiao. Let be the numbers of -jiao, -jiao, and -jiao coupons used, respectively. List all possible combinations of .
The output order is: first by in increasing order; if is the same, then by in increasing order.
Input Format
One integer (), the amount in jiao to be made up.
Output Format
Output several lines, each line in the form:
i a b c
The first column is the current line number (starting from 001, a fixed width of characters, zero-padded on the left if shorter). The following three columns are the numbers of -jiao, -jiao, and -jiao coupons (each fixed at characters wide, padded with spaces on the left).
Sample Input
10
Sample Output
001 10 0 0
002 8 1 0
003 6 2 0
004 4 3 0
005 2 4 0
006 0 5 0
007 5 0 1
008 3 1 1
009 1 2 1
010 0 0 2
Constraints
Time limit: 1s, memory limit: 1024KiB for each test case.
Hint
Each of is right-aligned in a field of width ; the line number is zero-padded to width .