//#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define mp make_pair #define pb push_back //#define DEBUG #ifdef LOCAL #define eprintf(...) fprintf(stderr,__VA_ARGS__) #else #define eprintf(...) #endif #define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC) #define TIMESTAMPf(x,...) eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, clock()*1.0/CLOCKS_PER_SEC) #if ( ( _WIN32 || __WIN32__ ) && __cplusplus < 201103L) #define LLD "%I64d" #else #define LLD "%lld" #endif using namespace std; #define TASKNAME "F" typedef vector vi; #define sz(a) ((int)(a).size()) #ifdef LOCAL static struct __timestamper { string what; __timestamper(const char* what) : what(what){}; __timestamper(const string& what) : what(what){}; ~__timestamper(){ TIMESTAMPf("%s", what.data()); } } __TIMESTAMPER("end"); #else struct __timestamper {}; #endif typedef long long ll; typedef long double ld; const int MOD = 998244353; const int ROOT = 3; int mmul(int a, int b) { return (a * 1LL * b) % MOD; } void madd(int& a, int b) { if ((a += b) >= MOD) a -= MOD; } int mpow(int a, int b){ if (!b) return 1; if (b & 1) return (mpow(a, b-1) * 1LL * a) % MOD; int temp = mpow(a, b/2); return (temp * 1LL * temp) % MOD; } bool checkRoot(int x){ return mpow(x, (MOD - 1) / 7) != 1 && mpow(x, (MOD - 1) / 17) != 1 && mpow(x, (MOD - 1) / 2) != 1; } // BEGIN ALGO const int MROOT = 19; const int MROOTP = 1<>1]>>1) | ((i&1) << (MROOT-1)); } inline void butterfly(int &a, int &b, int x){ int temp = mmul(x, b); b = a; madd(a, temp); madd(b, MOD - temp); } void fft(vi &a, bool inv){ int n = __builtin_ctz(sz(a)); for (int i = 0; i < (1<> (MROOT - n); if (temp > i) swap(a[i], a[temp]); } for (int step = 0; step < n; step++){ int pos = 0; /*BOXNEXT*/ int dlt = (inv ? -1 : 1) * (1 << (MROOT - step - 1)); for (int i = 0; i < (1< i) /*BOXNEXT*/ butterfly(a[i], a[i ^ (1< n) return false; int res = facs[n]; res = (res * 1LL * ifacs[k]) % MOD; res = (res * 1LL * ifacs[n-k]) % MOD; return res; } ll get2(int x1, int x2, int t){ int dlt = t - abs(x1 - x2); if (dlt < 0 || dlt % 2) return 0; return cnk(t, dlt / 2); } ll get1(int x1, int x2, int y1, int y2, int t){ return (get2(x1 + y1, x2 + y2, t) * 1LL * get2(x1 - y1, x2 - y2, t)) % MOD; } int get(int x1, int x2, int y1, int y2, int t){ return (get1(x1, x2, y1, y2, t) - get1(x1,-x2, y1, y2, t) - get1(x1, x2, y1,-y2, t) + get1(x1,-x2, y1,-y2, t) + 3LL * MOD) % MOD; } int main(){ assert(checkRoot(ROOT)); PreCalcRoots(); PreCalcFacs(); #ifdef LOCAL assert(freopen(TASKNAME".in","r",stdin)); assert(freopen(TASKNAME".out","w",stdout)); #endif int x1, y1, x2, y2, t; scanf("%d %d %d %d %d",&x1,&y1,&x2,&y2, &t); vi res(t+1); vi res0(t+1); for (int i = 0; i <= t; i++){ res[i] = get(x1, x2, y1, y2, i); res0[i] = get(x2, x2, y2, y2, i); } res = multiply(res, inverse(res0)); printf("%d\n", res[t]); return 0; }