LCC '21 Contest 2 S1 - Oscar's Fizz Buzz
View as PDFOscar has a coding interview tomorrow, so he's preparing by solving Fizz Buzz.
The problem statement reads:
"Print out a list of numbers from
to
, but replace multiples of
with
fizz, multiples ofwith
buzz, and multiples of both withfizzbuzz."
Since the problem is too easy for him, he thinks of a harder (but related) problem statement:
"If the fizzbuzz program runs for the input
, how many numbers from
to
are replaced by
fizz/buzz/fizzbuzz?"
He wants the answer to fizz, buzz, and fizzbuzz separately.
Input Specification
The first and only line of input will contain .
Note: may not fit in a 32-bit integer.
Output Specification
The first and only line of output should contain three space-separated integers: the answer for fizz, buzz, and fizzbuzz respectively.
Sample Input
20
Sample Output
5 3 1
Explanation
,
,
,
, and
are replaced by
fizz. ,
, and
are replaced by
buzz. is replaced by
fizzbuzz.
Comments