Problem E
Generalized FizzBuzz
FizzBuzz is a common coding interview problem. The problem is as follows:
Given a positive integer
-
If
is divisible by both and , print "FizzBuzz". -
Otherwise, if
is divisible by , print "Fizz". -
Otherwise, if
is divisible by , print "Buzz". -
Otherwise, print
.
We are interested in a generalized version of FizzBuzz:
Given three positive integers
-
If
is divisible by both and , print "FizzBuzz". -
Otherwise, if
is divisible by , print "Fizz". -
Otherwise, if
is divisible by , print "Buzz". -
Otherwise, print
.
Given
Input
The first and only line of input contains three positive
integers
Output
Output three integers: the number of times "Fizz" is printed, the number of times "Buzz" is printed, and the number of times "FizzBuzz" is printed.
Sample Input 1 | Sample Output 1 |
---|---|
17 3 5 |
4 2 1 |
Sample Input 2 | Sample Output 2 |
---|---|
10 3 3 |
0 0 3 |