Function to calculate the cumulative sum from a [ i ] to a [ j ]
static long sum ( int [ ] a , int i , int j ) { long ans = 0 ; for ( int m = i ; m <= j ; m ++ ) ans = ( ans + a [ m ] ) % 100 ; return ans ; } static long solve ( int [ ] a , int i , int j ) {