import java.util.*; import java.math.*; import java.io.*; import java.text.DecimalFormat; import java.math.BigInteger; public class Solution{ //static int d=20; static long mod=1000000007 ; //static HashMap hm=new HashMap<>(); static ArrayList> arr; static int size; static long[][] fac; static long[][] dp; static int num,max; static int ans=0; static HashMap hm; public static void main(String[] args) throws IOException { boolean online =false; String fileName = "C-large"; PrintWriter out; if (online) { s.init(new FileInputStream(new File(fileName + ".in"))); out= new PrintWriter(new FileWriter(fileName + "out.txt")); } else { s.init(System.in); out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); } int q=s.ni(); while(q--!=0){ int n=s.ni(); int[][] a=new int[n][2]; int x1,x2,y1,y2; x1=y1=Integer.MAX_VALUE; x2=y2=Integer.MIN_VALUE; for(int i=0;i{ int from,to,c,d,id; public edge(int x,int y,int u,int v,int z){ from=x; to=y; c=u; d=v; id=z; } public int compareTo(edge o){ return c-o.c; } } public static class s { static BufferedReader reader; static StringTokenizer tokenizer; /** call this method to initialize reader for InputStream */ static void init(InputStream input) { reader = new BufferedReader( new InputStreamReader(input) ); tokenizer = new StringTokenizer(""); } /** get next word */ static String ns() throws IOException { while ( ! tokenizer.hasMoreTokens() ) { //TODO add check for eof if necessary tokenizer = new StringTokenizer( reader.readLine() ); } return tokenizer.nextToken(); } static int ni() throws IOException { return Integer.parseInt( ns() ); } static double nd() throws IOException { return Double.parseDouble( ns() ); } static long nl() throws IOException { return Long.parseLong( ns() ); } } }