Under construction

Still being built. Things may change

Drinks

Time limit2sMemory limit256 MB

Summary
Two players alternately draw balls without replacement until the first red ball appears, and you compute the chance the first player draws it.
Level

Medium4 of 10

Topics
Probability, Dynamic programming, Number theory
Solved
No attempts yet

Problem

Every weekend dreamoon and drazil play in the park. Each time they meet, one of them has to buy drinks for both, and they settle who pays with this procedure.

  1. Put nn red balls and mm white balls into a paper bag.
  2. dreamoon and drazil take turns drawing one ball from the bag. A drawn ball is not put back.
  3. Whoever draws a red ball first buys the drinks.

drazil lets dreamoon draw first every week because dreamoon is older. One day dreamoon started wondering how likely he is to draw a red ball first. Every ball still in the bag is equally likely to be drawn. Compute that probability.

Input

The first line contains the number of test cases TT, where T≤1770T \le 1770.

Each of the next TT lines contains the number of red balls nn and the number of white balls mm, separated by a space. The values satisfy 1≤n≤591 \le n \le 59, 1≤m≤591 \le m \le 59, and n+m≤60n + m \le 60.

Output

For each test case, print on one line the probability that dreamoon draws a red ball first, written as a reduced fraction a/ba/b. Here aa and bb are coprime positive integers, and there is no space around the slash.

Examples2

  1. Example 1

    Input
    2
    1 1
    1 2
    
    Expected output
    1/2
    2/3
    
  2. Example 2

    Input
    3
    3 1
    1 3
    2 2
    
    Expected output
    3/4
    1/2
    2/3