P16824 [HackerEarth] Alice and Bob are playing a game. They both agree up on a number M and the score is set to 0 initially. Alice chooses t > 0 consecutive integers starting from 1 i.e numbers 1, 2, ...t. B
提高
题目描述

Alice and Bob are playing a game. They both agree up on a number M and the score is set to 0 initially. Alice chooses t > 0 consecutive integers starting from 1 i.e numbers 1, 2, ...t. Bob chooses t consecutive integers starting from any x > 0 i.e numbers x, x + 1, x +2, ... x + t - 1. Alice and Bob both multiply all the numbers they have chosen. If the ratio of results got by Alice and Bob is 1:M they will increase the score by 1 and continue playing the game, else they quit playing the game. No two games played must be identical. Two games are said to be identical if both Alice and Bob chooses same sequence of numbers in both the games. Find the maximum score they can get for a given M.

Input
First line of the input is the number of test cases T. It is followed by T lines, each test case has a single number M.

Output
For each test case, print a single number, the maximum score they can get. If they can get infinite score, print -1.

Constraints
1 ≤ T ≤ 10
1 ≤ M ≤ 10^13

Read the editorial here

SAMPLE INPUT
5
14
7
10
3
2

SAMPLE OUTPUT
2
2
4
2
1

输入格式

见题面

输出格式

见题面

样例输入
10 513293853750544 926705863890008 6666891 1676056044 16806729318616 9075135300 736480279903199 812091406112976 24310 817172948855115
样例输出
2 4 4 2 2 1 3 2 2 2