Three Dice
InterviewTime limit1sMemory limit128 MB
Given three dice values from 1 to 6, compute a prize following fixed rules for triples, pairs, or all different values.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
A game uses three dice, each showing a value from 1 to 6. The prize is calculated by the following rules:
- If all three dice show the same value, the prize is 10,000 plus that value multiplied by 1,000.
- If exactly two dice show the same value, the prize is 1,000 plus the repeated value multiplied by 100.
- If all three dice show different values, the prize is the largest value multiplied by 100.
Given the three dice values, write a program that calculates the prize.
Input
The first line contains three integers separated by spaces. Each integer is between 1 and 6, inclusive.
Output
Print the calculated prize on the first line.