Count of Binary Strings possible as per given conditions | C # program to implement the above approach ; Function to generate maximum possible strings that can be generated ; Maximum possible strings ; Driver Code
using System ; class GFG { static long countStrings ( long A , long B , long K ) { long X = ( A + B ) / ( K + 1 ) ; return ( Math . Min ( A , Math . Min ( B , X ) ) * ( K + 1 ) ) ; } public static void Main ( string [ ] args ) { long N = 101 , M = 231 , K = 15 ; Console . Write ( countStrings ( N , M , K ) ) ; } }