#CCBOTPBA0000007. Grenais
Grenais
Grenais
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
A session contains one or more games between Inter and Gremio. Read their scores in that order. After every game print Novo grenal (1-sim 2-nao) and read a decision: 1 for another game, 2 to end; other values repeat the prompt. Then print the number of games, wins for each team, ties, and the team with more wins.
Input
Repeatedly read a score pair inter gremio followed by decisions; invalid decisions (not 1 or 2) are re-entered. A decision of 1 starts the next game and 2 ends the session.
Output
Print the exact prompt before each decision. On termination print <games> grenais, Inter:<wins>, Gremio:<wins>, Empates:<draws>, and exactly one of Inter venceu mais, Gremio venceu mais, Nao houve vencedor.
Subtasks
-
Subtask 1 (20%): At most 3 games and 10 decisions, scores
0..10, decisions0..9. -
Subtask 2 (30%): At most 50 games and 200 decisions; scores
0..100. -
Subtask 3 (50%): At most 1000 games and 10000 decisions; scores
0..100.
Examples
Example 1
Input:
3 2
1
1 2
2
Output:
Novo grenal (1-sim 2-nao)
Novo grenal (1-sim 2-nao)
2 grenais
Inter:1
Gremio:1
Empates:0
Nao houve vencedor
Explanation: Two games and two prompts. Each team wins once, so neither won more games.
Example 2
Input:
0 0
9
2
Output:
Novo grenal (1-sim 2-nao)
Novo grenal (1-sim 2-nao)
1 grenais
Inter:0
Gremio:0
Empates:1
Nao houve vencedor
Explanation: Invalid decision 9 repeats the prompt; the draw is counted only once.