문제1964--Virus

1964: Virus

실행시간 제한: 1 Sec  메모리사용 제한: 128 MB
제출: 326  통과: 62
[제출] [채점기록] [묻고답하기]

문제 설명

Ajou university is attacking by hanaya1, the craziest creature on Earth.

He is using hanaya virus to occupy Ajou university`s network.

This virus has weird random rules, and destroy all network when it's number of population becomes N.

Virus starts with one. Every seconds, it can be increase two times or divides into three (below decimal points will be discarded).

You haved to find the minimum counts that virus becomes N.

입력 설명

First line, there will be Testcase T

second line, there will be N ( 1 <= N <= 10,000 )

출력 설명

Print the minimum seconds that virus becomes N

입력 예시 Copy

1
10

출력 예시 Copy

6

도움

1 -> 2 -> 4 -> 8 -> 16 -> 32 -> 10

출처/분류