Divisor game

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Alice and Bob invented a two-player game. At first, Alice chooses a positive integer k in the range from 1 to some fixed integer n. Then Bob asks questions of the form ‘Is k divisible by m?’, where m is a positive integer. Alice answers each such question with ‘yes’ or ‘no’. Bob wants to know what number Alice bears in mind by asking as few questions as possible. Your task is to write a program, which plays the game as Bob.

Let us denote by d( n) the minimal number of questions, which have to be asked to find k, regardless of what k Alice chooses (for given n). Your program’s answer for a test case will be considered correct, if k is correctly determined using no more than d( n) questions.