#P7842. Jogging
Jogging
Jogging
Problem Description
Notice:Don't output extra spaces at the end of one line. Dodo bird is jogging on an infinite 2-d plane, starting from . For a point, it is regarded as good if and only if . Dodo bird will walk infinite steps on the plane under the following strategy: Assume he is currently at , let be the set of good points among $(x-1,y-1),(x-1,y),(x-1,y+1),(x,y-1),(x,y+1),(x+1,y-1),(x+1,y),(x+1,y+1)$, be the size of . He has a probability of to stay in , and he also has a probility of to move to a point in . If he chooses to move, the probility of going to any point in is equal. Define as the probability of coming back to after walking steps, please calculate . It is guaranteed that the answer always exists.
Input
The first line contains an integer , indicating the number of test cases. Each test case has one line, which contains two integers , indicating the position of the start point. It is guaranteed that .
Output
lines, each line contains an irreducible fraction, indicating the answer.
Sample Input
3
18 16
18 6
18 8
Sample Output
0/1
1/1
2/7
Source
2020 Multi-University Training Contest 7