#include <iostream>
using namespace std;
const long long MOD = 1e9 +7 ;
long long dp[10002][102] ;
int K;
long long solve(long long dif ,int t){
if(t == 0){
return (dif > 9000) ;
}
while(dif < 0){}
if(dp[dif][t] != -1)
return dp[dif][t] ;
long long &ret = dp[dif][t] ;
ret = 0 ;
for(int i = -K ; i <= K ; i++)
for(int j = -K ; j <= K ; j++)
ret = (ret + solve(dif + i - j , t - 1))%MOD ;
return ret ;
}
int main(int argc,char* argv[]) {
int a,b,t ;
cin >> a >> b >> K >> t ;
memset(dp , -1 , sizeof(dp)) ;
long long ans = solve(a-b+9000,t) ;
while(ans < 0) ans += MOD ;
while(ans >= MOD) ans -= MOD ;
cout << ans << endl ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3QgbG9uZyBsb25nIE1PRCA9IDFlOSArNyA7CmxvbmcgbG9uZyBkcFsxMDAwMl1bMTAyXSA7CmludCBLOwpsb25nIGxvbmcgc29sdmUobG9uZyBsb25nIGRpZiAsaW50IHQpewogICAgaWYodCA9PSAwKXsKICAgICAgICByZXR1cm4gKGRpZiA+IDkwMDApIDsKICAgIH0KICAgIHdoaWxlKGRpZiA8IDApe30KICAgIGlmKGRwW2RpZl1bdF0gIT0gLTEpCiAgICAgICAgcmV0dXJuIGRwW2RpZl1bdF0gOwogICAgbG9uZyBsb25nICZyZXQgPSBkcFtkaWZdW3RdIDsKICAgIHJldCA9IDAgOwogICAgZm9yKGludCBpID0gLUsgOyBpIDw9IEsgOyBpKyspCiAgICAgICAgZm9yKGludCBqID0gLUsgOyBqIDw9IEsgOyBqKyspCiAgICAgICAgICAgIHJldCA9IChyZXQgKyBzb2x2ZShkaWYgKyBpIC0gaiAsIHQgLSAxKSklTU9EIDsKICAgIHJldHVybiByZXQgOwp9CmludCBtYWluKGludCBhcmdjLGNoYXIqIGFyZ3ZbXSkgeyAKCiAgICBpbnQgYSxiLHQgOwogICAgY2luID4+IGEgPj4gYiA+PiBLID4+IHQgOwogICAgbWVtc2V0KGRwICwgLTEgLCBzaXplb2YoZHApKSA7CiAgICBsb25nIGxvbmcgYW5zID0gc29sdmUoYS1iKzkwMDAsdCkgOwogICAgd2hpbGUoYW5zIDwgMCkgYW5zICs9IE1PRCA7CiAgICB3aGlsZShhbnMgPj0gTU9EKSBhbnMgLT0gTU9EIDsKICAgIGNvdXQgPDwgYW5zIDw8IGVuZGwgOwogICAgcmV0dXJuIDAgOwp9
prog.cpp: In function 'int main(int, char**)':
prog.cpp:25:32: error: 'memset' was not declared in this scope
memset(dp , -1 , sizeof(dp)) ;
^