Killing Assistants

2.9

25 votes
Mathematics, prob, Easy-Medium
Problem

The fictional university of ZombieLand - has n students volunteer for the role of Killing Assistants, student volunteers who help in smooth killing of zombies in the campus. Every student can either manage to shoot a zombie or miss it.

Out of these n Killing Assistants, m students try to shoot the zombie fairly, that is, they are unbiased, while the rest of them are biased. The probability that a zombie will be hit by a shot if the Killing Assistant is biased is 2/3, otherwise the probability is 1/2.

Little Harry figures out this mess by selecting a Killing Assistant randomly. He tricks that particular Killing Assistant in shooting the same zombie twice. The first time, the Killing Assistant shoots the zombie, while the other time, he ends up missing it.

Harry wants to know what are the chances that the selected Killing Assistant was NOT biased.

Input format:
The first line consists of a number t, which denotes the number of test cases. For every test case, there will be two integers on the next line. The number n denoting the number of students, while the number m denotes the number of unbiased students.

Output format:
For every test case, print the required probability in the form of a reduced fraction possible. More formally, print the desired probability as P/Q, where P and Q are coprime.

Constraints:
1t105
1n105
0mN

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

.

Editor Image

?