Current building paired with the building greater in height and on the extreme right
int right = 0 ; if ( maxIndSoFar > pairs [ i ] . first ) { right = ( pairs [ i ] . second * ( maxIndSoFar - pairs [ i ] . first - 1 ) ) ; }