// Arup Guha
// 4/23/2013
// Solution to 2013 UCF High School Contest Problem: Greatest Cosmic Devourers

import java.io.*;
import java.util.*;

public class cosmic {

	public static void main(String[] args) throws Exception {
		
		Scanner fin = new Scanner(new File("cosmic.in"));
		int n = fin.nextInt();
		
		// Go through each case.
		for (int loop=1; loop<=n; loop++) {
			
			// Get the input case.
			int a = fin.nextInt();
			int b = fin.nextInt();
		
			// These are the values we are interested in.
			// Basically, imagine looping through a*b/gcd(a,b), which is one cycle
			// before a and b line up. We can count how many unique stars will be
			// eaten since the only overlap is the last one.
			int lcm = a*b/gcd(a,b);
			int diva = lcm/a;
			int divb = lcm/b;
			
			// Here, we just represent our answer as a probability.
			double ans = 1.0 - 1.0*(diva+divb-2)/lcm;
			System.out.printf("Universe #%d: There's a %.4f%% chance we'll survive!\n", loop, 100*ans);
		}
	}
	
	// Returns the greatest common divisor of a and b.
	public static int gcd(int a, int b) {
		
		if (a == 0) return b;
		if (b == 0) return a;
		return gcd(b, a%b);
	}
}
