#include #include #include using namespace std; int main() { int a, b, c, k; long long int result = 0; cin >> a >> b >> k >> c; result += k * 2; long long 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 = ( tmp_result / 2 ) * i; result += tmp_result; //cout << tmp_result << ", " << result << endl; } cout << result % 1000000007 << endl; return 0; }