SORT2D  2DSORT
Given n points in a two dimensional space, sort all the points in ascending order.
(x1,y1) > (x2,y2) if and only if (x1>x2) or (x1==x2 && y1<y2)
Input Specification:
The first line consists of an integer t, the number of test cases. Then for each test case the first line consists of an integer n, the number of points. Then the next n lines contains two integers xi, yi which represents the point.
Output Specification:
For each test case print the sorted order of the points.
Input Constraints:
1<=t<=10
1<=n<=100000
 10^9<=coordinates<=10^9
NOTE: Strict time limit. Prefer scanf/printf/BufferedReader instead of cin/cout/Scanner.
Sample Input:
1
5
3 4
1 2
5 3
3 3
1 2
Sample Output:
1 2
1 2
3 4
3 3
5 3
hide comments
suryasis:
20170402 10:04:26
Use printf and scanf and also make sure that use std::sort and comp(point p1,point p2) 

jigar:
20160119 18:37:32
HI I AM NOT UNDERSTANDING THE QUESTION


sunshine:
20141003 20:19:51
getting tle..help plzz..i have done using structure and selection sort


cegprakash:
20120902 12:34:27
@Prakash: use scanf and printf instead of cin and cout 

Prakash:
20120821 17:48:38
i am getting AC on my system but here it shows WA at 0.73sec. i have used pair<> and sort() from STL..Reply soon.. 
Added by:  cegprakash 
Date:  20120405 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 