#K59317. FizzBuzz Replacement Pattern

    ID: 30838 Type: Default 1000ms 256MiB

FizzBuzz Replacement Pattern

FizzBuzz Replacement Pattern

You are given two integers a and b with a ≤ b. Your task is to generate a list of numbers from a to b (inclusive) with the following replacement rules:

  • If a number is a multiple of both 3 and 5, replace it with FizzBuzz. In mathematical terms, if \( n \equiv 0 \pmod{3} \) and \( n \equiv 0 \pmod{5} \), output "FizzBuzz".
  • If a number is a multiple of 3 (and not 5), replace it with Fizz. That is, if \( n \equiv 0 \pmod{3} \) and \( n \not\equiv 0 \pmod{5} \), output "Fizz".
  • If a number is a multiple of 5 (and not 3), replace it with Buzz. That is, if \( n \equiv 0 \pmod{5} \) and \( n \not\equiv 0 \pmod{3} \), output "Buzz".
  • Otherwise, output the number itself.

The output should be printed as a single line with each element separated by a space.

inputFormat

The input consists of a single line containing two space-separated integers a and b (with a ≤ b).

outputFormat

Print a single line containing the modified list elements from a to b (inclusive). The elements should be separated by a single space. Numbers that meet the replacement conditions are replaced by the respective strings.

## sample
1 2
1 2

</p>