Find maximum unreachable height using two ladders | C ++ implementation of the approach ; Function to return the maximum height which can 't be reached ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int maxHeight ( int h1 , int h2 ) { return ( ( h1 * h2 ) - h1 - h2 ) ; } int main ( ) { int h1 = 7 , h2 = 5 ; cout << max ( 0 , maxHeight ( h1 , h2 ) ) ; return 0 ; }