Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3118 Accepted Submission(s): 1135
Problem Description
Zty很癡迷數學問題.。一天,yifenfei出了個數學題想難倒他,讓他回答1 / n。但Zty卻回答不了^_^. 請大家程式設計幫助他.
Input
第一行整數T,表示測試組數。後面T行,每行一個整數 n (1<=|n|<=10^5).
Output
輸出1/n. (是循環小數的,隻輸出第一個循環節).
Sample Input
4
2
3
7
168
Sample Output
0.5
0.3
0.142857
0.005952380
思路:一旦發現餘數相同即開始循環
算法:離散化