2-D Points

0

0 votes
Easy
Problem

Given N 2-Dimensional points in the form of (x, y). Sort the points in the following way.
Two points (x1, y1) and (x2, y2) are said to be sorted with respect to each other if
1. x1 < x2
2. x1 == x2 and y1 > y2

Input
First line contains T (number of test cases). Next line contains N (number of points in 2-D space). Next N line contains two integers separated by a single space X and Y denoting the x-coordinate and y-coordinate respectively.

Constraints
1 <= T <= 100
1 <= N <= 105
-109 <= Ai <= 109

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?