#P2112. ACSL 2024-2025 Intermediate Division Contest #1 Rings

ACSL 2024-2025 Intermediate Division Contest #1 Rings

PROBLEM DESCRIPTION

ACSL Rings is a 3-player game where the object is to score points by tossing a ball through at least one of the 55 rings. Points are awarded as follows:

  • Through the aqua or red ring 1-1 point
  • Through the orange or green ring 3-3 points
  • Through the black ring 6-6 points
  • Through the space where 22 rings overlap - the sum of the points for the 22 rings plus 11

We will use a single letter to represent each of the above colors: aqua (A), red (R), orange (O), green (G) and black (B). The overlapping areas will be given by 22 letters in the order shown: aqua and orange (AO), orange and black (OB), black and green (BG), and green and red (GR).

You will be given 33 strings representing each player’s results for all tosses that go through at least one ring. The result of each toss will be separated by a single space. Output the 33 players’ scores in descending order separated by a single space. If any of the players have the same score, it doesn’t matter which one of the tied scores appears first.

INPUT FORMAT

The input will consist of 33 strings as described above. Each string will be no longer than 100100 characters.

OUTPUT FORMAT

Output the three scores in descending order, each separated by a single space.

SAMPLE

INPUT #1

GR A B
OB BG AO O
R G

OUTPUT #1

28 12 4

INPUT #2

A R O G B
A A B B
R O B

OUTPUT #2

14 14 10

INPUT #3

AO OB B G A B BG GR
R R G G AO AO BG BG B
AO GR A B R G O BG OB

OUTPUT #3

46 44 44

INPUT #4

A A A B B R O O O O
BG BG GR GR O O O A B
BG BG GR GR O O O B B G

OUTPUT #4

54 46 28

INPUT #5

A B B O O G AO OB GR BG
GR GR BG BG OB AO AO
B B B G G G A A A GR AO

OUTPUT #5

52 50 40

INPUT #6

GR BG OB AO A G B
A O B AO GR GR BG O GR AO
O O B G A A GR OB AO BG

OUTPUT #6

48 47 40

EXPLANATION

SAMPLE #1 EXPLANATION

Player 1’s tosses go through the green & red, aqua, and black rings for a score of (3+1+1)+1+6=12(3+1+1) + 1 + 6 = 12.

Player 2 has a score of (3+6+1)+(6+3+1)+(1+3+1)+3=28(3+6+1) + (6+3+1) + (1+3+1) + 3 = 28.

Player 3 has a score of 1+3=41 + 3 = 4.

The output is the string 2828 1212 44, the scores in descending order.