97
100026500 100010776 19170 diamond
100024464 99996319 5706 heart
100005436 99990832 32392 diamond
100000292 99982871 12383 spade
100019912 99993613 25668 club
100004664 99996953 15142 heart
100006868 99979224 25548 diamond
100012316 99990126 3036 diamond
100000288 99991248 30107 diamond
100019264 99991818 22649 heart
100003548 99990925 19630 spade
100018756 100013790 11841 spade
100026308 99993869 16945 diamond
100022704 100008727 9931 diamond
100026924 100020654 19073 heart
100016512 100003222 23987 heart
100018636 99993869 22356 club
100012052 100010902 27351 heart
100021724 100018294 13967 club
100018588 99993642 6423 diamond
100029168 99996577 901 diamond
100027624 100006076 20538 club
100030836 100019816 9375 spade
100027348 100007680 23200 spade
100006900 99988773 3789 club
100003728 99979080 14894 club
100007616 99990165 18936 spade
100031556 100001253 22799 spade
100011008 99978399 5845 heart
100007448 99993990 25201 diamond
100020580 100005782 19797 heart
100020472 100001934 23623 spade
100022888 100011377 19157 diamond
100024272 100003944 20056 diamond
100023844 100001963 1417 diamond
100028476 100004087 27893 club
100010712 100008202 2601 club
100014688 100004899 13402 club
100027088 99998471 31427 heart
100009832 100005663 30933 diamond
100019976 100017608 31330 spade
100009512 99991452 30146 diamond
100025996 100013467 16688 heart
100020416 100004311 28287 spade
100031316 100025530 20672 club
100000912 99999080 10809 heart
100027756 100008198 28322 diamond
100004144 99983922 23197 heart
100012044 99985752 21660 club
100020024 99990514 26155 heart
100002168 99983381 14019 heart
100025824 99999950 29335 spade
100002668 99988683 17193 diamond
100008480 100000853 29214 diamond
100001924 99971952 11024 heart
100027432 99999839 17506 heart
100008492 99991270 143 diamond
100013064 99993877 7901 spade
100025760 100021093 18897 heart
100000140 99997445 13695 spade
100026576 100003918 21695 diamond
100025484 99997020 1019 club
100023152 100005065 2801 spade
100009576 99997533 30228 diamond
100007164 99999282 5110 diamond
100031928 100003408 25424 diamond
100024596 100011335 3738 club
100001264 99995062 8261 spade
100021520 100006596 29791 spade
100004940 99986278 20852 heart
100030900 100011942 17714 diamond
100001200 99994761 26059 club
100012760 100010436 19358 heart
100005108 99990221 21114 heart
100014460 100001467 22429 spade
100006540 99977836 31112 club
100032356 100003006 6073 club
100020556 100018930 23217 heart
100012896 99983279 13023 spade
100018696 99994655 11586 club
100008932 99979077 22297 heart
100003584 99996930 29735 spade
100022532 100019925 2964 club
100022848 100009910 4676 club
100005556 99995380 1994 heart
100010548 100010248 15882 heart
100020424 100018672 32679 club
100028296 100018256 12674 heart
100020072 100019462 12819 heart
100014932 99984237 28113 heart
100020040 99991355 26489 diamond
100026740 100015482 22045 club
100011192 99985928 7606 heart
100020608 100014611 29293 heart
100029556 99997929 25562 club
100031240 100002066 27814 heart
100023992 100018391 25825 spade 98
100026500 100010776 19170 diamond
100024464 99996319 5706 heart
100005436 99990832 32392 diamond
100000292 99982871 12383 spade
100019912 99993613 25668 club
100004664 99996953 15142 heart
100006868 99979224 25548 diamond
100012316 99990126 3036 diamond
100000288 99991248 30107 diamond
100019264 99991818 22649 heart
100003548 99990925 19630 spade
100018756 100013790 11841 spade
100026308 99993869 16945 diamond
100022704 100008727 9931 diamond
100026924 100020654 19073 heart
100016512 100003222 23987 heart
100018636 99993869 22356 club
100012052 100010902 27351 heart
100021724 100018294 13967 club
100018588 99993642 6423 diamond
100029168 99996577 901 diamond
100027624 100006076 20538 club
100030836 100019816 9375 spade
100027348 100007680 23200 spade
100006900 99988773 3789 club
100003728 99979080 14894 club
100007616 99990165 18936 spade
100031556 100001253 22799 spade
100011008 99978399 5845 heart
100007448 99993990 25201 diamond
100020580 100005782 19797 heart
100020472 100001934 23623 spade
100022888 100011377 19157 diamond
100024272 100003944 20056 diamond
100023844 100001963 1417 diamond
100028476 100004087 27893 club
100010712 100008202 2601 club
100014688 100004899 13402 club
100027088 99998471 31427 heart
100009832 100005663 30933 diamond
100019976 100017608 31330 spade
100009512 99991452 30146 diamond
100025996 100013467 16688 heart
100020416 100004311 28287 spade
100031316 100025530 20672 club
100000912 99999080 10809 heart
100027756 100008198 28322 diamond
100004144 99983922 23197 heart
100012044 99985752 21660 club
100020024 99990514 26155 heart
100002168 99983381 14019 heart
100025824 99999950 29335 spade
100002668 99988683 17193 diamond
100008480 100000853 29214 diamond
100001924 99971952 11024 heart
100027432 99999839 17506 heart
100008492 99991270 143 diamond
100013064 99993877 7901 spade
100025760 100021093 18897 heart
100000140 99997445 13695 spade
100026576 100003918 21695 diamond
100025484 99997020 1019 club
100023152 100005065 2801 spade
100009576 99997533 30228 diamond
100007164 99999282 5110 diamond
100031928 100003408 25424 diamond
100024596 100011335 3738 club
100001264 99995062 8261 spade
100021520 100006596 29791 spade
100004940 99986278 20852 heart
100030900 100011942 17714 diamond
100001200 99994761 26059 club
100012760 100010436 19358 heart
100005108 99990221 21114 heart
100014460 100001467 22429 spade
100006540 99977836 31112 club
100032356 100003006 6073 club
100020556 100018930 23217 heart
100012896 99983279 13023 spade
100018696 99994655 11586 club
100008932 99979077 22297 heart
100003584 99996930 29735 spade
100022532 100019925 2964 club
100022848 100009910 4676 club
100005556 99995380 1994 heart
100010548 100010248 15882 heart
100020424 100018672 32679 club
100028296 100018256 12674 heart
100020072 100019462 12819 heart
100014932 99984237 28113 heart
100020040 99991355 26489 diamond
100026740 100015482 22045 club
100011192 99985928 7606 heart
100020608 100014611 29293 heart
100029556 99997929 25562 club
100031240 100002066 27814 heart
100023992 100018391 25825 spade
100026428 100022344 28028 club 97
100026500 100010776 19170 diamond
100024464 99996319 5706 heart
100005436 99990832 32392 diamond
100000292 99982871 12383 spade
100019912 99993613 25668 club
100004664 99996953 15142 heart
100006868 99979224 25548 diamond
100012316 99990126 3036 diamond
100000288 99991248 30107 diamond
100019264 99991818 22649 heart
100003548 99990925 19630 spade
100018756 100013790 11841 spade
100026308 99993869 16945 diamond
100022704 100008727 9931 diamond
100026924 100020654 19073 heart
100016512 100003222 23987 heart
100018636 99993869 22356 club
100012052 100010902 27351 heart
100021724 100018294 13967 club
100018588 99993642 6423 diamond
100029168 99996577 901 diamond
100027624 100006076 20538 club
100030836 100019816 9375 spade
100027348 100007680 23200 spade
100006900 99988773 3789 club
100003728 99979080 14894 club
100007616 99990165 18936 spade
100031556 100001253 22799 spade
100011008 99978399 5845 heart
100007448 99993990 25201 diamond
100020580 100005782 19797 heart
100020472 100001934 23623 spade
100022888 100011377 19157 diamond
100024272 100003944 20056 diamond
100023844 100001963 1417 diamond
100028476 100004087 27893 club
100010712 100008202 2601 club
100014688 100004899 13402 club
100027088 99998471 31427 heart
100009832 100005663 30933 diamond
100019976 100017608 31330 spade
100009512 99991452 30146 diamond
100025996 100013467 16688 heart
100020416 100004311 28287 spade
100031316 100025530 20672 club
100000912 99999080 10809 heart
100027756 100008198 28322 diamond
100004144 99983922 23197 heart
100012044 99985752 21660 club
100020024 99990514 26155 heart
100002168 99983381 14019 heart
100025824 99999950 29335 spade
100002668 99988683 17193 diamond
100008480 100000853 29214 diamond
100001924 99971952 11024 heart
100027432 99999839 17506 heart
100008492 99991270 143 diamond
100013064 99993877 7901 spade
100025760 100021093 18897 heart
100000140 99997445 13695 spade
100026576 100003918 21695 diamond
100025484 99997020 1019 club
100023152 100005065 2801 spade
100009576 99997533 30228 diamond
100007164 99999282 5110 diamond
100031928 100003408 25424 diamond
100024596 100011335 3738 club
100001264 99995062 8261 spade
100021520 100006596 29791 spade
100004940 99986278 20852 heart
100030900 100011942 17714 diamond
100001200 99994761 26059 club
100012760 100010436 19358 heart
100005108 99990221 21114 heart
100014460 100001467 22429 spade
100006540 99977836 31112 club
100032356 100003006 6073 club
100020556 100018930 23217 heart
100012896 99983279 13023 spade
100018696 99994655 11586 club
100008932 99979077 22297 heart
100003584 99996930 29735 spade
100022532 100019925 2964 club
100022848 100009910 4676 club
100005556 99995380 1994 heart
100010548 100010248 15882 heart
100020424 100018672 32679 club
100028296 100018256 12674 heart
100020072 100019462 12819 heart
100014932 99984237 28113 heart
100020040 99991355 26489 diamond
100026740 100015482 22045 club
100011192 99985928 7606 heart
100020608 100014611 29293 heart
100029556 99997929 25562 club
100031240 100002066 27814 heart
100023992 100018391 25825 spade 51
68 49 11 heart
28 16 1 club
28 24 5 spade
96 31 24 club
68 36 1 diamond
4 3 1 heart
12 5 3 club
60 22 9 heart
36 7 6 spade
24 11 1 spade
32 17 5 club
24 11 6 diamond
16 11 4 spade
56 24 2 diamond
32 23 5 diamond
8 8 2 heart
88 88 12 heart
92 92 18 diamond
60 18 10 spade
84 10 2 diamond
92 83 17 spade
100 85 19 heart
100 39 19 spade
28 5 6 heart
84 70 21 diamond
36 9 1 heart
20 19 2 club
96 22 14 club
24 11 4 club
80 58 11 diamond
92 73 13 spade
12 7 3 spade
56 23 1 diamond
76 2 10 diamond
52 32 12 heart
76 17 16 diamond
4 2 1 spade
56 19 2 heart
56 30 5 heart
40 40 4 spade
88 22 12 heart
96 65 10 diamond
56 27 3 heart
72 24 9 heart
56 6 8 spade
36 14 3 diamond
60 40 13 heart
88 7 6 club
60 51 14 club
64 41 13 heart
28 12 1 club
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
 0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
 0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
0.0000000100
 0.0147058824
0.0357142857
0.0357142857
0.0104166667
0.0147058824
0.2500000000
0.0833333333
0.0166666667
0.0277777778
0.0416666667
0.0312500000
0.0416666667
0.0625000000
0.0178571429
0.0312500000
0.1250000000
0.0113636364
0.0108695652
0.0166666667
0.0119047619
0.0108695652
0.0100000000
0.0100000000
0.0357142857
0.0119047619
0.0277777778
0.0500000000
0.0104166667
0.0416666667
0.0125000000
0.0108695652
0.0833333333
0.0178571429
0.0131578947
0.0192307692
0.0131578947
0.2500000000
0.0178571429
0.0178571429
0.0250000000
0.0113636364
0.0104166667
0.0178571429
0.0138888889
0.0178571429
0.0277777778
0.0166666667
0.0113636364
0.0166666667
0.0156250000
0.0357142857

t = int(raw_input())
while t!=0:
	t-=1
	a = raw_input().split()
	a = map(int, a[:3])
	cards = a[0]/4
	p = cards/float(a[0])
	p /= cards
	print '{0:.10f}'.format(p)