Under construction

Still being built. Things may change

Basketball Score

Time limit5sMemory limit1024 MB

Summary
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.

Examples3

  1. Example 1

    Input
    10 20 30
    50 10 10
    
    Expected output
    1
    
  2. Example 2

    Input
    5 5 5
    1 99 1
    
    Expected output
    2
    
  3. Example 3

    Input
    1 2 3
    0 1 4
    
    Expected output
    0