Help Req. in Lunchtime Ques

https://www.codechef.com/problems/MAXAND18

In this Ques how to sort array of pairs, first in dec order of first pair item then in inc ord of second pair item.