Unhappy Pair

Limits: 1s, 512 MB

There is only one school in Titan. Students from different places come to learn here. Different peoples from different places have different tastes, choices. Recently, the authority of the school has decided to make pairs of every student to make them happier. As, many students might want to make pair with a particular one, the authority imposes a rule to make pairs. They collected the heights of students and scores of their last final exams. They’ve agreed in a meeting that one student can only make pair with a student whose height is closest to the student because it will look beautiful.


This is a companion discussion topic for the original entry at https://toph.co/p/unhappy-pair