In the recent parliament election, none of the parties have vast majority of seats, so there should be a coalition to select the members of the Management Board, which are one speaker, two deputy speakers and six secretaries. The board has a special voting system: the speaker has 25 votes, deputy speakers have 8 votes and each secretary has 1 vote.
ACM party decides to take a commanding role and shape the coalition, but they are m
Knowing the demands of all other parties, ACM wants to know how powerful it can be in Management Board. This means that ACM wants to maximize its number of votes while forming a coalition with other parties such that it overcomes its shortage of m
The input contains multiple test cases. Each test case starts with a line containing two integers n
$(n \le 50)$
-->
(n<=50)
$0 \le a \le 1$
-->
0<=a<=1
$0 \le b \le 2$
-->
0<=b<=2
$0 \le c \le 6$
-->
0<=c<=6
<tt> or </tt>" and are terminated with a semicolon in the end (see the sample input). The input is terminated with a line containing
0 0'.
* If you really want to know, we have m<=10000 for each test case.
For each test case, write a single line containing three integers, which represent speaker, deputy speaker and secretaries which ACM party can have in the coalition to have maximum votes in board's voting system.
3 4 1: (0,0,0); 2: (1,2,0); 3: (1,0,5) or (1,2,0) or (0,2,6); 1 0 1: (1,1,1); 1 1 1: (1,1,1); 4 6 6: (1,0,0) or (1,2,6); 2: (0,2,0); 2: (0,0,3); 2: (0,0,3); 0 0
1 0 0 1 2 6 0 1 5 1 0 0
Migrated from old NTUJ.
ICPC Tehran, 2008
No. | Testdata Range | Score |
---|