MIT Time

시간 제한1초메모리 제한256 MB

요약
N분 지각했을 때 N이 (5^(k-1), 5^k] 구간에 속하는 k를 찾고, k=1이면 MIT time을 출력한다.
난이도

쉬움10점 중 2점

유형
수학, 구현, 완전 탐색
정답자
아직 제출이 없습니다

문제

Busy Beaver arrived to his MIT class late! However, thanks to "MIT time", all classes actually start 55 minutes later than the posted time.

Busy Beaver wants to make a generalization of this system. Namely, if someone arrives NN minutes late to an event, then:

  • if N≤5N \le 5, they arrived on "MIT time";
  • if 5<N≤255 < N \le 25, they arrived on "MIT2^2 time";
  • if 25<N≤12525 < N \le 125, they arrived on "MIT3^3 time";
  • and so on. Formally, if k≥2k \ge 2, then "MITk^k time" is when 5k−1<N≤5k5^{k-1} < N \le 5^k.

Given NN, determine on which of "MIT time", "MIT2^2 time", etc. this person arrived at.

입력

The first line contains a single integer TT (1≤T≤105)(1 \leq T \leq 10^5) --- the number of test cases.

The only line of each test case contains a single integer NN (1≤N≤1091 \le N \le 10^9) --- the number of minutes late to an event the person is.

출력

For each test case, output a single line that consists of either "MIT time" or "MIT^kk time" for some integer k≥2k \geq 2, corresponding to the time this person arrives at.

힌트

In the first test case, N=4N = 4, which is at most 55, so this is MIT time.

In the second test case, N=5N = 5, which is equal to 55, so this is also MIT time.

In the third test case, N=13N = 13, which is not more than 2525 but more than 55, so this is MIT2^2 time.

The fourth test case, N=126N = 126, which is not more than 54=6255^4=625 but more than 53=1255^3 = 125, so this is MIT4^4 time.

예제1

  1. 예제 1

    입력
    5
    4
    5
    13
    126
    1
    
    예상 출력
    MIT time
    MIT time
    MIT^2 time
    MIT^4 time
    MIT time