pair class
class pair { public int first , second ; public pair ( int a , int b ) { first = a ; second = b ; } } class sortHelper : IComparer { int IComparer . Compare ( object a , object b ) { pair first = ( pair ) a ; pair second = ( pair ) b ; return first . first - second . first ; } }