Tianjin University Online Judge
Contests Virtual Contests Problems Submit Runs Status Rank List Forum

3495.   A Simple Game
Time Limit: 1.0 Seconds   Memory Limit: 65536K
Total Runs: 654   Accepted Runs: 142

Alice and Bob are playing a simple game . They have N integer number and a target number T in common . Either of them independently and randomly picks a number from the N numbers . They win the game if the product of the two picked numbers is strictly greater than the target number T .

You are to calculate the probability that they will win . Assume that each numble is picked with the same probability.


The input consists of multiple test cases . Each test case consists of two lines . The first line contains two integers N (1 ≤ N ≤ 30,000) and T (-1,000,000,000 ≤ T ≤ 1,000,000,000) . The second line contains N integers numbers that Alice and Bob have , each of which will be between -30,000 and 30,000 , inclusive . The last test case is followed by a line containing two zeros.


For each test case , print a line containing the test case number ( beginning with 1 ) followed by the probability of which Alice and Bob will win the game . The probability is printed as a fraction number formatted as “a/b”, where the greatest common divisor of a and b must be 1.

Sample Input

2 0
2 -9
4 5
1 -4 3 -2
0 0

Sample Output

Case 1: 1/2
Case 2: 1/4

Source: TJRAC Team Selection 2010 (1)
Submit   List    Runs   Forum   Statistics

Tianjin University Online Judge v1.3.0
Maintance:Fxz. Developer: SuperHacker, G.D.Retop, Fxz