#P11013. [2016杭电多校]It's All In The Mind
[2016杭电多校]It's All In The Mind
It's All In The Mind
Problem Description
Professor Zhang has a number sequence . However, the sequence is not complete and some elements are missing. Fortunately, Professor Zhang remembers some properties of the sequence:
- For every , .
- The sequence is non-increasing, i.e. .
- The sum of all elements in the sequence is not zero. Professor Zhang wants to know the maximum value of among all the possible sequences.
Input
There are multiple test cases. The first line of input contains an integer , indicating the number of test cases. For each test case: The first contains two integers and -- the length of the sequence and the number of known elements. In the next lines, each contains two integers and $(1 \le x_i \le n, 0 \le y_i \le 100, x_i < x_{i+1}, y_i \ge y_{i+1})$, indicating that .
Output
For each test case, output the answer as an irreducible fraction "/", where , are integers, .
Sample Input
2
2 0
3 1
3 1
Sample Output
1/1
200/201
Author
zimpha
Source
2016 Multi-University Training Contest 2