프로그램 명: boi_brunhilda
제한시간: 1 초

Except for her affinity towards old armours, Brunhilda is a normal seven year old girl. Thus, she is planning the perfect birthday party, for which she has invented the following game: All children run around until some number k is announced. Then all children try to form groups of exactly k people. As long as at least k children are left over, further groups of k children are formed. In the end, less than k children are left over and will be eliminated (not literally of course) from the game. The game continues with further numbers announced, and ends if all children are out.

Brunhilda asked her father Wotan to announce the numbers in the game. Wotan does not like this game and announced 1 when they first tried it. Brunhilda thinks this would be quite embarrassing at the party, and so she gave him a list of m prime numbers from which he can choose for each call; he may use the same number more than once.

Wotan would like to end the game as soon as possible since he has tickets for a match of his favourite football club FC Asgard. Unfortunately, Brunhilda does not know the number of children at her party yet. Now, for Q different numbers n1,..., nQ of children, Wotan wants to know in advance the least number of calls he will need to end the game.

입력

출력

The output should consist of Q lines. The j-th line should contain the answer for nj: if Wotan can end the game it should contain the least number of calls he needs (an integer), otherwise the line should contain the string oo (two lower case letters o, meaning 1).

입출력 예

입력

2 2
2 3
5
6

출력

3
oo

Constraints

출처:boi/2013/

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]