{{ message }}

Instantly share code, notes, and snippets.

# tnoda/fizzbuzz.org

Last active Aug 29, 2015
The FizzBuzz Question in the Imedio

# The FizzBuzz Question in the Imedio

Imedians who originate from the planet Imedio love games of the Earth. The FizzBuzz Question is one of the most popular game among them, and is the winner of Imedian Game of the Year 2014.

Its rule is defined in a Wikipedia article as follows:

Fizz buzz is a group word game for children to teach them about division. Players take turns to count incrementally, replacing any number divisible by three with the word “fizz”, and any number divisible by five with the word “buzz”.

[…]

The player designated to go first says the number “1”, and each player thenceforth counts one number in turn. However, any number divisible by three is replaced by the word fizz and any divisible by five by the word buzz. Numbers divisible by both become fizz buzz.

For example, a typical round of fizz buzz would start as follows:

```1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz,
16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz,
31, 32, Fizz, 34, Buzz, Fizz, ...
```

\$N\$ Imedians are forming a line from west to east, and the westernmost Imedian has just started a FizzBuzz game. Find the number or words that the last easternmost Imedian will say.

## Input: standard input

The only line of the input contains a number \[ N (0 < N < 101000000) \].

## Output: standard output

If the last Imedian count a number, print the resulting number in a single line. Otherwise, print either “Fizz”, “Buzz”, or “Fizz Buzz” (without quotes, case-sensitive) appropriately in a single line.

5 seconds

## <<sample>>Sample tests

```3
```

```Fizz
```

```5
```

```Buzz
```

```7
```

```7
```

### Case 4

```15
```

#### Output

```Fizz Buzz
```

### Case 5

#### Input

```1999999999999999995
```

#### Output

```Fizz Buzz
```

# イメディオ星の FizzBuzz

イメディオ星のイメディオ星人は地球のゲームが大好き。中でも FizzBuzz は最も人気のあるゲームで、2014 年のイメディオゲーム大賞を受賞したほどです。

FizzBuzz のルールは Wikipedia の記事 で次のように定義されています。

ゲームは、次のように進行します

```1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz,
16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz,
31, 32, Fizz, 34, Buzz, Fizz, ...
```

\$N\$ 人のイメディオ星人が西から東に向かって一列に並んでいます。今、最西端のイメディオ星人から FizzBuzz が始まりました。最東端にいる最後のイメディオ星人が何と言うかを答えてください。

## 入力（標準入力から読み込むものとします）

\$1\$ 以上 \$101000000\$ 未満の整数 \$N\$ が一行で与えられます。

1 実行あたり 5 秒

## 例

This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

to join this conversation on GitHub. Already have an account? Sign in to comment