chandu-and-probability

After playing the game of stones and board chandu decide to put all the games in the boxes and sleep. But, he is afraid that you will go to market without taking him along with you. So, he decide to indulge you in a task.

Clever chandu has N boxes, N keys and N locks (1 key corresponding to each lock). He put all locks on all the boxes. Shuffled all the keys that are with him and slipped them into the box(Those were piggy bank like boxes).

Now, obviously, No one will be able to any of his box not even him without keys. But he has prepared a few bombs which can be used to break the locks. One bomb can be used to break exactly one lock. He asks you what is the probability that he will be able to open all boxes if he has M bombs.

Input: 

First line of input contains t which is the number of test cases. Each test case contains exactly one line having 2 integers N and M.

Output:

Print the probability that he will be able to open all boxes in a/b format. Note that a/b is in minimal fraction form.

Constraints:

1 ≤ N ≤ 20, 

1 ≤ M ≤ N

SAMPLE INPUT
3
2 1
2 2
3 1

SAMPLE OUTPUT
1/2
1/1
1/3

Explanation

Test case 1: When box 1 contains key 2, you can get all the keys 
Test case 2: When N=M, you can always get all the keys 
Test case 3: There are 6 possible configurations of keys in boxes. Using 1 bomb, you can open all the boxes in 2 of them:
box 1 - key 2, box 2 - key 3, box 3 - key 1;
box 1 - key 3, box 2 - key 1, box 3 - key 2.

Source: hackerearth | Difficulty: MEDIUM
Tags: Dynamic programming

Mathematics

Probability


Solutions: