if a and b are same
if ( a == b ) : NEW_LINE INDENT return ( check ( a * n , a , b ) ) NEW_LINE DEDENT ans = 0 NEW_LINE for i in range ( n + 1 ) : NEW_LINE INDENT if ( check ( i * a + ( n - i ) * b , a , b ) ) : NEW_LINE INDENT ans = ( ans + comb ( n , i ) ) % mod NEW_LINE DEDENT DEDENT return ans NEW_LINE