Problem list
Log in
#r03550 · CCC 2019 Junior

Winning Score

Bronze IV 2.0 s 256 MB

You record all of the scoring activity at a basketball game. Points are scored by a 3-point shot, a 2-point field goal, or a 1-point free throw.

You know the number of each of these types of scoring for the two teams: the Apples and the Bananas. Your job is to determine which team won, or if the game ended in a tie.

Input for Sample Input 2

7
3
0
6
4
1

Input

The first three lines of input describe the scoring of the Apples, and the next three lines of input describe the scoring of the Bananas. For each team, the first line contains the number of successful 3-point shots, the second line contains the number of successful 2-point field goals, and the third line contains the number of successful 1-point free throws. Each number will be an integer between 0 and 100, inclusive.

Output

The output will be a single character. If the Apples scored more points than the Bananas, output A. If the Bananas scored more points than the Apples, output B. Otherwise, output T, to indicate a tie.

Example 1

Input
10
3
7
8
9
6
Output
B

The Apples scored $10\cdot 3+3\cdot 2+7\cdot 1=43$ points and the Bananas scored $8\cdot 3+9\cdot 2+6\cdot 1=48$ points, and thus the Bananas won.

Source
CCC 2019 Junior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code