Time limit
1s
Memory limit
128 MB
Each participant rolls four dice whose faces are numbered from 1 through 6. The prize for one participant is determined by the combination of the four rolled faces.
50000 + face * 5000.10000 + face * 1000.2000 + (sum of the paired faces) * 500.1000 + paired face * 100.largest face * 100.Given the results for N participants, print the largest prize.
The first line contains the number of participants N. (1 <= N <= 1000)
Each of the next N lines contains four integers separated by spaces, representing the faces rolled by one participant. Each face is an integer from 1 to 6.
Print the largest prize among all participants.