Problem A
Cheering Game
One of the perhaps most important factors in deciding the winning team of a football match is the amount of cheers the teams get from their supporters. The Sportify football team is about to meet their worst opponent, Spoilify. As the manager of Sportify’s cheerleading squad, you have to decide on a cheerleading tactic which will ensure you the win.
At your disposal you have
If a team gets more cheers than the other team for 5 consecutive minutes of the game, that team will score a goal. The 5 minute count is then reset, so if a team gets more cheers than the other team for, say, 17 consecutive minutes, that team will score three goals. The 5 minute interval can not run over the half time intermission, e.g., getting more cheers than the other team from the 43’rd minute to the 49’th minute is not sufficient to score a goal.
As an additional ace up your sleeve, you have spied on the Spoilify cheerleading team and know what their strategy for the game is. Based on this information, what is the best result that can be obtained?
Input
The first line of input consists of three integers
Output
Output two integers
Sample Input 1 | Sample Output 1 |
---|---|
1 31 2 20 60 50 90 |
4 3 |
Sample Input 2 | Sample Output 2 |
---|---|
2 5 3 0 90 0 90 3 90 |
0 17 |