sort all queries in order of their index value so that results of queries can be printed in same order as of input ) ;
x . index - y . index ) ; for ( int i = 0 ; i < m ; i ++ ) { System . out . println ( q [ i ] . armstrong ) ; } }