ARCTAN  Use of Function Arctan
It's easy to know that arctan(1/2)+arctan(1/3)=arctan(1). Given number A, write a program 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(about 1000). 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.
Example
Sample input: 1 1 Sample output: 5
Added some new test data.
hide comments
amir_ofir:
20181003 14:17:51
No one did it on Python. always time exeeded 

dvynsh_chan17:
20171017 20:28:52
how can i make this below 256b????????


albertg:
20140911 15:25:13
nice problem 

ওয়াসী (Wasi):
20130523 10:52:38
tricky one!


Himanshu:
20130130 09:02:30
i dont know why it gives WA??? 

saket diwakar:
20130115 17:18:08
nice and tricky....:) 
Added by:  Fudan University Problem Setters 
Date:  20070331 
Time limit:  2s 
Source limit:  256B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: C99 ERL GOSU JSRHINO OBJC 
Resource:  Chinese National Olympiad in Informatics 2001,Day 1; translated by Blue Mary 