FIZZFIZZ - Fizz-fizz
n
students are standing in a line (that goes from left to right) playing a game of fizz-fizz. The rules of fizz-fizz are, the students will go in order from left to right and say something, the i
th student from the left will say the number i
if i
is not divisible by 3, otherwise the i
th student will say fizz multiple times, they will say it one time for every time you can divide it by 3 (with no remainder).
For example, if there are nine students, they will say (in this exact order):
1, 2, fizz, 4, 5, fizz, 7, 8, fizz-fizz
The 9th student will say fizz twice because 9 is divisible by 3 * 3
.
Given n
, output what the students say and in the order that they say it.
Input
The first and only line will contain a single integer n.
1 ≤ n ≤ 10,000
Output
You should output n lines, the i
th of which should contain what the ith student says. Should they say ‘fizz’ more than once then output them with hyphens in- between (i.e. fizz-fizz-fizz for students like the 27th student).
Example
Input: 9 Output: 1 2 fizz 4 5 fizz 7 8 fizz-fizz
Added by: | jslew |
Date: | 2021-11-05 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |