SP19899 MIDEARTH - Middle Earth
Description
Middle Earth
Input Format
The first line of input contains T (the number of test cases).
The first line of each test case contains 2 integers separated by spaces (1
The following N lines contain 2 integers separated by spaces (1
Output Format
The answer to each test case separated by a new line.