시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 64 MB | 17 | 11 | 11 | 78.571% |
Professor Zhang has a number sequence $a_1, a_2, \ldots, a_n$. However, the sequence is not complete and some elements are missing. Fortunately, Professor Zhang remembers some attributes of the sequence:
Professor Zhang wants to know the maximum value of $\frac{a_1 + a_2}{\sum_{i = 1}^{n}{a_i}}$ among all the possible sequences.
There are multiple test cases. The first line of input contains an integer $T$ indicating the number of test cases. For each test case:
The first line contains two integers $n$ and $m$ ($2 \le n \le 100$, $0 \le m \le n$): the length of the sequence and the number of known elements.
Each of the next $m$ lines contains two integers $x_i$ and $y_i$ ($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 $a_{x_i} = y_i$.
There are at most $2000$ test cases, and the total size of the input is no more than $350$ kibibytes.
For each test case, output the answer as an irreducible fraction $p$/
$q$ where $p$ and $q$ are integers, and $q > 0$.
2 2 0 3 1 3 1
1/1 200/201