2642Dice

2642   Dice

题目描述

Little K has n dice which have x sides, each with faces numbered 1,2,...,x-1,x. Big S has m dice which have y sides, each with faces numbered 1,2,...y-1,y.

Now they want to play a game. They roll their dice and compare total scores,the highest scores wins.What is the probability that little K can win ?

输入格式:

The first line contains one integer T, indicates the total test cases. Each test case contains four integer n, x, m, y.1<=n,m<=100,1<=x,y<=10,T<=20

输出格式:

Print a number with exactly 7 decimal places.

输入样例 复制
2
9 4 6 6
1 1 1 1
输出样例 复制
0.5731441
0.0000000

说明

8
19
通过提交
时空限制1000ms/32mb
题目来源数据结构实验与竞赛训练
评测方式在线评测
题目类型
难        度