#K92602. FizzBuzz Sequence Generation
FizzBuzz Sequence Generation
FizzBuzz Sequence Generation
You are given a positive integer n. Your task is to generate a sequence of strings for each integer from 1 to n following these rules:
- If an integer i satisfies \( i \bmod 15 = 0 \), output FizzBuzz.
- If \( i \bmod 3 = 0 \) (and not divisible by 15), output Fizz.
- If \( i \bmod 5 = 0 \) (and not divisible by 15), output Buzz.
- Otherwise, output the string representation of i.
For example, if n is 15, the output sequence should be:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz
Make sure to read the input from standard input and print the result to standard output.
inputFormat
The input consists of a single integer n (1 ≤ n ≤ 105), representing the upper limit of the sequence.
outputFormat
Output a single line containing the sequence from 1 to n separated by a single space. Each number or word should follow the transformation rules described above.
## sample5
1 2 Fizz 4 Buzz