You are given the ratings of n coders in an array. To create effective teams, you want to form pairs of coders who have similar ratings. The strategy is to sort all the coders by their rating and then pair up adjacent coders.
Your task is to determine if it's possible to pair up all n coders. This is only possible if n is an even number.
If n is even, you must sort the ratings and form n/2 pairs from adjacent elements. Return a list of these pairs.
If n is odd, it's impossible to pair up everyone. In this case, you should indicate that pairing is not possible.
Input Format:
The first line contains a single integer N, the number of coders.
The second line contains N space-separated integers, representing the ratings of the coders.
Output Format:
If N is even, print N/2 lines, where each line contains a pair of ratings (the two numbers in the pair separated by a space). The pairs should be printed in increasing order of their ratings.
If N is odd, print a single line with the value -1.
Note:
The core of the problem lies in sorting the initial array to bring coders with similar ratings next to each other.