check for given condition
if ( ( length / breadth + breadth / length ) > ( arr_pairs . get ( i ) / arr_pairs . get ( i - 1 ) + arr_pairs . get ( i - 1 ) / arr_pairs . get ( i ) ) ) { length = arr_pairs . get ( i ) ; breadth = arr_pairs . get ( i - 1 ) ; } }