Dice Game
InterviewTime limit1sMemory limit128 MB
For each player's three dice rolls, compute a prize using given rules and print the maximum prize among all players.
- Level
Easy2 of 10
- Topics
- Simulation, Implementation
- Solved
- No attempts yet
Problem
Three dice, each with faces from 1 to 6, are rolled. The prize for one player is determined as follows.
- If all three dice show the same face, the prize is 10,000 + (that face) × 1,000.
- If exactly two dice show the same face, the prize is 1,000 + (that face) × 100.
- If all three faces are different, the prize is (the largest face) × 100.
N (2 ≤ N ≤ 1,000) players take part. Given the three dice results for each player, output the largest prize.
Input
The first line contains the number of players N. Each of the next N lines contains three dice results for one player, separated by spaces.
Output
Output the largest prize on one line.