//pierwszy plus czwarty //to jeszcze drugi w O(x * y^3), jak mam 10 s xD #pragma GCC optimize("O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // gp_hash_table<int, int> mapka; using namespace std; #define PB push_back #define MP make_pair #define LL long long #define int LL #define FOR(i,a,b) for(int i = (a); i <= (b); i++) #define RE(i,n) FOR(i,1,n) #define REP(i,n) FOR(i,0,(int)(n)-1) #define R(i,n) REP(i,n) #define VI vector<int> #define PII pair<int,int> #define LD long double #define FI first #define SE second #define st FI #define nd SE #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); } template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); } template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; } template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while(*sdbg!=',')cerr<<*sdbg++; cerr<<'='<<h<<','; _dbg(sdbg+1, a...); } template<class T> ostream &operator<<(ostream& os, vector<T> V) { os << "["; for (auto vv : V) os << vv << ","; return os << "]"; } template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) { return os << "(" << P.st << "," << P.nd << ")"; } #ifdef LOCAL #define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (__VA_ARGS__) #define cerr if(0)cout #endif struct depek{ int lim; vector<vector<pair<uint,uint>>> dp; int sum; inline pair<uint,uint>& daj(int a,int b){ return dp[a][b + lim]; } depek(int _lim):lim(_lim),dp(_lim, vector<pair<uint,uint>>(2 * _lim + 1)),sum(0){ daj(0,0) = MP(1u, 0u); daj(0,1) = MP(1u, 1u); }; void dodaj(int x,int y){ if(x <= 0)return; for(int i = sum; i >= 0;i--){ R(j,SZ(dp[i]))if(dp[i][j].FI || dp[i][j].SE){ dp[i + x][j + y].FI += dp[i][j].FI; dp[i + x][j + y].SE += dp[i][j].SE; dp[i + x][j + y].SE += dp[i][j].FI * uint(abs(y)); } } sum += x; } void liczcoefy(){ uint a = 0,b = 0,c = 0; R(i,sum+1){ R(j,SZ(dp[i]))if(dp[i][j].FI || dp[i][j].SE){ a += dp[i][j].FI * dp[i][j].FI; b += uint(i) * dp[i][j].FI * dp[i][j].FI; c += uint(i) * dp[i][j].SE * dp[i][j].FI; } } cout << "{" << a << "u, " << b << "u, " << c << "u}," << endl; } }; int kw(int a){ return a * a; } vector<PII> wek; int k; void inicjuj(); void wyliczcoefy(){ k = 250; inicjuj(); depek dp(16000); int j = 0; for(int i = 1; i <= k; i++){ while(j < SZ(wek) && kw(wek[j].FI) + kw(wek[j].SE) <= i * i){ dp.dodaj(wek[j].FI,wek[j].SE); j++; } cerr << i << endl; dp.liczcoefy(); } exit(0); } struct dpek3d{ int n,m; vector<vector<vector<uint>>> dp; int sumx; int poy,koy; int sze; dpek3d(int _n,int _m): n(_n), m(_m), dp(_n + 1, vector<vector<uint>>(_m * 2 + 1, vector<uint>(_m + 300))), sumx(0),poy(_m-1),koy(_m+2),sze(2) { //dp[0][m-1][0] = 1; dp[0][m][0] = 1; //dp[0][m+1][1] = 1; } void dodaj(int x,int y){ if(x <= 0)return; int ysze = max(y, 0ll); for(int i = sumx; i >= 0;i--){ if(i + x >= SZ(dp))continue; for(int j = poy; j < koy; j++){ if(j + y < 0 || j + y >= m * 2 + 1)continue; R(l,sze){ dp[i + x][j + y][l + ysze] += dp[i][j][l]; } } } sumx += x; if(y >= 0){ koy += y; sze += y; }else poy += y; maxi(poy, 0ll); mini(koy, 2 * m + 1); mini(sze, m); } uint licz(){ uint res = 0; debug(n,m); R(i,n){ for(int j = 1; j < m * 2;j++){ for(int l = 0; l < m; l++)if(dp[i][j][l]){ for(int l2 = 0; l2 + l < m; l2++){ res += (n - i) * (m - l - l2) * dp[i][j][l] * ( dp[i][2*m-j][l2] + dp[i][2*m-j+1][l2]); res += (n - i) * (m - l - l2 - 1) * dp[i][j][l] * (dp[i][2*m-j][l2] + dp[i][2*m-j-1][l2]); } } } } return res; } }; uint x,y; void case2(){ dpek3d dp(x,y); for(PII el:wek){ dp.dodaj(el.FI,el.SE); } uint res = dp.licz(); debug(res); res -= x * y; for(PII el:wek){ if(el.FI > 0 || (el.FI == 0 && el.SE > 0)){ if(x > abs(el.FI) && y > abs(el.SE)){ res -= (x - (uint)abs(el.FI)) * (y - (uint)abs(el.SE)); } } } cout << res << "\n"; } namespace case1{ uint res = 0; void bt(int kt, int a, int b,uint sze, uint wys,int il){ if(kt == SZ(wek)){ if(a == 0 && b == 0 && il > 2){ sze /= 2; wys /= 2; if(x > sze && y > wys){ res += (x - sze) * (y - wys); } } return; } bt(kt+1,a,b,sze,wys,il); bt(kt+1,a + wek[kt].FI,b + wek[kt].SE,sze + abs(wek[kt].FI),wys + abs(wek[kt].SE),il+1); } void case1(){ bt(0,0,0,0,0,0); cout << res << "\n"; } } vector<vector<uint>> coefs; void case4(){ debug(coefs[k-1]); uint res = coefs[k-1][0] * x * y; res -= coefs[k-1][1] * (x + y); res += coefs[k-1][2]; res -= x * y; for(PII el:wek){ if(el.FI > 0 || (el.FI == 0 && el.SE > 0)){ res -= (x - (uint)abs(el.FI)) * (y - (uint)abs(el.SE)); } } cout << res << "\n"; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(11); cerr << fixed << setprecision(6); // wyliczcoefy(); cin >> x >> y >> k; inicjuj(); if(x >= 2e5 && y >= 2e5){ case4(); #ifndef LOCAL return 0; #endif } if(x < 200 && y < 200){ case2(); #ifndef LOCAL return 0; #endif } if(k <= 15){ case1::case1(); return 0; } } void inicjuj(){ coefs = { {4u, 2u, 1u}, {4u, 2u, 1u}, {4u, 2u, 1u}, {4u, 2u, 1u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {1840u, 45080u, 1214476u}, {1840u, 45080u, 1214476u}, {1840u, 45080u, 1214476u}, {1840u, 45080u, 1214476u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {11993264u, 941471224u, 3422118060u}, {11993264u, 941471224u, 3422118060u}, {11993264u, 941471224u, 3422118060u}, {11993264u, 941471224u, 3422118060u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {547682336u, 994795728u, 2775644744u}, {547682336u, 994795728u, 2775644744u}, {547682336u, 994795728u, 2775644744u}, {547682336u, 994795728u, 2775644744u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {2140219456u, 609748448u, 425738640u}, {2140219456u, 609748448u, 425738640u}, {2140219456u, 609748448u, 425738640u}, {2140219456u, 609748448u, 425738640u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3551711264u, 211046672u, 1566340968u}, {3551711264u, 211046672u, 1566340968u}, {3551711264u, 211046672u, 1566340968u}, {3551711264u, 211046672u, 1566340968u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1096062416u, 3536563560u, 2044986516u}, {1096062416u, 3536563560u, 2044986516u}, {1096062416u, 3536563560u, 2044986516u}, {1096062416u, 3536563560u, 2044986516u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {3840732912u, 2058972184u, 1791125852u}, {3840732912u, 2058972184u, 1791125852u}, {3840732912u, 2058972184u, 1791125852u}, {3840732912u, 2058972184u, 1791125852u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {3515497840u, 2923764040u, 2882541564u}, {3515497840u, 2923764040u, 2882541564u}, {3515497840u, 2923764040u, 2882541564u}, {3515497840u, 2923764040u, 2882541564u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {319093744u, 846443928u, 267485404u}, {319093744u, 846443928u, 267485404u}, {319093744u, 846443928u, 267485404u}, {319093744u, 846443928u, 267485404u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {3827362848u, 1786450640u, 1617598184u}, {3827362848u, 1786450640u, 1617598184u}, {3827362848u, 1786450640u, 1617598184u}, {3827362848u, 1786450640u, 1617598184u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {1483982160u, 554890456u, 378187892u}, {1483982160u, 554890456u, 378187892u}, {1483982160u, 554890456u, 378187892u}, {1483982160u, 554890456u, 378187892u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {902879568u, 1278219224u, 1422492212u}, {902879568u, 1278219224u, 1422492212u}, {902879568u, 1278219224u, 1422492212u}, {902879568u, 1278219224u, 1422492212u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u} }; wek.PB(MP(0ll,1ll)); wek.PB(MP(0ll,-1ll)); wek.PB(MP(1ll,0ll)); wek.PB(MP(-1ll,0ll)); if(5 <= k) wek.PB(MP(3ll,4ll)); if(5 <= k) wek.PB(MP(3ll,-4ll)); if(5 <= k) wek.PB(MP(-3ll,4ll)); if(5 <= k) wek.PB(MP(-3ll,-4ll)); if(5 <= k) wek.PB(MP(4ll,3ll)); if(5 <= k) wek.PB(MP(4ll,-3ll)); if(5 <= k) wek.PB(MP(-4ll,3ll)); if(5 <= k) wek.PB(MP(-4ll,-3ll)); if(13 <= k) wek.PB(MP(5ll,12ll)); if(13 <= k) wek.PB(MP(5ll,-12ll)); if(13 <= k) wek.PB(MP(-5ll,12ll)); if(13 <= k) wek.PB(MP(-5ll,-12ll)); if(13 <= k) wek.PB(MP(12ll,5ll)); if(13 <= k) wek.PB(MP(12ll,-5ll)); if(13 <= k) wek.PB(MP(-12ll,5ll)); if(13 <= k) wek.PB(MP(-12ll,-5ll)); if(17 <= k) wek.PB(MP(8ll,15ll)); if(17 <= k) wek.PB(MP(8ll,-15ll)); if(17 <= k) wek.PB(MP(-8ll,15ll)); if(17 <= k) wek.PB(MP(-8ll,-15ll)); if(17 <= k) wek.PB(MP(15ll,8ll)); if(17 <= k) wek.PB(MP(15ll,-8ll)); if(17 <= k) wek.PB(MP(-15ll,8ll)); if(17 <= k) wek.PB(MP(-15ll,-8ll)); if(25 <= k) wek.PB(MP(7ll,24ll)); if(25 <= k) wek.PB(MP(7ll,-24ll)); if(25 <= k) wek.PB(MP(-7ll,24ll)); if(25 <= k) wek.PB(MP(-7ll,-24ll)); if(25 <= k) wek.PB(MP(24ll,7ll)); if(25 <= k) wek.PB(MP(24ll,-7ll)); if(25 <= k) wek.PB(MP(-24ll,7ll)); if(25 <= k) wek.PB(MP(-24ll,-7ll)); if(29 <= k) wek.PB(MP(20ll,21ll)); if(29 <= k) wek.PB(MP(20ll,-21ll)); if(29 <= k) wek.PB(MP(-20ll,21ll)); if(29 <= k) wek.PB(MP(-20ll,-21ll)); if(29 <= k) wek.PB(MP(21ll,20ll)); if(29 <= k) wek.PB(MP(21ll,-20ll)); if(29 <= k) wek.PB(MP(-21ll,20ll)); if(29 <= k) wek.PB(MP(-21ll,-20ll)); if(37 <= k) wek.PB(MP(12ll,35ll)); if(37 <= k) wek.PB(MP(12ll,-35ll)); if(37 <= k) wek.PB(MP(-12ll,35ll)); if(37 <= k) wek.PB(MP(-12ll,-35ll)); if(37 <= k) wek.PB(MP(35ll,12ll)); if(37 <= k) wek.PB(MP(35ll,-12ll)); if(37 <= k) wek.PB(MP(-35ll,12ll)); if(37 <= k) wek.PB(MP(-35ll,-12ll)); if(41 <= k) wek.PB(MP(9ll,40ll)); if(41 <= k) wek.PB(MP(9ll,-40ll)); if(41 <= k) wek.PB(MP(-9ll,40ll)); if(41 <= k) wek.PB(MP(-9ll,-40ll)); if(41 <= k) wek.PB(MP(40ll,9ll)); if(41 <= k) wek.PB(MP(40ll,-9ll)); if(41 <= k) wek.PB(MP(-40ll,9ll)); if(41 <= k) wek.PB(MP(-40ll,-9ll)); if(53 <= k) wek.PB(MP(28ll,45ll)); if(53 <= k) wek.PB(MP(28ll,-45ll)); if(53 <= k) wek.PB(MP(-28ll,45ll)); if(53 <= k) wek.PB(MP(-28ll,-45ll)); if(53 <= k) wek.PB(MP(45ll,28ll)); if(53 <= k) wek.PB(MP(45ll,-28ll)); if(53 <= k) wek.PB(MP(-45ll,28ll)); if(53 <= k) wek.PB(MP(-45ll,-28ll)); if(61 <= k) wek.PB(MP(11ll,60ll)); if(61 <= k) wek.PB(MP(11ll,-60ll)); if(61 <= k) wek.PB(MP(-11ll,60ll)); if(61 <= k) wek.PB(MP(-11ll,-60ll)); if(61 <= k) wek.PB(MP(60ll,11ll)); if(61 <= k) wek.PB(MP(60ll,-11ll)); if(61 <= k) wek.PB(MP(-60ll,11ll)); if(61 <= k) wek.PB(MP(-60ll,-11ll)); if(65 <= k) wek.PB(MP(16ll,63ll)); if(65 <= k) wek.PB(MP(16ll,-63ll)); if(65 <= k) wek.PB(MP(-16ll,63ll)); if(65 <= k) wek.PB(MP(-16ll,-63ll)); if(65 <= k) wek.PB(MP(33ll,56ll)); if(65 <= k) wek.PB(MP(33ll,-56ll)); if(65 <= k) wek.PB(MP(-33ll,56ll)); if(65 <= k) wek.PB(MP(-33ll,-56ll)); if(65 <= k) wek.PB(MP(56ll,33ll)); if(65 <= k) wek.PB(MP(56ll,-33ll)); if(65 <= k) wek.PB(MP(-56ll,33ll)); if(65 <= k) wek.PB(MP(-56ll,-33ll)); if(65 <= k) wek.PB(MP(63ll,16ll)); if(65 <= k) wek.PB(MP(63ll,-16ll)); if(65 <= k) wek.PB(MP(-63ll,16ll)); if(65 <= k) wek.PB(MP(-63ll,-16ll)); if(73 <= k) wek.PB(MP(48ll,55ll)); if(73 <= k) wek.PB(MP(48ll,-55ll)); if(73 <= k) wek.PB(MP(-48ll,55ll)); if(73 <= k) wek.PB(MP(-48ll,-55ll)); if(73 <= k) wek.PB(MP(55ll,48ll)); if(73 <= k) wek.PB(MP(55ll,-48ll)); if(73 <= k) wek.PB(MP(-55ll,48ll)); if(73 <= k) wek.PB(MP(-55ll,-48ll)); if(85 <= k) wek.PB(MP(13ll,84ll)); if(85 <= k) wek.PB(MP(13ll,-84ll)); if(85 <= k) wek.PB(MP(-13ll,84ll)); if(85 <= k) wek.PB(MP(-13ll,-84ll)); if(85 <= k) wek.PB(MP(36ll,77ll)); if(85 <= k) wek.PB(MP(36ll,-77ll)); if(85 <= k) wek.PB(MP(-36ll,77ll)); if(85 <= k) wek.PB(MP(-36ll,-77ll)); if(85 <= k) wek.PB(MP(77ll,36ll)); if(85 <= k) wek.PB(MP(77ll,-36ll)); if(85 <= k) wek.PB(MP(-77ll,36ll)); if(85 <= k) wek.PB(MP(-77ll,-36ll)); if(85 <= k) wek.PB(MP(84ll,13ll)); if(85 <= k) wek.PB(MP(84ll,-13ll)); if(85 <= k) wek.PB(MP(-84ll,13ll)); if(85 <= k) wek.PB(MP(-84ll,-13ll)); if(89 <= k) wek.PB(MP(39ll,80ll)); if(89 <= k) wek.PB(MP(39ll,-80ll)); if(89 <= k) wek.PB(MP(-39ll,80ll)); if(89 <= k) wek.PB(MP(-39ll,-80ll)); if(89 <= k) wek.PB(MP(80ll,39ll)); if(89 <= k) wek.PB(MP(80ll,-39ll)); if(89 <= k) wek.PB(MP(-80ll,39ll)); if(89 <= k) wek.PB(MP(-80ll,-39ll)); if(97 <= k) wek.PB(MP(65ll,72ll)); if(97 <= k) wek.PB(MP(65ll,-72ll)); if(97 <= k) wek.PB(MP(-65ll,72ll)); if(97 <= k) wek.PB(MP(-65ll,-72ll)); if(97 <= k) wek.PB(MP(72ll,65ll)); if(97 <= k) wek.PB(MP(72ll,-65ll)); if(97 <= k) wek.PB(MP(-72ll,65ll)); if(97 <= k) wek.PB(MP(-72ll,-65ll)); if(101 <= k) wek.PB(MP(20ll,99ll)); if(101 <= k) wek.PB(MP(20ll,-99ll)); if(101 <= k) wek.PB(MP(-20ll,99ll)); if(101 <= k) wek.PB(MP(-20ll,-99ll)); if(101 <= k) wek.PB(MP(99ll,20ll)); if(101 <= k) wek.PB(MP(99ll,-20ll)); if(101 <= k) wek.PB(MP(-99ll,20ll)); if(101 <= k) wek.PB(MP(-99ll,-20ll)); if(109 <= k) wek.PB(MP(60ll,91ll)); if(109 <= k) wek.PB(MP(60ll,-91ll)); if(109 <= k) wek.PB(MP(-60ll,91ll)); if(109 <= k) wek.PB(MP(-60ll,-91ll)); if(109 <= k) wek.PB(MP(91ll,60ll)); if(109 <= k) wek.PB(MP(91ll,-60ll)); if(109 <= k) wek.PB(MP(-91ll,60ll)); if(109 <= k) wek.PB(MP(-91ll,-60ll)); if(113 <= k) wek.PB(MP(15ll,112ll)); if(113 <= k) wek.PB(MP(15ll,-112ll)); if(113 <= k) wek.PB(MP(-15ll,112ll)); if(113 <= k) wek.PB(MP(-15ll,-112ll)); if(113 <= k) wek.PB(MP(112ll,15ll)); if(113 <= k) wek.PB(MP(112ll,-15ll)); if(113 <= k) wek.PB(MP(-112ll,15ll)); if(113 <= k) wek.PB(MP(-112ll,-15ll)); if(125 <= k) wek.PB(MP(44ll,117ll)); if(125 <= k) wek.PB(MP(44ll,-117ll)); if(125 <= k) wek.PB(MP(-44ll,117ll)); if(125 <= k) wek.PB(MP(-44ll,-117ll)); if(125 <= k) wek.PB(MP(117ll,44ll)); if(125 <= k) wek.PB(MP(117ll,-44ll)); if(125 <= k) wek.PB(MP(-117ll,44ll)); if(125 <= k) wek.PB(MP(-117ll,-44ll)); if(137 <= k) wek.PB(MP(88ll,105ll)); if(137 <= k) wek.PB(MP(88ll,-105ll)); if(137 <= k) wek.PB(MP(-88ll,105ll)); if(137 <= k) wek.PB(MP(-88ll,-105ll)); if(137 <= k) wek.PB(MP(105ll,88ll)); if(137 <= k) wek.PB(MP(105ll,-88ll)); if(137 <= k) wek.PB(MP(-105ll,88ll)); if(137 <= k) wek.PB(MP(-105ll,-88ll)); if(145 <= k) wek.PB(MP(17ll,144ll)); if(145 <= k) wek.PB(MP(17ll,-144ll)); if(145 <= k) wek.PB(MP(-17ll,144ll)); if(145 <= k) wek.PB(MP(-17ll,-144ll)); if(145 <= k) wek.PB(MP(24ll,143ll)); if(145 <= k) wek.PB(MP(24ll,-143ll)); if(145 <= k) wek.PB(MP(-24ll,143ll)); if(145 <= k) wek.PB(MP(-24ll,-143ll)); if(145 <= k) wek.PB(MP(143ll,24ll)); if(145 <= k) wek.PB(MP(143ll,-24ll)); if(145 <= k) wek.PB(MP(-143ll,24ll)); if(145 <= k) wek.PB(MP(-143ll,-24ll)); if(145 <= k) wek.PB(MP(144ll,17ll)); if(145 <= k) wek.PB(MP(144ll,-17ll)); if(145 <= k) wek.PB(MP(-144ll,17ll)); if(145 <= k) wek.PB(MP(-144ll,-17ll)); if(149 <= k) wek.PB(MP(51ll,140ll)); if(149 <= k) wek.PB(MP(51ll,-140ll)); if(149 <= k) wek.PB(MP(-51ll,140ll)); if(149 <= k) wek.PB(MP(-51ll,-140ll)); if(149 <= k) wek.PB(MP(140ll,51ll)); if(149 <= k) wek.PB(MP(140ll,-51ll)); if(149 <= k) wek.PB(MP(-140ll,51ll)); if(149 <= k) wek.PB(MP(-140ll,-51ll)); if(157 <= k) wek.PB(MP(85ll,132ll)); if(157 <= k) wek.PB(MP(85ll,-132ll)); if(157 <= k) wek.PB(MP(-85ll,132ll)); if(157 <= k) wek.PB(MP(-85ll,-132ll)); if(157 <= k) wek.PB(MP(132ll,85ll)); if(157 <= k) wek.PB(MP(132ll,-85ll)); if(157 <= k) wek.PB(MP(-132ll,85ll)); if(157 <= k) wek.PB(MP(-132ll,-85ll)); if(169 <= k) wek.PB(MP(119ll,120ll)); if(169 <= k) wek.PB(MP(119ll,-120ll)); if(169 <= k) wek.PB(MP(-119ll,120ll)); if(169 <= k) wek.PB(MP(-119ll,-120ll)); if(169 <= k) wek.PB(MP(120ll,119ll)); if(169 <= k) wek.PB(MP(120ll,-119ll)); if(169 <= k) wek.PB(MP(-120ll,119ll)); if(169 <= k) wek.PB(MP(-120ll,-119ll)); if(173 <= k) wek.PB(MP(52ll,165ll)); if(173 <= k) wek.PB(MP(52ll,-165ll)); if(173 <= k) wek.PB(MP(-52ll,165ll)); if(173 <= k) wek.PB(MP(-52ll,-165ll)); if(173 <= k) wek.PB(MP(165ll,52ll)); if(173 <= k) wek.PB(MP(165ll,-52ll)); if(173 <= k) wek.PB(MP(-165ll,52ll)); if(173 <= k) wek.PB(MP(-165ll,-52ll)); if(181 <= k) wek.PB(MP(19ll,180ll)); if(181 <= k) wek.PB(MP(19ll,-180ll)); if(181 <= k) wek.PB(MP(-19ll,180ll)); if(181 <= k) wek.PB(MP(-19ll,-180ll)); if(181 <= k) wek.PB(MP(180ll,19ll)); if(181 <= k) wek.PB(MP(180ll,-19ll)); if(181 <= k) wek.PB(MP(-180ll,19ll)); if(181 <= k) wek.PB(MP(-180ll,-19ll)); if(185 <= k) wek.PB(MP(57ll,176ll)); if(185 <= k) wek.PB(MP(57ll,-176ll)); if(185 <= k) wek.PB(MP(-57ll,176ll)); if(185 <= k) wek.PB(MP(-57ll,-176ll)); if(185 <= k) wek.PB(MP(104ll,153ll)); if(185 <= k) wek.PB(MP(104ll,-153ll)); if(185 <= k) wek.PB(MP(-104ll,153ll)); if(185 <= k) wek.PB(MP(-104ll,-153ll)); if(185 <= k) wek.PB(MP(153ll,104ll)); if(185 <= k) wek.PB(MP(153ll,-104ll)); if(185 <= k) wek.PB(MP(-153ll,104ll)); if(185 <= k) wek.PB(MP(-153ll,-104ll)); if(185 <= k) wek.PB(MP(176ll,57ll)); if(185 <= k) wek.PB(MP(176ll,-57ll)); if(185 <= k) wek.PB(MP(-176ll,57ll)); if(185 <= k) wek.PB(MP(-176ll,-57ll)); if(193 <= k) wek.PB(MP(95ll,168ll)); if(193 <= k) wek.PB(MP(95ll,-168ll)); if(193 <= k) wek.PB(MP(-95ll,168ll)); if(193 <= k) wek.PB(MP(-95ll,-168ll)); if(193 <= k) wek.PB(MP(168ll,95ll)); if(193 <= k) wek.PB(MP(168ll,-95ll)); if(193 <= k) wek.PB(MP(-168ll,95ll)); if(193 <= k) wek.PB(MP(-168ll,-95ll)); if(197 <= k) wek.PB(MP(28ll,195ll)); if(197 <= k) wek.PB(MP(28ll,-195ll)); if(197 <= k) wek.PB(MP(-28ll,195ll)); if(197 <= k) wek.PB(MP(-28ll,-195ll)); if(197 <= k) wek.PB(MP(195ll,28ll)); if(197 <= k) wek.PB(MP(195ll,-28ll)); if(197 <= k) wek.PB(MP(-195ll,28ll)); if(197 <= k) wek.PB(MP(-195ll,-28ll)); if(205 <= k) wek.PB(MP(84ll,187ll)); if(205 <= k) wek.PB(MP(84ll,-187ll)); if(205 <= k) wek.PB(MP(-84ll,187ll)); if(205 <= k) wek.PB(MP(-84ll,-187ll)); if(205 <= k) wek.PB(MP(133ll,156ll)); if(205 <= k) wek.PB(MP(133ll,-156ll)); if(205 <= k) wek.PB(MP(-133ll,156ll)); if(205 <= k) wek.PB(MP(-133ll,-156ll)); if(205 <= k) wek.PB(MP(156ll,133ll)); if(205 <= k) wek.PB(MP(156ll,-133ll)); if(205 <= k) wek.PB(MP(-156ll,133ll)); if(205 <= k) wek.PB(MP(-156ll,-133ll)); if(205 <= k) wek.PB(MP(187ll,84ll)); if(205 <= k) wek.PB(MP(187ll,-84ll)); if(205 <= k) wek.PB(MP(-187ll,84ll)); if(205 <= k) wek.PB(MP(-187ll,-84ll)); if(221 <= k) wek.PB(MP(21ll,220ll)); if(221 <= k) wek.PB(MP(21ll,-220ll)); if(221 <= k) wek.PB(MP(-21ll,220ll)); if(221 <= k) wek.PB(MP(-21ll,-220ll)); if(221 <= k) wek.PB(MP(140ll,171ll)); if(221 <= k) wek.PB(MP(140ll,-171ll)); if(221 <= k) wek.PB(MP(-140ll,171ll)); if(221 <= k) wek.PB(MP(-140ll,-171ll)); if(221 <= k) wek.PB(MP(171ll,140ll)); if(221 <= k) wek.PB(MP(171ll,-140ll)); if(221 <= k) wek.PB(MP(-171ll,140ll)); if(221 <= k) wek.PB(MP(-171ll,-140ll)); if(221 <= k) wek.PB(MP(220ll,21ll)); if(221 <= k) wek.PB(MP(220ll,-21ll)); if(221 <= k) wek.PB(MP(-220ll,21ll)); if(221 <= k) wek.PB(MP(-220ll,-21ll)); if(229 <= k) wek.PB(MP(60ll,221ll)); if(229 <= k) wek.PB(MP(60ll,-221ll)); if(229 <= k) wek.PB(MP(-60ll,221ll)); if(229 <= k) wek.PB(MP(-60ll,-221ll)); if(229 <= k) wek.PB(MP(221ll,60ll)); if(229 <= k) wek.PB(MP(221ll,-60ll)); if(229 <= k) wek.PB(MP(-221ll,60ll)); if(229 <= k) wek.PB(MP(-221ll,-60ll)); if(233 <= k) wek.PB(MP(105ll,208ll)); if(233 <= k) wek.PB(MP(105ll,-208ll)); if(233 <= k) wek.PB(MP(-105ll,208ll)); if(233 <= k) wek.PB(MP(-105ll,-208ll)); if(233 <= k) wek.PB(MP(208ll,105ll)); if(233 <= k) wek.PB(MP(208ll,-105ll)); if(233 <= k) wek.PB(MP(-208ll,105ll)); if(233 <= k) wek.PB(MP(-208ll,-105ll)); if(241 <= k) wek.PB(MP(120ll,209ll)); if(241 <= k) wek.PB(MP(120ll,-209ll)); if(241 <= k) wek.PB(MP(-120ll,209ll)); if(241 <= k) wek.PB(MP(-120ll,-209ll)); if(241 <= k) wek.PB(MP(209ll,120ll)); if(241 <= k) wek.PB(MP(209ll,-120ll)); if(241 <= k) wek.PB(MP(-209ll,120ll)); if(241 <= k) wek.PB(MP(-209ll,-120ll)); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 | //pierwszy plus czwarty //to jeszcze drugi w O(x * y^3), jak mam 10 s xD #pragma GCC optimize("O3") #include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // gp_hash_table<int, int> mapka; using namespace std; #define PB push_back #define MP make_pair #define LL long long #define int LL #define FOR(i,a,b) for(int i = (a); i <= (b); i++) #define RE(i,n) FOR(i,1,n) #define REP(i,n) FOR(i,0,(int)(n)-1) #define R(i,n) REP(i,n) #define VI vector<int> #define PII pair<int,int> #define LD long double #define FI first #define SE second #define st FI #define nd SE #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); } template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); } template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; } template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while(*sdbg!=',')cerr<<*sdbg++; cerr<<'='<<h<<','; _dbg(sdbg+1, a...); } template<class T> ostream &operator<<(ostream& os, vector<T> V) { os << "["; for (auto vv : V) os << vv << ","; return os << "]"; } template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) { return os << "(" << P.st << "," << P.nd << ")"; } #ifdef LOCAL #define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (__VA_ARGS__) #define cerr if(0)cout #endif struct depek{ int lim; vector<vector<pair<uint,uint>>> dp; int sum; inline pair<uint,uint>& daj(int a,int b){ return dp[a][b + lim]; } depek(int _lim):lim(_lim),dp(_lim, vector<pair<uint,uint>>(2 * _lim + 1)),sum(0){ daj(0,0) = MP(1u, 0u); daj(0,1) = MP(1u, 1u); }; void dodaj(int x,int y){ if(x <= 0)return; for(int i = sum; i >= 0;i--){ R(j,SZ(dp[i]))if(dp[i][j].FI || dp[i][j].SE){ dp[i + x][j + y].FI += dp[i][j].FI; dp[i + x][j + y].SE += dp[i][j].SE; dp[i + x][j + y].SE += dp[i][j].FI * uint(abs(y)); } } sum += x; } void liczcoefy(){ uint a = 0,b = 0,c = 0; R(i,sum+1){ R(j,SZ(dp[i]))if(dp[i][j].FI || dp[i][j].SE){ a += dp[i][j].FI * dp[i][j].FI; b += uint(i) * dp[i][j].FI * dp[i][j].FI; c += uint(i) * dp[i][j].SE * dp[i][j].FI; } } cout << "{" << a << "u, " << b << "u, " << c << "u}," << endl; } }; int kw(int a){ return a * a; } vector<PII> wek; int k; void inicjuj(); void wyliczcoefy(){ k = 250; inicjuj(); depek dp(16000); int j = 0; for(int i = 1; i <= k; i++){ while(j < SZ(wek) && kw(wek[j].FI) + kw(wek[j].SE) <= i * i){ dp.dodaj(wek[j].FI,wek[j].SE); j++; } cerr << i << endl; dp.liczcoefy(); } exit(0); } struct dpek3d{ int n,m; vector<vector<vector<uint>>> dp; int sumx; int poy,koy; int sze; dpek3d(int _n,int _m): n(_n), m(_m), dp(_n + 1, vector<vector<uint>>(_m * 2 + 1, vector<uint>(_m + 300))), sumx(0),poy(_m-1),koy(_m+2),sze(2) { //dp[0][m-1][0] = 1; dp[0][m][0] = 1; //dp[0][m+1][1] = 1; } void dodaj(int x,int y){ if(x <= 0)return; int ysze = max(y, 0ll); for(int i = sumx; i >= 0;i--){ if(i + x >= SZ(dp))continue; for(int j = poy; j < koy; j++){ if(j + y < 0 || j + y >= m * 2 + 1)continue; R(l,sze){ dp[i + x][j + y][l + ysze] += dp[i][j][l]; } } } sumx += x; if(y >= 0){ koy += y; sze += y; }else poy += y; maxi(poy, 0ll); mini(koy, 2 * m + 1); mini(sze, m); } uint licz(){ uint res = 0; debug(n,m); R(i,n){ for(int j = 1; j < m * 2;j++){ for(int l = 0; l < m; l++)if(dp[i][j][l]){ for(int l2 = 0; l2 + l < m; l2++){ res += (n - i) * (m - l - l2) * dp[i][j][l] * ( dp[i][2*m-j][l2] + dp[i][2*m-j+1][l2]); res += (n - i) * (m - l - l2 - 1) * dp[i][j][l] * (dp[i][2*m-j][l2] + dp[i][2*m-j-1][l2]); } } } } return res; } }; uint x,y; void case2(){ dpek3d dp(x,y); for(PII el:wek){ dp.dodaj(el.FI,el.SE); } uint res = dp.licz(); debug(res); res -= x * y; for(PII el:wek){ if(el.FI > 0 || (el.FI == 0 && el.SE > 0)){ if(x > abs(el.FI) && y > abs(el.SE)){ res -= (x - (uint)abs(el.FI)) * (y - (uint)abs(el.SE)); } } } cout << res << "\n"; } namespace case1{ uint res = 0; void bt(int kt, int a, int b,uint sze, uint wys,int il){ if(kt == SZ(wek)){ if(a == 0 && b == 0 && il > 2){ sze /= 2; wys /= 2; if(x > sze && y > wys){ res += (x - sze) * (y - wys); } } return; } bt(kt+1,a,b,sze,wys,il); bt(kt+1,a + wek[kt].FI,b + wek[kt].SE,sze + abs(wek[kt].FI),wys + abs(wek[kt].SE),il+1); } void case1(){ bt(0,0,0,0,0,0); cout << res << "\n"; } } vector<vector<uint>> coefs; void case4(){ debug(coefs[k-1]); uint res = coefs[k-1][0] * x * y; res -= coefs[k-1][1] * (x + y); res += coefs[k-1][2]; res -= x * y; for(PII el:wek){ if(el.FI > 0 || (el.FI == 0 && el.SE > 0)){ res -= (x - (uint)abs(el.FI)) * (y - (uint)abs(el.SE)); } } cout << res << "\n"; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(11); cerr << fixed << setprecision(6); // wyliczcoefy(); cin >> x >> y >> k; inicjuj(); if(x >= 2e5 && y >= 2e5){ case4(); #ifndef LOCAL return 0; #endif } if(x < 200 && y < 200){ case2(); #ifndef LOCAL return 0; #endif } if(k <= 15){ case1::case1(); return 0; } } void inicjuj(){ coefs = { {4u, 2u, 1u}, {4u, 2u, 1u}, {4u, 2u, 1u}, {4u, 2u, 1u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {80u, 600u, 5364u}, {1840u, 45080u, 1214476u}, {1840u, 45080u, 1214476u}, {1840u, 45080u, 1214476u}, {1840u, 45080u, 1214476u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {133104u, 6322440u, 316485372u}, {11993264u, 941471224u, 3422118060u}, {11993264u, 941471224u, 3422118060u}, {11993264u, 941471224u, 3422118060u}, {11993264u, 941471224u, 3422118060u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {1535638064u, 3120122216u, 4129614348u}, {547682336u, 994795728u, 2775644744u}, {547682336u, 994795728u, 2775644744u}, {547682336u, 994795728u, 2775644744u}, {547682336u, 994795728u, 2775644744u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3565658176u, 1747674592u, 2045614896u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {3296100608u, 1737252992u, 3727894528u}, {2140219456u, 609748448u, 425738640u}, {2140219456u, 609748448u, 425738640u}, {2140219456u, 609748448u, 425738640u}, {2140219456u, 609748448u, 425738640u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3385992320u, 3699520960u, 3239764672u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3842663392u, 437713712u, 1455255704u}, {3551711264u, 211046672u, 1566340968u}, {3551711264u, 211046672u, 1566340968u}, {3551711264u, 211046672u, 1566340968u}, {3551711264u, 211046672u, 1566340968u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1690965744u, 3278960776u, 60455484u}, {1096062416u, 3536563560u, 2044986516u}, {1096062416u, 3536563560u, 2044986516u}, {1096062416u, 3536563560u, 2044986516u}, {1096062416u, 3536563560u, 2044986516u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {1654252048u, 698669816u, 3324211460u}, {3840732912u, 2058972184u, 1791125852u}, {3840732912u, 2058972184u, 1791125852u}, {3840732912u, 2058972184u, 1791125852u}, {3840732912u, 2058972184u, 1791125852u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {2907057520u, 1625953512u, 2391785180u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {3469017776u, 1413602936u, 473759820u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {2032222640u, 729910696u, 1424893676u}, {3515497840u, 2923764040u, 2882541564u}, {3515497840u, 2923764040u, 2882541564u}, {3515497840u, 2923764040u, 2882541564u}, {3515497840u, 2923764040u, 2882541564u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {3013762768u, 2423879112u, 855010996u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {2523529024u, 1924361824u, 3401054960u}, {319093744u, 846443928u, 267485404u}, {319093744u, 846443928u, 267485404u}, {319093744u, 846443928u, 267485404u}, {319093744u, 846443928u, 267485404u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {2341737680u, 3098352536u, 1817452788u}, {3827362848u, 1786450640u, 1617598184u}, {3827362848u, 1786450640u, 1617598184u}, {3827362848u, 1786450640u, 1617598184u}, {3827362848u, 1786450640u, 1617598184u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {3184172144u, 896232760u, 1284907484u}, {1483982160u, 554890456u, 378187892u}, {1483982160u, 554890456u, 378187892u}, {1483982160u, 554890456u, 378187892u}, {1483982160u, 554890456u, 378187892u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {2372749376u, 3415863712u, 1215312240u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {1914047168u, 1075281376u, 2574093040u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {4248956880u, 1886138696u, 3416402068u}, {902879568u, 1278219224u, 1422492212u}, {902879568u, 1278219224u, 1422492212u}, {902879568u, 1278219224u, 1422492212u}, {902879568u, 1278219224u, 1422492212u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {3805621776u, 4080257288u, 856427012u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u}, {1039347088u, 1409074904u, 396331812u} }; wek.PB(MP(0ll,1ll)); wek.PB(MP(0ll,-1ll)); wek.PB(MP(1ll,0ll)); wek.PB(MP(-1ll,0ll)); if(5 <= k) wek.PB(MP(3ll,4ll)); if(5 <= k) wek.PB(MP(3ll,-4ll)); if(5 <= k) wek.PB(MP(-3ll,4ll)); if(5 <= k) wek.PB(MP(-3ll,-4ll)); if(5 <= k) wek.PB(MP(4ll,3ll)); if(5 <= k) wek.PB(MP(4ll,-3ll)); if(5 <= k) wek.PB(MP(-4ll,3ll)); if(5 <= k) wek.PB(MP(-4ll,-3ll)); if(13 <= k) wek.PB(MP(5ll,12ll)); if(13 <= k) wek.PB(MP(5ll,-12ll)); if(13 <= k) wek.PB(MP(-5ll,12ll)); if(13 <= k) wek.PB(MP(-5ll,-12ll)); if(13 <= k) wek.PB(MP(12ll,5ll)); if(13 <= k) wek.PB(MP(12ll,-5ll)); if(13 <= k) wek.PB(MP(-12ll,5ll)); if(13 <= k) wek.PB(MP(-12ll,-5ll)); if(17 <= k) wek.PB(MP(8ll,15ll)); if(17 <= k) wek.PB(MP(8ll,-15ll)); if(17 <= k) wek.PB(MP(-8ll,15ll)); if(17 <= k) wek.PB(MP(-8ll,-15ll)); if(17 <= k) wek.PB(MP(15ll,8ll)); if(17 <= k) wek.PB(MP(15ll,-8ll)); if(17 <= k) wek.PB(MP(-15ll,8ll)); if(17 <= k) wek.PB(MP(-15ll,-8ll)); if(25 <= k) wek.PB(MP(7ll,24ll)); if(25 <= k) wek.PB(MP(7ll,-24ll)); if(25 <= k) wek.PB(MP(-7ll,24ll)); if(25 <= k) wek.PB(MP(-7ll,-24ll)); if(25 <= k) wek.PB(MP(24ll,7ll)); if(25 <= k) wek.PB(MP(24ll,-7ll)); if(25 <= k) wek.PB(MP(-24ll,7ll)); if(25 <= k) wek.PB(MP(-24ll,-7ll)); if(29 <= k) wek.PB(MP(20ll,21ll)); if(29 <= k) wek.PB(MP(20ll,-21ll)); if(29 <= k) wek.PB(MP(-20ll,21ll)); if(29 <= k) wek.PB(MP(-20ll,-21ll)); if(29 <= k) wek.PB(MP(21ll,20ll)); if(29 <= k) wek.PB(MP(21ll,-20ll)); if(29 <= k) wek.PB(MP(-21ll,20ll)); if(29 <= k) wek.PB(MP(-21ll,-20ll)); if(37 <= k) wek.PB(MP(12ll,35ll)); if(37 <= k) wek.PB(MP(12ll,-35ll)); if(37 <= k) wek.PB(MP(-12ll,35ll)); if(37 <= k) wek.PB(MP(-12ll,-35ll)); if(37 <= k) wek.PB(MP(35ll,12ll)); if(37 <= k) wek.PB(MP(35ll,-12ll)); if(37 <= k) wek.PB(MP(-35ll,12ll)); if(37 <= k) wek.PB(MP(-35ll,-12ll)); if(41 <= k) wek.PB(MP(9ll,40ll)); if(41 <= k) wek.PB(MP(9ll,-40ll)); if(41 <= k) wek.PB(MP(-9ll,40ll)); if(41 <= k) wek.PB(MP(-9ll,-40ll)); if(41 <= k) wek.PB(MP(40ll,9ll)); if(41 <= k) wek.PB(MP(40ll,-9ll)); if(41 <= k) wek.PB(MP(-40ll,9ll)); if(41 <= k) wek.PB(MP(-40ll,-9ll)); if(53 <= k) wek.PB(MP(28ll,45ll)); if(53 <= k) wek.PB(MP(28ll,-45ll)); if(53 <= k) wek.PB(MP(-28ll,45ll)); if(53 <= k) wek.PB(MP(-28ll,-45ll)); if(53 <= k) wek.PB(MP(45ll,28ll)); if(53 <= k) wek.PB(MP(45ll,-28ll)); if(53 <= k) wek.PB(MP(-45ll,28ll)); if(53 <= k) wek.PB(MP(-45ll,-28ll)); if(61 <= k) wek.PB(MP(11ll,60ll)); if(61 <= k) wek.PB(MP(11ll,-60ll)); if(61 <= k) wek.PB(MP(-11ll,60ll)); if(61 <= k) wek.PB(MP(-11ll,-60ll)); if(61 <= k) wek.PB(MP(60ll,11ll)); if(61 <= k) wek.PB(MP(60ll,-11ll)); if(61 <= k) wek.PB(MP(-60ll,11ll)); if(61 <= k) wek.PB(MP(-60ll,-11ll)); if(65 <= k) wek.PB(MP(16ll,63ll)); if(65 <= k) wek.PB(MP(16ll,-63ll)); if(65 <= k) wek.PB(MP(-16ll,63ll)); if(65 <= k) wek.PB(MP(-16ll,-63ll)); if(65 <= k) wek.PB(MP(33ll,56ll)); if(65 <= k) wek.PB(MP(33ll,-56ll)); if(65 <= k) wek.PB(MP(-33ll,56ll)); if(65 <= k) wek.PB(MP(-33ll,-56ll)); if(65 <= k) wek.PB(MP(56ll,33ll)); if(65 <= k) wek.PB(MP(56ll,-33ll)); if(65 <= k) wek.PB(MP(-56ll,33ll)); if(65 <= k) wek.PB(MP(-56ll,-33ll)); if(65 <= k) wek.PB(MP(63ll,16ll)); if(65 <= k) wek.PB(MP(63ll,-16ll)); if(65 <= k) wek.PB(MP(-63ll,16ll)); if(65 <= k) wek.PB(MP(-63ll,-16ll)); if(73 <= k) wek.PB(MP(48ll,55ll)); if(73 <= k) wek.PB(MP(48ll,-55ll)); if(73 <= k) wek.PB(MP(-48ll,55ll)); if(73 <= k) wek.PB(MP(-48ll,-55ll)); if(73 <= k) wek.PB(MP(55ll,48ll)); if(73 <= k) wek.PB(MP(55ll,-48ll)); if(73 <= k) wek.PB(MP(-55ll,48ll)); if(73 <= k) wek.PB(MP(-55ll,-48ll)); if(85 <= k) wek.PB(MP(13ll,84ll)); if(85 <= k) wek.PB(MP(13ll,-84ll)); if(85 <= k) wek.PB(MP(-13ll,84ll)); if(85 <= k) wek.PB(MP(-13ll,-84ll)); if(85 <= k) wek.PB(MP(36ll,77ll)); if(85 <= k) wek.PB(MP(36ll,-77ll)); if(85 <= k) wek.PB(MP(-36ll,77ll)); if(85 <= k) wek.PB(MP(-36ll,-77ll)); if(85 <= k) wek.PB(MP(77ll,36ll)); if(85 <= k) wek.PB(MP(77ll,-36ll)); if(85 <= k) wek.PB(MP(-77ll,36ll)); if(85 <= k) wek.PB(MP(-77ll,-36ll)); if(85 <= k) wek.PB(MP(84ll,13ll)); if(85 <= k) wek.PB(MP(84ll,-13ll)); if(85 <= k) wek.PB(MP(-84ll,13ll)); if(85 <= k) wek.PB(MP(-84ll,-13ll)); if(89 <= k) wek.PB(MP(39ll,80ll)); if(89 <= k) wek.PB(MP(39ll,-80ll)); if(89 <= k) wek.PB(MP(-39ll,80ll)); if(89 <= k) wek.PB(MP(-39ll,-80ll)); if(89 <= k) wek.PB(MP(80ll,39ll)); if(89 <= k) wek.PB(MP(80ll,-39ll)); if(89 <= k) wek.PB(MP(-80ll,39ll)); if(89 <= k) wek.PB(MP(-80ll,-39ll)); if(97 <= k) wek.PB(MP(65ll,72ll)); if(97 <= k) wek.PB(MP(65ll,-72ll)); if(97 <= k) wek.PB(MP(-65ll,72ll)); if(97 <= k) wek.PB(MP(-65ll,-72ll)); if(97 <= k) wek.PB(MP(72ll,65ll)); if(97 <= k) wek.PB(MP(72ll,-65ll)); if(97 <= k) wek.PB(MP(-72ll,65ll)); if(97 <= k) wek.PB(MP(-72ll,-65ll)); if(101 <= k) wek.PB(MP(20ll,99ll)); if(101 <= k) wek.PB(MP(20ll,-99ll)); if(101 <= k) wek.PB(MP(-20ll,99ll)); if(101 <= k) wek.PB(MP(-20ll,-99ll)); if(101 <= k) wek.PB(MP(99ll,20ll)); if(101 <= k) wek.PB(MP(99ll,-20ll)); if(101 <= k) wek.PB(MP(-99ll,20ll)); if(101 <= k) wek.PB(MP(-99ll,-20ll)); if(109 <= k) wek.PB(MP(60ll,91ll)); if(109 <= k) wek.PB(MP(60ll,-91ll)); if(109 <= k) wek.PB(MP(-60ll,91ll)); if(109 <= k) wek.PB(MP(-60ll,-91ll)); if(109 <= k) wek.PB(MP(91ll,60ll)); if(109 <= k) wek.PB(MP(91ll,-60ll)); if(109 <= k) wek.PB(MP(-91ll,60ll)); if(109 <= k) wek.PB(MP(-91ll,-60ll)); if(113 <= k) wek.PB(MP(15ll,112ll)); if(113 <= k) wek.PB(MP(15ll,-112ll)); if(113 <= k) wek.PB(MP(-15ll,112ll)); if(113 <= k) wek.PB(MP(-15ll,-112ll)); if(113 <= k) wek.PB(MP(112ll,15ll)); if(113 <= k) wek.PB(MP(112ll,-15ll)); if(113 <= k) wek.PB(MP(-112ll,15ll)); if(113 <= k) wek.PB(MP(-112ll,-15ll)); if(125 <= k) wek.PB(MP(44ll,117ll)); if(125 <= k) wek.PB(MP(44ll,-117ll)); if(125 <= k) wek.PB(MP(-44ll,117ll)); if(125 <= k) wek.PB(MP(-44ll,-117ll)); if(125 <= k) wek.PB(MP(117ll,44ll)); if(125 <= k) wek.PB(MP(117ll,-44ll)); if(125 <= k) wek.PB(MP(-117ll,44ll)); if(125 <= k) wek.PB(MP(-117ll,-44ll)); if(137 <= k) wek.PB(MP(88ll,105ll)); if(137 <= k) wek.PB(MP(88ll,-105ll)); if(137 <= k) wek.PB(MP(-88ll,105ll)); if(137 <= k) wek.PB(MP(-88ll,-105ll)); if(137 <= k) wek.PB(MP(105ll,88ll)); if(137 <= k) wek.PB(MP(105ll,-88ll)); if(137 <= k) wek.PB(MP(-105ll,88ll)); if(137 <= k) wek.PB(MP(-105ll,-88ll)); if(145 <= k) wek.PB(MP(17ll,144ll)); if(145 <= k) wek.PB(MP(17ll,-144ll)); if(145 <= k) wek.PB(MP(-17ll,144ll)); if(145 <= k) wek.PB(MP(-17ll,-144ll)); if(145 <= k) wek.PB(MP(24ll,143ll)); if(145 <= k) wek.PB(MP(24ll,-143ll)); if(145 <= k) wek.PB(MP(-24ll,143ll)); if(145 <= k) wek.PB(MP(-24ll,-143ll)); if(145 <= k) wek.PB(MP(143ll,24ll)); if(145 <= k) wek.PB(MP(143ll,-24ll)); if(145 <= k) wek.PB(MP(-143ll,24ll)); if(145 <= k) wek.PB(MP(-143ll,-24ll)); if(145 <= k) wek.PB(MP(144ll,17ll)); if(145 <= k) wek.PB(MP(144ll,-17ll)); if(145 <= k) wek.PB(MP(-144ll,17ll)); if(145 <= k) wek.PB(MP(-144ll,-17ll)); if(149 <= k) wek.PB(MP(51ll,140ll)); if(149 <= k) wek.PB(MP(51ll,-140ll)); if(149 <= k) wek.PB(MP(-51ll,140ll)); if(149 <= k) wek.PB(MP(-51ll,-140ll)); if(149 <= k) wek.PB(MP(140ll,51ll)); if(149 <= k) wek.PB(MP(140ll,-51ll)); if(149 <= k) wek.PB(MP(-140ll,51ll)); if(149 <= k) wek.PB(MP(-140ll,-51ll)); if(157 <= k) wek.PB(MP(85ll,132ll)); if(157 <= k) wek.PB(MP(85ll,-132ll)); if(157 <= k) wek.PB(MP(-85ll,132ll)); if(157 <= k) wek.PB(MP(-85ll,-132ll)); if(157 <= k) wek.PB(MP(132ll,85ll)); if(157 <= k) wek.PB(MP(132ll,-85ll)); if(157 <= k) wek.PB(MP(-132ll,85ll)); if(157 <= k) wek.PB(MP(-132ll,-85ll)); if(169 <= k) wek.PB(MP(119ll,120ll)); if(169 <= k) wek.PB(MP(119ll,-120ll)); if(169 <= k) wek.PB(MP(-119ll,120ll)); if(169 <= k) wek.PB(MP(-119ll,-120ll)); if(169 <= k) wek.PB(MP(120ll,119ll)); if(169 <= k) wek.PB(MP(120ll,-119ll)); if(169 <= k) wek.PB(MP(-120ll,119ll)); if(169 <= k) wek.PB(MP(-120ll,-119ll)); if(173 <= k) wek.PB(MP(52ll,165ll)); if(173 <= k) wek.PB(MP(52ll,-165ll)); if(173 <= k) wek.PB(MP(-52ll,165ll)); if(173 <= k) wek.PB(MP(-52ll,-165ll)); if(173 <= k) wek.PB(MP(165ll,52ll)); if(173 <= k) wek.PB(MP(165ll,-52ll)); if(173 <= k) wek.PB(MP(-165ll,52ll)); if(173 <= k) wek.PB(MP(-165ll,-52ll)); if(181 <= k) wek.PB(MP(19ll,180ll)); if(181 <= k) wek.PB(MP(19ll,-180ll)); if(181 <= k) wek.PB(MP(-19ll,180ll)); if(181 <= k) wek.PB(MP(-19ll,-180ll)); if(181 <= k) wek.PB(MP(180ll,19ll)); if(181 <= k) wek.PB(MP(180ll,-19ll)); if(181 <= k) wek.PB(MP(-180ll,19ll)); if(181 <= k) wek.PB(MP(-180ll,-19ll)); if(185 <= k) wek.PB(MP(57ll,176ll)); if(185 <= k) wek.PB(MP(57ll,-176ll)); if(185 <= k) wek.PB(MP(-57ll,176ll)); if(185 <= k) wek.PB(MP(-57ll,-176ll)); if(185 <= k) wek.PB(MP(104ll,153ll)); if(185 <= k) wek.PB(MP(104ll,-153ll)); if(185 <= k) wek.PB(MP(-104ll,153ll)); if(185 <= k) wek.PB(MP(-104ll,-153ll)); if(185 <= k) wek.PB(MP(153ll,104ll)); if(185 <= k) wek.PB(MP(153ll,-104ll)); if(185 <= k) wek.PB(MP(-153ll,104ll)); if(185 <= k) wek.PB(MP(-153ll,-104ll)); if(185 <= k) wek.PB(MP(176ll,57ll)); if(185 <= k) wek.PB(MP(176ll,-57ll)); if(185 <= k) wek.PB(MP(-176ll,57ll)); if(185 <= k) wek.PB(MP(-176ll,-57ll)); if(193 <= k) wek.PB(MP(95ll,168ll)); if(193 <= k) wek.PB(MP(95ll,-168ll)); if(193 <= k) wek.PB(MP(-95ll,168ll)); if(193 <= k) wek.PB(MP(-95ll,-168ll)); if(193 <= k) wek.PB(MP(168ll,95ll)); if(193 <= k) wek.PB(MP(168ll,-95ll)); if(193 <= k) wek.PB(MP(-168ll,95ll)); if(193 <= k) wek.PB(MP(-168ll,-95ll)); if(197 <= k) wek.PB(MP(28ll,195ll)); if(197 <= k) wek.PB(MP(28ll,-195ll)); if(197 <= k) wek.PB(MP(-28ll,195ll)); if(197 <= k) wek.PB(MP(-28ll,-195ll)); if(197 <= k) wek.PB(MP(195ll,28ll)); if(197 <= k) wek.PB(MP(195ll,-28ll)); if(197 <= k) wek.PB(MP(-195ll,28ll)); if(197 <= k) wek.PB(MP(-195ll,-28ll)); if(205 <= k) wek.PB(MP(84ll,187ll)); if(205 <= k) wek.PB(MP(84ll,-187ll)); if(205 <= k) wek.PB(MP(-84ll,187ll)); if(205 <= k) wek.PB(MP(-84ll,-187ll)); if(205 <= k) wek.PB(MP(133ll,156ll)); if(205 <= k) wek.PB(MP(133ll,-156ll)); if(205 <= k) wek.PB(MP(-133ll,156ll)); if(205 <= k) wek.PB(MP(-133ll,-156ll)); if(205 <= k) wek.PB(MP(156ll,133ll)); if(205 <= k) wek.PB(MP(156ll,-133ll)); if(205 <= k) wek.PB(MP(-156ll,133ll)); if(205 <= k) wek.PB(MP(-156ll,-133ll)); if(205 <= k) wek.PB(MP(187ll,84ll)); if(205 <= k) wek.PB(MP(187ll,-84ll)); if(205 <= k) wek.PB(MP(-187ll,84ll)); if(205 <= k) wek.PB(MP(-187ll,-84ll)); if(221 <= k) wek.PB(MP(21ll,220ll)); if(221 <= k) wek.PB(MP(21ll,-220ll)); if(221 <= k) wek.PB(MP(-21ll,220ll)); if(221 <= k) wek.PB(MP(-21ll,-220ll)); if(221 <= k) wek.PB(MP(140ll,171ll)); if(221 <= k) wek.PB(MP(140ll,-171ll)); if(221 <= k) wek.PB(MP(-140ll,171ll)); if(221 <= k) wek.PB(MP(-140ll,-171ll)); if(221 <= k) wek.PB(MP(171ll,140ll)); if(221 <= k) wek.PB(MP(171ll,-140ll)); if(221 <= k) wek.PB(MP(-171ll,140ll)); if(221 <= k) wek.PB(MP(-171ll,-140ll)); if(221 <= k) wek.PB(MP(220ll,21ll)); if(221 <= k) wek.PB(MP(220ll,-21ll)); if(221 <= k) wek.PB(MP(-220ll,21ll)); if(221 <= k) wek.PB(MP(-220ll,-21ll)); if(229 <= k) wek.PB(MP(60ll,221ll)); if(229 <= k) wek.PB(MP(60ll,-221ll)); if(229 <= k) wek.PB(MP(-60ll,221ll)); if(229 <= k) wek.PB(MP(-60ll,-221ll)); if(229 <= k) wek.PB(MP(221ll,60ll)); if(229 <= k) wek.PB(MP(221ll,-60ll)); if(229 <= k) wek.PB(MP(-221ll,60ll)); if(229 <= k) wek.PB(MP(-221ll,-60ll)); if(233 <= k) wek.PB(MP(105ll,208ll)); if(233 <= k) wek.PB(MP(105ll,-208ll)); if(233 <= k) wek.PB(MP(-105ll,208ll)); if(233 <= k) wek.PB(MP(-105ll,-208ll)); if(233 <= k) wek.PB(MP(208ll,105ll)); if(233 <= k) wek.PB(MP(208ll,-105ll)); if(233 <= k) wek.PB(MP(-208ll,105ll)); if(233 <= k) wek.PB(MP(-208ll,-105ll)); if(241 <= k) wek.PB(MP(120ll,209ll)); if(241 <= k) wek.PB(MP(120ll,-209ll)); if(241 <= k) wek.PB(MP(-120ll,209ll)); if(241 <= k) wek.PB(MP(-120ll,-209ll)); if(241 <= k) wek.PB(MP(209ll,120ll)); if(241 <= k) wek.PB(MP(209ll,-120ll)); if(241 <= k) wek.PB(MP(-209ll,120ll)); if(241 <= k) wek.PB(MP(-209ll,-120ll)); } |