Sort pairs 2
Given a list of pairs, you are asked to sort them in increasing order based on the second element. So, when looking at the final list of the pairs, the second element should be a non-decreasing sequence.
The first line of the input contains a single integer
n- the number of pairs. The next
nlines contain 2 integers separated by a space.
The program should print
nlines containing the resulting list. Each line should have two integers separated by a space.
3 10 4 12 1 6 7
12 1 10 4 6 7
Time limit: 1 seconds
Memory limit: 512 MB
Output limit: 1 MB