프로그램 명: coci_liga
제한시간: 1 초

While the players are resting between sets, the station puts on tedious commercials. Zvonko fires up the teletext feature on his TV set and is reviewing the latest scores and standings in the football league. Always sharp, he has come up with a new mathematical game.

The standings table contains five statistics for each team: the total number of games played, how many of those games the team won, drew and lost, and points earned. A team earns 3 points for every win and 1 point for every draw.

Zvonko noticed that the values of some fields can be determined from the others. Write a program that takes in a table in which the values of some fields are unknown, and fills in the missing fields.

The data for different teams is not related. For example, it is possible that the table says all teams have won all their games (although that is not possible in a real league).

Each team will have played at most 100 games (even though that can be one of the missing fields).

입력

The input will be consistent and there will be a unique way to determine the values of the missing fields.

출력

Output the table with the missing fields filled in.

Note: For each test case, your program will receive a score linearly proportional to the number of correctly solved teams, rounded down. If your program exceeds the time limit or another error occurs, the score for that test case will be 0.

입출력 예

input 

5 
27 21 3 3 66 
27 18 6 3 ? 
? 15 5 7 50 
? 14 7 5 ? 
? 14 ? 8 47 

output 

27 21 3 3 66 
27 18 6 3 60 
27 15 5 7 50 
26 14 7 5 49 
27 14 5 8 47
출처:coci/2006-2007/contest5 4

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]