Count of Binary Strings possible as per given conditions | Function to generate maximum possible strings that can be generated ; Maximum possible strings ; Driver Code
function countStrings ( A , B , K ) { let X = Math . floor ( ( A + B ) / ( K + 1 ) ) ; return ( Math . min ( A , Math . min ( B , X ) ) * ( K + 1 ) ) ; } let N = 101 , M = 231 , K = 15 ; document . write ( countStrings ( N , M , K ) ) ;