卡特兰数 只不过需要在(1, 0) 和 (0, 1)处分别做一下
(n-m)/(m+n)
import java.util.Scanner;
class Main{
public static void main(String[] args) {
int m, n, t;
Scanner in = new Scanner(System.in);
t = in.nextInt();
int cnt = 1;
while(cnt<=t){
n = in.nextInt();
m = in.nextInt();
System.out.print("Case #"+ cnt++ +": ") ;
System.out.println(String.format("%.8f", (n-m)*1.0/(m+n)));
}
}
}