Home Web Board ProblemSet Standing Status Statistics
long long输出请使用 %lld服务器的python版本为3.4
Problem F: Using arctan

Problem F: Using arctan

Time Limit: 1 Sec  Memory Limit: 256 MB
Submit: 37  Solved: 12
[Submit][Status][Web Board]

Description

It's easy to know that arctan(1/2)+arctan(1/3)=arctan(1).The problem is,to some fixed number A,you have to calculate the minimum sum B+C.A,B and C are all positive integers and satisfy the equation below:

arctan(1/A)=arctan(1/B)+arctan(1/C)

Input

The first line contains a integer number T(T <= 200).T lines follow,each contains a single integer A, 1<=A<=60000.

Output

T lines,each contains a single integer which denotes to the minimum sum B+C.

Sample Input

1
1

Sample Output

5

HINT

[Submit][Status][Web Board]