It's All In The Mind

아직 제출이 없습니다시간 제한1초메모리 제한64 MB

문제

Professor Zhang has a number sequence a_1,a_2,,a_na\_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:

  • For every i1,2,,ni \in \\{1, 2, \ldots, n\\}, 0a_i1000 \le a\_i \le 100.
  • The sequence is non-increasing: a_1a_2a_na\_1 \ge a\_2 \ge \ldots \ge a\_n.
  • The sum of all elements in the sequence is not zero.

Professor Zhang wants to know the maximum value of a_1+a_2_i=1na_i\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 TT indicating the number of test cases. For each test case:

The first line contains two integers nn and mm (2n1002 \le n \le 100, 0mn0 \le m \le n): the length of the sequence and the number of known elements.

Each of the next mm lines contains two integers x_ix\_i and y_iy\_i (1x_in1 \le x\_i \le n, 0y_i1000 \le y\_i \le 100, x_i<x_i+1x\_i < x\_{i + 1}, y_iy_i+1y\_i \ge y\_{i + 1}) indicating that a_x_i=y_ia\_{x\_i} = y\_i.

There are at most 20002000 test cases, and the total size of the input is no more than 350350 kibibytes.

출력

For each test case, output the answer as an irreducible fraction pp/qq where pp and qq are integers, and q>0q > 0.