APPROB  GETTING AN AP
Little John has been learning about sequences of numbers and he is very excited about arithmetic progressions.
He takes three boxes and puts some chits in each of them.For deciding the number of chits, he randomly chooses a number n , and places n chits in first box, 2*n chits in the second box and 3*n chits in the third box. If a box contains x chits then the chits are numbered from 1 to x.
Now he randomly chooses a chit from each of the three boxes , and places them in order.(Chit from first box first,then the chit from second box and then the chit from third box).He wants to determine if the sequence so obtained form an arithmetic progression.
Given the number n that he chooses, find the probability that the chits he draws form an arithmetic progression.
Input
The input consists of a number of test cases. The first line of input contains T ,the number of test cases.
Then T lines follow , each containing the number n that Little John has chosen.
1<=T<=100000
1<=n<=100000
Output
The output for each test case should be of the form p/q , where p/q is an irreducible fraction denoting the probability of forming an arithmetic progression from the chits he picks.
Example
Input:
2
1
2
Output:
1/3
1/8
hide comments
sagar_zhcet:
20170615 20:10:44
finally AC Last edit: 20170615 20:37:28 

shubham_cs_iet:
20170206 21:16:05
Enjoyed deriving the nth term of the pattern....after 1 WA (common difference can be 1) and a TLE (loop gives TLE)...:))). Last edit: 20170206 21:16:38 

cs_abhi2000:
20170123 09:21:24
Simple pattern...


akshayvenkat:
20160526 06:53:37
https://www.wolframalpha.com to the rescue ! :D O(n long n) > TLE while O(log n) gives AC 

sonupmandal:
20151101 12:04:27
100th :) 

Anant Upadhyay:
20150817 14:37:43
nice question.....


Dushyant Singh:
20150728 11:44:15
Both because int range is upto 2.14 * 10^9. So we cannot take int for both numerator and denominator. So we have to either typecast it or initialize it as long long. 

[Mayank Pratap]:
20150728 10:14:34
@Dushyant.... Isit because of overflow of intermediate results while calculating numerator and denominator??


ASHUTOSH DWIVEDI:
20150714 22:15:24
Be careful....because d can be negative as well caused me 1 WA 

Diksha Jaiswal:
20150616 05:30:24
simple pattern...AC in 1 go :) 
Added by:  Sarvesh Mahajan 
Date:  20140601 
Time limit:  1s2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 