There is a strange counter. At the first second, it displays the number . Each second, the number displayed by decrements by until it reaches . In next second, the timer resets to and continues counting down. The diagram below shows the counter values for each time in the first three cycles:
Find and print the value displayed by the counter at time .
Complete the strangeCounter function in the editor below.
strangeCounter has the following parameter(s):
- int t: an integer
- int: the value displayed at time
A single integer, the value of .
- for of the maximum score.
Time marks the beginning of the second cycle. It is double the number displayed at the beginning of the first cycle:. This is shown in the diagram in the problem statement.