F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Ants run!

Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1367    Accepted Submission(s): 460


Problem Description
Professor Yang likes to play with ants when he is free.
This time, Professor Yang caught several ants after finishing his lecture for freshmen. At the beginning of the game, he puts N ants around a plate and numbers them in clockwise order. The ants are so obedient that they run clockwise under the guide of Professor Yang on the boundary of the plate which is a circle. At first the distances of every two adjacent ants are the same around the boundary of the circle. When one ant catches up with its previous ant, the game is over. Knowing the speed of ants, Professor Yang wants you to help him to change the order of the ants to make the game last longer.
 

Input
The first line of the input is T (no more than 100), which stands for the number of test cases you need to solve.
Each test case begins with N and R, representing the number of ants participating the game is N ( N <= 100000)and the radius of the circle is R(R <= 100000) cm. The next line lists N integers and the i-th number is the speed (cm/s) of the i-th ant in clockwise direction. All these N numbers are positive integer not larger than 1000.
 

Output
If the game can last forever, print ˇ°Infˇ± in a single line, otherwise please output the longest time in seconds each game can last, which should be printed accurately rounded to three decimals.
 

Sample Input
2 3 1 1 1 1 2 1 1 2
 

Sample Output
Inf 3.142
 

Author
lxhgww
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 16:06:16, Gzip enabled