No.661 Hello Kitty Weighs 3 Apples
Problem Statement
It is generally known that Hello Kitty's weight is equal to that of 3 apples.
Here, we define the weight of 3 apples as 1 Kitty.
Given a natural number N as input, output the value M, the weight of N apples in Kitties.
However, if N is a multiple of 8, output "iki"; if it is a multiple of 10, output "sugi"; and if it is both a multiple of 8 and a multiple of 10, output "ikisugi".
$N$ is a multiple of $3$, a multiple of $8$, or a multiple of $10$.
Input
$i$ $N_1$ $N_2$ $N_3$ . . . $N_i$
The input consists of i+1 lines.
The i on the first line represents the number of lines given as input. (1≦i≦5)
Lines 2 through i+1 represent the integers given as input.
It is guaranteed that $N_x$ (1≦x≦i) is always 3*a, 8*a, or 10*a (a=0,1,2.....).
$ 1 \le N_x \le 1000000$
Output
The output consists of i lines.
For each input, output the integer that is the answer.
However, if the input is a multiple of 8, output the string "iki"; if it is a multiple of 10, output the string "sugi"; and if it is both a multiple of 8 and a multiple of 10, output the string "ikisugi".
Sample
Sample 1
Input
3 3 6 30
Output
1 2 sugi
Sample 2
Input
4 36 8 30 160
Output
12 iki sugi ikisugi
Even if an input satisfies both 3*a and 10*a (a=0,1,2.....) at the same time, as the third input does, the output of the string "sugi" takes priority. For any integer N, give priority to the conditions for outputting a string.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
kyamatsu