Find maximum unreachable height using two ladders | Java implementation of the approach ; Function to return the maximum height which can 't be reached ; Driver code
class GFG { static int maxHeight ( int h1 , int h2 ) { return ( ( h1 * h2 ) - h1 - h2 ) ; } public static void main ( String args [ ] ) { int h1 = 7 , h2 = 5 ; System . out . println ( Math . max ( 0 , maxHeight ( h1 , h2 ) ) ) ; } }