F - Hats |
John Hatman, the honest cloakroom attendant of the Royal Theatre of London, would like to know the solution to the following problem.
Some of them take a wrong hat. But, how likely is that everyone take a wrong hat?
The first line of the input contains an integer, t, indicating the number of test cases. For each test case, one line appears, that contains a number n, 2<=n<=12, representing the number of people and hats.
For each test case, the output should contain a single line with the number representing the number of favourable cases (i.e., the number of cases where all people take a wrong hat), followed by a bar, "/", and followed by a number representing the total number of possible cases.
3
2
3
4
1/2
2/6
9/24
OMP'11
Facultad
de Informatica
Universidad
de Murcia (SPAIN)