#include using namespace std; int main ( void ) { int a, b, c, k; ios::sync_with_stdio ( false ); cin >> a >> b >> k >> c; if ( k == 0 ) { cout << 0 << endl; return 0; } if ( c != a && c != b ) { cout << 0 << endl; return 0; } if ( a == b ) { cout << k << endl; return 0; } int res = k, comb = k; for ( int i = 2; i <= k; ++ i ) { comb *= (k - i + 1); comb /= (i-1); res += comb; } cout << res << endl; return 0; }