Vote Counting
Time limit1sMemory limit1024 MB
Given vote counts for several candidates, print each count as tally marks with groups of five drawn as ++++ followed by a space.
- Level
Easy2 of 10
- Topics
- Implementation, Math
- Solved
- No attempts yet
Problem
After voting ends, the votes must be counted. Counting is usually done on a chalkboard, with one more stroke added for each vote.
In this problem, counting follows these rules.
- Every candidate starts at votes, which means nothing is drawn yet.
- Each time a candidate receives a vote, draw
|at the end. - However, each time a candidate receives votes, do not draw the
|. Instead, draw a horizontal line across the four existing|to make++++, then add one blank space at the end.
For example, a candidate with votes has ++++ ++++ || on the board.
Input
The first line contains the number of candidates .
The next lines each contain the number of votes that a candidate received.
Output
For each candidate, print the result drawn on the board, one result per line.