Minigolf
Time limit1sMemory limit1024 MB
Given strokes per hole, with odd holes par 2 and even holes par 3 and any hole capped at 7 strokes, print the total score relative to par.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
A minigolf course has holes. Every odd-numbered hole is a "par 2" and every even-numbered hole is a "par 3", where "par" is the recommended number of strokes a golfer should need to complete that hole. There is also a rule that if you take more than strokes on a hole, it still counts as only strokes in the final tally.
Write a program that, given the number of strokes you took on each hole, calculates the total score over or under par.
Input
The first line contains a single integer , the number of holes, where . The second line contains integers between 1 and 10: the number of strokes you took on each hole.
Output
Print a single integer, the total score over or under par.