SRM 529 Div2 500 modified sorting