Basketball Score
Time limit5sMemory limit1024 MB
Given the free throw, 2 pointer, and 3 pointer counts for two teams, the task is to print 1, 2, or 0 for the team with more points or a tie.
- Level
Easy1 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
There are three types of shots in basketball: 1 pointer (free throw), 2 pointers, and 3 pointers.
Given how many shots of each type two teams made, determine the winner.
Input
The first input line contains three integers (each between 0 and 99 inclusive), indicating how many 1 pointer, 2 pointer, and 3 pointer shots Team1 made, in that order.
The second input line gives the shots made by Team2 in the same format.
Output
Print 1 if Team1 wins, 2 if Team2 wins, or 0 if the game is a tie. The team with the higher total points wins. If both teams have the same total points, the game is a tie.