Function that prints the number of times X gets a value between L and R
static void goodint ( int [ ] arr , int n , int h , int l , int r ) { int [ , ] dp = new int [ n + 1 , h ] ; for ( int i = 0 ; i < n ; i ++ ) for ( int j = 0 ; j < h ; j ++ ) dp [ i , j ] = - 1 ;