// Arup Guha
// 4/22/2017
// Solution for 2017 Round 1B Code Jam Problem A (large) 

import java.util.*;

public class a {
	
	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();
		
		for (int loop=1; loop<=numCases; loop++) {
			
			int d = stdin.nextInt();
			int n = stdin.nextInt();
			
			double maxReach = 0;
			
			// All we care about is the slowest horse, we can ignore the others who end up slowing down.
			// The slowest one (limiting factor) never slows down.
			for (int i=0; i<n; i++) {
				int mark = stdin.nextInt();
				int speed = stdin.nextInt();
				double reach = (double)(d-mark)/speed;
				maxReach = Math.max(maxReach, reach);
			}
			
			// So, here is our answer.
			double maxS = (double)d/maxReach;
			System.out.printf("Case #"+loop+": %.9f\n", maxS);
		}
	}
}