Problem A
Tired Terry
Terry is feeling tired and he suspects it is because of a lack of sleep. He created a device that records his sleeping pattern over a period of time measured in seconds.
Assuming that the recorded sleeping pattern keeps repeating, help Terry by letting him know how often he is tired during each of the repeating time periods.
More precisely, for integers
Input
The first line of input contains three integers
The second line of input contains a single string of length
Output
Display a single integer which represents the number of seconds that Terry is tired during each of the repeating time periods.
Sample Input 1 | Sample Output 1 |
---|---|
2 1 1 WZ |
1 |
Sample Input 2 | Sample Output 2 |
---|---|
5 3 2 WZWWZ |
4 |