Generalized FizzBuzz
면접 대비시간 제한1초메모리 제한2048 MB
정수 n, a, b가 주어질 때 1부터 n까지의 수 중 일반화된 FizzBuzz 규칙에 따라 Fizz, Buzz, FizzBuzz가 각각 몇 번 출력되는지 센다.
문제
FizzBuzz is a common coding interview problem. The problem is as follows:
Given a positive integer , for all integers from 1 to , inclusive:
- 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 , , and , for all integers from 1 to , inclusive:
- 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 , and , how many times are "Fizz", "Buzz", and "FizzBuzz" printed for a correct implementation?
입력
The first and only line of input contains three positive integers , and
출력
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.