Utilitiy function to obtain maximum date or month or year
static int getMax ( int arr [ ] [ ] , int n , int q ) { int maxi = Integer . MIN_VALUE ; for ( int i = 0 ; i < n ; i ++ ) { maxi = Math . max ( maxi , arr [ i ] [ q ] ) ; } return maxi ; }