#include #include #include using namespace std; int main() { int a, b, c, k; int result = 0; bool ac = false, bc = false; cin >> a >> b >> k >> c; if (a == c) { ac = true; } else if (b == c) { bc = true; } result += k * 2; int tmp_result; for (int i = 2; i < k; i++) { tmp_result = 1; for ( int braces = 0 ; braces < i ; braces++ ) tmp_result *= k - braces; tmp_result /= 2; result += tmp_result * i; } //cout << a << b << k << c << ac << bc << endl; cout << result % 1000000007 << endl; return 0; }