#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define ls(_o) (_o<<1)
#define rs(_o) ((_o<<1)|1)
#define ll long long
#define p 998244353
#define abs(_o) ((_o<0)?-(_o):_o)
using namespace std;
namespace ywy{
	inline ll mi(int a,int b){
		ll ans=1,tmp=a;while(b){
			if(b&1)ans=(ans*tmp)%p;tmp=(tmp*tmp)%p;b>>=1;
		}return(ans);
	}int lsh[300],cnt[2001];int data[2001];
	inline void up(int tree,int l,int r){
		if(cnt[tree])data[tree]=lsh[r]-lsh[l-1];else data[tree]=data[ls(tree)]+data[rs(tree)];
	}
	void add(int rl,int rr,int l,int r,int tree,int x){
		if(rl==l&&rr==r){
			cnt[tree]+=x;if(!cnt[tree]){
				if(l==r)data[tree]=0;else data[tree]=data[ls(tree)]+data[rs(tree)];
			}else data[tree]=lsh[r]-lsh[l-1];return;
		}int mid=(l+r)>>1;if(rl>mid)add(rl,rr,mid+1,r,rs(tree),x);else{
			if(rr<=mid)add(rl,rr,l,mid,ls(tree),x);else{
				add(rl,mid,l,mid,ls(tree),x);add(mid+1,rr,mid+1,r,rs(tree),x);
			}
		}up(tree,l,r);
	}ll inv2,inv6;
	inline ll sig2(ll n){
		ll cjr=n;cjr*=(n+1);cjr%=p;cjr*=(n*2+1);cjr%=p;cjr*=inv6;return(cjr%p);
	}
	inline ll sig(ll n){
		ll cjr=n;cjr*=(n+1);cjr%=p;cjr*=inv2;return(cjr%p);
	}
	typedef struct _n{
		int l;int r;
	}node;vector<node> adds[300],dels[300];
	inline void clear(vector<node> &v){
		vector<node> tmp;v=tmp;
	}int xs[60],ys[60];int n;
	void build(int l,int r,int tree){
		cnt[tree]=data[tree]=0;if(l==r)return;int mid=(l+r)>>1;build(l,mid,ls(tree));build(mid+1,r,rs(tree));
	}
	inline ll getS(int t){
		int ptr=1;for(register int i=1;i<=n;i++){
			lsh[ptr]=xs[i]-t-1;ptr++;lsh[ptr]=xs[i]+t;ptr++;lsh[ptr]=ys[i]-t-1;ptr++;lsh[ptr]=ys[i]+t;ptr++;
		}ptr--;sort(lsh+1,lsh+1+ptr);ptr=unique(lsh+1,lsh+1+ptr)-lsh-1;build(1,ptr,1);
		for(register int i=1;i<=ptr;i++)clear(adds[i]),clear(dels[i]);
		for(register int i=1;i<=n;i++){
			node cjr;cjr.l=lower_bound(lsh+1,lsh+1+ptr,ys[i]-t-1)-lsh+1;
			cjr.r=lower_bound(lsh+1,lsh+1+ptr,ys[i]+t)-lsh;int l=lower_bound(lsh+1,lsh+1+ptr,xs[i]-t-1)-lsh;
			int r=lower_bound(lsh+1,lsh+1+ptr,xs[i]+t)-lsh;adds[l].push_back(cjr);dels[r].push_back(cjr);
		}ll ans=0;for(register int i=1;i<=ptr;i++){
			ans=(ans+data[1]*(ll)(lsh[i]-lsh[i-1]))%p;
			for(register int j=0;j<adds[i].size();j++)add(adds[i][j].l,adds[i][j].r,1,ptr,1,1);
			for(register int j=0;j<dels[i].size();j++)add(dels[i][j].l,dels[i][j].r,1,ptr,1,-1);
		}return(ans);
	}int tme[100001];
	void ywymain(){
		inv2=mi(2,p-2);inv6=mi(6,p-2);int t;cin>>n>>t;
		for(register int i=1;i<=n;i++)cin>>xs[i]>>ys[i];int ptr=1;for(register int i=1;i<=n;i++){
			for(register int j=1;j<i;j++){
				tme[ptr]=max(abs(xs[i]-xs[j]),abs(ys[i]-ys[j]))/2;if(tme[ptr]<=t)ptr++;
				tme[ptr]=max(abs(xs[i]-xs[j]),abs(ys[i]-ys[j]))/2+1;if(tme[ptr]<=t)ptr++;
			}
		}tme[ptr]=0;ptr++;tme[ptr]=t;sort(tme+1,tme+1+ptr);ptr=unique(tme+1,tme+1+ptr)-tme-1;
		ll ans=(getS(t)*t)%p;for(register int i=1;i<ptr;i++){
			if(tme[i+1]-tme[i]<=2){
				for(register int j=tme[i];j<tme[i+1];j++)ans=(ans+p-getS(j))%p;continue;
			}ll c=getS(tme[i]),A=getS(tme[i]+1),B=getS(tme[i]+2);
			ll a=(B-A*2+c)*inv2;a%=p;a+=p;a%=p;ll b=A-c-a;b%=p;b+=p;b%=p;
			ans-=a*sig2(tme[i+1]-tme[i]-1);ans%=p;ans+=p;ans%=p;
			ans-=b*sig(tme[i+1]-tme[i]-1);ans%=p;ans+=p;ans%=p;
			ans-=c*(tme[i+1]-tme[i]);ans%=p;ans+=p;ans%=p;
		}cout<<ans<<endl;
	}
}
int main(){
	ywy::ywymain();return(0);
}

#include <bits/stdc++.h>
using namespace std;

const int maxn = 55, P = 998244353;
int n, T, x[maxn], y[maxn], tag[maxn << 1];
vector<pair<int, int>> V[maxn << 1];

int qp(int x, int y) {
    int z = 1;
    for (; y; y >>= 1, x = 1LL * x * x % P) {
        if (y & 1) z = 1LL * z * x % P;
    }
    return z;
}

int main() {
    scanf("%d %d", &n, &T);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &x[i], &y[i]);
    }
    auto F = [&](int t) {
        vector<int> V1, V2;
        for (int i = 1; i <= n; i++) {
            V1.push_back(x[i] - t), V1.push_back(x[i] + t + 1);
            V2.push_back(y[i] - t), V2.push_back(y[i] + t + 1);
        }
        sort(V1.begin(), V1.end()), sort(V2.begin(), V2.end());
        V1.resize(unique(V1.begin(), V1.end()) - V1.begin());
        V2.resize(unique(V2.begin(), V2.end()) - V2.begin());
        for (int i = 0; i < V1.size(); i++) {
            V[i].clear();
        }
        for (int i = 1; i <= n; i++) {
            int l = lower_bound(V1.begin(), V1.end(), x[i] - t) - V1.begin(),
                r = lower_bound(V1.begin(), V1.end(), x[i] + t + 1) - V1.begin();
            V[l].emplace_back(i, 1), V[r].emplace_back(i, -1);
        }
        memset(tag, 0, sizeof(tag));
        int ans = 0;
        for (int i = 0; i < V1.size() - 1; i++) {
            for (auto p : V[i]) {
                int l = lower_bound(V2.begin(), V2.end(), y[p.first] - t) -
                    V2.begin(), r = lower_bound(V2.begin(), V2.end(), y[p.first]
                    + t + 1) - V2.begin();
                tag[l] += p.second, tag[r] -= p.second;
            }
            for (int j = 0, cur = 0; j < V2.size() - 1; j++) {
                if (cur += tag[j]) ans = (ans + 1LL * (V1[i + 1] - V1[i]) *
                    (V2[j + 1] - V2[j])) % P;
            }
        }
        return ans;
    };
    auto lagrange = [&](int n, vector<int> V) {
        int ans = 0;
        for (int i = 0; i < 4; i++) {
            int sum = 1;
            for (int j = 0; j < 4; j++) if (i ^ j) {
                sum = 1LL * sum * (n - j + P) % P * qp(i - j + P, P - 2) % P;
            }
            ans = (ans + 1LL * V[i] * sum) % P;
        }
        return ans;
    };
    auto solve = [&](int l, int r) {
        if (r - l <= 2) {
            int ans = 0;
            for (int i = l; i <= r; i++) {
                (ans += F(i)) %= P;
            }
            return ans;
        }
        vector<int> V = {F(l), F(l + 1), F(l + 2), F(l + 3)};
        for (int i = 1; i < 4; i++) (V[i] += V[i - 1]) %= P;
        return lagrange(r - l, V);
    };
    int ans = 1LL * T * F(T) % P;
    vector<int> tim = {0, T};
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            int t = max(abs(x[i] - x[j]) + 1, abs(y[i] - y[j]) + 1) >> 1;
            if (t < T) tim.push_back(t);
        }
    }
    sort(tim.begin(), tim.end());
    tim.resize(unique(tim.begin(), tim.end()) - tim.begin());
    for (int i = 0; i < tim.size() - 1; i++) {
        ans = (ans - solve(tim[i], tim[i + 1] - 1) + P) % P;
    }
    printf("%d\n", ans);
    return 0;
}

#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif

#define MEMO 1

#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>

struct tree{int x,y;};
std::vector<tree> trees;

#if MEMO
#include<unordered_map>
std::unordered_map<int,int64_t> totalarea_memo;
#endif

int64_t totalarea(int t){
	// compute total number of lattice points in the union of rectangles
	// [x-t..x+t, y-t..y+t]
	if(t<0)return 0; // ...
	if(t==0)return trees.size();

#if MEMO
	auto iter=totalarea_memo.find(t);
	if(iter!=totalarea_memo.end())return iter->second;
#endif

	struct rect{int firstx,lastx,firsty,lasty;};
	std::vector<rect> rects(trees.size());
	std::transform(trees.begin(),trees.end(),rects.begin(),
	[t](tree a){return rect{a.x-t,a.x+t+1,a.y-t,a.y+t+1};});

	std::vector<int> xcoord,ycoord;
	xcoord.reserve(trees.size()*2);
	ycoord.reserve(trees.size()*2);
	for(auto r:rects){
		xcoord.push_back(r.firstx);
		xcoord.push_back(r.lastx);
		ycoord.push_back(r.firsty);
		ycoord.push_back(r.lasty);
	}
	std::sort(xcoord.begin(),xcoord.end());
	std::sort(ycoord.begin(),ycoord.end());
	xcoord.erase(std::unique(xcoord.begin(),xcoord.end()),xcoord.end());
	ycoord.erase(std::unique(ycoord.begin(),ycoord.end()),ycoord.end());
	std::vector<std::vector<int>> acm(xcoord.size(),std::vector<int>(ycoord.size()));
#define FIND(x,vec) (int(std::lower_bound(vec.begin(),vec.end(),x)-vec.begin()))
	for(auto r:rects){
		r.firstx=FIND(r.firstx,xcoord);
		r.lastx=FIND(r.lastx,xcoord);
		r.firsty=FIND(r.firsty,ycoord);
		r.lasty=FIND(r.lasty,ycoord);
		++acm[r.firstx][r.firsty];
		--acm[r.firstx][r.lasty];
		--acm[r.lastx][r.firsty];
		++acm[r.lastx][r.lasty];
	}
#undef FIND

	for(unsigned row=1;row<xcoord.size();++row)
		for(unsigned col=0;col<ycoord.size();++col)
			acm[row][col]+=acm[row-1][col];
	for(unsigned row=0;row<xcoord.size();++row)
		for(unsigned col=1;col<ycoord.size();++col)
			acm[row][col]+=acm[row][col-1];
	int64_t ans=0;
	for(unsigned row=0;row<xcoord.size()-1;++row)
		for(unsigned col=0;col<ycoord.size()-1;++col){
			if(acm[row][col])
				ans+=(xcoord[row+1]-xcoord[row])*int64_t(ycoord[col+1]-ycoord[col]);
		}

#if MEMO
	totalarea_memo.emplace(t,ans);
#endif

	return ans;
}

// a piecewise linear function with (time)
int64_t ncellwithval(int time){
	return totalarea(time)-totalarea(time-1);
}

int constexpr MOD=998244353;

template<class T,T f>
int sumfn(int min,int max,int64_t fmin,int64_t fmax){
	// compute sum(f(i)*i for integer i, min<=i<=max)%MOD
	// assume it's linear over the range
	if(min>max)return 0;
	if(min==max)return fmin%MOD*min%MOD;
	auto const d=fmax-fmin;
	auto const q=d/(max-min),r=d%(max-min);

	// formula from Mathematica :)
	int64_t ans = ((1 + max - min)*((
		3*fmin%MOD*(max + min) +
		(max + 2LL*max*max - max*(int64_t)min - min*(1LL + min))%MOD*(q%MOD)%MOD)
			%MOD));
	ans=ans%MOD*166374059 /* 1/6 */ %MOD;
	if(ans<0)ans+=MOD;
	return ans;
}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int ntree,time;std::cin>>ntree>>time;
	trees.resize(ntree);for(auto& t:trees)std::cin>>t.x>>t.y;
	if(time==0){std::cout<<"0\n";return 0;}

	std::vector<int> splitpts;splitpts.push_back(0);
	// split point x : x | (x+1)
	for(auto t:trees)
		for(auto t2:trees){
			if(t.x==t2.x&&t.y==t2.y)break;
			int dist=std::max(std::abs(t.x-t2.x),std::abs(t.y-t2.y));
			splitpts.push_back(dist/2);
			splitpts.push_back((dist-1)/2);
		}
	std::sort(splitpts.begin(),splitpts.end());
	while(splitpts.back()>time)
		splitpts.pop_back();
	splitpts.push_back(time);
	int64_t ans=0;
	for(unsigned i=1;i<splitpts.size();++i){
#define f ncellwithval
		auto a=splitpts[i-1]+1;
		auto b=splitpts[i];
		ans+=sumfn<decltype(&f),f>(a,b,f(a),f(b));
	}
	std::cout<<ans%MOD<<'\n';
}

#define DEBUG 0

#include <bits/stdc++.h>
using namespace std;

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------
#define MOD 998244353
#define INV2 499122177
#define INV6 166374059

int x[50],y[50];
vi v;
LLI getNum(int t,int n) {
    if (t == 0) return n;
    int i,j;
    LLI c = 0;
    for (i = 0; i < n; i++) {
        int l1 = x[i]-t,r1 = x[i]+t-1,l2 = x[i]-t+1,r2 = x[i]+t;
        int d1 = y[i]-t,u1 = y[i]+t-1,d2 = y[i]-t+1,u2 = y[i]+t;
        for (j = 0; j < n; j++) {
            if (i == j) continue;
            int l,r,d,u;
            if (j > i) l = x[j]-t+1,r = x[j]+t-1,d = y[j]-t+1,u = y[j]+t-1;
            else l = x[j]-t,r = x[j]+t,d = y[j]-t,u = y[j]+t;
            if ((y[i]+t >= d) && (y[i]+t <= u)) {
                if (l <= l1) l1 = max(l1,r+1);
                if (r >= r1) r1 = min(r1,l-1);
            }
            if ((y[i]-t >= d) && (y[i]-t <= u)) {
                if (l <= l2) l2 = max(l2,r+1);
                if (r >= r2) r2 = min(r2,l-1);
            }
            if ((x[i]-t >= l) && (x[i]-t <= r)) {
                if (d <= d1) d1 = max(d1,u+1);
                if (u >= u1) u1 = min(u1,d-1);
            }
            if ((x[i]+t >= l) && (x[i]+t <= r)) {
                if (d <= d2) d2 = max(d2,u+1);
                if (u >= u2) u2 = min(u2,d-1);
            }
        }
        c += max(r1-l1+1,0)+max(r2-l2+1,0)+max(u1-d1+1,0)+max(u2-d2+1,0);
    }
    return c;
}
int main() {
    int i;
    int n,t;
    scanf("%d %d",&n,&t);
    for (i = 0; i < n; i++) scanf("%d %d",&x[i],&y[i]);

    int j;
    LLI ans = 0;
    v.pb(0),v.pb(1),v.pb(t+1);
    for (i = 0; i < n; i++) {
        for (j = i+1; j < n; j++) {
            v.pb(max(abs(x[i]-x[j]),abs(y[i]-y[j]))/2);
            v.pb(max(abs(x[i]-x[j]),abs(y[i]-y[j]))/2+1);
        }
    }
    sort(v.begin(),v.end());
    while (v.back() > t+1) v.pop_back();
    v.resize(unique(v.begin(),v.end())-v.begin());
    for (i = 0; i < v.size()-1; i++) {
        if (v[i+1] == v[i]+1) ans += getNum(v[i],n)*v[i],ans %= MOD;
        else {
            LLI p = getNum(v[i],n) % MOD,q = getNum(v[i]+1,n) % MOD;
            LLI a = (q-p+MOD) % MOD,b = (p-(q-p)*v[i]) % MOD;
            if (b < 0) b += MOD;
            LLI s1 = ((((((LLI) (v[i]-1)*v[i]) % MOD)*(2*v[i]-1)) % MOD)*INV6) % MOD;
            LLI s2 = ((((((LLI) (v[i+1]-1)*v[i+1]) % MOD)*(2*v[i+1]-1)) % MOD)*INV6) % MOD;
            ans += (s2-s1+MOD)*a,ans %= MOD;
            s1 = ((((LLI) (v[i]-1)*v[i]) % MOD)*INV2) % MOD;
            s2 = ((((LLI) (v[i+1]-1)*v[i+1]) % MOD)*INV2) % MOD;
            ans += (s2-s1+MOD)*b,ans %= MOD;
        }
    }
    printf("%d\n",(int) ans);

    return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

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 FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#define unordered_map __fast_unordered_map
template<class Key, class Value, class Hash = std::hash<Key>>
using unordered_map = __gnu_pbds::gp_hash_table<Key, Value, Hash>;

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

const int Mod = 998'244'353;

int PowMod(int a, int n) {
  int r = 1;
  while (n) {
    if (n & 1) { r = (LL)r * a % Mod; }
    n >>= 1;
    a = (LL)a * a % Mod;
  }
  return r;
}

struct Point {
  int x, y;
};

const int MaxN = 64;

Point pts[MaxN];
int N, T;

LL GetNumCovered(int tm) {
  struct Event {
    int x;
    int y1, y2;
    int coef;

    bool operator<(const Event &other) const {
      return x < other.x;
    }
  };

  vector<int> all_ys;

  vector<Event> events;
  for (int i = 0; i < N; ++i) {
    events.push_back(Event{pts[i].x - tm, pts[i].y - tm, pts[i].y + tm + 1, 1});
    events.push_back(Event{pts[i].x + tm + 1, pts[i].y - tm, pts[i].y + tm + 1, -1});
    all_ys.PB(pts[i].y + tm + 1);
    all_ys.PB(pts[i].y - tm);
  }

  sort(ALL(events));
  sort(ALL(all_ys));
  all_ys.resize(unique(ALL(all_ys)) - all_ys.begin());
  vector<int> count_covers(SZ(all_ys));

  int last_x = -1e9;
  LL answer = 0;
  LL total_y = 0;

  for (auto &event : events) {
    const int x = event.x;
    answer += (x - last_x) * total_y;
    last_x = x;

    const int start_y = lower_bound(ALL(all_ys), event.y1) - all_ys.begin();
    const int end_y = lower_bound(ALL(all_ys), event.y2) - all_ys.begin();

    for (int i = start_y; i < end_y; ++i)
      count_covers[i] += event.coef;

    total_y = 0;
    for (int i = 0; i < SZ(all_ys) - 1; ++i) {
      if (count_covers[i]) {
        total_y += all_ys[i + 1] - all_ys[i];
      }
    }

    //debug(all_ys, count_covers);
  }

  return answer;
}

LL GetIncrNumCovered(int tm) {
  return GetNumCovered(tm) - GetNumCovered(tm - 1);
}

const int Inv2 = PowMod(2, Mod - 2);
const int Inv6 = PowMod(6, Mod - 2);

int SumQuad(int A, int B, int C, int n) {
  LL ans = (LL)C * n % Mod;
  LL bcoef = (n * (n + 1)) % Mod * Inv2 % Mod;
  ans = (ans + bcoef * B) % Mod;
  LL acoef = (n * (n + 1)) % Mod * (2 * n + 1) % Mod * Inv6 % Mod;
  ans = (ans + acoef * A) % Mod;
  return ans;
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);

  cin >> N >> T;
  for (int i = 0; i < N; ++i) {
    cin >> pts[i].x >> pts[i].y;
  }

  int cur_tm = 2;
  LL p0 = GetIncrNumCovered(2);
  LL p1 = GetIncrNumCovered(1);
  debug(p0, p1);
  LL answer = 0;
  if (T >= 1) { answer = (answer + p1) % Mod; }
  if (T >= 2) { answer = (answer + 2LL * p0) % Mod; }
  if (T <= 2) {
    cout << answer << "\n";
    return 0;
  }
  int events = 1;
  while (cur_tm < T) {
    int left_lin = cur_tm;
    int right_lin = T;

    while (right_lin - left_lin > 1) {
      const int mid_lin = (left_lin + right_lin) / 2;
      const LL pmid = GetIncrNumCovered(mid_lin);
      debug(p0, p1, mid_lin, pmid);

      if (p0 + (mid_lin - cur_tm) * (p0 - p1) == pmid) {
        left_lin = mid_lin;
      } else {
        right_lin = mid_lin;
      }
    }

    debug(left_lin);
    const LL A = (p0 - p1) % Mod;
    const LL B = (p0 + cur_tm * (p0 - p1)) % Mod;
    const LL C = (p0 % Mod) * cur_tm % Mod;

    debug(A, B, C);
    answer = (answer + SumQuad(A, B, C, left_lin - cur_tm)) % Mod;

    p1 = GetIncrNumCovered(left_lin);
    p0 = GetIncrNumCovered(left_lin + 1);
    cur_tm = left_lin + 1;
    answer = (answer + (LL)(p0 % Mod * cur_tm)) % Mod;
    debug(cur_tm, answer);
    events++;
  }
  assert(events <= 10 * N);
  cout << answer << "\n";
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

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 FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#define unordered_map __fast_unordered_map
template<class Key, class Value, class Hash = std::hash<Key>>
using unordered_map = __gnu_pbds::gp_hash_table<Key, Value, Hash>;

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

const int Mod = 998'244'353;

int PowMod(int a, int n) {
  int r = 1;
  while (n) {
    if (n & 1) { r = (LL)r * a % Mod; }
    n >>= 1;
    a = (LL)a * a % Mod;
  }
  return r;
}

struct Point {
  int x, y;
};

const int MaxN = 64;

Point pts[MaxN];
int N, T;

LL GetNumCovered(int tm) {
  struct Event {
    int x;
    int y1, y2;
    int coef;

    bool operator<(const Event &other) const {
      return x < other.x;
    }
  };

  vector<int> all_ys;

  vector<Event> events;
  for (int i = 0; i < N; ++i) {
    events.push_back(Event{pts[i].x - tm, pts[i].y - tm, pts[i].y + tm + 1, 1});
    events.push_back(Event{pts[i].x + tm + 1, pts[i].y - tm, pts[i].y + tm + 1, -1});
    all_ys.PB(pts[i].y + tm + 1);
    all_ys.PB(pts[i].y - tm);
  }

  sort(ALL(events));
  sort(ALL(all_ys));
  all_ys.resize(unique(ALL(all_ys)) - all_ys.begin());
  vector<int> count_covers(SZ(all_ys));

  int last_x = -1e9;
  LL answer = 0;
  LL total_y = 0;

  for (auto &event : events) {
    const int x = event.x;
    answer += (x - last_x) * total_y;
    last_x = x;

    const int start_y = lower_bound(ALL(all_ys), event.y1) - all_ys.begin();
    const int end_y = lower_bound(ALL(all_ys), event.y2) - all_ys.begin();

    for (int i = start_y; i < end_y; ++i)
      count_covers[i] += event.coef;

    total_y = 0;
    for (int i = 0; i < SZ(all_ys) - 1; ++i) {
      if (count_covers[i]) {
        total_y += all_ys[i + 1] - all_ys[i];
      }
    }

    //debug(all_ys, count_covers);
  }

  return answer;
}

LL GetIncrNumCovered(int tm) {
  return GetNumCovered(tm) - GetNumCovered(tm - 1);
}

const int Inv2 = PowMod(2, Mod - 2);
const int Inv6 = PowMod(6, Mod - 2);

int SumQuad(int A, int B, int C, int n) {
  LL ans = (LL)C * n % Mod;
  LL bcoef = (n * (n + 1)) % Mod * Inv2 % Mod;
  ans = (ans + bcoef * B) % Mod;
  LL acoef = (n * (n + 1)) % Mod * (2 * n + 1) % Mod * Inv6 % Mod;
  ans = (ans + acoef * A) % Mod;
  return ans;
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);

  cin >> N >> T;
  for (int i = 0; i < N; ++i) {
    cin >> pts[i].x >> pts[i].y;
  }

  int cur_tm = 2;
  LL p0 = GetIncrNumCovered(2);
  LL p1 = GetIncrNumCovered(1);
  debug(p0, p1);
  LL answer = 0;
  if (T >= 1) { answer = (answer + p1) % Mod; }
  if (T >= 2) { answer = (answer + 2LL * p0) % Mod; }
  if (T <= 2) {
    cout << answer << "\n";
    return 0;
  }
  int events = 1;
  while (cur_tm < T) {
    int left_lin = cur_tm;
    int right_lin = T;

    while (right_lin - left_lin > 1) {
      const int mid_lin = (left_lin + right_lin) / 2;
      const LL pmid = GetIncrNumCovered(mid_lin);
      debug(p0, p1, mid_lin, pmid);

      if (p0 + (mid_lin - cur_tm) * (p0 - p1) == pmid) {
        left_lin = mid_lin;
      } else {
        right_lin = mid_lin;
      }
    }

    debug(left_lin);
    const LL A = (p0 - p1) % Mod;
    const LL B = (p0 + cur_tm * (p0 - p1)) % Mod;
    const LL C = (p0 % Mod) * cur_tm % Mod;

    debug(A, B, C);
    answer = (answer + SumQuad(A, B, C, left_lin - cur_tm)) % Mod;

    p1 = GetIncrNumCovered(left_lin);
    p0 = GetIncrNumCovered(left_lin + 1);
    cur_tm = left_lin + 1;
    answer = (answer + (LL)(p0 % Mod * cur_tm)) % Mod;
    debug(cur_tm, answer);
    events++;
  }
  assert(events <= 7 * N);
  cout << answer << "\n";
}

    #include <bits/stdc++.h>
    #define MOD 998244353
    using namespace std;
    typedef long long ll;
    int main()
    {
      do {
        ios::sync_with_stdio(false);
        cin.tie(nullptr);
        cout.tie(nullptr);
      } while (false);
      int n, lim;
      cin >> n >> lim;
      vector<int> x(n), y(n);
      for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
      }
      vector<int> time = {0, lim + 1};
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < i; j++) {
          int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
          if (t <= lim) {
            time.push_back(t);
          }
        }
      }
      auto apply = [&] (vector<int> &vec) {
        sort(vec.begin(), vec.end());
        vec.erase(unique(vec.begin(), vec.end()), vec.end());
      };
      auto find = [&] (vector<int> &vec, int val) {
        return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
      };
      apply(time);
      auto calc = [&] (int t) {
        vector<int> vec_x, vec_y;
        for (int i = 0; i < n; i++) {
          vec_x.push_back(x[i] - t);
          vec_x.push_back(x[i] + t + 1);
          vec_y.push_back(y[i] - t);
          vec_y.push_back(y[i] + t + 1);
        }
        apply(vec_x);
        apply(vec_y);
        vector<vector<tuple<int, int, int> > > add(vec_x.size());
        for (int i = 0; i < n; i++) {
          int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
          int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
          add[xl].emplace_back(yl, yr, 1);
          add[xr].emplace_back(yl, yr, -1);
        }
        vector<int> val(vec_y.size());
        int res = 0;
        for (int i = 0; i + 1 < vec_x.size(); i++) {
          for (auto [l, r, v] : add[i]) {
            for (int j = l; j < r; j++) {
              val[j] += v;
            }
          }
          for (int j = 0; j + 1 < vec_y.size(); j++) {
            if (val[j]) {
              res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[j + 1] - vec_y[j])) % MOD;
            }
          }
        }
        return res;
      };
      auto lagrange = [&] (vector<int> &val, int pos) {
        static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
        int m = val.size() - 1;
        vector<int> pre(m + 1), suf(m + 1);
        for (int i = 0, cur = 1; i <= m; i++) {
          cur = (ll)cur * (pos - i) % MOD;
          pre[i] = cur;
        }
        for (int i = m, cur = 1; i >= 0; i--) {
          cur = (ll)cur * (pos - i) % MOD;
          suf[i] = cur;
        }
        int res = 0;
        for (int i = 0; i <= m; i++) {
          int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
          if (i) {
            tmp = (ll)tmp * pre[i - 1] % MOD;
          }
          if (i != m) {
            tmp = (ll)tmp * suf[i + 1] % MOD;
          }
          if (m - i + 1 & 1) {
            res = (res + tmp) % MOD;
          } else {
            res = (res - tmp + MOD) % MOD;
          }
        }
        return res;
      };
      auto calc_sum = [&] (int l, int r) {
        const int D = 3;
        if (r - l <= D) {
          int res = 0;
          for (int i = l; i <= r; i++) {
            res = (res + calc(i)) % MOD;
          }
          return res;
        }
        vector<int> val(D + 1);
        for (int i = 0; i <= D; i++) {
          val[i] = calc(l + i);
          if (i) {
            val[i] = (val[i] + val[i - 1]) % MOD;
          }
        }
        return lagrange(val, r - l);
      };
      int ans = (ll)(lim + 1) * calc(lim) % MOD;
      for (int i = 1; i < time.size(); i++) {
        ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
      }
      cout << ans << endl;
      return 0;
    }

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x)
{
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R()
{
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 55*55, mo = 998244353,inv2=(mo+1)/2,inv6=(mo+1)/6;
int n,t,x[N],y[N],s[N],len,now;
inline int Abs(int x){return x>0?x:-x;}
bool operator<(const Pii &a,const Pii &b){return a.fi*now+a.se<b.fi*now+b.se;}
Pii operator-(const Pii &a,const Pii &b){return Pii((a.fi-b.fi+mo)%mo,(a.se-b.se+mo)%mo);}
Pii operator+(const Pii &a,const Pii &b){return Pii((a.fi+b.fi)%mo,(a.se+b.se)%mo);}
inline void add(int &x,int y){x=(x+y)%mo;}
struct Line{
	Pii l,r,p;int kd;
}a[N];int tot;
bool cmp(const Line &a,const Line &b){return a.p<b.p;}
struct Seg{
	Pii l,r;
}seg[N];int seglen;
bool operator==(const Pii &a,const Pii &b){return a.fi==b.fi&&a.se==b.se;}
bool operator==(const Seg &a,const Seg &b){return a.l==b.l&&a.r==b.r;}
bool cmp1(const Seg &a,const Seg &b){return a.l<b.l;}
inline Pii getlen()
{
	sort(seg+1,seg+seglen+1,cmp1);
	static Seg a[N];int len=0;
	rep(i,1,seglen)
		if(!len||a[len].r<seg[i].l)a[++len]=seg[i];
		else if(a[len].r<seg[i].r)a[len].r=seg[i].r;
	Pii res(0,0);rep(i,1,len)res=res+a[i].r-a[i].l+Pii(0,1);
	return res;
}
inline void solve(int poly[3])
{
	tot=0;
	rep(i,1,n)
	{
		Line tmp;tmp.p=Pii(-1,x[i]);tmp.l=Pii(-1,y[i]);tmp.r=Pii(1,y[i]);
		tmp.kd=1;a[++tot]=tmp;
		tmp.kd=-1;tmp.p=Pii(1,x[i]+1);a[++tot]=tmp;
	}
	sort(a+1,a+tot+1,cmp);seglen=0;
	rep(i,1,tot)
	{
		Pii x=getlen(),y=a[i].p-a[i-1].p;
		add(poly[0],1LL*x.se*y.se%mo);
		add(poly[1],(1LL*x.se*y.fi+1LL*x.fi*y.se)%mo);
		add(poly[2],1LL*x.fi*y.fi%mo);
		if(a[i].kd==1)seg[++seglen]=(Seg){a[i].l,a[i].r};
		else rep(j,1,seglen)if(seg[j]==(Seg){a[i].l,a[i].r})
		{
			rep(k,j,seglen-1)seg[k]=seg[k+1];seglen--;
			break;
		}
	}
}
int main()
{
	read(n);read(t);rep(i,1,n)read(x[i]),read(y[i]);
	s[++len]=0;
	s[++len]=t;
	rep(i,1,n)rep(j,i+1,n)
	{
		s[++len]=(max(Abs(x[i]-x[j]),Abs(y[i]-y[j]))+1)/2;
		if(s[len]>t)len--;
	}
	sort(s+1,s+len+1);
	len=unique(s+1,s+len+1)-s-1;
	int res=0;
	rep(i,1,len)
	{
		now=s[i];
		int poly[3]={0};
		solve(poly);
		if(i==len)res=(res+1LL*(1LL*poly[0]+1LL*poly[1]*now+1LL*poly[2]*now%mo*now)%mo*now)%mo;
		else
		{
			int l=s[i],r=s[i+1]-1;
			res=(res-(1LL*poly[0]*(r-l+1)+1LL*poly[1]*(l+r)%mo*(r-l+1)%mo*inv2+1LL*poly[2]*(1LL*r*(r+1)%mo*(2*r+1)%mo-1LL*(l-1)*l%mo*(2*l-1)%mo)%mo*inv6))%mo;
		}
	}
	res=(res%mo+mo)%mo;
	cout<<res;
	return 0;
}

#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>

inline int rint () {
	int x = 0, f = 1; char s = getchar ();
	for ( ; s < '0' || '9' < s; s = getchar () ) f = s == '-' ? -f : f;
	for ( ; '0' <= s && s <= '9'; s = getchar () ) x = x * 10 + ( s ^ '0' );
	return x * f;
}

template<typename Tp>
inline void wint ( Tp x ) {
	if ( x < 0 ) putchar ( '-' ), x = ~ x + 1;
	if ( 9 < x ) wint ( x / 10 );
	putchar ( x % 10 ^ '0' );
}

inline int abs_ ( const int x ) { return x < 0 ? -x : x; }

inline int max_ ( const int a, const int b ) { return a < b ? b : a; }

const int MAXN = 50, MOD = 998244353, INV2 = 499122177, INV6 = 166374059;
int n, t, x[MAXN + 5], y[MAXN + 5];

namespace MatrixInter {

int tmp[MAXN * 4 + 5];

class SegmentTree {
private:
	int cover[MAXN << 4], cnt[MAXN << 4];

public:
	inline void clear ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] = 0;
		if ( l == r ) return ;
		int mid = l + r >> 1;
		clear ( rt << 1, l, mid ), clear ( rt << 1 | 1, mid + 1, r );
	}
	inline void pushup ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] ? tmp[r] - tmp[l - 1] : cover[rt << 1] + cover[rt << 1 | 1];
	}
	inline void add ( const int rt, const int al, const int ar, const int l, const int r, const int v ) {
		if ( al <= l && r <= ar ) {
			if ( ! ( cnt[rt] += v ) ) cover[rt] = l == r ? 0 : cover[rt << 1] + cover[rt << 1 | 1];
			else cover[rt] = tmp[r] - tmp[l - 1];
			return ;
		}
		int mid = l + r >> 1;
		if ( al <= mid ) add ( rt << 1, al, ar, l, mid, v );
		if ( mid < ar ) add ( rt << 1 | 1, al, ar, mid + 1, r, v );
		pushup ( rt, l, r );
	}
	inline int getTop () { return cover[1]; }
} st;

struct Event { int l, r, opt; };
std :: vector<Event> evt[MAXN * 4 + 5];

inline int calcS ( const int t ) {
	int cnt = 0;
	for ( int i = 1; i <= n; ++ i ) {
		tmp[++ cnt] = x[i] - t - 1, tmp[++ cnt] = x[i] + t;
		tmp[++ cnt] = y[i] - t - 1, tmp[++ cnt] = y[i] + t;
	}
	std :: sort ( tmp + 1, tmp + cnt + 1 );
	cnt = std :: unique ( tmp + 1, tmp + cnt + 1 ) - tmp - 1;
	st.clear ( 1, 1, cnt );
	for ( int i = 1; i <= cnt; ++ i ) evt[i].clear ();
	for ( int i = 1, up, dn, le, ri; i <= n; ++ i ) {
		up = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] - t - 1 ) - tmp + 1;
		dn = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] + t ) - tmp;
		le = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] - t - 1 ) - tmp;
		ri = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] + t ) - tmp;
		evt[le].push_back ( { up, dn, true } ), evt[ri].push_back ( { up, dn, false } );
	}
	int ret = 0;
	for ( int i = 1; i <= cnt; ++ i ) {
		ret = ( ret + 1ll * st.getTop () * ( tmp[i] - tmp[i - 1] ) % MOD ) % MOD;
		for ( Event e: evt[i] ) st.add ( 1, e.l, e.r, 1, cnt, e.opt ? 1 : -1 );
	}
	return ret;
}

} // namespace MatrixInter.

int itime[MAXN * MAXN + 5];

inline int preS ( const int n ) { return n * ( n + 1ll ) % MOD * INV2 % MOD; }

inline int sqrS ( const int n ) { return n * ( n + 1ll ) % MOD * ( n * 2ll + 1 ) % MOD * INV6 % MOD; }

int main () {
#define MI MatrixInter
	n = rint (), t = rint ();
	for ( int i = 1; i <= n; ++ i ) x[i] = rint (), y[i] = rint ();
	int icnt = 0;
	for ( int i = 1; i < n; ++ i ) {
		for ( int j = i + 1, tmpt; j <= n; ++ j ) {
			tmpt = max_ ( abs_ ( x[i] - x[j] ), abs ( y[i] - y[j] ) ) >> 1;
			if ( tmpt <= t ) itime[++ icnt] = tmpt;
			if ( ++ tmpt <= t ) itime[++ icnt] = tmpt;
		}
	}
	itime[++ icnt] = 0, itime[++ icnt] = t;
	std :: sort ( itime + 1, itime + icnt + 1 );
	icnt = std :: unique ( itime + 1, itime + icnt + 1 ) - itime - 1;
	int ans = 1ll * t * MI :: calcS ( t ) % MOD;
	for ( int i = 1, tl, tr, a, b, c, ta, tb; i < icnt; ++ i ) {
		if ( ( tl = itime[i] ) + 3 > ( tr = itime[i + 1] ) ) {
			for ( ; tl < tr; ++ tl ) ans = ( ans - MI :: calcS ( tl ) + MOD ) % MOD;
			continue;
		}
		c = MI :: calcS ( tl ), ta = MI :: calcS ( tl + 1 ), tb = MI :: calcS ( tl + 2 );
		a = ( ( tb - ta * 2ll % MOD + c ) % MOD + MOD ) % MOD * INV2 % MOD;
		b = ( ( ta - c - a ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * a * sqrS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * b * preS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * c * ( tr - tl ) % MOD + MOD ) % MOD;
	}
	return wint ( ans ), putchar ( '\n' ), 0;
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    vector<int> u;
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    vector<int> has(u.size());
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        //assert(len < 3);
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // qq[2]-qq[1] = a+b, qq[1]-qq[0] = b
            // interpolation
            // c + c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + ... -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ... -> += a * len * (len-1) * (len+1) / 6
            qq[2] = (qq[2]+MOD*2-qq[1]*2+qq[0])%MOD;
            qq[1] = (qq[1]+MOD-qq[0])%MOD; // b
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            // B[1] = 0, B[2] = 1, B[3] = 3, B[4] = 6
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len-2) % MOD * i6 % MOD)) % MOD;
            // A[1] = 0, A[2] = 1, A[3] = 4, A[4] = 10
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

/*Lucky_Glass*/
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int N=55,MOD=998244353;

inline int Add(const int &a,const int &b){return a+b>=MOD? a+b-MOD:a+b;}
inline int Sub(const int &a,const int &b){return a-b<0? a-b+MOD:a-b;}
inline int Mul(const int &a,const int &b){return 1ll*a*b%MOD;}
inline int Pow(int a,int b){int r=1;while(b){if(b&1)r=Mul(r,a);a=Mul(a,a),b>>=1;}return r;}

int n,m;
int pnt[N][2],sav[N][2];
int cov[N<<1];
vector<int> tpo,uni;

struct OPT{
	int pos,le,ri,key;
	OPT(){}
	OPT(int p,int l,int r,int k):pos(p),le(l),ri(r),key(k){}
}Op[N<<1];
bool operator <(OPT A,OPT B){return A.pos<B.pos;}

#define uniq(x) (lower_bound(uni.begin(),uni.end(),x)-uni.begin())
void Cover(int le,int ri,int key){
	for(int i=le;i<ri;i++)
		cov[i]+=key;
}
int SumUp(int t){
	int ret=0;
	for(int i=0;i<t-1;i++)
		ret+=cov[i]? uni[i+1]-uni[i]:0;
	return ret;
}
int Calc(int t){
	memset(cov,0,sizeof cov);
	uni.clear();
	for(int i=1;i<=n;i++){
		uni.push_back(pnt[i][1]-t);
		uni.push_back(pnt[i][1]+t+1);
	}
	sort(uni.begin(),uni.end());
	uni.erase(unique(uni.begin(),uni.end()),uni.end());
	int cnt=0;
	for(int i=1;i<=n;i++){
		Op[++cnt]=OPT(pnt[i][0]-t,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),1);
		Op[++cnt]=OPT(pnt[i][0]+t+1,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),-1);
	}
	sort(Op+1,Op+1+cnt);
	int ret=0,siz=uni.size();
	for(int i=1,las=-1e9;i<=cnt;i++){
		int j=i,cur=Op[i].pos;
		while(j+1<=cnt && Op[j+1].pos==cur) j++;
		ret=Add(ret,Mul(Sub(cur,las),SumUp(siz)));
		for(int k=i;k<=j;k++) Cover(Op[k].le,Op[k].ri,Op[k].key);
		i=j,las=cur;
	}
	return ret;
}
int ABS(int x){return x<0? -x:x;}
int Poly(int x){
	int ret=0;
	for(int i=0;i<5;i++){
		int obv=sav[i][1],blw=1;
		for(int j=0;j<5;j++)
			if(i!=j){
				obv=Mul(obv,Sub(x,sav[j][0]));
				blw=Mul(blw,Sub(sav[i][0],sav[j][0]));
			}
		ret=Add(ret,Mul(obv,Pow(blw,MOD-2)));
	}
	return ret;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&pnt[i][0],&pnt[i][1]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int cur=max(ABS(pnt[i][0]-pnt[j][0]),ABS(pnt[i][1]-pnt[j][1]));
			cur=(cur-1)/2+1;
			if(cur>m) continue;
			tpo.push_back(cur);
		}
	tpo.push_back(0),tpo.push_back(m);
	sort(tpo.begin(),tpo.end());
	tpo.erase(unique(tpo.begin(),tpo.end()),tpo.end());
	int sum=0;
	for(int i=1,li=tpo.size();i<li;i++){
		int le=tpo[i-1],ri=tpo[i]-1;
		if(ri-le+1>=5){
			for(int k=0;k<5;k++)
				sav[k][0]=le+k,sav[k][1]=Calc(le+k);
			for(int k=1;k<5;k++)
				sav[k][1]=Add(sav[k][1],sav[k-1][1]);
			sum=Add(sum,Poly(ri));
		}
		else{
			for(int k=le;k<=ri;k++)
				sum=Add(sum,Calc(k));
		}
	}
	sum=Add(sum,Calc(m));
	printf("%d\n",Sub(Mul(m+1,Calc(m)),sum));
	return 0;
}

#include<bits/stdc++.h>
#define reg register int
#define il inline
#define fi first
#define se second
#define mk(a,b) make_pair(a,b)
#define numb (ch^'0')
#define pb push_back
#define solid const auto &
#define enter cout<<endl
#define pii pair<int,int>
using namespace std;
typedef long long ll;
template<class T>il void rd(T &x){
    char ch;x=0;bool fl=false;while(!isdigit(ch=getchar()))(ch=='-')&&(fl=true);
    for(x=numb;isdigit(ch=getchar());x=x*10+numb);(fl==true)&&(x=-x);}
template<class T>il void output(T x){if(x/10)output(x/10);putchar(x%10+'0');}
template<class T>il void ot(T x){if(x<0) putchar('-'),x=-x;output(x);putchar(' ');}
template<class T>il void prt(T a[],int st,int nd){for(reg i=st;i<=nd;++i) ot(a[i]);putchar('\n');}
namespace Modulo{
const int mod=998244353;
int ad(int x,int y){return (x+y)>=mod?x+y-mod:x+y;}
void inc(int &x,int y){x=ad(x,y);}
int mul(int x,int y){return (ll)x*y%mod;}
int sub(int x,int y){return ad(x,mod-y);}
void inc2(int &x,int y){x=mul(x,y);}
int qm(int x,int y=mod-2){int ret=1;while(y){if(y&1) ret=mul(x,ret);x=mul(x,x);y>>=1;}return ret;}
template<class ...Args>il int ad(const int a,const int b,const Args &...args) {return ad(ad(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
}
using namespace Modulo;
namespace Miracle{
const int N=505;
int n,T;
int X[N],Y[N];

int tmp[N];
int z[N];
#define ls (x<<1)
#define rs (x<<1|1)
#define mid ((l+r)>>1)
struct node{
    int ct,val;
    int sum;
}t[4*N];
void pushup(int x){
    if(t[x].ct) t[x].sum=t[x].val;
    else t[x].sum=t[x<<1].sum+t[x<<1|1].sum;
}
void build(int x,int l,int r){
    if(l==r){
        t[x].ct=0;t[x].sum=0;
        t[x].val=z[l]-z[l-1];
        // cout<<" val "<<l<<" "<<r<<" : "<<t[x].val<<endl;
        return;
    }
    t[x].ct=0;t[x].sum=0;
    t[x].val=z[r]-z[l-1];
    build(ls,l,mid);
    build(rs,mid+1,r);
}
void upda(int x,int l,int r,int L,int R,int c){
    if(L<=l&&r<=R){
        t[x].ct+=c;pushup(x);
        return;
    }
    if(L<=mid) upda(ls,l,mid,L,R,c);
    if(mid<R) upda(rs,mid+1,r,L,R,c);
    pushup(x);
}
struct qs{
    int p,c;
    int u,d;
    qs(){}
    qs(int pp,int cc,int dd,int uu){
        p=pp;c=cc;d=dd;u=uu;
    }
    bool friend operator <(qs a,qs b){
        return a.p<b.p;
    }
}h[N];
ll calc(int tim){
    // cout<<" calc *******"<<tim<<endl;
    int ch=0,cl=0,cz=0;
    for(reg i=1;i<=n;++i){
        h[++ch]=qs(X[i]-tim,1,Y[i]-tim,Y[i]+tim);
        h[++ch]=qs(X[i]+tim+1,-1,Y[i]-tim,Y[i]+tim);
        tmp[++cl]=Y[i]+tim;
        tmp[++cl]=Y[i]-tim;
    }
    sort(h+1,h+ch+1);
    sort(tmp+1,tmp+cl+1);
    cl=unique(tmp+1,tmp+cl+1)-tmp-1;
    z[0]=tmp[1]-1;
    for(reg i=1;i<=cl;++i){
        z[++cz]=tmp[i];
        if(i!=cl&&tmp[i+1]!=tmp[i]+1){
            z[++cz]=tmp[i+1]-1;
        }
    }
    // cout<<" zz "<<endl;
    // prt(z,1,cz);

    build(1,1,cz);
    ll ret=0;
    for(reg i=1;i<=ch;++i){
        if(i!=1){
            ret+=(ll)t[1].sum*(h[i].p-h[i-1].p);
        }
        h[i].u=lower_bound(z+1,z+cz+1,h[i].u)-z;
        h[i].d=lower_bound(z+1,z+cz+1,h[i].d)-z;
        // cout<<" u "<<h[i].u<<" d "<<h[i].d<<endl;
        upda(1,1,cz,h[i].d,h[i].u,h[i].c);
        // cout<<"after "<<i<<" sum "<<t[1].sum<<endl;
    }
    // cout<<"RETETETE "<<ret<<endl;
    return ret%mod;//warning!!! % mod
}
int nr[55*55],num;
ll px[5],py[5];
int ping(int n){
    return mul(n,n+1,2*n+1,qm(6));
}
int main(){
    rd(n);rd(T);
    for(reg i=1;i<=n;++i){
        rd(X[i]);rd(Y[i]);
    }
    nr[++num]=0;
    for(reg i=1;i<=n;++i){
        for(reg j=i+1;j<=n;++j){
            int yu=max((abs(X[i]-X[j])+1)/2,(abs(Y[i]-Y[j])+1)/2);
            nr[++num]=yu;
        }
    }
    nr[++num]=T;
    sort(nr+1,nr+num+1);
    num=unique(nr+1,nr+num+1)-nr-1;

    int ans=mul(T,calc(T));
    // cout<<" ans "<<ans<<endl;
    for(reg i=1;i<=num;++i){
        if(nr[i]==T) break;
        int tot=0;
        int ti=nr[i];
        while(ti-nr[i]<3&&ti!=nr[i+1]){
            px[++tot]=ti;
            py[tot]=calc(ti);
            ++ti;
        }
        // cout<<"tot----------- "<<tot<<endl;
        // prt(py,1,tot);
        if(tot<=2){
            for(reg j=1;j<=tot;++j){
                inc(ans,mod-py[j]);
            }
        }else{
            // cout<<" TriTri ";
            int A=0,B=0,C=0;
            for(reg j=1;j<=tot;++j){
                int lp=py[j];
                int ss=0,sc=1;
                for(reg k=1;k<=tot;++k){
                    if(k==j) continue;
                    lp=mul(lp,qm(ad(px[j],mod-px[k])));
                    inc(ss,px[k]);
                    inc2(sc,px[k]);
                }
                A=ad(A,lp);
                B=ad(B,mod-mul(lp,ss));
                C=ad(C,mul(lp,sc));
            }
            int st=nr[i],nd=nr[i+1]-1;
            inc(ans,mod-ad(mul(A,sub(ping(nd),ping(st-1))),mul(B,(nd-st+1),(nd+st),qm(2)),mul(C,(nd-st+1))));
        }
    }
    ot(ans);
    return 0;
}

}
signed main(){
    Miracle::main();
    return 0;
}

/*
   Author: *Miracle*
*/

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

int n, T;
pair<int,int> v[N];
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    vector<int> u;
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    int res = 0;
    vector<int> has(u.size());
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + 1LL * (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        ll len = bb[i+1] - bb[i];
        //assert(len < 3);
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j)) % MOD;
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // qq[2]-qq[1] = a+b, qq[1]-qq[0] = b
            // interpolation
            // c + c +  c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + 4b + ... -> += b * len * (len-1) / 2;
            // 0 + 0 +  a + 3a + 6a + ... -> += a * len * (len-1) * (len-2) / 6
            qq[2] = (qq[2]+MOD*2-qq[1]*2+qq[0])%MOD;
            qq[1] = (qq[1]+MOD-qq[0])%MOD; // b
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            // B[1] = 0, B[2] = 1, B[3] = 3, B[4] = 6
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len-2) % MOD * i6 % MOD)) % MOD;
            // A[1] = 0, A[2] = 1, A[3] = 4, A[4] = 10
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define db long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define MK make_pair
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define UPD(x,y) (((x)+=(y))>=mo?x-=mo:233)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
using namespace std;
const int mo=998244353;
int power(int x,int y){
	int s=1;
	for (;y;y/=2,x=1ll*x*x%mo)
		if (y&1) s=1ll*s*x%mo;
	return s;
}
const int N=105;
int n,t,spe[N*N];
int x[N],y[N],X[N],Y[N];
struct que{
	int l,r,v;
};
vector<que> Q[N];
int cnt[N];
int calc(int T){
	int ans=0; *X=*Y=0;
	For(i,1,N-1) Q[i].resize(0);
	CLR(cnt,0);
	For(i,1,n){
		X[++*X]=x[i]-T;
		X[++*X]=x[i]+T+1;
		Y[++*Y]=y[i]-T;
		Y[++*Y]=y[i]+T+1;
	}
	sort(X+1,X+*X+1);
	sort(Y+1,Y+*Y+1);
	*X=unique(X+1,X+*X+1)-X-1;
	*Y=unique(Y+1,Y+*Y+1)-Y-1;
	For(i,1,n){
		int p1=lower_bound(Y+1,Y+*Y+1,y[i]-T)-Y;
		int p2=lower_bound(Y+1,Y+*Y+1,y[i]+T+1)-Y-1;
		Q[lower_bound(X+1,X+*X+1,x[i]-T)-X].PB((que){p1,p2,1});
		Q[lower_bound(X+1,X+*X+1,x[i]+T+1)-X].PB((que){p1,p2,-1});
	}
	For(i,1,(*X)-1){
		for (auto j:Q[i])
			For(k,j.l,j.r) cnt[k]+=j.v;
		int sum=0;
		For(k,1,(*Y)-1)
			if (cnt[k]) sum+=Y[k+1]-Y[k];
		ans=(ans+1ll*sum*(X[i+1]-X[i]))%mo;
	}
	return ans;
}
int val[10],f[10],poly[10];
int main(){
	scanf("%d%d",&n,&t);
	spe[++*spe]=-1; spe[++*spe]=t-1;
	For(i,1,n) scanf("%d%d",&x[i],&y[i]);
	For(i,1,n) For(j,i+1,n){
		int val=(max(abs(x[i]-x[j]),abs(y[i]-y[j]))+1)/2;
		if (val<t) spe[++*spe]=val-1;
	}
	sort(spe+1,spe+*spe+1);
	*spe=unique(spe+1,spe+*spe+1)-spe-1;
	int ans=1ll*t*calc(t)%mo;
	For(l,2,*spe){
		CLR(val,0);
		int st=spe[l-1]+1,ed=min(st+3,spe[l]),len=ed-st;
		For(j,st,ed) val[j-st]=calc(j);
		For(j,1,3) val[j]=(val[j]+val[j-1])%mo;
		CLR(poly,0);
		For(i,0,3){
			int tmp=1;
			For(j,0,3) if (i!=j)
				tmp=1ll*tmp*(i+mo-j)%mo;
			int v=1ll*val[i]*power(tmp,mo-2)%mo;
			//printf("%d\n",v);
			CLR(f,0); f[0]=1;
			For(j,0,3) if (i!=j){
				Rep(k,3,1) f[k]=(1ll*f[k]*(mo-j)+f[k-1])%mo;
				f[0]=1ll*f[0]*(mo-j)%mo;
			}
			For(j,0,3)
				poly[j]=(poly[j]+1ll*v*f[j])%mo;
		}
		len=spe[l]-st;
		//printf("%d %d %d %d\n",len,poly[0],poly[1],poly[2]);
		ans=(ans+mo-poly[0])%mo;
		ans=(ans+mo-1ll*len*poly[1]%mo)%mo;
		ans=(ans+mo-1ll*len*len%mo*poly[2]%mo)%mo;
		ans=(ans+mo-1ll*len*len%mo*len%mo*poly[3]%mo)%mo;
		//printf("%d\n",ans);
	}
	printf("%d\n",ans);
}
/*
2 10
0 0
2 0
*/

#include <bits/stdc++.h>

using Linear = std::array<int, 2>;

const int N = 50;
const int MOD = 998244353;
const int INV2 = 499122177;
const int INV6 = 166374059;

int n, t, x[N], y[N], rank[N << 1], xorder[N << 1], yorder[N << 1],
    count[N << 1];
Linear dys[N << 1];

struct Comparer {
  Comparer(int t, int *a) : t(t), a(a) {}

  int v(int i) const { return a[i >> 1] + (i & 1 ? t + 1 : -t); }

  bool operator()(int i, int j) const {
    return v(i) != v(j) ? v(i) < v(j) : (i & 1) < (j & 1);
  }

  int t;
  int *a;
};

Linear boundary(int *a, int i) {
  if (i & 1) {
    return {a[i >> 1] + 1, 1};
  } else {
    return {a[i >> 1], MOD - 1};
  }
}

int add(int x, int a) {
  x += a;
  if (x >= MOD) {
    x -= MOD;
  }
  return x;
}

void update(int &x, int a) { x = add(x, a); }

Linear subtract(const Linear &a, const Linear &b) {
  return {add(a[0], MOD - b[0]), add(a[1], MOD - b[1])};
}

int sum1(int n)
{
  return n * (n - 1LL) % MOD * INV2 % MOD;
}

int sum2(int n)
{
  return n * (n - 1LL) % MOD * (n + n - 1) % MOD * INV6 % MOD;
}

int main() {
  while (scanf("%d%d", &n, &t) == 2) {
    for (int i = 0; i < n; ++i) {
      scanf("%d%d", x + i, y + i);
    }
    std::vector<int> time{0, t, t + 1};
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (x[i] < x[j]) {
          time.push_back(x[j] - x[i] >> 1);
        }
        if (y[i] < y[j]) {
          time.push_back(y[j] - y[i] >> 1);
        }
      }
    }
    std::sort(time.begin(), time.end());
    time.erase(std::unique(time.begin(), time.end()), time.end());
    std::iota(xorder, xorder + (n << 1), 0);
    std::iota(yorder, yorder + (n << 1), 0);
    memset(count, 0, sizeof(count));
    int result = 0;
    for (int k = 0; k + 1 < time.size(); ++k) {
      // [time[k], time[k + 1])
      int t0 = time[k];
      int t1 = time[k + 1];
      std::sort(xorder, xorder + (n << 1), Comparer{t0, x});
      std::sort(yorder, yorder + (n << 1), Comparer{t0, y});
      for (int i = 0; i < n << 1; ++i) {
        rank[yorder[i]] = i;
      }
      for (int j = 1; j < n << 1; ++j) {
        dys[j] = subtract(boundary(y, yorder[j]), boundary(y, yorder[j - 1]));
      }
      int quad[]{0, 0, 0};
      for (int _i = 0; _i < n << 1; ++_i) {
        int i = xorder[_i];
        int delta = i & 1 ? -1 : 1;
        if (_i) {
          Linear dx = subtract(boundary(x, i), boundary(x, xorder[_i - 1]));
          for (int j = 1; j < n << 1; ++j) {
            if (count[j - 1]) {
              update(quad[0], 1LL * dx[0] * dys[j][0] % MOD);
              update(quad[1],
                     (1LL * dx[0] * dys[j][1] + 1LL * dx[1] * dys[j][0]) % MOD);
              update(quad[2], 1LL * dx[1] * dys[j][1] % MOD);
            }
          }
        }
        for (int j = rank[i & ~1]; j < rank[i | 1]; ++j) {
          count[j] += delta;
        }
      }
      int sum = 1LL * (t1 - t0) * quad[0] % MOD;
      update(sum, 1LL * (sum1(t1) + MOD - sum1(t0)) * quad[1] % MOD);
      update(sum, 1LL * (sum2(t1) + MOD - sum2(t0)) * quad[2] % MOD);
      update(result, t0 == t ? 1LL * t * sum % MOD : MOD - sum);
      if (t0 == t) {
        break;
      }
    }
    printf("%d\n", result);
  }
}

#include <bits/stdc++.h>
#define ll long long
#define MOD 998244353
using namespace std;
const int Q=1<<8;
int X[Q],Y[Q],n;
int uni[Q*Q];
int ux[Q],uy[Q];
int cnt[Q][Q];
#define G(aa,bb,cc) (lower_bound(aa+1,aa+(bb)+1,cc)-aa)
int Cov(int d)
{
	int mx=0,my=0;
	for(int i=1;i<=n;i++)
		ux[++mx]=X[i]-d,ux[++mx]=X[i]+d+1,
		uy[++my]=Y[i]-d,uy[++my]=Y[i]+d+1;
	sort(ux+1,ux+mx+1),sort(uy+1,uy+my+1);
	mx=unique(ux+1,ux+mx+1)-ux-1;
	my=unique(uy+1,uy+my+1)-uy-1;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++)
			cnt[i][j]=0;
	for(int i=1;i<=n;i++){
		int x0=G(ux,mx,X[i]-d),x1=G(ux,mx,X[i]+d+1),
		y0=G(uy,my,Y[i]-d),y1=G(uy,my,Y[i]+d+1);
		cnt[x0][y0]++,cnt[x1][y1]++;
		cnt[x0][y1]--,cnt[x1][y0]--;
	}
	ll tmp=0;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++){
			cnt[i][j]+=cnt[i-1][j]+cnt[i][j-1]-cnt[i-1][j-1];
			if(cnt[i][j])tmp+=1LL*(ux[i+1]-ux[i])*(uy[j+1]-uy[j]);
		}
	return tmp%MOD;
}
int dd[4]={MOD-(MOD+1)/6,(MOD+1)/2,MOD-(MOD+1)/2,(MOD+1)/6};
int main()
{
	int k;
	scanf("%d%d",&n,&k);
	if(k==0)return 0&puts("0");
	for(int i=1;i<=n;i++)
		scanf("%d%d",&X[i],&Y[i]);
	int maxn=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			uni[++maxn]=(max(abs(X[i]-X[j]),abs(Y[i]-Y[j]))+1)>>1;
	uni[++maxn]=0;
	sort(uni+1,uni+maxn+1);
	maxn=unique(uni+1,uni+maxn+1)-uni-1;
	while(uni[maxn]>=k)--maxn;
	uni[++maxn]=k;
	ll als=0;
	for(int i=1;i<maxn;i++){
		if(uni[i+1]-uni[i]<=4){
			for(int j=uni[i];j<uni[i+1];j++)
				als+=Cov(j);
			continue;
		}
		int sm=0;
		for(int j=0;j<=3;j++){
			sm=(sm+Cov(uni[i]+j))%MOD;
			ll pi=1LL*sm*dd[j]%MOD;
			for(int k=0;k<4;k++)
				if(j!=k)pi=pi*(uni[i+1]-uni[i]-1-k)%MOD;
			als+=pi;
		}
	}
	printf("%lld\n",(1LL*Cov(k)*k%MOD-als%MOD+MOD)%MOD);
	return 0;
}

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

int n,t;
const ll mod = 998244353;
vector<ll>za;

ll x[55],y[55];
ll smsum(ll a){
	return (a * (a+1) / 2) % mod;
}
ll modpow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll dbsum(ll a){
	return a*(a+1)%mod*(2*a+1)%mod*modpow(6LL,mod-2)%mod;
}
ll calc(ll T){
    if(T == 0) return n;
    vector<ll>zax,zay;
    rep(i,n){
		zax.pb(x[i]-T); zax.pb(x[i]+T+1);
		zay.pb(y[i]-T); zay.pb(y[i]+T+1);
	}
	SORT(zax); ERASE(zax);
	SORT(zay); ERASE(zay);

	bool ex[105][105]={};
	rep(i,n){
		int a = POSL(zax,x[i]-T); int aa = POSL(zax,x[i]+T+1);
		int b = POSL(zay,y[i]-T); int bb = POSL(zay,y[i]+T+1);
		for(int c=a;c<aa;c++) for(int d=b;d<bb;d++) ex[c][d] = 1;
	}

	ll ret = 0;
	rep(i,zax.size()) rep(j,zay.size()){
		if(ex[i][j]){
			ret += (zax[i+1]-zax[i]) * (zay[j+1]-zay[j]) % mod;
		}
	}
	return ret%mod;
}
int main(){
	cin >> n >> t;
	rep(i,n){
		cin >> x[i] >> y[i];
	}
	za.pb(1);
	za.pb(t+1);
	rep(i,n) rep(j,n){
		if(i < j){
			ll mx = max(abs(x[i]-x[j]),abs(y[i]-y[j]));
			za.pb((mx+1)/2);
		}
	}

	SORT(za); ERASE(za);

	ll ans = 0;
	for(int i=0;i<za.size();i++){
		if(za[i] == t+1) break;
		//sum ax^2 + bx over [za[i], za[i+1])

		if(za[i+1]-za[i] <= 4){
			ans += (calc(za[i]) - calc(za[i]-1)) * za[i] % mod;
			for(ll x=za[i]+1;x<za[i+1];x++){
				ans += (calc(x)-calc(x-1)) * x % mod;
			}
		}
		else{
			ans += (calc(za[i]) - calc(za[i]-1)) * za[i] % mod;

			ll pre = (calc(za[i]+1) - calc(za[i]));
			ll nxt = (calc(za[i]+2) - calc(za[i]+1));

			ll a = (nxt-pre);
			ll b = pre - a * (za[i]+1) % mod;

			//ax^2+bx を [za[i]+1, za[i+1]) の範囲で総和を取る

			ans += a * (dbsum(za[i+1]-1) - dbsum(za[i])) % mod;
			ans += b * (smsum(za[i+1]-1) - smsum(za[i])) % mod;
		}
	}

	cout << (ans%mod+mod)%mod << endl;
}

#include<bits/stdc++.h>
#define ALL(A)  A.begin(),A.end()
#define maxn 55
#define maxm 10
#define modu 998244353
using namespace std;
typedef long long LL;

LL inv(LL a)
{
    LL ans=1;
    for (int k=modu-2;k;k>>=1)
    {
        if (k&1)
            ans=ans*a%modu;
        a=a*a%modu;
    }
    return ans;
}

int n,m;
int x[maxn],y[maxn];

vector<int> T;

LL calc(int T)
{
    vector<int> C,Y;
    struct node {
        int x,l,r,d;
        node(int _x,int _l,int _r,int _d)   {
            x=_x,l=_l,r=_r,d=_d;
        }
        bool operator < (const node& N) const   {
            return x<N.x;
        }
    };
    vector<node> X;
    for (int i=1;i<=n;++i)
    {
        int ly=y[i]-T,ry=y[i]+T+1;
        Y.push_back(ly);
        Y.push_back(ry);
        X.push_back(node(x[i]-T,ly,ry,1));
        X.push_back(node(x[i]+T+1,ly,ry,-1));
    }

    sort(ALL(X));
    sort(ALL(Y));
    Y.resize(unique(ALL(Y))-Y.begin());
    C.resize(Y.size(),0);

    LL ans=0;
    for (int i=0;i<X.size();++i)
    {
        int l=lower_bound(ALL(Y),X[i].l)-Y.begin(),r=lower_bound(ALL(Y),X[i].r)-Y.begin(),d=X[i].d;
        if (i)
            for (int j=0;j<Y.size();++j)
                if (C[j])
                {
                    assert(j!=Y.size()-1);
                    ans=(ans+1LL*(X[i].x-X[i-1].x)*(Y[j+1]-Y[j]))%modu;
                }
        for (int j=l;j<r;++j)
            C[j]+=d;
    }
    return ans;
}

LL X[maxm],Fx[maxm];

int main()
{
    scanf("%d%d",&n,&m);
    for (int i=1;i<=n;++i)
        scanf("%d%d",x+i,y+i);

    T.push_back(m);
    for (int i=1;i<=n;++i)
        for (int j=1;j<=n;++j)
        {
            int tx=abs(x[i]-x[j]),ty=abs(y[i]-y[j]),t=max((tx+1)>>1,(ty+1)>>1);
            // cout<<i<<" "<<j<<" "<<t<<endl;
            if (t>m)    continue;
            T.push_back(t);
        }
    sort(ALL(T));
    T.resize(unique(T.begin(),T.end())-T.begin());

    LL ans=0;
    for (int i=0;i<T.size()-1;++i)
    {
        // cout<<"time:"<<T[i]<<endl;
        if (T[i]+4>=T[i+1])
        {
            for (int t=T[i];t<T[i+1];++t)
                ans=(ans+calc(t))%modu;
        } else
        {
            for (int j=1;j<=4;++j)
                X[j]=T[i]+j-1,Fx[j]=(calc(X[j])+Fx[j-1])%modu;

            // for (int j=1;j<=4;++j)
            //     cout<<"("<<X[j]<<" "<<Fx[j]<<")"<<endl;
            // cout<<endl;

            LL sum=0,t=T[i+1]-1;
            for (int j=1;j<=4;++j)
            {
                LL p=1,q=1;
                for (int k=1;k<=4;++k)
                    if (k!=j)
                        p=p*(t-X[k]+modu)%modu,q=q*(X[j]-X[k]+modu)%modu;
                sum=(sum+p*inv(q)%modu*Fx[j])%modu;
            }
            // cout<<"sum:"<<sum<<endl;
            ans=(ans+sum)%modu;
        }
    }

    ans=(m*calc(m)-ans+modu)%modu;
    printf("%lld\n",ans);
    // cout<<"last:"<<calc(0)<<" "<<calc(15)<<" "<<calc(m)<<endl;
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
#define maxn 110
#define N 5010
using namespace std;
struct event{int pos, l, r, tp;};
event E[maxn];
int x[maxn], y[maxn], sj[N], cnt, val[10], A[maxn], sum[maxn], n;
bool cmp(event a, event b) {return a.pos < b.pos;}
int calc(int a, int k)
{
	int ans = 1;
	while (k)
	{
		if (k % 2) ans = (ll)ans * a % mod;
		a = (ll)a * a % mod;
		k /= 2;
	}
	return ans;
}
int get_S(int tp, int n)
{
	if (tp == 1) return n * ((ll)n + 1) / 2 % mod;
	else return (ll)n * (2 * n + 1) % mod * (n + 1) % mod * calc(6, mod - 2) % mod;
}
bool check(int a, int b, int x)
{
	if (a > b) swap(a, b);
	return a + x >= b - x;
}
int get_sj(int id1, int id2)
{
	int lef = 0, righ = 100000000, ch = 0;
	while (lef <= righ)
	{
		int mid = (lef + righ) / 2;
		if (check(x[id1], x[id2], mid) && check(y[id1], y[id2], mid))
		{
			ch = mid;
			righ = mid - 1;
		}
		else lef = mid + 1;
	}
	return ch;
}
int solve(int now)
{
	int diff = 0;
	for (int i = 1; i <= n; i++)
	{
		int t1 = y[i] - now, t2 = y[i] + now;
		A[++diff] = t1; A[++diff] = t2 + 1;
	}
	sort(A + 1, A + diff + 1);
	diff = unique(A + 1, A + diff + 1) - A - 1;
	int tot = 0;
	for (int i = 1; i <= n; i++)
	{
		E[++tot] = (event){x[i] - now, y[i] - now, y[i] + now, 1};
		E[++tot] = (event){x[i] + now + 1, y[i] - now, y[i] + now, -1};
	}
	sort(E + 1, E + tot + 1, cmp);
	int res = 0;
	for (int i = 1; i <= tot; i++)
	{
		int t1 = lower_bound(A + 1, A + diff + 1, E[i].l) - A, t2;
		t2 = lower_bound(A + 1, A + diff + 1, E[i].r + 1) - A;
		for (int j = t1; j <= t2 - 1; j++)
			sum[j] += E[i].tp;
		int len = 0;
		for (int j = 1; j <= diff; j++)
			if (sum[j]) len += A[j + 1] - A[j];
		res = (res + len * ((ll)E[i + 1].pos - E[i].pos) % mod) % mod;
	}
	return res;
}
int main()
{
	int t;
	scanf("%d%d", &n, &t);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &x[i], &y[i]);
	for (int i = 1; i <= n; i++)
		for (int j = i + 1; j <= n; j++)
			sj[++cnt] = get_sj(i, j);
	sj[++cnt] = t + 1; sj[++cnt] = 0;
	sort(sj + 1, sj + cnt + 1);
	cnt = unique(sj + 1, sj + cnt + 1) - sj - 1;
	int res = 0;
	for (int i = 1; i <= cnt; i++)
	{
		if (sj[i] == t + 1) break;
		for (int j = 1; j <= 3; j++)
			val[j] = solve(sj[i] + j - 1);
		int A, B, C, tmp;
		A = (((ll)val[1] - 2 * val[2] + val[3]) % mod + mod) % mod * calc(2, mod - 2) % mod;
		B = ((val[2] - val[1] - 3LL * A) % mod + mod) % mod;
		C = ((val[1] - A - B) % mod + mod) % mod;
		if (sj[i + 1] == t + 1)
		{
			int x = t - sj[i] + 1;
			tmp = ((ll)A * x % mod * x % mod + (ll)B * x % mod + C) % mod;
			res = (res + tmp * ((ll)t + 1) % mod) % mod;
		}
		tmp = ((ll)A * get_S(2, sj[i + 1] - sj[i]) % mod + (ll)B * get_S(1, sj[i + 1] - sj[i]) % mod
				+ C * ((ll)sj[i + 1] - sj[i])) % mod;
		res = (res - tmp + mod) % mod;
	}
	printf("%d\n", res);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

const i64 mod = 998244353;
const int maxN = 2234;

int n, t, x[maxN], y[maxN];
vector<int> row, col;

i64 inv[maxN], invfac[maxN];

void init(int deg) {
	invfac[0] = 1;
	invfac[1] = 1;
	inv[1] = 1;
	for (int i = 2; i <= deg; i++) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
		invfac[i] = invfac[i - 1] * inv[i] % mod;
	}
}

i64 interpol(i64 *p, int deg, i64 x) {
	i64 mul1[10], mul2[10];
	mul1[0] = 1;
	mul2[0] = 1;
	for (int i = 0; i <= deg; i++) {
		mul1[i + 1] = mul1[i] * (x - i) % mod;
		mul2[i + 1] = mul2[i] * (x - deg + i) % mod;
	}

	i64 ans = 0;
	for (int i = 0; i <= deg; i++) {
		i64 t = invfac[i] * invfac[deg - i] % mod * mul1[i] % mod * mul2[deg - i] % mod * p[i] % mod;
		if ((deg - i) & 1) ans = ans - t;
		else ans = ans + t;
	}
	ans = ans % mod;
	if (ans < 0) ans += mod;
	return ans;

}

vector<vector<int>> seg[123];
int cnt[123];
i64 len[123];
i64 solvet(int t) {
	vector<int> row, col;
	for (int i = 0; i < n; i++) {
		row.push_back(x[i] - t);
		row.push_back(x[i] + t + 1);
		col.push_back(y[i] - t);
		col.push_back(y[i] + t + 1);
	}
	sort(row.begin(), row.end());
	row.erase(unique(row.begin(), row.end()), row.end());
	sort(col.begin(), col.end());
	col.erase(unique(col.begin(), col.end()), col.end());
	int r = row.size(), c = col.size();
	for (int i = 0; i < r; i++) seg[i].clear();
	for (int j = 0; j + 1 < c; j++) {
		cnt[j] = 0;
		len[j] = col[j + 1] - col[j];
	}
	for (int i = 0; i < n; i++) {
		int px = lower_bound(row.begin(), row.end(), x[i] - t) - row.begin();
		int qx = lower_bound(row.begin(), row.end(), x[i] + t + 1) - row.begin();
		int py = lower_bound(col.begin(), col.end(), y[i] - t) - col.begin();
		int qy = lower_bound(col.begin(), col.end(), y[i] + t + 1) - col.begin();
		seg[px].push_back(vector<int> {py, qy, 1});
		seg[qx].push_back(vector<int> {py, qy, -1});
	}
	i64 ans = 0;
	for (int i = 0; i + 1 < r; i++) {
		for (auto p : seg[i]) {
			for (int j = p[0]; j < p[1]; j++) {
				cnt[j] += p[2];
			}
		}
		i64 rlen = row[i + 1] - row[i];
		for (int j = 0; j + 1 < c; j++)
			if (cnt[j] > 0) ans = ans + len[j] * rlen;
	}
	return ans;
}

vector<int> v;

i64 solve(int t1, int t2) {
	i64 d[10];
	for (int i = 0; i <= 3; i++) {
		d[i] = solvet(t1 + i) % mod;
	}
	for (int i = 1; i <= 3; i++) d[i] = (d[i - 1] + d[i]) % mod;
	return interpol(d, 3, t2 - t1);
}

int main() {
	init(100);
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);
	}
	v.push_back(0);
	v.push_back(t + 1);
	for (int i = 0; i < n; i++) for (int j = i + 1; j < n; j++) {
			int d = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
			if (d < t) v.push_back(d);
		}
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	i64 ans = (solvet(t) % mod * (t + 1)) % mod;
	for (int i = 0; i + 1 < v.size(); i++) {
		ans = (ans - solve(v[i], v[i + 1] - 1)) % mod;
	}
	if (ans < 0) ans += mod;
	printf("%lld\n", ans);
}

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
int gi(){
	int x=0,w=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')w=0,ch=getchar();
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
const int N=10005;
const int mod=998244353;
int n,T,x[N],y[N],o[N],ox[N],oy[N],cov[N],ans;
struct node{int l,r,v;};vector<node>E[N];
int cal(int t){
	int lenx=0,leny=0,res=0;
	for(int i=1;i<=n;++i){
		ox[++lenx]=x[i]-t;ox[++lenx]=x[i]+t+1;
		oy[++leny]=y[i]-t;oy[++leny]=y[i]+t+1;
	}
	sort(ox+1,ox+lenx+1);lenx=unique(ox+1,ox+lenx+1)-ox-1;
	sort(oy+1,oy+leny+1);leny=unique(oy+1,oy+leny+1)-oy-1;
	for(int i=1;i<=lenx;++i)E[i].clear();
	for(int i=1;i<=leny;++i)cov[i]=0;
	for(int i=1;i<=n;++i){
		int lx=lower_bound(ox+1,ox+lenx+1,x[i]-t)-ox;
		int rx=lower_bound(ox+1,ox+lenx+1,x[i]+t+1)-ox;
		int ly=lower_bound(oy+1,oy+leny+1,y[i]-t)-oy;
		int ry=lower_bound(oy+1,oy+leny+1,y[i]+t+1)-oy;
		E[lx].push_back((node){ly,ry,1});
		E[rx].push_back((node){ly,ry,-1});
	}
	for(int i=1;i<lenx;++i){
		for(auto p:E[i])for(int j=p.l;j<p.r;++j)cov[j]+=p.v;
		for(int j=1;j<leny;++j)if(cov[j])res=(res+1ll*(ox[i+1]-ox[i])*(oy[j+1]-oy[j]))%mod;
	}
	return res;
}
int inv[4]={0,1,499122177,332748118};
int cal(int l,int r){
	int res=0;
	if(r-l<3)for(int i=l;i<=r;++i)res=(res+cal(i))%mod;
	else for(int i=0,sum=0,s;i<4;++i){
			s=sum=(sum+cal(l+i))%mod;
			for(int j=0;j<i;++j)s=1ll*s*(r-l-j)%mod*inv[i-j]%mod;
			for(int j=i+1;j<4;++j)s=1ll*s*(r-l-j)%mod*(mod-inv[j-i])%mod;
			res=(res+s)%mod;
		}
	return res;
}
int main(){
	n=gi();T=gi();
	for(int i=1;i<=n;++i)x[i]=gi(),y[i]=gi();
	int len=0;o[++len]=0;o[++len]=T;
	for(int i=1;i<=n;++i)
		for(int j=i+1;j<=n;++j){
			int tmp=max(abs(x[i]-x[j]),abs(y[i]-y[j]))-1>>1;
			if(tmp<=T)o[++len]=tmp;
		}
	sort(o+1,o+len+1);len=unique(o+1,o+len+1)-o-1;
	for(int i=1;i<len;++i)ans=(ans+cal(o[i],o[i+1]-1))%mod;
	ans=(1ll*T*cal(T)-ans+mod)%mod;printf("%d\n",ans);
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define SZ 666666
#define yn yyn
int n,t,x[SZ],y[SZ];
int ys[SZ],yn;
pair<int,pair<pii,int> > os[SZ]; int on;
const int M=128;
pii operator + (pii a,pii b)
{
	if(a.fi<b.fi) return a;
	if(b.fi<a.fi) return b;
	return pii(a.fi,a.se+b.se);
}
pii seg[SZ]; int tg[SZ],ls[SZ],rs[SZ];
void pd(int x)
{
	if(!tg[x]) return;
	seg[x].fi+=tg[x];
	if(x<=M)
		tg[x+x]+=tg[x],tg[x+x+1]+=tg[x];
	tg[x]=0;
}
void upd(int x)
{
	pd(x+x); pd(x+x+1);
	seg[x]=seg[x+x]+seg[x+x+1];
}
void edt(int x,int l,int r,int v)
{
	if(l>r||rs[x]<l||r<ls[x]) return;
	pd(x);
	if(l<=ls[x]&&rs[x]<=r)
	{
		tg[x]+=v; return;
	}
	edt(x+x,l,r,v);
	edt(x+x+1,l,r,v);
	upd(x);
}
map<int,ll> rss;
ll calc(int s)
{
	if(rss.count(s)) return rss[s];
	yn=0;
	for(int i=1;i<=n;++i)
		ys[++yn]=y[i]-s,ys[++yn]=y[i]+s+1;
	sort(ys+1,ys+1+yn); yn=unique(ys+1,ys+1+yn)-ys-1;
	int tot=ys[yn]-ys[1]; on=0;
	for(int i=1;i<=n;++i)
	{
		int L=lower_bound(ys+1,ys+1+yn,y[i]-s)-ys,
		R=lower_bound(ys+1,ys+1+yn,y[i]+s+1)-ys;
		os[++on]=mp(x[i]-s,mp(pii(L,R-1),1));
		os[++on]=mp(x[i]+s+1,mp(pii(L,R-1),-1));
	}
	sort(os+1,os+1+on);
	for(int i=1;i<=M+M;++i) seg[i]=pii(0,0),tg[i]=0;
	for(int i=1;i<yn;++i) seg[i+M]=pii(0,ys[i+1]-ys[i]);
	for(int i=M-1;i>=1;--i) seg[i]=seg[i+i]+seg[i+i+1];
	ll ans=0;
	for(int i=1;i<=on;++i)
		edt(1,os[i].se.fi.fi,os[i].se.fi.se,os[i].se.se),
		ans+=(tot-seg[1].se)*ll(os[i+1].fi-os[i].fi);
	return rss[s]=ans;
}
ll cd(int s)
{
	return calc(s)-calc(s-1);
}
const int MOD=998244353;
ll S1(ll x)
{return x*(x+1)/2%MOD;}
ll S2(ll x)
{
	ll t[]={x,x+1,2*x+1};
	for(int i=0;i<3;++i)
		if(t[i]%2==0) {t[i]/=2; break;}
	for(int i=0;i<3;++i)
		if(t[i]%3==0) {t[i]/=3; break;}
	return t[0]*(ll)t[1]%MOD*t[2]%MOD;
}
bool cp(ll l,ll r)
{
	if(l>=r) return 1;
	return cd(r)-cd(l)==(r-l)*(cd(l+1)-cd(l));
}
int main()
{
	for(int i=1;i<=M;++i) ls[i+M]=rs[i+M]=i;
	for(int i=M-1;i>=1;--i) ls[i]=ls[i+i],rs[i]=rs[i+i+1];
//	n=50,t=1e6;
	cin>>n>>t;
	for(int i=1;i<=n;++i)
//		x[i]=rand()*32+rand(),y[i]=rand()*32+rand();
		cin>>x[i]>>y[i];
//	ll aa=0;
//	for(int i=1;i<=t;++i) aa+=cd(i)*i,aa%=MOD;
//	cout<<aa<<"\n";
//	return 0;
	ll L=1,ans=0;
	while(L<=t)
	{
		if(L==t)
		{
			ans+=cd(L)%MOD*L;
			ans%=MOD;
			break;
		}
		ll u=cd(L+1)-cd(L);
		ll l=L+1,r=t;
		while(l<r)
		{
			ll m=(l+r+1)>>1;
			if(cd(m)-cd(m-1)!=u
			||(!cp(L,m))||(!cp(L,m-1))
			||(!cp(L,m-2))||(!cp(L,m-3)))
				r=m-1;
			else l=m;
		}
		ll b=cd(L),n=l-L;
		b%=MOD; u%=MOD;
		//(b+u*i)*(i+L)  i in [0,n]
		ans+=S2(n)*u+S1(n)*((u*L+b)%MOD)+L*b%MOD*(n+1);
		ans%=MOD;
		L=l+1;
	}
	ans=(ans%MOD+MOD)%MOD;
	cout<<ans<<"\n";
}

#include <bits/stdc++.h>

using namespace std;
typedef long long INT;
typedef double DO;
typedef pair<int, int> pii;
typedef pair<pii, int> pi3;
typedef vector<int> VI;

#define x first
#define y second
#define pb push_back
#define mp make_pair

int power(int a, int b, int c, int ans=1) {
	for (; b; b>>=1, a=(INT)a*a%c) if (b&1) ans=(INT)ans*a%c;
	return ans;
}

const int NN = 55;
int a[NN*NN], x[NN], y[NN], n;

const int mod = 998244353, M = 155;

pi3 p[NN*3];
int tmp[NN];

void erase(int &n, int x) {
	int u=lower_bound(tmp, tmp+n, x)-tmp;
	n--;
	for (int i=u; i<n; i++) tmp[i]=tmp[i+1];
}

void add(int &n, int x) {
	int u=upper_bound(tmp, tmp+n, x)-tmp;
	for (int i=n; i>u; i--) tmp[i]=tmp[i-1];
	tmp[u]=x; n++;
}

int calc(int n, int t) {
	int ans = 0;
	for (int i=0, j; i<n; i=j) {
		for (j=i+1; j<n && tmp[j-1]+2*t>=tmp[j]; j++);
		ans = (ans + 2LL*t+1+tmp[j-1]-tmp[i])%mod;
	}
	return ans;
}

int ff(int t) {
	if (t==0) return n;
	int nn=0;
	for (int i=0; i<n; i++) {
		p[nn++]=mp(mp(x[i]-t, 1), y[i]-t);
		p[nn++]=mp(mp(x[i]+t+1, -1), y[i]-t);
	}
	sort(p, p+nn);
	int tt = 0, ans = 0, pre = 0, prex = 0;
	for (int i=0, j; i<nn; i=j) {
		for (j=i; j<nn && p[i].x.x==p[j].x.x; j++) {
			if (p[j].x.y==-1) erase(tt, p[j].y);
			else add(tt, p[j].y);
		}
		if (i) ans=(ans+(INT)prex*(p[i].x.x-pre))%mod;
		pre=p[i].x.x; prex = calc(tt, t);
	}
	return ans;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

	int t;
	cin>>n>>t;
	for (int i=0; i<n; i++) scanf("%d%d", x+i, y+i);

	int nn=1; a[nn++]=t;
	for (int i=0; i<n; i++) for (int j=i+1; j<n; j++) {
		a[nn]=max(abs(x[i]-x[j]), abs(y[i]-y[j]))+1>>1;
		if (a[nn]>t) continue;
		nn++;
	}
	sort(a, a+nn); nn=unique(a, a+nn)-a;

	int ans = 0;
	for (int i=1; i<nn; i++) {
		if (a[i]-a[i-1]<6) {
			for (int j=a[i-1]; j<a[i]; j++) ans=(ans+ff(j))%mod;
			continue;
		}
		int now = 0;
		for (int j=0; j<4; j++) {
			int mid=1;
			for (int k=0; k<4; k++) if (k!=j) mid=(INT)mid*(a[i]-1-a[i-1]-k)%mod*power((j-k+mod)%mod, mod-2, mod)%mod;
			now = (now + ff(a[i-1]+j))%mod;
			ans = (ans + (INT)mid*now)%mod;
		}
	}

	ans = ((INT)t*ff(t)+mod-ans)%mod;
	cout << ans << endl;

	return 0;
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(a) int(a.size())
#define clr(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int mod=998244353;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
string to_string(string s) { return '"'+s+'"'; }
string to_string(const char *s) { return to_string((string)s); }
template<typename A,typename B> string to_string(pair<A,B> p) {
    return "("+to_string(p.fi)+","+to_string(p.se)+")";
}
template<typename T> string to_string(T v) {
    int fst=1;string ret="{";
    for(auto x:v) {
        if(!fst) ret+=",";
        fst=0,ret+=to_string(x);
    }
    ret+="}";return ret;
}
void dbg_out() { cerr<<endl; }
template<typename Head,typename... Tail> void dbg_out(Head H,Tail... T) {
    cerr<<" "<<to_string(H);
    dbg_out(T...);
}
#define dbg(...) cerr<<"{"<<#__VA_ARGS__<<"}:",dbg_out(__VA_ARGS__)

const int N=120;

int n,t,x[N],y[N],sx[N],sy[N],tx=0,ty=0;

int qpow(int a,int b) {
    int ret=1;
    while(b) {
        if(b&1) ret=1ll*ret*a%mod;
        a=1ll*a*a%mod,b>>=1;
    }
    return ret;
}

int find(int *s,int t,int x) {
    return lower_bound(s+1,s+t+1,x)-s;
}

vector<pii> ins[N],del[N];
int cov[N];

int f(int t) {
    tx=ty=0;
    for(int i=1;i<=n;i++) {
        int x1=x[i]-t,x2=x[i]+t+1,y1=y[i]-t,y2=y[i]+t+1;
        sx[++tx]=x1,sx[++tx]=x2,sy[++ty]=y1,sy[++ty]=y2;
    }
    sort(sx+1,sx+tx+1);tx=unique(sx+1,sx+tx+1)-sx-1;
    sort(sy+1,sy+ty+1);ty=unique(sy+1,sy+ty+1)-sy-1;
    for(int i=1;i<=ty;i++) ins[i].clear(),del[i].clear();
    for(int i=1;i<=n;i++) {
        int x1=x[i]-t,x2=x[i]+t+1,y1=y[i]-t,y2=y[i]+t+1;
        x1=find(sx,tx,x1),x2=find(sx,tx,x2);
        y1=find(sy,ty,y1),y2=find(sy,ty,y2);
        ins[y1].pb(mp(x1,x2));del[y2].pb(mp(x1,x2));
    }
    memset(cov,0,sizeof(cov));
    int ret=0;
    for(int i=1;i<=ty;i++) {
        if(i>1) {
            int sum=0;
            for(int j=1;j<tx;j++) if(cov[j]) inc(sum,sub(sx[j+1],sx[j]));
            inc(ret,1ll*sum*sub(sy[i],sy[i-1])%mod);
        }
        for(auto x:ins[i])
            for(int j=x.fi;j<x.se;j++) ++cov[j];
        for(auto x:del[i])
            for(int j=x.fi;j<x.se;j++) --cov[j];
    }
    return ret;
}

int ip(int *a,int d,int s,int x) {
    //d-deg poly
    //x=s,s+1,..,s+d
    //y=a_0,a_1,...,a_d
    int ret=0;
    for(int i=0;i<=d;i++) {
        int c=1;
        for(int j=0;j<=d;j++) if(i!=j) c=1ll*c*(sub(x,add(s,j)))%mod*qpow(sub(i,j),mod-2)%mod;
        inc(ret,1ll*c*a[i]%mod);
    }
    return ret;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
#endif
    n=gi(),t=gi();
    for(int i=1;i<=n;i++) x[i]=gi(),y[i]=gi();
    //dbg(f(0));return 0;
    vector<int> sec;
    sec.pb(0);sec.pb(t);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++) {
            int u=(max(abs(x[i]-x[j]),abs(y[i]-y[j]))-1)/2+1;
            if(u<=t) sec.pb(u);
        }
    sort(all(sec));
    sec.erase(unique(all(sec)),sec.end());
    int ans=1ll*t*f(t)%mod;
    for(int i=0;i<sz(sec)-1;i++) {
        int l=sec[i],r=sec[i+1]-1;
        if(r-l+1<=5) {
            for(int j=l;j<=r;j++) dec(ans,f(j));
        }
        else {
            int a[10];
            a[0]=f(l);
            for(int j=1;j<=3;j++) a[j]=add(a[j-1],f(l+j));
            dec(ans,ip(a,3,l,r));
        }
    }
    //for(int i=0;i<=t;i++) dbg(i,f(i));
    printf("%d\n",ans);
    return 0;
}

#include<bits/stdc++.h>

const int moder = 998244353;
const int inv2 = (moder + 1) >> 1;
const int inv3 = (moder + 1) / 3;
const int inv6 = 1ll * inv2 * inv3 % moder;
const int N = 60;
typedef std::pair <int, int> pii;

int sum1(int n){
    return 1ll * n * (n + 1) % moder * inv2 % moder;
}

int sum2(int n){
    return 1ll * n * (n + 1) % moder * (2 * n + 1) % moder * inv6 % moder;
}

int calc(int a, int b, int c, int t){
    return (1ll * a * t % moder * t + 1ll * b * t + c) % moder;
}

int ntime;
pii p[N];
bool vis[N];

struct event{
    int sit;
    int id;
    bool type;

    int getsit()const{
        return (sit << 1 | 1) + (type ? ntime + 1 : -ntime - 1);
    }

    bool operator < (const event &t){
        return getsit() < t.getsit() || (getsit() == t.getsit() && (type < t.type));
    }

    bool operator == (const event &t){
        return sit == t.sit && type == t.type;
    }
};

int main(){
    int n, t;
    scanf("%d%d", &n, &t);
    std::vector <event> xvec;
    for (int i = 0, x, y; i < n; ++ i){
        scanf("%d%d", &x, &y);
        p[i] = {x, y};
        xvec.push_back({x, i, true});
        xvec.push_back({x, i, false});
    }
    std::vector <int> times;
    times.push_back(0);
    times.push_back((t + 1) << 1);
    for (int i = 0; i < n; ++ i){
        for (int j = i + 1; j < n; ++ j){
            int x = std::abs(p[j].first - p[i].first);
            if (x <= t << 1){
                times.push_back(x);
            }
            x = std::abs(p[j].second - p[i].second);
            if (x <= (t + 1) << 1){
                times.push_back(x);
            }
        }
    }
    std::sort(times.begin(), times.end());
    times.erase(std::unique(times.begin(), times.end()), times.end());
    int prevarea = 0;
    int ans = 0;
    for (int i = 0, sz = times.size(); i < sz - 1; ++ i){
        ntime = times[i];
        int left = ntime + (ntime & 1);
        int right = (times[i + 1] - 1) >> 1 << 1;
        if (left > right){
            continue;
        }
        std::sort(xvec.begin(), xvec.end());
        int a = 0, b = 0, c = 0;
        for (int j = 0, k = 0, sz1 = xvec.size(); j < sz1; j = k){
            while (k < sz1 && xvec[k] == xvec[j]){
                vis[xvec[k].id] = !xvec[k].type;
                ++ k;
            }
            if (k == sz1){
                break;
            }
            int a1 = (xvec[k].type ? 1 : -1) - (xvec[j].type ? 1 : -1);
            int b1 = (xvec[k].sit << 1 | 1) - (xvec[j].sit << 1 | 1);
            b1 += (xvec[k].type ? 1 : -1) - (xvec[j].type ? 1 : -1);
            a1 += a1 < 0 ? moder : 0;
            b1 += a1 < 0 ? moder : 0;
            int a2 = 0, b2 = 0;
            std::vector <event> yvec;
            for (int i = 0; i < n; ++ i){
                if (vis[i]){
                    yvec.push_back({p[i].second, i, true});
                    yvec.push_back({p[i].second, i, false});
                }
            }
            std::sort(yvec.begin(), yvec.end());
            int level = 0;
            for (int u = 0, sz2 = yvec.size(); u < sz2 - 1; ++ u){
                level += yvec[u].type ? -1 : 1;
                if (level){
                    a2 += (yvec[u + 1].type ? 1 : -1) - (yvec[u].type ? 1 : -1);
                    b2 += (yvec[u + 1].sit << 1 | 1) - (yvec[u].sit << 1 | 1);
                    b2 += (yvec[u + 1].type ? 1 : -1) - (yvec[u].type ? 1 : -1);
                    a2 %= moder;
                    b2 %= moder;
                }
            }
            a2 += a2 < 0 ? moder : 0;
            b2 += b2 < 0 ? moder : 0;
            a = (a + 1ll * a1 * a2) % moder;
            b = (b + 1ll * a1 * b2 + 1ll * a2 * b1) % moder;
            c = (c + 1ll * b1 * b2) % moder;
        }
        ans = (ans + 1ll * (calc(a, b, c, left) - prevarea) * left) % moder;
        int coe1 = 16ll * a % moder;
        int coe2 = (4ll * b - 8ll * a) % moder;
        ans = (ans + 1ll * coe1 * (sum2(right >> 1) - sum2(left >> 1))) % moder;
        ans = (ans + 1ll * coe2 * (sum1(right >> 1) - sum1(left >> 1))) % moder;
        ans += ans < 0 ? moder : 0;
        prevarea = calc(a, b, c, right);
    }
    for (int i = 0; i < 3; ++ i){
        ans = 1ll * ans * inv2 % moder;
    }
    printf("%d\n", ans);
    return 0;
}

#include <bits/stdc++.h>
#define FR first
#define SE second
#define last last2
#define inf 0x3f3f3f3f
#define MOD 998244353
#define inv2 499122177
#define inv6 166374059

using namespace std;

typedef long long ll;
typedef pair<int,int> pr;

pr p[55];

int calc(int T,int n) {
  static pr a[105],b[205];
  int tot=0;
  for(int i=1;i<=n;i++) {
  	a[++tot]=pr(p[i].FR-T,i);
  	a[++tot]=pr(p[i].FR+T+1,-i);
  }
  sort(a+1,a+tot+1);
  int ans=0,cnt=0;
  for(int i=1,j=0;i<=tot;i=j+1) {
  	while (j<tot&&a[j+1].FR==a[i].FR) j++;
  	for(int k=i;k<=j;k++) {
  		int t=abs(a[k].SE);
  		if (a[k].SE>0) {
  			b[++cnt]=pr(p[t].SE-T,1);
  			b[++cnt]=pr(p[t].SE+T+1,-1);
		  }
		else {
			b[++cnt]=pr(p[t].SE-T,-1);
			b[++cnt]=pr(p[t].SE+T+1,1);
		}
	  }
	sort(b+1,b+cnt+1);
	int s=0,val=0;
	for(int k=1;k<=cnt;k++) {
		if (val) s+=b[k].FR-b[k-1].FR;
		val+=b[k].SE;
	}
	ans=(ans+(ll)s*(a[j+1].FR-a[i].FR))%MOD;
  }
  return ans;
}

inline ll S1(ll n) {
  return n*(n+1)%MOD*inv2%MOD;
}

inline ll S2(ll n) {
  return n*(n+1)%MOD*(2LL*n+1)%MOD*inv6%MOD;
}

int getsum(int l,int r,int n) {
  if (r-l<3) {
  	int ans=0;
  	for(int i=l;i<=r;i++) ans=(ans+calc(i,n))%MOD;
  	return ans;
  }
  else {
  	ll s1=calc(l,n),s2=calc(l+1,n),s3=calc(l+2,n);
  	ll v0=s1,v2=((s3-s1+MOD)*inv2-(s2-s1+MOD)%MOD+MOD)%MOD,v1=((s2-v0-v2)%MOD+MOD)%MOD;
  	return (v0*(r-l+1)+v1*S1(r-l)+v2*S2(r-l))%MOD;
  }
}

int a[2505];

int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  for(int i=1;i<=n;i++) {
  	int x,y;
  	scanf("%d%d",&x,&y);
  	p[i]=pr(x,y);
  }
  int cnt=0;
  a[++cnt]=0;a[++cnt]=m;
  for(int i=1;i<=n;i++)
    for(int j=i+1;j<=n;j++) {
    	int x=max((abs(p[i].FR-p[j].FR)+1)>>1,(abs(p[i].SE-p[j].SE)+1)>>1);
    	if (x<m) a[++cnt]=x;
	}
  sort(a+1,a+cnt+1);
  cnt=unique(a+1,a+cnt+1)-a-1;
  int ans=(ll)m*calc(m,n)%MOD;
  for(int i=1;i<cnt;i++) ans=(ans-getsum(a[i],a[i+1]-1,n)+MOD)%MOD;
  printf("%d\n",ans);
  return 0;
}

#include <bits/stdc++.h>
#define FR first
#define SE second
#define last last2
#define inf 0x3f3f3f3f
#define MOD 998244353
#define inv2 499122177
#define inv6 166374059

using namespace std;

typedef long long ll;
typedef pair<int,int> pr;

pr p[55];

int calc(int T,int n) {
  static pr a[105],b[205];
  int tot=0;
  for(int i=1;i<=n;i++) {
  	a[++tot]=pr(p[i].FR-T,i);
  	a[++tot]=pr(p[i].FR+T+1,-i);
  }
  sort(a+1,a+tot+1);
  int ans=0,cnt=0;
  for(int i=1,j=0;i<=tot;i=j+1) {
  	while (a[j+1].FR==a[i].FR) j++;
  	for(int k=i;k<=j;k++) {
  		int t=abs(a[k].SE);
  		if (a[k].SE>0) {
  			b[++cnt]=pr(p[t].SE-T,1);
  			b[++cnt]=pr(p[t].SE+T+1,-1);
		  }
		else {
			b[++cnt]=pr(p[t].SE-T,-1);
			b[++cnt]=pr(p[t].SE+T+1,1);
		}
	  }
	sort(b+1,b+cnt+1);
	int s=0,val=0;
	for(int k=1;k<=cnt;k++) {
		if (val>0) s+=b[k].FR-b[k-1].FR;
		val+=b[k].SE;
	}
	ans=(ans+(ll)s*(a[j+1].FR-a[i].FR))%MOD;
  }
  return ans;
}

inline ll S1(ll n) {
  return n*(n+1)%MOD*inv2%MOD;
}

inline ll S2(ll n) {
  return n*(n+1)%MOD*(2LL*n+1)%MOD*inv6%MOD;
}

int getsum(int l,int r,int n) {
  if (r-l<3) {
  	int ans=0;
  	for(int i=l;i<=r;i++) ans=(ans+calc(i,n))%MOD;
  	return ans;
  }
  else {
  	ll s1=calc(l,n),s2=calc(l+1,n),s3=calc(l+2,n);
  	ll v0=s1,v2=((s3-s1+MOD)*inv2-(s2-s1+MOD)%MOD+MOD)%MOD,v1=((s2-v0-v2)%MOD+MOD)%MOD;
  	return (v0*(r-l+1)+v1*S1(r-l)+v2*S2(r-l))%MOD;
  }
}

int a[2505];

int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  for(int i=1;i<=n;i++) {
  	int x,y;
  	scanf("%d%d",&x,&y);
  	p[i]=pr(x,y);
  }
  int cnt=0;
  a[++cnt]=0;a[++cnt]=m;
  for(int i=1;i<=n;i++)
    for(int j=i+1;j<=n;j++) {
    	int x=max((abs(p[i].FR-p[j].FR)+1)>>1,(abs(p[i].SE-p[j].SE)+1)>>1);
    	if (x<m) a[++cnt]=x;
	}
  sort(a+1,a+cnt+1);
  cnt=unique(a+1,a+cnt+1)-a-1;
  int ans=(ll)m*calc(m,n)%MOD;
  for(int i=1;i<cnt;i++) ans=(ans-getsum(a[i],a[i+1]-1,n)+MOD)%MOD;
  printf("%d\n",ans);
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int md = 998244353;

inline void add(int &x, int y) {
  x += y;
  if (x >= md) {
    x -= md;
  }
}

inline void sub(int &x, int y) {
  x -= y;
  if (x < 0) {
    x += md;
  }
}

inline int mul(int x, int y) {
  return (long long)x * y % md;
}

int main() {
#ifdef wxh010910
  freopen("input.txt", "r", stdin);
#endif
  int n, t;
  scanf("%d %d", &n, &t);
  vector<int> x(n), y(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &x[i], &y[i]);
  }
  vector<int> all;
  all.push_back(0);
  all.push_back(t + 1);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < i; ++j) {
      int s = max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1 >> 1;
      if (s <= t) {
        all.push_back(s);
      }
    }
  }
  sort(all.begin(), all.end());
  all.erase(unique(all.begin(), all.end()), all.end());
  auto get = [&](int t) {
    vector<int> dx, dy;
    for (int i = 0; i < n; ++i) {
      dx.push_back(x[i] - t);
      dx.push_back(x[i] + t + 1);
      dy.push_back(y[i] - t);
      dy.push_back(y[i] + t + 1);
    }
    sort(dx.begin(), dx.end());
    sort(dy.begin(), dy.end());
    dx.erase(unique(dx.begin(), dx.end()), dx.end());
    dy.erase(unique(dy.begin(), dy.end()), dy.end());
    vector<vector<pair<pair<int, int>, int>>> events(dx.size());
    for (int i = 0; i < n; ++i) {
      int xl = lower_bound(dx.begin(), dx.end(), x[i] - t) - dx.begin();
      int xr = lower_bound(dx.begin(), dx.end(), x[i] + t + 1) - dx.begin();
      int yl = lower_bound(dy.begin(), dy.end(), y[i] - t) - dy.begin();
      int yr = lower_bound(dy.begin(), dy.end(), y[i] + t + 1) - dy.begin();
      events[xl].emplace_back(make_pair(yl, yr), 1);
      events[xr].emplace_back(make_pair(yl, yr), -1);
    }
    vector<int> cnt(dy.size());
    int answer = 0;
    for (int i = 0; i < dx.size() - 1; ++i) {
      for (auto p : events[i]) {
        for (int j = p.first.first; j < p.first.second; ++j) {
          cnt[j] += p.second;
        }
      }
      for (int j = 0; j < dy.size() - 1; ++j) {
        if (cnt[j]) {
          add(answer, mul(dx[i + 1] - dx[i], dy[j + 1] - dy[j]));
        }
      }
    }
    return answer % md;
  };
  const int m = 3;
  vector<int> inv_fact(m + 1);
  inv_fact[0] = inv_fact[1] = 1;
  inv_fact[2] = (md + 1) / 2;
  inv_fact[3] = (md + 1) / 6;
  vector<int> f(m + 1), foo(m + 1), bar(m + 1);
  auto lagrange = [&](int n) {
    for (int i = 0, coef = 1; i <= m; ++i) {
      foo[i] = coef;
      coef = mul(coef, n - i);
    }
    for (int i = 0, coef = 1; i <= m; ++i) {
      bar[i] = coef;
      coef = mul(coef, m - n - i + md);
    }
    int result = 0;
    for (int i = 0; i <= m; ++i) {
      add(result, mul(f[i], mul(mul(foo[i], bar[m - i]), mul(inv_fact[i], inv_fact[m - i]))));
    }
    return result;
  };
  auto solve = [&](int l, int r) {
    if (r - l <= 3) {
      int answer = 0;
      for (int i = l; i <= r; ++i) {
        add(answer, get(i));
      }
      return answer;
    } else {
      for (int i = 0; i <= m; ++i) {
        f[i] = get(l + i);
        if (i) {
          add(f[i], f[i - 1]);
        }
      }
      return lagrange(r - l);
    }
  };
  int answer = mul(t + 1, get(t));
  for (int i = 0; i < all.size() - 1; ++i) {
    sub(answer, solve(all[i], all[i + 1] - 1));
  }
  printf("%d\n", answer);
  return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include <climits>
#include <chrono>
#include <random>
using namespace std;

#define PB push_back
#define MP make_pair
#define SZ(v) ((int)(v).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n) FORE(i,0,n)
#define FORSZ(i,a,v) FOR(i,a,SZ(v))
#define REPSZ(i,v) REP(i,SZ(v))
typedef long long ll;
typedef unsigned long long ull;
ull gcd(ull a, ull b) { return b == 0 ? a : gcd(b, a%b); }

const int MAXTREE=50;
const int MOD=998244353;
const int INV6=166374059;
const int MINCOORD=-1000000000;
const int MAXCOORD=+1000000000;
struct P { int x,y; P() {} P(int x,int y):x(x),y(y) {} };
P operator-(const P &a,const P &b) { return P(a.x-b.x,a.y-b.y); }
bool operator==(const P &a,const P &b) { return a.x==b.x&&a.y==b.y; }
struct Pol { vector<P> p; };

int ntree,tlast;
P t[MAXTREE];

void rotate(P &p) { p=P(-p.y,+p.x); }
void rotate(Pol &pol) { REPSZ(i,pol.p) rotate(pol.p[i]); }
void flip(P &p) { swap(p.x,p.y); }
void flip(Pol &pol) { REPSZ(i,pol.p) flip(pol.p[i]); reverse(pol.p.begin(),pol.p.end()); }

P infleftup(const P &p) { int t=min(p.x-MINCOORD,MAXCOORD-p.y); return P(p.x-t,p.y+t); }
P infleftdown(const P &p) { int t=min(p.x-MINCOORD,p.y-MINCOORD); return P(p.x-t,p.y-t); }
P infrightup(const P &p) { int t=min(MAXCOORD-p.x,MAXCOORD-p.y); return P(p.x+t,p.y+t); }
P infrightdown(const P &p) { int t=min(MAXCOORD-p.x,p.y-MINCOORD); return P(p.x+t,p.y-t); }

int getdelta(const P &a,const P &b) { P ba=b-a; assert(ba.y==0||abs(ba.y)==abs(ba.x)); return ba.y/ba.x; }
int getdir(const P &a,const P &b) {
	P ba=b-a; int mag=max(abs(ba.x),abs(ba.y)); assert(mag!=0&&ba.x%mag==0&&ba.y%mag==0); ba.x/=mag,ba.y/=mag;
	if(ba==P(1,1)) return 0; if(ba==P(1,0)) return 1; if(ba==P(1,-1)) return 2; if(ba==P(0,-1)) return 3; if(ba==P(-1,-1)) return 4; if(ba==P(-1,0)) return 5; if(ba==P(-1,1)) return 6; if(ba==P(0,1)) return 7; assert(false); return -1;
}

int gety(int x,const vector<P> &path) {
	int idx=0; while(idx+1<SZ(path)&&path[idx+1].x<=x) ++idx; assert(idx+1<SZ(path));
	int v=getdelta(path[idx],path[idx+1]);
	return path[idx].y+(x-path[idx].x)*v;
}

vector<pair<P,P>> segmentsbeloworequal(P a,P b,const vector<P> &path) {
	bool swapab=false; if(a.x>b.x) swapab=true,swap(a,b);
	P ba=b-a; vector<pair<P,P>> ret;
	if(ba.x==0) {
		int x=a.x,py=gety(x,path); assert(!swapab);
		if(a.y<=py) ret.PB(MP(a,P(x,min(py,b.y)))); else if(b.y<=py) ret.PB(MP(P(x,py),b));
	} else {
		int x=a.x,y=a.y,u=getdelta(a,b),idx=0; P oth=a;
		while(true) {
			while(idx+1<SZ(path)&&path[idx+1].x<=x) ++idx; assert(idx+1<SZ(path));
			int v=getdelta(path[idx],path[idx+1]);
			int py=path[idx].y+(x-path[idx].x)*v;
			if(x==b.x) { if(y<=py) ret.PB(MP(oth,b)); break; }
			int dx=min(b.x-x,path[idx+1].x-x);
			if(y<=py) {
				if(u-v>=1) { int t=(py-y)/(u-v); if(t<dx) ret.PB(MP(oth,P(x+t,y+u*t))); }
			} else {
				if(v-u>=1) { int t=(y-py-1)/(v-u); if(t<dx) oth=P(x+t+1,y+u*(t+1)); }
			}
			x+=dx,y+=u*dx;
		}
	}
	if(swapab) { swapab=false,swap(a,b),reverse(ret.begin(),ret.end()); REPSZ(i,ret) swap(ret[i].first,ret[i].second); }
	//printf("\t\tsegments of (%d,%d)-(%d,%d) <= path:",a.x,a.y,b.x,b.y); REPSZ(i,ret) printf(" (%d,%d)..(%d,%d)",ret[i].first.x,ret[i].first.y,ret[i].second.x,ret[i].second.y); puts("");
	return ret;
}
bool isbeloworequal(const P &a,const vector<P> &path) {
	return a.y<=gety(a.x,path);
}
bool isinside(const P &p,const Pol &pol) {
	if(SZ(pol.p)==1) return pol.p[0]==p;
	bool ret=false;
	REPSZ(i,pol.p) {
		P a=pol.p[i],b=pol.p[(i+1)%SZ(pol.p)],c=pol.p[(i+2)%SZ(pol.p)],d=pol.p[(i+3)%SZ(pol.p)];
		int pdir=getdir(a,b),cdir=getdir(b,c),ndir=getdir(c,d); int sgn,delta; P l,r; bool includefirst,includelast;
		if(cdir<4) {
			includefirst=pdir<3||pdir>=cdir+4,includelast=cdir!=3&&ndir>=4&&ndir<=cdir+4;
			if(cdir==3) {
				sgn=includefirst?+1:0,delta=0,l=r=b; ++l.y,++r.y;
			} else {
				sgn=+1,delta=getdelta(b,c); l=b,r=c; ++l.y,++r.y; if(!includefirst) ++l.x,l.y+=delta; if(!includelast) --r.x,r.y-=delta;
			}
		} else {
			includefirst=pdir!=7&&pdir>=cdir-4,includelast=cdir!=7&&ndir<=cdir-4;
			if(cdir==7) {
				sgn=includefirst?-1:0,delta=0,l=r=b;
			} else {
				sgn=-1,delta=getdelta(c,b),l=c,r=b; if(!includefirst) --r.x,r.y-=delta; if(!includelast) ++l.x,l.y+=delta;
			}
		}
		//printf("\t\t\ttestinside (%d,%d): (%d,%d)-(%d,%d) -> (%d,%d)..(%d,%d)\n",p.x,p.y,b.x,b.y,c.x,c.y,l.x,l.y,r.x,r.y);
		if(sgn!=0&&l.x<=p.x&&p.x<=r.x&&p.y<l.y+(p.x-l.x)*delta) ret=!ret;
	}
	return ret;
}
void updatepol(Pol &pol,bool prvonpol,const P p,const vector<P> &path,const Pol &orig) {
	//printf("\t\t\tupdate pol with (%d,%d) [prvonpol=%s]\n",p.x,p.y,SZ(pol.p)==0?"unknown":prvonpol?"true":"false");
	if(SZ(pol.p)>=1&&p==pol.p[SZ(pol.p)-1]) return;
	if(!prvonpol&&SZ(pol.p)>=1) {
		P a=pol.p[SZ(pol.p)-1],b=p;
		//printf("\t\ttesting path vertexes between (%d,%d) and (%d,%d)\n",a.x,a.y,b.x,b.y);
		bool swapab=false; if(a.x>b.x) swapab=true,swap(a,b);
		int ay=gety(a.x,path),by=gety(b.x,path);
		//printf("\t\ttesting path vertexes between (%d,%d->%d) and (%d,%d->%d)\n",a.x,a.y,ay,b.x,b.y,by);
		if(ay!=a.y) { assert(ay==a.y+1); if(isinside(P(a.x,a.y+1),orig)) ++a.y; else ++a.x,--ay; }
		if(by!=b.y) { assert(by==b.y+1); if(isinside(P(b.x,b.y+1),orig)) ++b.y; else --b.x,--by; }
		//printf("\t\ttesting path vertexes between (%d,%d->%d) and (%d,%d->%d)\n",a.x,a.y,ay,b.x,b.y,by);
		vector<P> extra;
		if(!(a==pol.p[SZ(pol.p)-1])) extra.PB(a);
		REPSZ(i,path) if(a.x<path[i].x&&path[i].x<b.x) extra.PB(path[i]);
		if(!(b==p)&&!(b==a)) extra.PB(b);
		if(swapab)  reverse(extra.begin(),extra.end());
		REPSZ(i,extra) pol.p.PB(extra[i]);
		//printf("extra:"); REPSZ(i,extra) printf(" (%d,%d)",extra[i].x,extra[i].y); puts("");
	}
	if(SZ(pol.p)==0||!(p==pol.p[SZ(pol.p)-1])) pol.p.PB(p);
}

Pol cutabove(Pol pol,const vector<P> &path) {
	if(SZ(pol.p)==0) return pol;
	//printf("\tpath:"); REPSZ(i,path) printf(" (%d,%d)",path[i].x,path[i].y); puts("");
	//printf("\tpol:"); REPSZ(i,pol.p) printf(" (%d,%d)",pol.p[i].x,pol.p[i].y); puts("");
	Pol ret;
	if(SZ(pol.p)==1) return isbeloworequal(pol.p[0],path)?pol:ret;
	bool prvonpol=false;
	REPSZ(i,pol.p) {
		P a=pol.p[i],b=pol.p[(i+1)%SZ(pol.p)];
		vector<pair<P,P>> segments=segmentsbeloworequal(a,b,path);
		if(SZ(segments)==0||!(segments[0].first==a)) prvonpol=false;
		REPSZ(k,segments) {
			if(segments[k].first==b) {
				assert(segments[k].second==b); assert(k==SZ(segments)-1);
				prvonpol=false;
			} else {
				updatepol(ret,prvonpol,segments[k].first,path,pol);
				if(segments[k].first==segments[k].second) {
					prvonpol=false;
				} else if(segments[k].second==b) {
					prvonpol=true;
				} else {
					updatepol(ret,true,segments[k].second,path,pol);
					prvonpol=false;
				}
			}
		}
	}
	if(SZ(ret.p)>=1) {
		if(!(ret.p[0]==pol.p[0])) prvonpol=false;
		updatepol(ret,prvonpol,ret.p[0],path,pol);
		if(SZ(ret.p)>=2&&ret.p[SZ(ret.p)-1]==ret.p[0]) ret.p.pop_back();
	}
	//printf("\tret:"); REPSZ(i,ret.p) printf(" (%d,%d)",ret.p[i].x,ret.p[i].y); puts("");
	return ret;
}

Pol cut(Pol pol,P a,P b,bool winequal) {
	int nrot=0,nflip=0;
	while(b.y<=a.y||b.x<a.x) rotate(pol),rotate(a),rotate(b),++nrot;
	if(b.y-a.y<b.x-a.x) flip(pol),flip(a),flip(b),++nflip;
	P d=b-a; // d.y>=d.x>=0
	//printf("\ta=(%d,%d) b=(%d,%d) d=(%d,%d)\n",a.x,a.y,b.x,b.y,d.x,d.y);
	//printf("\tpol:"); REPSZ(k,pol.p) printf(" (%d,%d)",pol.p[k].x,pol.p[k].y); puts("");
	int between=d.y-1;
	int asteps=between/2,bsteps=between/2,turn=winequal?0:1; if(between%2==1) if(turn==0) ++asteps,turn=1; else ++bsteps,turn=0;
	vector<P> path; int y=a.y+asteps;
	if(d.x==d.y) {
		P m(a.x+asteps+(turn==0?1:0),y); path.PB(infleftup(m)); path.PB(infrightdown(m));
	} else if(d.x==0) {
		if(asteps<bsteps) { assert(turn==0); ++asteps,turn=1; } if(bsteps<asteps) { assert(turn==1); ++bsteps,turn=0; } assert(asteps==bsteps);
		P l(a.x-asteps,y),r(a.x+asteps,y); path.PB(turn==0?infleftup(l):infleftdown(l)); path.PB(l); if(l.x!=r.x||l.y!=r.y) path.PB(r); path.PB(turn==0?infrightup(r):infrightdown(r));
	} else {
		P l(a.x+d.x-bsteps-(turn==0?0:1),y),r(a.x+asteps+(turn==0?1:0),y); path.PB(infleftup(l)); path.PB(l); path.PB(r); path.PB(infrightdown(r));
	}
	pol=cutabove(pol,path);

	while(nflip%2!=0) flip(pol),flip(a),flip(b),++nflip;
	while(nrot%4!=0) rotate(pol),rotate(a),rotate(b),++nrot;
	return pol;
}

int sum(int a,int b) { return (ll)(a+b)*(b-a+1)/2%MOD; }
int sumsq(int a,int b) { return ((ll)2*a*a+(ll)2*b*b+(ll)2*a*b+b-a)%MOD*(b-a+1)%MOD*INV6%MOD; }

int calcsum(const P &l,const P &r,int delta) {
	int y=l.y%MOD; if(y<0) y+=MOD; int x=l.x%MOD; if(x<0) x+=MOD;
	if(delta==0) { // sum(x=lx..rx,x*ly)
		return (ll)sum(l.x,r.x)*y%MOD;
	} else if(delta==1) { // sum(x=lx..rx,x*(ly+x-lx))=sum(x=lx..rx,x)*(ly-lx)+sum(x=lx..rx,x*x)
		return ((ll)sum(l.x,r.x)*(y+MOD-x)+sumsq(l.x,r.x))%MOD;
	} else if(delta==-1) { // sum(x=lx..rx,x*(ly+lx-x))=sum(x=lx..rx,x)*(ly+lx)-sum(x=lx..rx,x*x)
		return ((ll)sum(l.x,r.x)*(y+x)+MOD-sumsq(l.x,r.x))%MOD;
	} else {
		assert(false);
	}
}

int xcalc(Pol pol) {
	int ret=0;
	//printf("xcalc:"); REPSZ(i,pol.p) printf(" (%d,%d)",pol.p[i].x,pol.p[i].y); puts("");
	if(SZ(pol.p)>=2) REPSZ(i,pol.p) {
		P a=pol.p[i],b=pol.p[(i+1)%SZ(pol.p)],c=pol.p[(i+2)%SZ(pol.p)],d=pol.p[(i+3)%SZ(pol.p)];
		int pdir=getdir(a,b),cdir=getdir(b,c),ndir=getdir(c,d); int sgn,delta; P l,r; bool includefirst,includelast;
		if(cdir<4) {
			includefirst=pdir<3||pdir>=cdir+4,includelast=cdir!=3&&ndir>=4&&ndir<=cdir+4;
			if(cdir==3) {
				sgn=includefirst?+1:0,delta=0,l=r=b; ++l.y,++r.y;
			} else {
				sgn=+1,delta=getdelta(b,c); l=b,r=c; ++l.y,++r.y; if(!includefirst) ++l.x,l.y+=delta; if(!includelast) --r.x,r.y-=delta;
			}
		} else {
			includefirst=pdir!=7&&pdir>=cdir-4,includelast=cdir!=7&&ndir<=cdir-4;
			if(cdir==7) {
				sgn=includefirst?-1:0,delta=0,l=r=b;
			} else {
				sgn=-1,delta=getdelta(c,b),l=c,r=b; if(!includefirst) --r.x,r.y-=delta; if(!includelast) ++l.x,l.y+=delta;
			}
		}
		int cur=sgn!=0&&l.x<=r.x?calcsum(l,r,delta):0;
		//printf("\t\tcur=%d sgn=%d l=(%d,%d) r=(%d,%d) delta=%d dir=(%d,%d,%d)\n",cur,sgn,l.x,l.y,r.x,r.y,delta,pdir,cdir,ndir);
		if(sgn==+1) ret=(ret+cur)%MOD; else ret=(ret+MOD-cur)%MOD;
	}
	if(SZ(pol.p)==1) ret=(ret+pol.p[0].x)%MOD;
	//printf("xcalc:"); REPSZ(i,pol.p) printf(" (%d,%d)",pol.p[i].x,pol.p[i].y); printf(" = %d\n",ret);
	return ret;
}

Pol cutbelow(Pol pol,vector<P> path) {
	REP(rep,2) { rotate(pol); REPSZ(i,path) rotate(path[i]); } reverse(path.begin(),path.end());
	pol=cutabove(pol,path);
	REP(rep,2) { rotate(pol); REPSZ(i,path) rotate(path[i]); } reverse(path.begin(),path.end());
	return pol;
}

int calc(Pol pol) {
	//printf("\tcalc:"); REPSZ(i,pol.p) printf(" (%d,%d)",pol.p[i].x,pol.p[i].y); puts("");
	int ret=0;
	REP(rep,4) {
		vector<P> upath; upath.PB(infleftdown(P(0,0))); upath.PB(infrightup(P(0,0)));
		vector<P> lpath; lpath.PB(P(MINCOORD,0)); lpath.PB(P(1,0)); lpath.PB(infrightdown(P(1,0)));
		Pol cpol=cutbelow(cutabove(pol,upath),lpath);
		ret=(ret+xcalc(cpol))%MOD;
		rotate(pol);
	}
	return ret;
}

int solve() {
	if(tlast==0) return 0;
	int ret=0;
	REP(i,ntree) {
		//printf("processing %d\n",i);
		Pol pol;
		pol.p.PB(P(t[i].x-tlast,t[i].y+tlast));
		pol.p.PB(P(t[i].x+tlast,t[i].y+tlast));
		pol.p.PB(P(t[i].x+tlast,t[i].y-tlast));
		pol.p.PB(P(t[i].x-tlast,t[i].y-tlast));
		//printf("\tpol:"); REPSZ(k,pol.p) printf(" (%d,%d)",pol.p[k].x,pol.p[k].y); puts("");
		REP(j,ntree) if(j!=i) {
			pol=cut(pol,t[i],t[j],i<j);
			//printf("\tpol:"); REPSZ(k,pol.p) printf(" (%d,%d)",pol.p[k].x,pol.p[k].y); puts("");
		}
		//printf("\tpol:"); REPSZ(k,pol.p) printf(" (%d,%d)",pol.p[k].x,pol.p[k].y); puts("");
		REPSZ(k,pol.p) pol.p[k]=pol.p[k]-t[i];
		ret=(ret+calc(pol))%MOD;
	}
	return ret;
}

void run() {
	scanf("%d%d",&ntree,&tlast);
	REP(i,ntree) scanf("%d%d",&t[i].x,&t[i].y);
	printf("%d\n",solve());
}

int solvestupid() {
	int lx=INT_MAX,hx=INT_MIN,ly=INT_MAX,hy=INT_MIN;
	REP(i,ntree) lx=min(lx,t[i].x-tlast),hx=max(hx,t[i].x+tlast),ly=min(ly,t[i].y-tlast),hy=max(hy,t[i].y+tlast);
	vector<vector<int>> d(hx-lx+1,vector<int>(hy-ly+1,INT_MAX));
	REP(i,ntree) FORE(x,t[i].x-tlast,t[i].x+tlast) FORE(y,t[i].y-tlast,t[i].y+tlast) { int &v=d[x-lx][y-ly]; v=min(v,max(abs(x-t[i].x),abs(y-t[i].y))); }
	int ret=0; FORE(x,lx,hx) FORE(y,ly,hy) { int v=d[x-lx][y-ly]; if(v!=INT_MAX) ret+=v; } return ret;
}

void stress() {
	mt19937 rnd(12344);
	int mxn=100,mxt=100,mncoord=0,mxcoord=100;
	REP(rep,100000) {
		ntree=rnd()%mxn+1; tlast=rnd()%(mxt+1);
		set<pair<int,int>> seen; REP(i,ntree) while(true) { t[i].x=rnd()%(mxcoord-mncoord+1)+mncoord,t[i].y=rnd()%(mxcoord-mncoord+1)+mncoord; if(seen.count(MP(t[i].x,t[i].y))) continue; seen.insert(MP(t[i].x,t[i].y)); break; }
		int have=solve();
		int want=solvestupid();
		if(have==want) { if(rep%100==99) printf("."); continue; }
		puts(""); printf("%d %d\n",ntree,tlast); REP(i,ntree) printf("%d %d\n",t[i].x,t[i].y);
		printf("err have=%d want=%d\n",have,want);
		break;
	}
}

int main() {
	run();
	//stress();
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
char buf[1<<20],*p1,*p2;
#define GC (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?0:*p1++)
template<class T> inline void read(T &n){
	char ch=GC;T w=1,x=0;
	while(!isdigit(ch)){if(ch=='-') w=-1;ch=GC;}
	while(isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=GC;}
	n=x*w;
}
const int mod=998244353;
const int inv2=499122177;
const int inv6=166374059;
inline int add(int x,int y){
	x+=y;return x>=mod?x-mod:x;
}
inline int mul(int x,int y){
	return 1ll*x*y%mod;
}
inline int get1(int x){
	return mul(mul(x,x+1),inv2);
}
inline int get2(int x){
	return mul(mul(x,x+1),mul(2*x+1,inv6));
}
int n,T,x[55],y[55],bot[2005],tot;
int st[505],top;
int sum[2005],lazy[2005];
void clear(int l,int r,int id){
	sum[id]=lazy[id]=0;
	if(l==r) return;
	int mid=(l+r)>>1;
	clear(l,mid,id<<1);
	clear(mid+1,r,id<<1|1);
}
inline void update(int l,int r,int id){
	if(lazy[id]) sum[id]=st[r+1]-st[l];
	else{
		if(l==r) sum[id]=0;
		else sum[id]=sum[id<<1]+sum[id<<1|1];
	}
}
inline void putdown(int l,int r,int id){
	if(!lazy[id]) return;
	int mid=(l+r)>>1;
	lazy[id<<1]+=lazy[id];
	lazy[id<<1|1]+=lazy[id];
	update(l,mid,id<<1);
	update(mid+1,r,id<<1|1);
	lazy[id]=0;
}
void modify(int l,int r,int id,int L,int R,int val){
	if(L<=l&&r<=R){
		lazy[id]+=val;
		update(l,r,id);
		return;
	}
	int mid=(l+r)>>1;
	if(L<=mid) modify(l,mid,id<<1,L,R,val);
	if(R>mid) modify(mid+1,r,id<<1|1,L,R,val);
	update(l,r,id);
}
#define pii pair<int,int>
#define fir first
#define sec second
vector <pii> Add[505],Del[505];
int getval(int t){
	top=0;
	for(int i=1;i<=n;i++){
		st[++top]=x[i]-t,st[++top]=x[i]+t+1;
		st[++top]=y[i]-t,st[++top]=y[i]+t+1;
	}
	sort(st+1,st+top+1);
	top=unique(st+1,st+top+1)-(st+1);
	clear(1,top,1);
	for(int i=1;i<=top;i++) Add[i].clear(),Del[i].clear();
	for(int i=1;i<=n;i++){
		int L=lower_bound(st+1,st+top+1,y[i]-t)-st,R=lower_bound(st+1,st+top+1,y[i]+t+1)-st;
		int B=lower_bound(st+1,st+top+1,x[i]-t)-st,E=lower_bound(st+1,st+top+1,x[i]+t+1)-st;
		Add[B].push_back(make_pair(L,R-1)),Del[E].push_back(make_pair(L,R-1));
	}
	int ans=0;
	for(int i=1;i<top;i++){
		for(auto u:Add[i]) modify(1,top,1,u.fir,u.sec,1);
		for(auto u:Del[i]) modify(1,top,1,u.fir,u.sec,-1);
		ans=add(ans,mul(sum[1],st[i+1]-st[i]));
	}
	return ans;
}
int main(){
	read(n),read(T);
	for(int i=1;i<=n;i++) read(x[i]),read(y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int tmp=max(abs(x[i]-x[j]),abs(y[i]-y[j]))/2;
			if(tmp<=T) bot[++tot]=tmp;
		}
	bot[++tot]=0,bot[++tot]=T;
	sort(bot+1,bot+tot+1);
	tot=unique(bot+1,bot+tot+1)-(bot+1);
	int ans=mul(T,getval(T)),res=0;
	for(int i=1;i<tot;i++){
		if(bot[i+1]-bot[i]<=2){
			for(int j=bot[i];j<bot[i+1];j++) res=add(res,getval(j));
			continue;
		}
		int y0=getval(bot[i]),y1=getval(bot[i]+1),y2=getval(bot[i]+2);
		int A=mul(add(y2+y0,mod-y1*2),inv2),B=add(y1,mod-add(A,y0)),C=y0;
		res=add(res,mul(A,get2(bot[i+1]-bot[i]-1)));
		res=add(res,mul(B,get1(bot[i+1]-bot[i]-1)));
		res=add(res,mul(C,bot[i+1]-bot[i]));
	}
	cout<<add(ans,mod-res)<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>
struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
istream& operator>>(istream& in,ModInt<mod>& a){
	return (in>>a.a);
}
template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

template<class T>
struct Polynomial:vector<T>{
	using vector<T>::vector;
	Polynomial& operator+=(const Polynomial &x){
		if(vector<T>::size()<x.size())vector<T>::resize(x.size());
		for(int i=0;i<x.size();i++)vector<T>::operator[](i)+=x[i];
		return *this;
	}
	Polynomial& operator-=(const Polynomial &x){
		if(vector<T>::size()<x.size())vector<T>::resize(x.size());
		for(int i=0;i<x.size();i++)vector<T>::operator[](i)-=x[i];
		return *this;
	}
	Polynomial& operator*=(const Polynomial &x){
		if(vector<T>::size()==0||x.size()==0){
			vector<T>::clear();
			return *this;
		}
		Polynomial z(vector<T>::size()+x.size()-1);
		for(int i=0;i<vector<T>::size();i++){
			for(int j=0;j<x.size();j++){
				z[i+j]+=vector<T>::operator[](i)*x[j];
			}
		}
		return *this=z;
	}
	Polynomial& operator+=(const T &x){
		if(vector<T>::size()==0)vector<T>::resize(1);
		vector<T>::operator[](0)+=x;
		return *this;
	}
	Polynomial& operator-=(const T &x){
		if(vector<T>::size()==0)vector<T>::resize(1);
		vector<T>::operator[](0)-=x;
		return *this;
	}
	Polynomial& operator*=(const T &x){
		for(int i=0;i<vector<T>::size();i++)vector<T>::operator[](i)*=x;
		return *this;
	}
	Polynomial& operator/=(const T &x){
		for(int i=0;i<vector<T>::size();i++)vector<T>::operator[](i)/=x;
		return *this;
	}

	Polynomial operator+(const Polynomial &x)const{
		return Polynomial(*this)+=x;
	}
	Polynomial operator-(const Polynomial &x)const{
		return Polynomial(*this)-=x;
	}
	Polynomial operator*(const Polynomial &x)const{
		return Polynomial(*this)*=x;
	}
	Polynomial operator+(const T &x)const{
		return Polynomial(*this)+=x;
	}
	Polynomial operator-(const T &x)const{
		return Polynomial(*this)-=x;
	}
	Polynomial operator*(const T &x)const{
		return Polynomial(*this)*=x;
	}
	Polynomial operator/(const T &x)const{
		return Polynomial(*this)/=x;
	}

	T eval(T x){
		T ret=0;
		T powX=1;
		for(int i=0;i<vector<T>::size();i++){
			ret+=vector<T>::operator[](i)*powX;
			powX*=x;
		}
		return ret;
	}
};
template<class T>
Polynomial<T>simpleInterpolate(vector<T>x,vector<T>y){
	Polynomial<T>ret;
	for(int i=0;i<x.size();i++){
		Polynomial<T>prod={1};
		T div=1;
		for(int j=0;j<x.size();j++)if(i!=j){
			div*=x[i]-x[j];
			Polynomial<T>tmp={-x[j],1};
			prod*=tmp;
		}
		ret+=prod*y[i]/div;
	}
	return ret;
}

using poly=Polynomial<mint>;

int N,T;
int X[55],Y[55];

mint calcNumCovered(int t){
	vint ys;
	rep(i,N){
		ys.pb(Y[i]-t);
		ys.pb(Y[i]+t+1);
	}
	sort(all(ys));
	ys.erase(unique(all(ys)),ys.end());

	vector<pint>qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int lastX=0;

	mint ret=0;
	vint num(ys.size());
	rep(i,qs.size()){
		int x=qs[i].fi;
		int k=qs[i].se/2;

		int sum=0;
		for(int j=0;j+1<ys.size();j++)if(num[j])sum+=ys[j+1]-ys[j];
		ret+=mint(sum)*(x-lastX);
		lastX=x;

		int l=lower_bound(all(ys),Y[k]-t)-ys.begin();
		int r=lower_bound(all(ys),Y[k]+t+1)-ys.begin();
		int coef;
		if(qs[i].se&1)coef=-1;
		else coef=1;
		for(int j=l;j<r;j++)num[j]+=coef;
	}
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	mint ans;

	vint ts;
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			ma=(ma+1)/2;
			if(ma>T)continue;
			ts.pb(ma);
		}
	}
	ts.pb(0);ts.pb(T);
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		vector<mint>x(4),y(4);
		x[0]=l-1;
		y[0]=0;

		for(int i=1;i<4;i++){
			x[i]=l+i-1;
			y[i]=y[i-1]+calcNumCovered(l+i-1);
		}
		poly p=simpleInterpolate(x,y);
		ans-=p.eval(r-1);
	}

	ans+=calcNumCovered(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>&a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calcNumCovered(int t){
	vint ys;
	rep(i,N){
		ys.pb(Y[i]-t);
		ys.pb(Y[i]+t+1);
	}
	sort(all(ys));
	ys.erase(unique(all(ys)),ys.end());

	vector<pint>qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int lastX=0;

	mint ret=0;
	vint num(ys.size());
	rep(i,qs.size()){
		int x=qs[i].fi;
		int k=qs[i].se/2;

		int sum=0;
		for(int j=0;j+1<ys.size();j++)if(num[j])sum+=ys[j+1]-ys[j];
		ret+=mint(sum)*(x-lastX);
		lastX=x;

		int l=lower_bound(all(ys),Y[k]-t)-ys.begin();
		int r=lower_bound(all(ys),Y[k]+t+1)-ys.begin();
		int coef;
		if(qs[i].se&1)coef=-1;
		else coef=1;
		for(int j=l;j<r;j++)num[j]+=coef;
	}
	return ret;
}

vector<mint>lag(vector<mint>&x,vector<mint>&y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}
vector<mint>Lag(vector<mint>&x,vector<mint>&y){
	vector<mint>p(3);
	for(int j=0;j<3;j++){
		vector<mint>pp=lag(x,y);
		rep(k,3)p[k]+=pp[k];
		rotate(x.begin(),x.begin()+1,x.end());
		rotate(y.begin(),y.begin()+1,y.end());
	}
	return p;
}

//sum of p(x) (x=l,...,r-1)
mint calcSum(vector<mint>&p,int l,int r){
	mint ret;
	ret+=p[0]*(r-l);
	ret+=p[1]*(mint(r-1)*r-mint(l-1)*l)/2;
	ret+=p[2]*(mint(r-1)*r*(2*r-1)-mint(l-1)*l*(2*l-1))/6;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	mint ans;
	int curTm=0;

	while(curTm<T){
		vector<mint>x(3),y(3);
		rep(i,3){
			x[i]=mint(curTm+i);
			y[i]=calcNumCovered(curTm+i);
		}
		vector<mint>p=Lag(x,y);

		int lb=curTm,ub=T;
		while(ub-lb>1){
			int mid=(ub+lb)/2;
			if(p[0]+p[1]*mid+p[2]*mid*mid!=calcNumCovered(mid))ub=mid;
			else lb=mid;
		}
		ans-=calcSum(p,curTm,ub);
		curTm=ub;
	}
	ans+=calcNumCovered(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>
struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
istream& operator>>(istream& in,ModInt<mod>& a){
	return (in>>a.a);
}
template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

template<class T>
struct Polynomial:vector<T>{
	using vector<T>::vector;
	Polynomial& operator+=(const Polynomial &x){
		if(vector<T>::size()<x.size())vector<T>::resize(x.size());
		for(int i=0;i<x.size();i++)vector<T>::operator[](i)+=x[i];
		return *this;
	}
	Polynomial& operator-=(const Polynomial &x){
		if(vector<T>::size()<x.size())vector<T>::resize(x.size());
		for(int i=0;i<x.size();i++)vector<T>::operator[](i)-=x[i];
		return *this;
	}
	Polynomial& operator*=(const Polynomial &x){
		if(vector<T>::size()==0||x.size()==0){
			vector<T>::clear();
			return *this;
		}
		Polynomial z(vector<T>::size()+x.size()-1);
		for(int i=0;i<vector<T>::size();i++){
			for(int j=0;j<x.size();j++){
				z[i+j]+=vector<T>::operator[](i)*x[j];
			}
		}
		return *this=z;
	}
	Polynomial& operator+=(const T &x){
		if(vector<T>::size()==0)vector<T>::resize(1);
		vector<T>::operator[](0)+=x;
		return *this;
	}
	Polynomial& operator-=(const T &x){
		if(vector<T>::size()==0)vector<T>::resize(1);
		vector<T>::operator[](0)-=x;
		return *this;
	}
	Polynomial& operator*=(const T &x){
		for(int i=0;i<vector<T>::size();i++)vector<T>::operator[](i)*=x;
		return *this;
	}
	Polynomial& operator/=(const T &x){
		for(int i=0;i<vector<T>::size();i++)vector<T>::operator[](i)/=x;
		return *this;
	}

	Polynomial operator+(const Polynomial &x)const{
		return Polynomial(*this)+=x;
	}
	Polynomial operator-(const Polynomial &x)const{
		return Polynomial(*this)-=x;
	}
	Polynomial operator*(const Polynomial &x)const{
		return Polynomial(*this)*=x;
	}
	Polynomial operator+(const T &x)const{
		return Polynomial(*this)+=x;
	}
	Polynomial operator-(const T &x)const{
		return Polynomial(*this)-=x;
	}
	Polynomial operator*(const T &x)const{
		return Polynomial(*this)*=x;
	}
	Polynomial operator/(const T &x)const{
		return Polynomial(*this)/=x;
	}

	T eval(T x){
		T ret=0;
		T powX=1;
		for(int i=0;i<vector<T>::size();i++){
			ret+=vector<T>::operator[](i)*powX;
			powX*=x;
		}
		return ret;
	}
};
template<class T>
Polynomial<T>simpleInterpolate(vector<T>x,vector<T>y){
	Polynomial<T>ret;
	for(int i=0;i<x.size();i++){
		Polynomial<T>prod={1};
		T div=1;
		for(int j=0;j<x.size();j++)if(i!=j){
			div*=x[i]-x[j];
			Polynomial<T>tmp={-x[j],1};
			prod*=tmp;
		}
		ret+=prod*y[i]/div;
	}
	return ret;
}

using poly=Polynomial<mint>;

int N,T;
int X[55],Y[55];

mint calcNumCovered(int t){
	vint ys;
	rep(i,N){
		ys.pb(Y[i]-t);
		ys.pb(Y[i]+t+1);
	}
	sort(all(ys));
	ys.erase(unique(all(ys)),ys.end());

	vector<pint>qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int lastX=0;

	mint ret=0;
	vint num(ys.size());
	rep(i,qs.size()){
		int x=qs[i].fi;
		int k=qs[i].se/2;

		int sum=0;
		for(int j=0;j+1<ys.size();j++)if(num[j])sum+=ys[j+1]-ys[j];
		ret+=mint(sum)*(x-lastX);
		lastX=x;

		int l=lower_bound(all(ys),Y[k]-t)-ys.begin();
		int r=lower_bound(all(ys),Y[k]+t+1)-ys.begin();
		int coef;
		if(qs[i].se&1)coef=-1;
		else coef=1;
		for(int j=l;j<r;j++)num[j]+=coef;
	}
	return ret;
}

vector<mint>lag(vector<mint>&x,vector<mint>&y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}
vector<mint>Lag(vector<mint>&x,vector<mint>&y){
	vector<mint>p(3);
	for(int j=0;j<3;j++){
		vector<mint>pp=lag(x,y);
		rep(k,3)p[k]+=pp[k];
		rotate(x.begin(),x.begin()+1,x.end());
		rotate(y.begin(),y.begin()+1,y.end());
	}
	return p;
}

//sum of p(x) (x=l,...,r-1)
mint calcSum(vector<mint>&p,int l,int r){
	mint ret;
	ret+=p[0]*(r-l);
	ret+=p[1]*(mint(r-1)*r-mint(l-1)*l)/2;
	ret+=p[2]*(mint(r-1)*r*(2*r-1)-mint(l-1)*l*(2*l-1))/6;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	mint ans;

	vint ts;
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			ma=(ma+1)/2;
			if(ma>T)continue;
			ts.pb(ma);
		}
	}
	ts.pb(0);ts.pb(T);
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());
	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		vector<mint>x(4),y(4);
		x[0]=l-1;
		y[0]=0;

		for(int i=1;i<4;i++){
			x[i]=l+i-1;
			y[i]=y[i-1]+calcNumCovered(l+i-1);
		}
		poly p=simpleInterpolate(x,y);
		ans-=p.eval(r-1);
	}

	ans+=calcNumCovered(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int32_t mod>
struct ModInt{
	int32_t a;
	inline int32_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=(int64_t)a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int32_t mod>
istream& operator>>(istream& in,ModInt<mod>& a){
	return (in>>a.a);
}
template<int32_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>& a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

template<class T>
struct Polynomial:vector<T>{
	using vector<T>::vector;
	Polynomial& operator+=(const Polynomial &x){
		if((*this).size()<x.size())(*this).resize(x.size());
		for(int i=0;i<x.size();i++)(*this)[i]+=x[i];
		return *this;
	}
	Polynomial& operator-=(const Polynomial &x){
		if((*this).size()<x.size())(*this).resize(x.size());
		for(int i=0;i<x.size();i++)(*this).operator[](i)-=x[i];
		return *this;
	}
	Polynomial& operator*=(const Polynomial &x){
		if((*this).size()==0||x.size()==0){
			(*this).clear();
			return *this;
		}
		Polynomial z((*this).size()+x.size()-1);
		for(int i=0;i<(*this).size();i++){
			for(int j=0;j<x.size();j++){
				z[i+j]+=(*this).operator[](i)*x[j];
			}
		}
		return *this=z;
	}
	Polynomial& operator+=(const T &x){
		if((*this).size()==0)(*this).resize(1);
		(*this).operator[](0)+=x;
		return *this;
	}
	Polynomial& operator-=(const T &x){
		if((*this).size()==0)(*this).resize(1);
		(*this).operator[](0)-=x;
		return *this;
	}
	Polynomial& operator*=(const T &x){
		for(int i=0;i<(*this).size();i++)(*this).operator[](i)*=x;
		return *this;
	}
	Polynomial& operator/=(const T &x){
		for(int i=0;i<(*this).size();i++)(*this).operator[](i)/=x;
		return *this;
	}

	Polynomial operator+(const Polynomial &x)const{
		return Polynomial(*this)+=x;
	}
	Polynomial operator-(const Polynomial &x)const{
		return Polynomial(*this)-=x;
	}
	Polynomial operator*(const Polynomial &x)const{
		return Polynomial(*this)*=x;
	}
	Polynomial operator+(const T &x)const{
		return Polynomial(*this)+=x;
	}
	Polynomial operator-(const T &x)const{
		return Polynomial(*this)-=x;
	}
	Polynomial operator*(const T &x)const{
		return Polynomial(*this)*=x;
	}
	Polynomial operator/(const T &x)const{
		return Polynomial(*this)/=x;
	}

	T eval(T x){
		T ret=0;
		T powX=1;
		for(int i=0;i<(*this).size();i++){
			ret+=(*this).operator[](i)*powX;
			powX*=x;
		}
		return ret;
	}
};
template<class T>
Polynomial<T>simpleInterpolate(vector<T>x,vector<T>y){
	Polynomial<T>ret;
	for(int i=0;i<x.size();i++){
		Polynomial<T>prod={1};
		T div=1;
		for(int j=0;j<x.size();j++)if(i!=j){
			div*=x[i]-x[j];
			Polynomial<T>tmp={-x[j],1};
			prod*=tmp;
		}
		ret+=prod*y[i]/div;
	}
	return ret;
}

using poly=Polynomial<mint>;

int N,T;
int X[55],Y[55];

mint calcNumCovered(int t){
	vint ys;
	rep(i,N){
		ys.pb(Y[i]-t);
		ys.pb(Y[i]+t+1);
	}
	sort(all(ys));
	ys.erase(unique(all(ys)),ys.end());

	vector<pint>qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int lastX=0;

	mint ret=0;
	vint num(ys.size());
	rep(i,qs.size()){
		int x=qs[i].fi;
		int k=qs[i].se/2;

		int sum=0;
		for(int j=0;j+1<ys.size();j++)if(num[j])sum+=ys[j+1]-ys[j];
		ret+=mint(sum)*(x-lastX);
		lastX=x;

		int l=lower_bound(all(ys),Y[k]-t)-ys.begin();
		int r=lower_bound(all(ys),Y[k]+t+1)-ys.begin();
		int coef;
		if(qs[i].se&1)coef=-1;
		else coef=1;
		for(int j=l;j<r;j++)num[j]+=coef;
	}
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	mint ans;

	vint ts;
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			ma=(ma+1)/2;
			if(ma>T)continue;
			ts.pb(ma);
		}
	}
	ts.pb(0);ts.pb(T);
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		vector<mint>x(4),y(4);
		x[0]=l-1;
		y[0]=0;

		for(int i=1;i<4;i++){
			x[i]=l+i-1;
			y[i]=y[i-1]+calcNumCovered(l+i-1);
		}
		poly p=simpleInterpolate(x,y);
		ans-=p.eval(r-1);
	}

	ans+=calcNumCovered(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>&a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calcNumCovered(int t){
	vint ys;
	rep(i,N){
		ys.pb(Y[i]-t);
		ys.pb(Y[i]+t+1);
	}
	sort(all(ys));
	ys.erase(unique(all(ys)),ys.end());

	vector<pint>qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int lastX=0;

	mint ret=0;
	vint num(ys.size());
	rep(i,qs.size()){
		int x=qs[i].fi;
		int k=qs[i].se/2;

		int sum=0;
		for(int j=0;j+1<ys.size();j++)if(num[j])sum+=ys[j+1]-ys[j];
		ret+=mint(sum)*(x-lastX);
		lastX=x;

		int l=lower_bound(all(ys),Y[k]-t)-ys.begin();
		int r=lower_bound(all(ys),Y[k]+t+1)-ys.begin();
		int coef;
		if(qs[i].se&1)coef=-1;
		else coef=1;
		for(int j=l;j<r;j++)num[j]+=coef;
	}
	return ret;
}

vector<mint>lag(vector<mint>&x,vector<mint>&y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}
vector<mint>Lag(vector<mint>&x,vector<mint>&y){
	vector<mint>p(3);
	for(int j=0;j<3;j++){
		vector<mint>pp=lag(x,y);
		rep(k,3)p[k]+=pp[k];
		rotate(x.begin(),x.begin()+1,x.end());
		rotate(y.begin(),y.begin()+1,y.end());
	}
	return p;
}

//sum of p(x) (x=l,...,r-1)
mint calcSum(vector<mint>&p,int l,int r){
	mint ret;
	ret+=p[0]*(r-l);
	ret+=p[1]*(mint(r-1)*r-mint(l-1)*l)/2;
	ret+=p[2]*(mint(r-1)*r*(2*r-1)-mint(l-1)*l*(2*l-1))/6;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	mint ans;

	vint ts;
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			ma=(ma+1)/2;
			if(ma>T)continue;
			ts.pb(ma);
		}
	}
	ts.pb(0);ts.pb(T);
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());
	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calcNumCovered(l+j);
		}
		vector<mint>p=Lag(x,y);

		ans-=calcSum(p,l,r);
	}

	ans+=calcNumCovered(T)*T;
	cout<<ans<<endl;
}

#include <bits/stdc++.h>
#define fi first
#define se second
#define gc getchar() //(p1==p2&&(p2=(p1=buf)+fread(buf,1,size,stdin),p1==p2)?EOF:*p1++)
#define mk make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define IT iterator
#define V vector
#define TP template <class o>
#define TPP template <typename t1, typename t2>
#define SZ(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define REP(i, a, b) for (int i = b; i >= a; i--)
#define FOR(i,n) rep(i,1,n)
#define debug(x) cerr << #x << " = " << x << endl
using namespace std;
typedef unsigned ui;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
const int N = 55, size = 1 << 20, mod = 998244353, inf = 2e9;
const ll INF = 1e15;

// char buf[size],*p1=buf,*p2=buf;
TP void qr(o& x) {
    char c = gc;
    x = 0;
    int f = 1;
    while (!isdigit(c)) {
        if (c == '-')
            f = -1;
        c = gc;
    }
    while (isdigit(c))
        x = x * 10 + c - '0', c = gc;
    x *= f;
}
TP void qw(o x) {
    if (x / 10)
        qw(x / 10);
    putchar(x % 10 + '0');
}
TP void pr1(o x) {
    if (x < 0)
        x = -x, putchar('-');
    qw(x);
    putchar(' ');
}
TP void pr2(o x) {
    if (x < 0)
        x = -x, putchar('-');
    qw(x);
    putchar('\n');
}

// math
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll power(ll a, ll b = mod - 2, ll p = mod) {
    ll c = 1;
    while (b) {
        if (b & 1)
            c = c * a % p;
        b /= 2;
        a = a * a % p;
    }
    return c;
}

TP void cmax(o& x, o y) {
    if (x < y)
        x = y;
}
TP void cmin(o& x, o y) {
    if (x > y)
        x = y;
}
TPP void ad(t1& x, t2 y) {
    x += y;
    if (x >= mod)
        x -= mod;
}
TPP void dl(t1& x, t2 y) {
    x -= y;
    if (x < 0)
        x += mod;
}

int n,x[N],y[N],t,in[N*N],tot;

namespace rec {
	const int N=210;
	struct node {int c,l;} tr[N<<2];
	#define lc x<<1
	#define rc x<<1|1
	int val[N],num;
	void add(int x,int l,int r,int L,int R,int d) {
		if(L <= l && r <= R) {
			tr[x].c += d;
			if(tr[x].c) tr[x].l=val[r+1]-val[l];
			else if(l == r) tr[x].l=0;
			else tr[x].l=tr[lc].l+tr[rc].l;
			return ;
		}
		int mid=(l+r)/2;
		if(L <= mid) add(lc,l,mid,L,R,d);
		if( R > mid) add(rc,mid+1,r,L,R,d);
		if(!tr[x].c) tr[x].l=tr[lc].l+tr[rc].l;
	}

	int get(int x) {return lower_bound(val+1,val+num+1,x)-val;}

	struct E {int l,r,d;} ;
	V<E> eve[N];

	ll f(int t) {
		val[num=0]=0;
		rep(i,1,n) {
			val[++num]=x[i]-t;
			val[++num]=x[i]+t+1;
			val[++num]=y[i]-t;
			val[++num]=y[i]+t+1;
		}
		sort(val+1,val+num+1); num=unique(val+1,val+num+1)-(val+1);
		FOR(i,num) eve[i].clear();
		FOR(i,n) {
			int xx=get(x[i]-t),X=get(x[i]+t+1),yy=get(y[i]-t),Y=get(y[i]+t+1)-1;
			eve[xx].pb((E){yy,Y,1});
			eve[X].pb((E){yy,Y,-1});
		}
		ll ans=0; val[0]=val[1];
		FOR(i,num) {
			ad(ans,(ll)tr[1].l*(val[i]-val[i-1])%mod);
			for(auto j:eve[i]) add(1,1,num-1,j.l,j.r,j.d);
		}
		return ans;
	}
}

ll inv2=(mod+1)/2,inv3=(mod+1)/3,inv6=inv2*inv3%mod;

ll s1(ll x) {x %= mod; return (x+1)*x/2%mod;}
ll s2(ll x) {x %= mod; return x*(x+1)%mod*(2*x+1)%mod*inv6%mod;}

int main() {
	qr(n); qr(t);
	FOR(i,n) qr(x[i]),qr(y[i]);
	in[tot=1]=0; in[++tot]=t;
	FOR(i,n) rep(j,i+1,n) {
		int tmp=max(abs(x[i]-x[j]),abs(y[i]-y[j]))>>1;
		if(tmp <= t) in[++tot]=tmp;
		if(++tmp <= t) in[++tot]=tmp;
	}
	sort(in+1,in+tot+1); tot=unique(in+1,in+tot+1)-(in+1);
	ll ans=rec::f(t)*t%mod; tot--;
	FOR(i,tot) {
		int l=in[i],r=in[i+1];
		if(l+3>r) {
			while(l<r)
				dl(ans,rec::f(l++));
		}
		else {
			ll u=rec::f(l),v=rec::f(l+1),w=rec::f(l+2);
			ll a=(u+w-2*(v-mod))*inv2%mod;
			ll b=((v-u-a)%mod+mod)%mod;
			dl(ans,a*s2(r-l-1)%mod);
			dl(ans,b*s1(r-l-1)%mod);
			dl(ans,u*(r-l)%mod);
		}
	}
	pr2(ans);
	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <cstdio>
#include <stdlib.h>
#include <stack>
#include <numeric>
#include <bitset>
#include <cctype>
#include <list>
#include <assert.h>
#include <random>
#include <unordered_map>
#include <ctime>
typedef  long long ll;
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD  998244353//1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef ll ValType;
template<typename  T> void maxtt(T& t1, T t2) {
    t1=max(t1,t2);
}
template<typename  T> void mintt(T& t1, T t2) {
    t1=min(t1,t2);
}
#define MAX 135

bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="URDL";//"RDLU";
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"YES" : "NO");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD) {
    assert(y>=0);
    x+=y; if (x>=mod) x-=mod;
    assert(x>=0 && x<mod);
}
void et(int x=-1) {
    printf("%d\n", x); exit(0);
}
ll fastPow(ll x, ll y, int mod=MOD) {
    ll ans = 1;
    while(y>0) {
        if(y&1) ans = (x * ans)%mod;
        x = x*x%mod;
        y>>=1;
    }
    return ans;
}
ll gcd1(ll x, ll y) { return y?gcd1(y,x%y):x;}

struct Point {
    ValType x, y;
    Point() { }
    Point(ValType x, ValType y) : x(x), y(y) { }
    ld abs() const { return hypot(x, y); }
    ld arg() const { return atan2(y, x); }
    Point operator*(double o) const { return Point(x * o, y * o); }
    Point operator+(const Point& o) const { return Point(x + o.x, y + o.y); }
    Point operator-(const Point& o) const { return Point(x - o.x, y - o.y); }
    Point operator/(double o) const { return Point(x / o, y / o); }

    bool operator<(const Point& o) const { return x < o.x  || (x == o.x  && y < o.y); }
    friend bool operator == (const Point &r1,const Point &r2)
    {return r1.x==r2.x&&r1.y==r2.y;}

    Point scale(double o) const { return *this * (o / abs()); }
    Point rotY() const { return Point(-y, x); }
    Point rotX() const { return Point(y, -x); }
    ValType cross(Point b) const {return x*b.y- b.x*y;}
    ValType dot(Point b) const {return x*b.x + y*b.y;}
    void readin() {
        scanf("%lld%lld", &x, &y);
    }
};
Point p[60];
vector<ll> vp;
ll T;
ll f(ll t) {
    vector<ll> y;
    REP(i,n) {
        y.push_back(p[i].y-t); y.push_back(p[i].y+t+1);
    }
    sort(y.begin(), y.end());
    ll ss=0;
    REP(i,n+n) {
        ll L=-infL;
        REP(j,n) {
            if (p[j].y-t > y[i] || p[j].y+t+1<=y[i]) continue;
            if (p[j].x+t<=L) continue;
            ss += (y[i+1]-y[i]) * (p[j].x+t - max(L, p[j].x-t-1) );
            L=p[j].x+t;
        }
    }
    return ss % MOD;
}
int i2,i6;
ll s2(ll x) {
    if(x<=0) return 0;
    return x%MOD*(x+1)%MOD*i2%MOD;
}
ll s3(ll x) {
    if(x<=0) return 0;
    return x%MOD * ((x+1)%MOD) % MOD * ((x+x+1)%MOD) %MOD *i6%MOD;
}
ll b[5];
void fmain(int tid) {
    i2=fastPow(2, MOD-2);i6 = fastPow(6, MOD-2);
    scanf("%d%lld",&n, &T);
    REP(i,n) p[i].readin();
    sort(p,p+n);
    REP(i,n) for(int j=i+1;j<n;j++) {
        Point tt=p[i]-p[j];
        vp.push_back( (max(abs(tt.x),abs(tt.y))+1)/2 );
    }
    vp.push_back(T); vp.push_back(0);
    sort(vp.begin(), vp.end());
    int ans = 0;
    for(int i=0;vp[i]<T;i++) {
        ll dis = vp[i+1]-vp[i];
        REP(j, min(3LL, dis)) b[j]=f(vp[i]+j);
        if (dis<=3) REP(j,dis) addmod(ans, b[j]);
        else {
            addmod(ans, b[0]*dis%MOD);
            ll B=MOD-3*b[0]*i2%MOD+2*b[1]+MOD-b[2]*i2%MOD;
            ll A=b[0]*i2+MOD-b[1]+b[2]*i2%MOD;
            A%=MOD; B%=MOD;

            addmod(ans,A*(dis-1)%MOD*dis%MOD*(2*dis-1)%MOD*i6%MOD);
           addmod(ans,B*(dis-1)%MOD*dis%MOD*i2%MOD);

        }

    }
    ll A = T*f(T)%MOD + MOD - ans; A%=MOD;
    printf("%lld\n", A);
}

int main() {
    int t=1;
//    scanf("%d", &t);
    REQ(i,t) {
        fmain(i);
    }
    return 0;
}

#include <algorithm>
#include <cstdio>
#include <map>

const int P=998244353;
inline int mul(const int &a,const int &b){return 1ll*a*b%P;}
inline int sub(int a,const int &b){a-=b;return (a<0)?a+P:a;}
inline int add(int a,const int &b){a+=b;return(a>=P)?a-P:a;}
int qsm(int a,int b){
	int ans=1;
	while(b){
		if(b&1)ans=mul(ans,a);
		a=mul(a,a);
		b>>=1;
	}
	return ans;
}
int inv2=qsm(2,P-2),inv6=qsm(6,P-2);
int n,t,time[100001],top,orig[110];
std::pair<int,int>p[101];
std::map<int,int>map;
struct ope{
	int l,r,t,ord;
}num[110];
bool cmp(ope a,ope b){return (a.t<b.t)||(a.t==b.t&&a.ord<b.ord);}
int abs(int x){return x<0?-x:x;}
int se[200001],mn[200001],lazy[200001];
void build(int root,int l,int r){
	mn[root]=lazy[root]=0,se[root]=orig[r+1]-orig[l];
	if(l==r)return;
	build(root<<1,l,(l+r)>>1);
	build(root<<1|1,((l+r)>>1)+1,r);
}
void pushdown(int x,int y){
	mn[x]+=y;
	lazy[x]+=y;
}
void spread(int x){
	if(lazy[x]){
		pushdown(x<<1,lazy[x]);
		pushdown(x<<1|1,lazy[x]);
		lazy[x]=0;
	}
}
void pushup(int x){
	mn[x]=std::min(mn[x<<1],mn[x<<1|1]);
	se[x]=0;
	if(mn[x<<1]==mn[x])se[x]+=se[x<<1];
	if(mn[x<<1|1]==mn[x])se[x]+=se[x<<1|1];
}
void update(int root,int l,int r,int el,int er,int x){
	if(el>r||er<l)return;
	if(el<=l&&er>=r){
		pushdown(root,x);
		return;
	}
	spread(root);
	update(root<<1,l,(l+r)>>1,el,er,x);
	update(root<<1|1,((l+r)>>1)+1,r,el,er,x);
	pushup(root);
}
int f(int x){
	if(map.count(x))return map[x];
	for(int i=1;i<=n;i++)orig[(i<<1)-1]=p[i].first-x,orig[i<<1]=p[i].first+x+1;
	std::sort(orig+1,orig+(n<<1)+1);
	int lim=std::unique(orig+1,orig+(n<<1)+1)-orig-1;
//	for(int i=1;i<=lim;i++)printf("%d ",orig[i]);putchar('\n');
	for(int i=1;i<=n;i++){
		int l=std::lower_bound(orig+1,orig+lim+1,p[i].first-x)-orig,
			r=std::lower_bound(orig+1,orig+lim+1,p[i].first+x+1)-orig-1;
		num[(i<<1)-1]=(ope){l,r,p[i].second-x,1};
		num[i<<1]=(ope){l,r,p[i].second+x+1,-1};
	}
	std::sort(num+1,num+(n<<1)+1,cmp);
	build(1,1,lim-1);
	int ans=0;
	for(int i=1;i<=n<<1;i++){
//		printf("update %d %d %d\n",num[i].l,num[i].r,num[i].ord);
//		printf("%d %d\n",se[1],mn[1]);
		update(1,1,lim-1,num[i].l,num[i].r,num[i].ord);
		ans=add(ans,mul(sub(orig[lim]-orig[1],mn[1]?0:se[1]),num[i+1].t-num[i].t));
//		printf("%d\n",ans);
	}
//	printf("f(%d)=%d\n",x,ans);
	return map[x]=ans;
}
int sum1(int x){return mul(mul(1+x,x),inv2);}
int sum2(int x){return mul(mul(x,x+1),mul(2*x+1,inv6));}
int solve(int l,int r){
	if(l>r)return 0;
	int ans=0;
	ans=mul(sub(f(l),f(l-1)),l);
	++l;
	if(r-l+1<3){
		for(int i=l;i<=r;i++)ans=add(ans,mul(sub(f(i),f(i-1)),i));
//		printf("%d\n",ans);
		return ans;
	}
	int f1=sub(f(l),f(l-1)),f2=sub(f(l+1),f(l)),k=sub(f2,f1),b=sub(f1,mul(k,l));
	return add(ans,add(mul(k,sub(sum2(r),sum2(l-1))),mul(b,sub(sum1(r),sum1(l-1)))));
}
int main(){
//	freopen("in.txt","r",stdin);
//	freopen("out.txt","w",stdout);
//	printf("%d\n",mul(8,sum2(100000000)));
	scanf("%d%d",&n,&t);
	time[++top]=t;
	for(int i=1;i<=n;i++)scanf("%d%d",&p[i].first,&p[i].second);
//	return 0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			time[++top]=std::max((abs(p[i].first-p[j].first)-1)>>1,(abs(p[i].second-p[j].second)-1)>>1);
		}
	time[++top]=0;
	std::sort(time+1,time+top+1);
	int ans=0;
	for(int i=1;i<=top;i++){
		if(time[i]>=t)break;
		ans=add(ans,solve(time[i]+1,time[i+1]));
	}
	printf("%d",ans);
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()
#define all(x) beg(x), en(x)
#define resz resize

const int MOD = 998244353;
const ll INF = 1e18;
const int MX = 100001;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace io {
    // TYPE ID (StackOverflow)

    template<class T> struct like_array : is_array<T>{};
    template<class T, size_t N> struct like_array<array<T,N>> : true_type{};
    template<class T> struct like_array<vector<T>> : true_type{};
    template<class T> bool is_like_array(const T& a) { return like_array<T>::value; }

    // I/O

    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0);
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
    }

    // INPUT

    template<class T> void re(T& x) { cin >> x; }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest);
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }

    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class Arg, class... Args> void re(Arg& first, Args&... rest) { re(first); re(rest...); }
    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }

    // OUTPUT

    template<class T1, class T2> ostream& operator<<(ostream& os, const pair<T1,T2>& a) {
        os << '{' << a.f << ", " << a.s << '}'; return os;
    }
    template<class T> ostream& printArray(ostream& os, const T& a, int SZ) {
        os << '{';
        F0R(i,SZ) {
            if (i) {
                os << ", ";
                if (is_like_array(a[i])) cout << "\n";
            }
            os << a[i];
        }
        os << '}';
        return os;
    }
    template<class T, size_t SZ> ostream& operator<<(ostream& os, const array<T,SZ>& a) {
        return printArray(os,a,SZ);
    }
    template<class T> ostream& operator<<(ostream& os, const vector<T>& a) {
        return printArray(os,a,sz(a));
    }
    template<class T> ostream& operator<<(ostream& os, const set<T>& a) {
        os << vector<T>(all(a)); return os;
    }
    template<class T1, class T2> ostream& operator<<(ostream& os, const map<T1,T2>& a) {
        os << vector<pair<T1,T2>>(all(a)); return os;
    }

    template<class T> void pr(const T& x) { cout << x << '\n'; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        cout << first << ' '; pr(rest...);
    }
}

using namespace io;

namespace modOp {
    int ad(int a, int b, int mod = MOD) { return (a+b)%mod; }
    int sub(int a, int b, int mod = MOD) { return (a-b+mod)%mod; }
    int mul(int a, int b, int mod = MOD) { return (ll)a*b%mod; }

    int AD(int& a, int b, int mod = MOD) { return a = ad(a,b,mod); }
    int SUB(int& a, int b, int mod = MOD) { return a = sub(a,b,mod); }
    int MUL(int& a, int b, int mod = MOD) { return a = mul(a,b,mod); }

    int po (int b, int p, int mod = MOD) { return !p?1:mul(po(mul(b,b,mod),p/2,mod),p&1?b:1,mod); }
    int inv (int b, int mod = MOD) { return po(b,mod-2,mod); }

    int invGeneral(int a, int b) { // 0 < a < b, gcd(a,b) = 1
        if (a == 0) return b == 1 ? 0 : -1;
        int x = invGeneral(b%a,a);
        return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
    }
}

using namespace modOp;

namespace vecOp {
    template<class T> T operator+=(T& l, const T& r) { return l = l+r; }
    template<class T> T operator-=(T& l, const T& r) { return l = l-r; }
    template<class T> T operator*=(T& l, const T& r) { return l = l*r; }

    vi rev(vi v) { reverse(all(v)); return v; }
    vi operator+(const vi& l, const vi& r) {
        vi res(max(sz(l),sz(r)));
        F0R(i,sz(l)) res[i] = l[i];
        F0R(i,sz(r)) AD(res[i],r[i]);
        return res;
    }
    vi operator-(const vi& l, const vi& r) {
        vi res(max(sz(l),sz(r)));
        F0R(i,sz(l)) res[i] = l[i];
        F0R(i,sz(r)) SUB(res[i],r[i]);
        return res;
    }
    vi operator*(const vi& l, const vi& r) {
        if (min(sz(l),sz(r)) == 0) return {};
        vi x(sz(l)+sz(r)-1);
        F0R(i,sz(l)) F0R(j,sz(r)) AD(x[i+j],mul(l[i],r[j]));
        return x;
    }
    vi operator*(const vi& l, const int& r) {
        int R = (r%MOD+MOD)%MOD;
        vi L = l;
        for (int& i: L) MUL(i,R);
        return L;
    }
    vi operator*(const int& l, const vi& r) { return r*l; }
    vi operator*=(vi& l, const int& r) { return l = l*r; }

    vi rem(vi a, vi b) {
        while (sz(b) && b.back() == 0) b.pop_back();
        assert(sz(b)); b *= inv(b.back());
        while (sz(a) >= sz(b)) {
            int k = a.back();
            F0R(i,sz(b)) SUB(a[sz(a)-sz(b)+i],mul(k,b[i]));
            while (sz(a) && a.back() == 0) a.pop_back();
        }
        return a;
    }

    vi interpolate(vpi v) {
        vi ret;
        F0R(i,sz(v)) {
            vi prod = {1};
            int todiv = 1;
            F0R(j,sz(v)) if (i != j) {
                MUL(todiv,sub(v[i].f,v[j].f));
                vi tmp = {sub(0,v[j].f),1};
                prod *= tmp;
            }
            ret += prod*mul(inv(todiv),v[i].s);
        }
        return ret;
    }
}

using namespace vecOp;

int n,t,ans;
vpi v;
vi ti;

int solve(multiset<pi>& m) {
    int l = -MOD;
    int ans = 0;
    trav(x,m) {
        ckmax(l,x.f-1);
        ans += max(x.s-l,0);
        ckmax(l,x.s);
    }
    return ans;
}

ll f(int x) {
    multiset<pi> m;
    vector<array<int,4>> ev;
    trav(z,v) ev.pb({z.f-x,1,z.s-x,z.s+x});
    trav(z,v) ev.pb({z.f+x+1,-1,z.s-x,z.s+x});
    sort(all(ev));
    ll ret = 0;
    F0R(i,sz(ev)) {
        if (i) ret += (ll)(ev[i][0]-ev[i-1][0])*solve(m);
        if (ev[i][1] == -1) m.erase(m.find({ev[i][2],ev[i][3]}));
        else m.insert({ev[i][2],ev[i][3]});
    }
    return ret;
}

int getRange(int l, int r) {
    vpi v = {{l-1,0}};
    FOR(i,l,l+3) v.pb({i,(v.back().s+f(i))%MOD});
    // pr(v);
    // pr(interpolate(v));
    vi V = interpolate(v);
    int ret = 0, fac = 1;
    F0R(i,sz(v)) {
        AD(ret,mul(V[i],fac));
        MUL(fac,r);
    }
    /*FOR(i,l,r+1) {
        ll t = f(i);
        if (i % 100 == 0) pr(i,t);
        AD(ret,t%MOD);
    }*/
    return ret;
}

int main() {
    // you should actually read the stuff at the bottom
    setIO(); re(n,t); v.resz(n); re(v);
    ti.pb(0), ti.pb(t);
    F0R(i,n) FOR(j,i+1,n) {
        int dif = max(abs(v[i].f-v[j].f),abs(v[i].s-v[j].s));
        dif = (dif+1)/2;
        if (dif <= t) ti.pb(dif);
    }
    sort(all(ti)); ti.erase(unique(all(ti)),ti.end());
    ans = mul(t,f(t)%MOD);
    F0R(i,sz(ti)-1) SUB(ans,getRange(ti[i],ti[i+1]-1));
    pr(ans);
    // t*f(t)-f(0)-f(1)-...-f(t-1)

    // you should actually read the stuff at the bottom
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/

#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, lim;
  cin >> n >> lim;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> time = {0, lim + 1};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= lim) {
        time.push_back(t);
      }
    }
  }
  auto apply = [&] (vector<int> &vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  auto find = [&] (vector<int> &vec, int val) {
    return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
  };
  apply(time);
  auto calc = [&] (int t) {
    vector<int> vec_x, vec_y;
    for (int i = 0; i < n; i++) {
      vec_x.push_back(x[i] - t);
      vec_x.push_back(x[i] + t + 1);
      vec_y.push_back(y[i] - t);
      vec_y.push_back(y[i] + t + 1);
    }
    apply(vec_x);
    apply(vec_y);
    vector<vector<tuple<int, int, int> > > add(vec_x.size());
    for (int i = 0; i < n; i++) {
      int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
      int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
      add[xl].emplace_back(yl, yr, 1);
      add[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(vec_y.size());
    int res = 0;
    for (int i = 0; i + 1 < vec_x.size(); i++) {
      for (auto [l, r, v] : add[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j + 1 < vec_y.size(); j++) {
        if (val[j]) {
          res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[j + 1] - vec_y[j])) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (vector<int> &val, int pos) {
    static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = val.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      cur = (ll)cur * (pos - i) % MOD;
      pre[i] = cur;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      cur = (ll)cur * (pos - i) % MOD;
      suf[i] = cur;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
      if (i) {
        tmp = (ll)tmp * pre[i - 1] % MOD;
      }
      if (i != m) {
        tmp = (ll)tmp * suf[i + 1] % MOD;
      }
      if (m - i + 1 & 1) {
        res = (res + tmp) % MOD;
      } else {
        res = (res - tmp + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc(i)) % MOD;
      }
      return res;
    }
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc(l + i);
      if (i) {
        val[i] = (val[i] + val[i - 1]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(lim + 1) * calc(lim) % MOD;
  for (int i = 1; i < time.size(); i++) {
    ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

//CLOCKS_PER_SEC
using namespace std;
#include<bits/stdc++.h>
#define sqr(x) (x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while (((c=getchar())==' ')||c=='\n');x=c;}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define si set<int>
#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define rep0(i,x) forup ((i),0,(x)-1)
#define rep0d(i,x) fordo ((i),((int)(x))-1,0)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x1bbbbbbbbbbbbbbbll
#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
const int mod=998244353;
int n,m,i,j,k,tx[55],ty[55],ans,fac[15],inv[15],fi[15];
vector<int> all;
struct pnt
{
	int x,y;
}p[55];
bool cmp(pnt x,pnt y)
{
	return x.x<y.x;
}
int calc(int x)
{
	int ans=0,i,j;
	vector<int> vy;
	rep(i,n){
		vy.push_back(p[i].y-x);
		vy.push_back(p[i].y+x+1);
	}
	sort(vy.begin(),vy.end());
	vy.resize(unique(all(vy))-vy.begin());
	rep0(i,vy.size()-1){
		int lst=-0x3f3f3f3f;
		rep(j,n){
			if(vy[i]<p[j].y-x||vy[i]>p[j].y+x||p[j].x+x<=lst) continue;
			ans=(ans+1ll*(vy[i+1]-vy[i])*(p[j].x+x-max(lst,p[j].x-x-1)))%mod;
			lst=p[j].x+x;
		}
	}
	return ans;
}
int main()
{
	fac[0]=fac[1]=inv[1]=fi[0]=fi[1]=1;
	forup(i,2,10){
		fac[i]=1ll*fac[i-1]*i%mod;
		inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;
		fi[i]=1ll*fi[i-1]*inv[i]%mod;
	}
	read(n);read(m);
	all.push_back(0);
	all.push_back(m);
	rep(i,n){
		read(p[i].x);
		read(p[i].y);
	}
	sort(p+1,p+n+1,cmp);
	rep(i,n){
		rep(j,i-1){
			all.push_back((max(abs(p[i].x-p[j].x),abs(p[i].y-p[j].y))+1)/2);
		}
	}
	sort(all.begin(),all.end());
	all.resize(unique(all(all))-all.begin());
	while(all.back()>m) all.pop_back();
	rep0(i,((int)all.size())-1){
		int len=all[i+1]-all[i];
		rep0(j,min(3,len)){
			tx[j]=all[i]+j;
			ty[j]=calc(tx[j]);
		}
		if(len<=3){
			rep0(j,len){
				ans=(ans+ty[j])%mod;
			}
		}
		else{
			ans=(0ll+ans+(1ll*ty[0]*inv[2]%mod-ty[1]+1ll*ty[2]*inv[2]%mod)%mod*(len-1)%mod*len%mod*(2*len-1)%mod*inv[6])%mod;
			ans=(0ll+ans+(mod-3ll*ty[0]*inv[2]%mod+2ll*ty[1]%mod-1ll*ty[2]*inv[2]%mod)%mod*(len-1)%mod*len%mod*inv[2]%mod)%mod;
			ans=(0ll+ans+1ll*ty[0]*len)%mod;
			if(ans<0) ans+=mod;
		}
	}
	cout<<(1ll*m*calc(m)-ans+mod)%mod<<endl;
	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using std::min;
using std::max;
using std::lower_bound;
using std::sort;
using std::unique;
using std::vector;
inline int abs(int x)
{
	return x<0?-x:x;
}
const int mod=998244353;
inline int add(int a,int b)
{
	return (a+=b)>=mod?a-mod:a;
}
inline int sub(int a,int b)
{
	return (a-=b)<0?a+mod:a;
}
inline int mul(int a,int b)
{
	return (long long)a*b%mod;
}
inline int qpow(int a,int b)
{
	int res=1;
	for(;b;a=mul(a,a),b>>=1)
		if(b&1)
			res=mul(res,a);
	return res;
}
const int N=105;
int n,t,ans;
struct cell
{
	int x,y;
}c[N];
vector<int> V,Vx,Vy;
int sw,w[N],sumw[N];
struct task
{
	int t,l,r,k;
};
vector<task> ta;
int f[N];
namespace lglr
{
	int n;
	int x[N],y[N];
	// inline void print()
	// {
	// 	register int i;
	// 	for(i=1;i<=n;i++)
	// 		fprintf(stderr,"x:%d y:%d\n",x[i],y[i]);
	// 	return;
	// }
	inline int get(int x0)
	{
		int res=0,cur;
		register int i,j;
		for(i=1;i<=n;i++)
		{
			cur=1;
			for(j=1;j<=n;j++)
				if(i!=j)
					cur=mul(cur,mul(sub(x0,x[j]),qpow(sub(x[i],x[j]),mod-2)));
			res=add(res,mul(cur,y[i]));
		}
		return res;
	}
}
namespace zkw
{
	int M;
	int Min[N<<2],lazy[N<<2],cnt[N<<2];
	inline void push_up(int x)
	{
		Min[x]=min(Min[x<<1],Min[x<<1|1])+lazy[x];
		cnt[x]=(Min[x<<1]+lazy[x]==Min[x])*cnt[x<<1]+(Min[x<<1|1]+lazy[x]==Min[x])*cnt[x<<1|1];
		return;
	}
	inline void build(int n)
	{
		register int i;
		for(M=1;M<=n;M<<=1);
		memset(lazy,0,sizeof(int)*(M<<1));
		memset(cnt,0,sizeof(int)*(M<<1));
		for(i=1;i<=n;i++)
			Min[M+i]=0,cnt[M+i]=w[i];
		for(i=M-1;i;i--)
			push_up(i);
		return;
	}
	inline void modify(int l,int r,int k)
	{
		for(l=M+l-1,r=M+r+1;l^r^1;l>>=1,r>>=1,push_up(l),push_up(r))
			(l&1)?0:(Min[l^1]+=k,lazy[l^1]+=k),(r&1)?(Min[r^1]+=k,lazy[r^1]+=k):0;
		for(l>>=1;l;l>>=1)
			push_up(l);
		return;
	}
	inline int query()
	{
		return sw-(Min[1]==0)*cnt[1];
	}
}
inline int calc(int t)
{
	int cl,cr,res=0;
	register int i;
	Vx.clear();Vy.clear();
	for(i=1;i<=n;i++)
	{
		Vx.push_back(c[i].x-t);
		Vx.push_back(c[i].x+t+1);
		Vy.push_back(c[i].y-t);
		Vy.push_back(c[i].y+t+1);
	}
	sort(Vx.begin(),Vx.end());
	Vx.erase(unique(Vx.begin(),Vx.end()),Vx.end());
	sort(Vy.begin(),Vy.end());
	Vy.erase(unique(Vy.begin(),Vy.end()),Vy.end());
	sw=0;
	for(i=1;i<(int)Vy.size();i++)
		w[i]=Vy[i]-Vy[i-1],sw+=w[i];
	ta.clear();
	for(i=1;i<=n;i++)
	{
		cl=lower_bound(Vy.begin(),Vy.end(),c[i].y-t)-Vy.begin()+1;
		cr=lower_bound(Vy.begin(),Vy.end(),c[i].y+t+1)-Vy.begin();
		ta.push_back(task{c[i].x-t,cl,cr,1});
		ta.push_back(task{c[i].x+t+1,cl,cr,-1});
	}
	sort(ta.begin(),ta.end(),[](task a,task b)->bool
	{
		return a.t<b.t;
	});
	zkw::build((int)Vy.size()-1);
	for(i=0;i<(int)ta.size()-1;i++)
	{
		// fprintf(stderr,"%d:%d %d %d\n",ta[i].t,ta[i].l,ta[i].r,ta[i].k);
		zkw::modify(ta[i].l,ta[i].r,ta[i].k);
		// fprintf(stderr,"q:%d %d\n",ta[i+1].t-ta[i].t,zkw::query());
		res=add(res,mul(ta[i+1].t-ta[i].t,zkw::query()%mod));
	}
	// fprintf(stderr,"%d:OK(%d)\n",t,res);
	return res;
}
inline int solve(int l,int r)
{
	int res=0;
	register int i;
	if(r-l+1<3)
	{
		for(i=l;i<=r;i++)
			res=add(res,calc(i));
		return res;
	}
	for(i=l;i<=l+2;i++)
		f[i-l]=calc(i);
	// fprintf(stderr,"hhhh\n");
	for(i=l+1;i<=l+2;i++)
		f[i-l]=add(f[i-l],f[i-l-1]);
	lglr::n=4;
	lglr::x[1]=l;lglr::y[1]=0;
	for(i=l;i<=l+2;i++)
		lglr::x[i-l+2]=i+1,lglr::y[i-l+2]=f[i-l];
	// fprintf(stderr,"hhhh\n");
	// lglr::print();
	return sub(lglr::get(r+1),lglr::get(l));
}
signed main()
{
	int d;
	register int i,j;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;i++)
		scanf("%d%d",&c[i].x,&c[i].y);
	V.push_back(0);V.push_back(t+1);
	for(i=1;i<=n;i++)
		for(j=i+1;j<=n;j++)
			if((d=(max(abs(c[i].x-c[j].x),abs(c[i].y-c[j].y))+1)/2)<=t)
			V.push_back(d);
	sort(V.begin(),V.end());
	V.erase(unique(V.begin(),V.end()),V.end());
	for(i=0;i<(int)V.size()-1;i++)
		ans=add(ans,solve(V[i],V[i+1]-1));
	// fprintf(stderr,"%d\n",ans);
	ans=sub(mul(t+1,calc(t)),ans);
	printf("%d\n",ans);
	return 0;
}

#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 55*55, mo = 998244353,inv2=(mo+1)/2,inv6=(mo+1)/6;
int n,t,x[N],y[N],s[N],len,now;
inline int Abs(int x){return x>0?x:-x;}
//Pii(fi,se) --> fi*now+se
bool operator<(const Pii &a,const Pii &b){
	return a.fi*now+a.se<b.fi*now+b.se;
}
Pii operator-(const Pii &a,const Pii &b){
	return Pii((a.fi-b.fi+mo)%mo,(a.se-b.se+mo)%mo);
}
Pii operator+(const Pii &a,const Pii &b){
	return Pii((a.fi+b.fi)%mo,(a.se+b.se)%mo);
}
inline void add(int &x,int y){x=(x+y)%mo;}
struct Line{
	Pii l,r,p;int kd;
}a[N];int tot;
bool cmp(const Line &a,const Line &b){return a.p<b.p;}
struct Seg{
	Pii l,r;
}seg[N];int seglen;
bool operator==(const Pii &a,const Pii &b){return a.fi==b.fi&&a.se==b.se;}
bool operator==(const Seg &a,const Seg &b){return a.l==b.l&&a.r==b.r;}
bool cmp1(const Seg &a,const Seg &b){return a.l<b.l;}
inline Pii getlen(){//seg[1..seglen]
	sort(seg+1,seg+seglen+1,cmp1);
	static Seg a[N];int len=0;
	rep(i,1,seglen)
		if(!len||a[len].r<seg[i].l)a[++len]=seg[i];
		else if(a[len].r<seg[i].r)a[len].r=seg[i].r;
	Pii res(0,0);rep(i,1,len)res=res+a[i].r-a[i].l+Pii(0,1);
	return res;
}
inline void solve(int poly[3]){
	tot=0;
	rep(i,1,n){
		Line tmp;tmp.p=Pii(-1,x[i]);tmp.l=Pii(-1,y[i]);tmp.r=Pii(1,y[i]);
		tmp.kd=1;a[++tot]=tmp;
		tmp.kd=-1;tmp.p=Pii(1,x[i]+1);a[++tot]=tmp;
	}
	sort(a+1,a+tot+1,cmp);seglen=0;
	rep(i,1,tot){
		Pii x=getlen(),y=a[i].p-a[i-1].p;
	//	printf("<%d %d> <%d %d>\n",x.fi,x.se,y.fi,y.se);
		add(poly[0],1LL*x.se*y.se%mo);
		add(poly[1],(1LL*x.se*y.fi+1LL*x.fi*y.se)%mo);
		add(poly[2],1LL*x.fi*y.fi%mo);
		if(a[i].kd==1)seg[++seglen]=(Seg){a[i].l,a[i].r};
		else rep(j,1,seglen)if(seg[j]==(Seg){a[i].l,a[i].r}){
			rep(k,j,seglen-1)seg[k]=seg[k+1];seglen--;
			break;
		}
	}
}
int main() {
	read(n);read(t);rep(i,1,n)read(x[i]),read(y[i]);
	s[++len]=0;s[++len]=t;
	rep(i,1,n)rep(j,i+1,n){
		s[++len]=(max(Abs(x[i]-x[j]),Abs(y[i]-y[j]))+1)/2;
		if(s[len]>t)len--;
	}
	sort(s+1,s+len+1);len=unique(s+1,s+len+1)-s-1;
	int res=0;
	rep(i,1,len){
		now=s[i];int poly[3]={0};solve(poly);
	//	printf("%d:%d %d %d\n",s[i],poly[0],poly[1],poly[2]);
		if(i==len)res=(res+1LL*(1LL*poly[0]+1LL*poly[1]*now+1LL*poly[2]*now%mo*now)%mo*now)%mo;
		else{
			int l=s[i],r=s[i+1]-1;
			res=(res-(1LL*poly[0]*(r-l+1)+1LL*poly[1]*(l+r)%mo*(r-l+1)%mo*inv2+1LL*poly[2]*(1LL*r*(r+1)%mo*(2*r+1)%mo-1LL*(l-1)*l%mo*(2*l-1)%mo)%mo*inv6))%mo;
		}
	}
	res=(res%mo+mo)%mo;cout<<res;
	return 0;
}

#pragma region
#ifndef M207
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
#endif
#include <bits/stdc++.h>
using namespace std;
#define ri register int
#define il inline
#define LL long long
#define uint unsigned int
#define ull unsigned long long
#define solid const auto &
#define pb emplace_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define gm int mid((l+r)/2)
#define space putchar(' ')
#define enter putchar('\n')
#define rd() ({ri t;in(t);t;})
#define Size(x) ((int)x.size())
#define mem(x,y) memset(x,y,sizeof(x))
template<class T>il void in(T &x)
{
	x=0; char c=getchar(); bool f=0;
	while(!isdigit(c)) f|=(c=='-'),c=getchar();
	while(isdigit(c)) x=x*10+(c^'0'),c=getchar();
	f?x=-x:0;
}
template<class T>il void out(T x,const char c='\n')
{
	static short st[40]; short m=0;
	if(x<0) putchar('-'),x=-x;
	do st[++m]=x%10,x/=10; while(x);
	while(m) putchar(st[m--]|'0');
	putchar(c);
}
template<class T>il void err(const T &x,const char c='\n') {cerr<<x<<c;}
template<class T,class ...Args>il void in(T &x,Args &...args) {in(x); in(args...);}
template<class T,class ...Args>il void out(const T &x,const Args &...args) {out(x,' '); out(args...);}
template<class T,class ...Args>il void err(const T &x,const Args &...args) {err(x,' '); err(args...);}
template<class T>il void prt(T a,int n) {for(ri i=0; i<n; ++i) out(a[i],i==n-1?'\n':' ');}
template<class T>il void clr(T a[],int n) {memset(a,0,sizeof(T)*n);}
template<class T>il void clr(T *a,T *b) {memset(a,0,sizeof(T)*(b-a));}
template<class T>il bool ckmax(T &a,const T &b) {return a<b?a=b,1:0;}
template<class T>il bool ckmin(T &a,const T &b) {return a>b?a=b,1:0;}
namespace MOD_CALC
{
const int md=998244353,inv2=(md+1)/2;
il int add(const int a,const int b) {return a+b>=md?a+b-md:a+b;}
il int sub(const int a,const int b) {return a-b<0?a-b+md:a-b;}
il int mul(const int a,const int b) {return (LL)a*b%md;}
il void inc(int &a,const int b) {(a+=b)>=md?a-=md:0;}
il void dec(int &a,const int b) {(a-=b)<0?a+=md:0;}
il int qpow(int a,int b) {int r=1; for(; b; b>>=1,a=mul(a,a)) if(b&1) r=mul(r,a); return r;}
il int qpow(int a,int b,const int p) {int r=1; for(; b; b>>=1,a=(LL)a*a%p) if(b&1) r=(LL)r*a%p; return r;}
il int mdinv(const int a) {return qpow(a,md-2);}
template<class ...Args>il int add(const int a,const int b,const Args &...args) {return add(add(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
} using namespace MOD_CALC;
namespace i207M
{
#pragma endregion
#define N 105
struct Node
{
	int x,y;
	Node() {}
	Node(const int _x,const int _y) {x=_x,y=_y;}
} pt[N];
int n;
int calc(int T)
{
	static int xp[N]; int cntx=0;
	for(ri i=1; i<=n; ++i)
		xp[++cntx]=pt[i].x-T,xp[++cntx]=pt[i].x+T+1;
	sort(xp+1,xp+1+cntx);
	cntx=unique(xp+1,xp+1+cntx)-xp-1;
	int ans=0;
	for(ri i=1; i<cntx; ++i)
	{
		static pii yp[N]; int cnty=0;
		for(ri j=1; j<=n; ++j)
			if(pt[j].x-T<=xp[i]&&xp[i]<=pt[j].x+T)
			{
				yp[++cnty]=mp(pt[j].y-T,1);
				yp[++cnty]=mp(pt[j].y+T+1,-1);
			}
		sort(yp+1,yp+1+cnty);
		cnty=unique(yp+1,yp+1+cnty)-yp-1;
		int sum=0,sq=0;
		for(ri j=1; j<cnty; ++j)
		{
			sum+=yp[j].se;
			while(j<cnty&&yp[j+1].fi==yp[j].fi) sum+=yp[++j].se;
			if(sum>0) sq+=yp[j+1].fi-yp[j].fi;
		}
		inc(ans,mul(sq,xp[i+1]-xp[i]));
	}
	return ans;
}
const int inv6=mdinv(6);
il int sum2(int x)
{
	if(x<=0) return 0;
	return mul(x,x+1,2*x+1,inv6);
}
il int sum(int x)
{
	if(x<=0) return 0;
	return mul(x,x+1,inv2);
}
int solve(int l,int r) // [ , )
{
	if(r-l<=3)
	{
		int ans=0;
		for(ri i=l; i<r; ++i) inc(ans,calc(i));
		return ans;
	}
	int g[3][4]; // C, B, A
	for(ri i=0; i<3; ++i)
	{
		g[i][0]=1;
		for(ri j=1; j<3; ++j) g[i][j]=mul(g[i][j-1],l+i);
		g[i][3]=calc(l+i);
	}
	for(ri i=0; i<3; ++i)
	{
		int iv=mdinv(g[i][i]);
		for(ri j=i; j<4; ++j) g[i][j]=mul(g[i][j],iv);
		for(ri j=0; j<3; ++j)
			if(i!=j&&g[j][i])
			{
				for(ri k=3; k>=i; --k) dec(g[j][k],mul(g[j][i],g[i][k]));
			}
	}
	int A=g[2][3],B=g[1][3],C=g[0][3];
	int ans=0;
	inc(ans,mul(A,sub(sum2(r-1),sum2(l-1))));
	inc(ans,mul(B,sub(sum(r-1),sum(l-1))));
	inc(ans,mul(C,r-l));
	return ans;
}
int T;
int tim[N*N],cntt;
signed main()
{
#ifdef M207
	freopen("in.in","r",stdin);
	// freopen("ot.out","w",stdout);
#endif
	in(n,T); int mn=0;
	for(ri i=1; i<=n; ++i)
	{
		in(pt[i].x,pt[i].y);
		ckmin(mn,min(pt[i].x,pt[i].y));
	}
	for(ri i=1; i<=n; ++i) pt[i].x-=mn,pt[i].y-=mn;
	tim[++cntt]=0,tim[++cntt]=T+1;
	for(ri i=1; i<=n; ++i)
		for(ri j=1; j<i; ++j)
		{
			int d=max(abs(pt[i].x-pt[j].x),abs(pt[i].y-pt[j].y));
			tim[++cntt]=(d+1)/2;
			if(tim[cntt]>T) --cntt;
		}
	sort(tim+1,tim+1+cntt);
	cntt=unique(tim+1,tim+1+cntt)-tim-1;
	int ans=0;
	for(ri i=1; i<cntt; ++i) inc(ans,solve(tim[i],tim[i+1]));
	ans=sub(mul(T+1,calc(T)),ans);
	out(ans);
	return 0;
}
#pragma region
}
signed main()
{
	i207M::main();
	return 0;
}
#pragma endregion

#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
#define il inline
using namespace std;
struct dat
{
	int x,l,r,k;
	void mem(int a,int b,int c,int d){x=a;l=b;r=c;k=d;}
	bool operator<(const dat&a)const{return x<a.x;}
}p[111];
int n,x[55],y[55],h[111],a[111];
il ll gets(int k)
{
	if (k<0) return 0;int i,j,cnt=0,l,r;ll ans=0;
	for (i=1;i<=n;i++)
	{
		p[++cnt].mem(x[i]-k,y[i]-k,y[i]+k+1,1);h[cnt]=y[i]+k+1;
		p[++cnt].mem(x[i]+k+1,y[i]-k,y[i]+k+1,-1);h[cnt]=y[i]-k;
	}
	sort(p+1,p+cnt+1);sort(h+1,h+cnt+1);
	cnt=unique(h+1,h+cnt+1)-h-1;
	for (i=1;i<=2*n;i++)
	{
		if (p[i].x!=p[i-1].x) for (j=1;j<cnt;j++)
			if (a[j]) ans+=(ll)(p[i].x-p[i-1].x)*(h[j+1]-h[j]);
		l=lower_bound(h+1,h+cnt+1,p[i].l)-h,r=lower_bound(h+1,h+cnt+1,p[i].r)-h;
		for (j=l;j<r;j++) a[j]+=p[i].k;
	}
	return ans;
}
il ll diff(int x){return gets(x)-gets(x-1);}
const ll inv2=499122177,inv6=166374059;
int main()
{
	int T,i,nw=0,l,r,to;ll ans=0;cin>>n>>T;for (i=1;i<=n;i++) cin>>x[i]>>y[i];
	while (nw<=T)
	{
		l=to=nw;r=T;ll g=diff(nw),e=diff(nw+1)-g;
		while (l<=r)
		{
			int mid=(l+r)>>1;ll t=diff(mid);if (t!=g+(mid-nw)*e) r=mid-1;
			else l=mid+1,to=mid;
		}
		ll t=e*(to-nw)%mod*(to-nw+1)%mod*(to-nw+2)%mod*inv6%mod;
		(g=g%mod*(to-nw)%mod*(to-nw+1)%mod*inv2%mod)%=mod;
		(ans+=gets(nw)%mod*(to-nw+1)%mod+t+g)%=mod;nw=to+1;
	}
	cout<<((gets(T)%mod*(T+1)%mod)-ans+mod)%mod;
}

#include <iostream>
#include <cstdio>

#include <array>
#include <algorithm>
#include <vector>
#include <cassert>

using namespace std;

const int MOD = 998244353;

typedef long long ll;
#define tll(X) static_cast<ll>(X)
#define ti(X) static_cast<int>(X)

int sum(int a, int b) {return ti((tll(a) + tll(b))%MOD);}
int dif(int a, int b) {return ti((tll(a) - tll(b) + (tll(MOD)<<6LL))%MOD);}
int prd(int a, int b) {return ti((tll(a) * tll(b))%MOD);}
int sqr(int a) {return prd(a, a);}
int pw(int b, int p) {
  int r = 1;
  for(;p;p>>=1, b=prd(b, b)) if(p&1) r = prd(r, b);
  return r;
}

int dv2;
int sumlin(int v) {
  if(v < 0) return 0;
  return prd(prd(v, v + 1), dv2);
}
int sumlin(int l, int r) {
  return sumlin(r - 1) - sumlin(l - 1);
}
int dv6;
int sumsqr(int v) {
  if(v < 0) return 0;
  return prd(prd(v, v + 1), prd((v << 1) + 1, dv6));
}
int sumsqr(int l, int r) {
  return sumsqr(r - 1) - sumsqr(l - 1);
}

typedef array<int, 2> ar2;
typedef array<int, 3> ar3;
typedef vector<int> vi;
typedef vector<ar2> va2;

int get(const ar3& a, int b) {
  return sum(prd(a[2], prd(b, b)), sum(prd(a[1], b), a[0]));
}
int get(const vi& a, int l, int r) {
  int f = 0;
  f = sum(f, prd(a[2], sumsqr(l, r)));
  f = sum(f, prd(a[1], sumlin(l, r)));
  f = sum(f, prd(a[0], r - l));
  return f;
}
ar3 operator + (const ar3& a, const ar3& b) {
  return {sum(a[0], b[0]), sum(a[1], b[1]), sum(a[2], b[2])};
}

typedef array<int, 2> pt;
typedef array<int, 4> ar4;

const int MAXN = 60;
int N, T;
pt I[MAXN];

template <class T> void compress(T * n, int& s) {
  sort(n, n + s);
  s = unique(n, n + s) - n;
}

int y[MAXN << 1];
int ys;

template <int MAXS = MAXN << 3> struct ST {
public:
  ar2 v[MAXS];
  int z[MAXS];
  int s;
  ar2 cmb(const ar2& a, const ar2& b) {
    if(a[0] == b[0]) return {a[0], a[1] + b[1]};
    if(b[0] < a[0]) return b;
    return a;
  }
  void init(int n, int nl, int nr) {
    if(nr - nl > 1) {
      int m = nl + ((nr - nl)>>1);
      init(n<<1, nl, m); init(n<<1|1, m, nr);
      v[n] = {0, y[nr] - y[nl]}, z[n] = 0;
    } else v[n] = {0, y[nr] - y[nl]}, z[n] = 0;
  }
  void init(int S) {
    init(1, 0, s = S);
  }
  void prop(int n, int nl, int nr) {
    v[n][0] += z[n];
    if(nr - nl > 1)
      z[n<<1] += z[n], z[n<<1|1] += z[n];
    z[n] = 0;
  }
  void upd(int gl, int gr, int q, int n, int nl, int nr) {
    if(gl <= nl and nr <= gr) {
      z[n] += q;
      prop(n, nl, nr);
    } else {
      int m = nl + ((nr - nl)>>1);
      prop(n, nl, nr);
      if(gl < m) upd(gl, gr, q, n<<1, nl, m); else prop(n<<1, nl, m);
      if(m < gr) upd(gl, gr, q, n<<1|1, m, nr); else prop(n<<1|1, m, nr);
      v[n] = cmb(v[n<<1], v[n<<1|1]);
    }
  }
  void upd(int gl, int gr, int q) {return upd(gl, gr, q, 1, 0, s);}
  int qry() {prop(1, 0, s); return v[1][0] == 0 ? (y[s] - y[0]) - v[1][1] : (y[s] - y[0]);}    //# of non-zeroes
};
ST<> st;
ar4 x[MAXN << 1];
int calc(int t) {
  for(int i = 0;i < N;i++) y[i<<1] = I[i][1] - t, y[i<<1|1] = I[i][1] + t + 1, x[i<<1] = {I[i][0] - t, I[i][1] - t, I[i][1] + t + 1, 1}, x[i<<1|1] = {I[i][0] + t + 1, I[i][1] - t, I[i][1] + t + 1, -1};
  ys = N<<1, compress(y, ys);
  for(int i = 0;i < N<<1;i++) x[i][1] = lower_bound(y, y + ys, x[i][1]) - y, x[i][2] = lower_bound(y, y + ys, x[i][2]) - y;
  st.init(--ys);

  ll f = 0;

  sort(x, x + (N<<1), [](const ar4& a, const ar4& b){return a[0] < b[0];});

  int c = 0;
  for(int i = 0, j;i < N<<1;i=j) {
    for(j = i;j < N<<1 and x[i][0] == x[j][0];j++) {
      st.upd(x[j][1], x[j][2], x[j][3]);
    }
    if((c = st.qry())) f += tll(c) * (x[j][0] - x[i][0]);
  }
  assert(c == 0);
  return ti(f%MOD);
}

int operator * (const pt& a, const pt& b) {
  return max((1 + abs(a[0] - b[0]))>>1, (1 + abs(a[1] - b[1]))>>1);
}

int c[MAXN * MAXN];

vi operator * (const vi& a, const vi& b) {
  vi r(a.size() + b.size() - 1, 0);
  for(int i = 0;i < a.size();i++) for(int j = 0;j < b.size();j++) r[i + j] = sum(r[i + j], prd(a[i], b[j]));
  return r;
}
vi operator *= (vi& a, const int& b) {
  for(int i = 0;i < a.size();i++) a[i] = prd(a[i], b);
  return a;
}
vi operator += (vi& a, const vi& b) {
  assert(not(a.size() < b.size()));
  for(int i = 0;i < b.size();i++) a[i] = sum(a[i], b[i]);
  return b;
}

vi interpolate(const va2& p) {
  vi r(p.size(), 0);
  for(int i = 0;i < p.size();i++) {
    vi n(1, 1);
    int d = 1;
    for(int j = 0;j < p.size();j++) if(j != i) {
      n = n * vi{dif(0, p[j][0]), 1};
      d = prd(d, dif(p[i][0], p[j][0]));
    }
    n *= prd(pw(d, MOD - 2), p[i][1]);
    assert(n.size() == r.size());
    r += n;
  }
  return r;
}

int solve(int t1, int t2) {
  if(t2 - t1 < 3) {
    int f = 0;
    for(int i = t1;i < t2;i++) f = sum(f, calc(i));
    return f;
  }

  vi q = interpolate(va2{{t1, calc(t1)}, {t1 + 1, calc(t1 + 1)}, {t1 + 2, calc(t1 + 2)}});
  //cerr << q[0] << " " << q[1] << " " << q[2] << "\n";
  //cerr << get(q, t1, t2) << "\n";
  return get(q, t1, t2);
}

int main() {
  dv2 = pw(2, MOD - 2);
  dv6 = pw(6, MOD - 2);

  scanf("%d%d", &N, &T);
  for(int i = 0;i < N;i++) scanf("%d%d", &I[i][0], &I[i][1]), y[i] = I[i][1];

  //sort(I, I + N, [](const pt& a, const pt& b) {return a[0] < b[0] or (not(b[0] < a[0]) and a[1] < b[1]);});

  for(int i = 0, t = 0;i < N;i++) for(int j = i + 1;j < N;j++) c[t++] = I[i] * I[j];
  sort(c, c + (N*(N - 1)>>1));
  ll f = 0LL;
  int p = 0;
  for(int i = 0;i < (N*(N-1))>>1;p = c[i++]) {
    if(c[i] < T) f = sum(f, solve(p, c[i])); else break;
  }
  f = sum(f, solve(p, T));

  printf("%d\n", dif(prd(T, calc(T)), f));

  return 0;
}

#pragma GCC optimize("-O3")
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#include<cmath>
#include<vector>
#include<bitset>
#define DB long double
#define LL long long
#define ui unsigned int
#define ull unsigned long long
using namespace std;

inline int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void Out(int x){
    if(x>9) Out(x/10);
    putchar('0'+x%10);
}
int gcd(int x,int y){
    if(!y) return x;
    return gcd(y,x%y);
}
LL qpow(LL x,LL y,LL P){
    LL re=1;
    while(y){
        if(y&1) re=re*x%P;
        x=x*x%P;y>>=1;
    }
    return re;
}
LL likegcd(LL a,LL b,LL c,LL n){
    LL re,p;
    if(c<0)
        return likegcd(-a,-b,-c,n);
    if(a<0||b<0){
        re=likegcd(a%c+c,b%c+c,c,n);
        re+=n*(n+1)/2*((a/c)-1);
        re+=(n+1)*((b/c)-1);
        return re;
    }

    if(a==0) {
        re=(b/c)*(n+1);
        return re;
    }
    if(a>=c||b>=c){
        p=likegcd(a%c,b%c,c,n);
        re=n*(n+1)/(LL)2*(a/c);
        re+=(b/c)*(n+1);
        re+=p;
        return re;
    }
    LL m=(a*n+b)/c;
    p=likegcd(c,c-b-1,a,m-1);
    re=-p+n*m;
    return re;
}
const DB eps=1e-6;
const int N=5e4+10;
const int mx=1e5+1;
const LL P=998244353;

struct date{
	int t,l,r,w;
}p[200];
bool operator < (date A,date B){
	return A.t<B.t;
}

int n;
int x[55],y[55],h[200],a[200];
int T;
LL get(int k){
	if(k<0) return 0;
	int cnt=0;
	for(int i=1;i<=n;++i){
		p[++cnt]=date{x[i]-k,y[i]-k,y[i]+k+1,1};h[cnt]=y[i]+k+1;
		p[++cnt]=date{x[i]+k+1,y[i]-k,y[i]+k+1,-1};h[cnt]=y[i]-k;
	}
	sort(p+1,p+1+cnt);sort(h+1,h+1+cnt);
	cnt=unique(h+1,h+1+cnt)-h-1;
	LL re=0;
	for(int i=1;i<=n+n;++i){
		if(p[i].t!=p[i-1].t)
			for(int j=1;j<cnt;++j)
				if(a[j]) re+=(LL)(p[i].t-p[i-1].t)*(h[j+1]-h[j]);
		int l=lower_bound(h+1,h+cnt+1,p[i].l)-h;
		int r=lower_bound(h+1,h+cnt+1,p[i].r)-h;
		for(int j=l;j<r;j++) a[j]+=p[i].w;
	}
	return re;
}
LL cha(int t){
	return get(t)-get(t-1);
}
const LL inv2=qpow((LL)2,P-2,P);
const LL inv3=qpow((LL)3,P-2,P);
const LL inv6=qpow((LL)6,P-2,P);

int main(){
	scanf("%d%d",&n,&T);
	for(int i=1;i<=n;++i) scanf("%d%d",&x[i],&y[i]);
	int now=0,l,r,mid,to;
	LL ans=0;
	//cout<<inv2<<" "<<inv6<<endl;
	while(now<=T){
		l=to=now;
		r=T;
		LL g=cha(now),e=cha(now+1)-g;
		while(l!=r){
			mid=l+r+1>>1;
			LL y=cha(mid);
			if(y!=g+(mid-now)*e) r=mid-1;
			else l=mid;
		}
		to=l;
		LL y=e*(to-now)%P*(to-now+1)%P*(to-now+2)%P*inv6%P;
		(g=g%P*(to-now)%P*(to-now+1)%P*inv2%P)%=P;
		(ans+=get(now)%P*(to-now+1)%P+y+g)%=P;
		now=to+1;
		//cout<<to<<" "<<y<<" "<<g<<endl;
	}
	//cout<<ans<<endl;
	cout<<((get(T)%P*(T+1)%P)-ans+P)%P;
}
/*

*/

#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int ha = 998244353;
const int inv2 = 499122177;
const int inv6 = 166374059;
const int MAXN = 300+5;
std::vector<LL> Sx,Sy;

namespace DS{
	int sm[MAXN<<2],tag[MAXN<<2];
	#define lc ((x)<<1)
	#define rc ((x)<<1|1)

	inline void modify(int x,int l,int r,int L,int R,int d){
		// int len = Sy[r-1]-(l==1?Sy[0]:Sy[l-2]);
		int len = Sy[r]-Sy[l-1];
		// if(l == 1 && r == 2) DEBUG(Sy[r]),DEBUG(Sy[l-1]);
		// DEBUG(l);DEBUG(r);DEBUG(len);
		if(l == L && r == R){
			tag[x] += d;
			sm[x] = tag[x] ? len : (l==r?0:(sm[lc]+sm[rc])%ha);
			return;
		}
		int mid = (l + r) >> 1;
		if(R <= mid) modify(lc,l,mid,L,R,d);
		else if(L > mid) modify(rc,mid+1,r,L,R,d);
		else modify(lc,l,mid,L,mid,d),modify(rc,mid+1,r,mid+1,R,d);
		sm[x] = tag[x]?len:(l==r?0:(sm[lc]+sm[rc])%ha);
	}
}
using DS::modify;

int x[MAXN],y[MAXN],n;

inline void add(int &x,int y){
	x += y;if(x >= ha) x -= ha;
}

struct Node{
	int x1,y1,x2,y2;//(x1,y1) <= (x2,y2)
	Node(int x1=0,int y1=0,int x2=0,int y2=0) : x1(x1),y1(y1),x2(x2),y2(y2) {}
}a[MAXN];

std::vector<std::pair<P,int> > G[MAXN];

inline int f(int k){
	Sx.clear();Sy.clear();
	FOR(i,1,n){
		a[i] = Node(x[i]-k,y[i]-k,x[i]+k+1,y[i]+k+1);
		Sx.pb(x[i]-k);Sy.pb(y[i]-k);Sx.pb(x[i]+k+1);Sy.pb(y[i]+k+1);
		// DEBUG(x[i]+k+1);DEBUG(y[i]+k+1);
	}
	std::sort(all(Sx));Sx.erase(std::unique(all(Sx)),Sx.end());
	std::sort(all(Sy));Sy.erase(std::unique(all(Sy)),Sy.end());
	// Sx.pb(Sx[0]-1);Sy.pb(Sy[0]-1);
	// std::sort(all(Sx));std::sort(all(Sy));
	int m = Sx.size(),M = Sy.size();
	FOR(i,0,m+1) G[i].clear();
	FOR(i,1,n){
		a[i].x1 = std::lower_bound(all(Sx),a[i].x1)-Sx.begin()+1;
		a[i].x2 = std::lower_bound(all(Sx),a[i].x2)-Sx.begin()+1;
		a[i].y1 = std::lower_bound(all(Sy),a[i].y1)-Sy.begin()+1;
		a[i].y2 = std::lower_bound(all(Sy),a[i].y2)-Sy.begin()+1;
		// printf("%d %d %d %d\n",a[i].x1,a[i].y1,a[i].x2,a[i].y2);
		G[a[i].x1].pb(MP(MP(a[i].y1,a[i].y2),1));
		G[a[i].x2].pb(MP(MP(a[i].y1,a[i].y2),-1));
	}
	Sy.pb(Sy.back());
	// Sy.pb(Sy[0]-1);std::sort(all(Sy));
	// exit(0);
	CLR(DS::sm,0);CLR(DS::tag,0);
	int ans = 0;
	FOR(i,1,m){
		int t = (Sx[i-1]-Sx[std::max(i-2,0)])%ha;
		// DEBUG(t);
		// DEBUG(DS::sm[1]);
		add(ans,1ll*t*DS::sm[1]%ha);
		for(auto x:G[i]) modify(1,1,M,x.fi.fi,x.fi.se-1,x.se);//,DEBUG(x.fi.fi),DEBUG(x.fi.se-1),DEBUG(x.se);
	}
	return ans;
}

inline int sm2(int n){
	int res = 0;if(n < 0) return 0;
	if(n <= 5){
		FOR(i,1,n) add(res,i*i);
	}
	else{
		res = 1ll*n*(n+1)%ha*(2ll*n+1)%ha*inv6%ha;
	}
	return res;
}

inline int sm(int n){
	int res = 0;if(n < 0) return 0;
	if(n <= 5){
		FOR(i,1,n) add(res,i);
	}
	else{
		res = 1ll*n*(n+1)%ha*inv2%ha;
	}
	return res;
}

inline int sm(int l,int r){
	return (sm(r)+ha-sm(l-1))%ha;
}

inline int sm2(int l,int r){
	return (sm2(r)+ha-sm2(l-1))%ha;
}

int main(){
	int t;scanf("%d%d",&n,&t);
	// t = 100000;
	FOR(i,1,n) scanf("%d%d",x+i,y+i);
	std::vector<int> part;part.pb(0);part.pb(t);
	FOR(i,1,n){
		FOR(j,i+1,n){
			int d = std::max(std::abs(x[i]-x[j]),std::abs(y[i]-y[j]));
			d = (d+1)/2;
			if(d >= t) continue;
			part.pb(d);
			// if(d-1 > 0) part.pb(d-1);
			// if(d+1 < t) part.pb(d+1);
		}
	}
	// DEBUG(f(t));
	// exit(0);
	// DEBUG(1ll*(400000000ll+1)*(400000000+1)%ha);
	// exit(0);
	// int ttt = 0;
	// FOR(i,0,t-1) add(ttt,f(i));
	// DEBUG(ttt);
	std::sort(all(part));part.erase(std::unique(all(part)),part.end());
	int ans = 0;
	FOR(i,1,(int)part.size()-1){
		int l = part[i-1],r = part[i]-1;
		// DEBUG(l);DEBUG(r);
		if(r-l+1 <= 3){
			FOR(k,l,r) add(ans,f(k));
			continue;
		}
		int x[3],y[3];
		FOR(j,0,2) y[j] = f(x[j]=l+j);
		int a = 1ll*y[0]*inv2%ha;
		add(a,ha-y[1]);add(a,1ll*y[2]*inv2%ha);
		int b = 1ll*y[0]*inv2%ha*(x[1]+x[2])%ha;
		add(b,ha-1ll*y[1]*((x[0]+x[2])%ha)%ha);
		add(b,1ll*y[2]*inv2%ha*(x[1]+x[0])%ha);
		b = ha-b;

		int c = 1ll*x[1]*x[2]%ha*y[0]%ha*inv2%ha;
		add(c,ha-1ll*x[0]*x[2]%ha*y[1]%ha);
		add(c,1ll*x[0]*x[1]%ha*y[2]%ha*inv2%ha);
		// DEBUG(a);DEBUG(b);DEBUG(c);
		// DEBUG(sm(l,r));
		// int tt = 0;
		// FOR(i,l,r) add(tt,i);
		// DEBUG(tt);
		add(ans,1ll*sm2(l,r)*a%ha);
		// DEBUG(sm2(l,r));
		add(ans,1ll*sm(l,r)*b%ha);
		add(ans,1ll*(r-l+1)*c%ha);
	}
	// DEBUG(ans);
	// DEBUG(ans);
	// int _ = 400000000ll*400000000%ha;
	add(ans,ha-1ll*t*f(t)%ha);
	ans = (ha-ans)%ha;
	printf("%d\n",ans);
	return 0;
}
/*
设 f(i) 表示 i 时间有多少个格子着火了
答案就是 tf(t)-\sum_{i=0}^{t-1}f(i)
单次询问 f(i) 是可以求矩阵面积并的,但是你不能询问1e8次
考虑用容斥原理将矩形面积并变成交
观察一个子集 发现只有在某两个矩形由不交变成相交的时候才会分段
所以只有 n^2 段 插值 每一段需要做3/4次矩形面积并
矩形面积并就是离散化后排序 支持区间加删线段 全局查询 修改到对应线段即可
*/

#include <bits/stdc++.h>

using namespace std;

const int max_n = 55, inf = 1000111222;
const int mod = 998244353;

int mul(int x, int y) {
    return 1LL * x * y % mod;
}

int power(int x, int y) {
    if (y == 0) {
        return 1;
    }
    if (y % 2 == 0) {
        return power(mul(x, x), y / 2);
    }
    return mul(x, power(x, y - 1));
}

int inv(int x) {
    return power(x, mod - 2);
}

int n, t, x[max_n], y[max_n];
vector<int> xs, ys;
multiset<int> q;

int add(int x, int len) {
    auto it = q.insert(x);
    int l = x;
    if (it != q.begin()) {
        --it;
        l = max(*it + len, x);
        ++it;
    }
    ++it;
    int r = x + len;
    if (it != q.end()) {
        r = min(r, *it);
    }
    return max(0, r - l);
}

int del(int x, int len) {
    q.erase(q.find(x));
    int res = add(x, len);
    q.erase(q.find(x));
    return res;
}

int f(int t) {
    vector<pair<int, pair<int, int>>> v;
    for (int i = 0; i < n; ++i) {
        v.push_back({x[i] - t, {0, y[i]}});
        v.push_back({x[i] + t + 1, {1, y[i]}});
    }
    sort(v.begin(), v.end());
    int res = 0, cur = 0;
    for (int i = 0; i < v.size(); ) {
        int pos = i;
        while (i < v.size() && v[pos].first == v[i].first) {
            if (v[i].second.first == 0) {
                cur += add(v[i].second.second, 2 * t + 1);
            } else {
                cur -= del(v[i].second.second, 2 * t + 1);
            }
            ++i;
        }
        if (i < v.size()) {
            //cout << "[" << v[pos].first << " " << v[i].first << "): " << cur << endl;
            res += mul(cur, v[i].first - v[pos].first);
            res %= mod;
        }
    }
    //cout << t << ": " << res << endl;
    return res;
}

int triv(int t) {
    int res = mul(t, f(t));
    for (int i = 0; i < t; ++i) {
        res += mod - f(i);
        res %= mod;
    }
    return res;
}

const int max_p = 4;

struct interpolation {
    int x[max_p], y[max_p];
    int rev[max_p];

    interpolation() {
        for (int i = 1; i < max_p; ++i) {
            rev[i] = inv(i);
        }
    }

    int interpolate(int X) const {
        int res = 0;
        for (int i = 0; i < max_p; ++i) {
            int add = y[i];
            for (int j = 0; j < max_p; ++j) {
                if (i != j) {
                    add = mul(add, X - x[j]);
                    add = mul(add, rev[abs(x[i] - x[j])]);
                    if (x[i] < x[j]) {
                        add = mod - add;
                    }
                }
            }
            res += add;
            res %= mod;
        }
        return res;
    }
};

int solve(int t) {
    vector<int> all;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            int d = max(abs(x[i] - x[j]), abs(y[i] - y[j]));
            all.push_back((d + 1) / 2);
        }
    }
    all.push_back(0);
    sort(all.begin(), all.end());
    all.erase(unique(all.begin(), all.end()), all.end());
    while (!all.empty() && all.back() >= t) {
        all.pop_back();
    }
    all.push_back(t);
    int res = 0;
    interpolation inter;
    for (int i = 0; i + 1 < all.size(); ++i) {
        int l = all[i], r = all[i + 1];
        if (r - l < max_p + 1) {
            for (int j = l; j < r; ++j) {
                res += f(j);
                res %= mod;
            }
        } else {
            int cur = 0;
            for (int j = l; j < l + max_p; ++j) {
                cur += f(j);
                cur %= mod;
                inter.x[j - l] = j;
                inter.y[j - l] = cur;
            }
            res += inter.interpolate(r - 1);
            res %= mod;
        }
    }
    res = (mul(t, f(t)) + mod - res) % mod;
    return res;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> t;
    for (int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i];
    }
    cout << solve(t) << endl;
    return 0;
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 50;
const int MOD = 998244353;
int pow_mod(int b, int p) {
	int ret = 1;
	while( p ) {
		if( p & 1 ) ret = 1LL*ret*b%MOD;
		b = 1LL*b*b%MOD;
		p >>= 1;
	}
	return ret;
}
inline int add(int a, int b) {return (a + b)%MOD;}
inline int mul(int a, int b) {return 1LL*a*b%MOD;}
inline int sub(int a, int b) {return add(a, (MOD - b)%MOD);}
inline int inv(int x) {return pow_mod(x, MOD - 2);}
vector<int>v1[2*MAXN + 5], v2[2*MAXN + 5];
int x[MAXN + 5], y[MAXN + 5], n;
int dx[2*MAXN + 5], dy[2*MAXN + 5], xcnt, ycnt;
int tag[2*MAXN + 5];
int func(int t) {
	xcnt = ycnt = 0;
	for(int i=1;i<=n;i++) {
		dx[++xcnt] = x[i] + t + 1, dx[++xcnt] = x[i] - t;
		dy[++ycnt] = y[i] + t + 1, dy[++ycnt] = y[i] - t;
	}
	sort(dx + 1, dx + xcnt + 1), xcnt = unique(dx + 1, dx + xcnt + 1) - dx - 1;
	sort(dy + 1, dy + ycnt + 1), ycnt = unique(dy + 1, dy + ycnt + 1) - dy - 1;
	for(int i=1;i<=xcnt;i++) v1[i].clear(), v2[i].clear();
	for(int i=1;i<=n;i++) {
		int l = lower_bound(dx + 1, dx + xcnt + 1, x[i] - t) - dx;
		int r = lower_bound(dx + 1, dx + xcnt + 1, x[i] + t + 1) - dx;
		v1[l].push_back(i), v2[r].push_back(i);
	}
	int ans = 0;
	for(int i=1;i<=xcnt;i++) {
		int tmp = 0;
		for(int j=1;j<=ycnt;j++) {
			if( tmp ) ans = add(ans, mul(dy[j] - dy[j-1], dx[i] - dx[i-1]));
			tmp += tag[j];
		}
		for(int j=0;j<v1[i].size();j++) {
			int p = v1[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]++, tag[d]--;
		}
		for(int j=0;j<v2[i].size();j++) {
			int p = v2[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]--, tag[d]++;
		}
	}
	return ans;
}
struct point{
	int x, y;
	point(int _x=0, int _y=0):x(_x), y(_y) {}
};
int func3(point *p, int x) {
	int ret = 0;
	for(int i=0;i<4;i++) {
		int del = 1;
		for(int j=0;j<4;j++)
			if( i != j ) del = mul(del, mul(sub(x, p[j].x), inv(sub(p[i].x, p[j].x))));
		ret = add(ret, mul(del, p[i].y));
	}
	return ret;
}
int func2(int l, int r) {
	if( r - l + 1 <= 3 ) {
		int ret = 0;
		for(int i=l;i<=r;i++) ret = add(ret, func(i));
		return ret;
	}
	point p[4] = {point(l, func(l))};
	for(int i=1;i<4;i++)
		p[i] = point(l + i, add(p[i - 1].y, func(l + i)));
	return (sub(func3(p, r), func3(p, l - 1)) + MOD)%MOD;
}
int a[MAXN*MAXN + 5], cnt;
int main() {
	int t; scanf("%d%d", &n, &t);
	for(int i=1;i<=n;i++)
		scanf("%d%d", &x[i], &y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++) {
			int p = max((abs(x[i] - x[j]) - 1) >> 1, (abs(y[i] - y[j]) - 1) >> 1);
			if( p <= t ) a[++cnt] = p;
		}
	a[++cnt] = t;
	sort(a + 1, a + cnt + 1), cnt = unique(a + 1, a + cnt + 1) - a - 1;
	int ans = mul(t + 1, func(t)), lst = 0;
	for(int i=1;i<=cnt;i++)
		ans = sub(ans, func2(lst, a[i])), lst = a[i] + 1;
	printf("%d\n", ans);
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 50;
const int MOD = 998244353;
int pow_mod(int b, int p) {
	int ret = 1;
	while( p ) {
		if( p & 1 ) ret = 1LL*ret*b%MOD;
		b = 1LL*b*b%MOD;
		p >>= 1;
	}
	return ret;
}
inline int add(int a, int b) {return (a + b)%MOD;}
inline int mul(int a, int b) {return 1LL*a*b%MOD;}
inline int sub(int a, int b) {return add(a, (MOD - b)%MOD);}
inline int inv(int x) {return pow_mod(x, MOD - 2);}
vector<int>v1[2*MAXN + 5], v2[2*MAXN + 5];
int x[MAXN + 5], y[MAXN + 5], n;
int dx[2*MAXN + 5], dy[2*MAXN + 5], xcnt, ycnt;
int tag[2*MAXN + 5];
int func(int t) {
	xcnt = ycnt = 0;
	for(int i=1;i<=n;i++) {
		dx[++xcnt] = x[i] + t + 1, dx[++xcnt] = x[i] - t;
		dy[++ycnt] = y[i] + t + 1, dy[++ycnt] = y[i] - t;
	}
	sort(dx + 1, dx + xcnt + 1), xcnt = unique(dx + 1, dx + xcnt + 1) - dx - 1;
	sort(dy + 1, dy + ycnt + 1), ycnt = unique(dy + 1, dy + ycnt + 1) - dy - 1;
	for(int i=1;i<=xcnt;i++) v1[i].clear(), v2[i].clear();
	for(int i=1;i<=n;i++) {
		int l = lower_bound(dx + 1, dx + xcnt + 1, x[i] - t) - dx;
		int r = lower_bound(dx + 1, dx + xcnt + 1, x[i] + t + 1) - dx;
		v1[l].push_back(i), v2[r].push_back(i);
	}
	int ans = 0;
	for(int i=1;i<=xcnt;i++) {
		int tmp = 0;
		for(int j=1;j<=ycnt;j++) {
			if( tmp ) ans = add(ans, mul(dy[j] - dy[j-1], dx[i] - dx[i-1]));
			tmp += tag[j];
		}
		for(int j=0;j<v1[i].size();j++) {
			int p = v1[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]++, tag[d]--;
		}
		for(int j=0;j<v2[i].size();j++) {
			int p = v2[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]--, tag[d]++;
		}
	}
	return ans;
}
struct point{
	int x, y;
	point(int _x=0, int _y=0):x(_x), y(_y) {}
};
void func3(point p1, point p2, point p3, int &a, int &b, int &c) {
	int d = 0; a = b = c = 0;
	d = mul(p1.y, mul(inv(p1.x - p2.x), inv(p1.x - p3.x)));
	a = add(a, d), b = sub(b, mul(add(p2.x, p3.x), d)), c = add(c, mul(mul(p2.x, p3.x), d));
	d = mul(p2.y, mul(inv(p2.x - p1.x), inv(p2.x - p3.x)));
	a = add(a, d), b = sub(b, mul(add(p1.x, p3.x), d)), c = add(c, mul(mul(p1.x, p3.x), d));
	d = mul(p3.y, mul(inv(p3.x - p2.x), inv(p3.x - p1.x)));
	a = add(a, d), b = sub(b, mul(add(p1.x, p2.x), d)), c = add(c, mul(mul(p1.x, p2.x), d));
}
int s0(int x) {return x;}
int s1(int x) {return mul(x, mul(x + 1, inv(2)));}
int s2(int x) {return mul(x, mul(x + 1, mul(mul(2, x) + 1, inv(6))));}
int func2(int l, int r) {
	if( r - l + 1 >= 3 ) {
		int a, b, c;
		func3(point(l, func(l)), point(l+1, func(l+1)), point(l+2, func(l+2)), a, b, c);
		a = mul(a, sub(s2(r), s2(l - 1)));
		b = mul(b, sub(s1(r), s1(l - 1)));
		c = mul(c, sub(s0(r), s0(l - 1)));
		return (add(add(a, b), c) + MOD) % MOD;
	}
	else if( r - l + 1 == 1 )
		return func(l);
	else if( r - l + 1 == 2 )
		return func(l) + func(r);
}
int a[MAXN*MAXN + 5], cnt;
int main() {
	int t; scanf("%d%d", &n, &t);
	for(int i=1;i<=n;i++)
		scanf("%d%d", &x[i], &y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++) {
			int p = max((abs(x[i] - x[j]) - 1) >> 1, (abs(y[i] - y[j]) - 1) >> 1);
			if( p <= t ) a[++cnt] = p;
		}
	a[++cnt] = t;
	sort(a + 1, a + cnt + 1), cnt = unique(a + 1, a + cnt + 1) - a - 1;
	int ans = mul(t + 1, func(t)), lst = 0;
	for(int i=1;i<=cnt;i++)
		ans = sub(ans, func2(lst, a[i])), lst = a[i] + 1;
	printf("%d\n", ans);
}

#pragma region
#ifndef M207
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
#endif
#include <bits/stdc++.h>
using namespace std;
#define ri register int
#define il inline
#define LL long long
#define uint unsigned int
#define ull unsigned long long
#define solid const auto &
#define pb emplace_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define gm int mid((l+r)/2)
#define space putchar(' ')
#define enter putchar('\n')
#define rd() ({ri t;in(t);t;})
#define Size(x) ((int)x.size())
#define mem(x,y) memset(x,y,sizeof(x))
template<class T>il void in(T &x)
{
	x=0; char c=getchar(); bool f=0;
	while(!isdigit(c)) f|=(c=='-'),c=getchar();
	while(isdigit(c)) x=x*10+(c^'0'),c=getchar();
	f?x=-x:0;
}
template<class T>il void out(T x,const char c='\n')
{
	static short st[40]; short m=0;
	if(x<0) putchar('-'),x=-x;
	do st[++m]=x%10,x/=10; while(x);
	while(m) putchar(st[m--]|'0');
	putchar(c);
}
template<class T>il void err(const T &x,const char c='\n') {cerr<<x<<c;}
template<class T,class ...Args>il void in(T &x,Args &...args) {in(x); in(args...);}
template<class T,class ...Args>il void out(const T &x,const Args &...args) {out(x,' '); out(args...);}
template<class T,class ...Args>il void err(const T &x,const Args &...args) {err(x,' '); err(args...);}
template<class T>il void prt(T a,int n) {for(ri i=0; i<n; ++i) out(a[i],i==n-1?'\n':' ');}
template<class T>il void clr(T a[],int n) {memset(a,0,sizeof(T)*n);}
template<class T>il void clr(T *a,T *b) {memset(a,0,sizeof(T)*(b-a));}
template<class T>il bool ckmax(T &a,const T &b) {return a<b?a=b,1:0;}
template<class T>il bool ckmin(T &a,const T &b) {return a>b?a=b,1:0;}
namespace MOD_CALC
{
const int md=998244353,inv2=(md+1)/2;
il int add(const int a,const int b) {return a+b>=md?a+b-md:a+b;}
il int sub(const int a,const int b) {return a-b<0?a-b+md:a-b;}
il int mul(const int a,const int b) {return (LL)a*b%md;}
il void inc(int &a,const int b) {(a+=b)>=md?a-=md:0;}
il void dec(int &a,const int b) {(a-=b)<0?a+=md:0;}
il int qpow(int a,int b) {int r=1; for(; b; b>>=1,a=mul(a,a)) if(b&1) r=mul(r,a); return r;}
il int qpow(int a,int b,const int p) {int r=1; for(; b; b>>=1,a=(LL)a*a%p) if(b&1) r=(LL)r*a%p; return r;}
il int mdinv(const int a) {return qpow(a,md-2);}
template<class ...Args>il int add(const int a,const int b,const Args &...args) {return add(add(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
} using namespace MOD_CALC;
namespace i207M
{
#pragma endregion
#define N 105
struct Node
{
	int x,y;
	Node() {}
	Node(const int _x,const int _y) {x=_x,y=_y;}
} pt[N];
int n;
int calc(int T)
{
	static int xp[N]; int cntx=0;
	for(ri i=1; i<=n; ++i)
		xp[++cntx]=pt[i].x-T,xp[++cntx]=pt[i].x+T+1;
	sort(xp+1,xp+1+cntx);
	cntx=unique(xp+1,xp+1+cntx)-xp-1;
	int ans=0;
	for(ri i=1; i<cntx; ++i)
	{
		static pii yp[N]; int cnty=0;
		for(ri j=1; j<=n; ++j)
			if(pt[j].x-T<=xp[i]&&xp[i]<=pt[j].x+T)
			{
				yp[++cnty]=mp(pt[j].y-T,1);
				yp[++cnty]=mp(pt[j].y+T+1,-1);
			}
		sort(yp+1,yp+1+cnty);
		cnty=unique(yp+1,yp+1+cnty)-yp-1;
		int sum=0,sq=0;
		for(ri j=1; j<cnty; ++j)
		{
			sum+=yp[j].se;
			while(j<cnty&&yp[j+1].fi==yp[j].fi) sum+=yp[++j].se;
			if(sum>0) sq+=yp[j+1].fi-yp[j].fi;
		}
		// err("A",xp[i],xp[i+1],sq);
		inc(ans,mul(sq,xp[i+1]-xp[i]));
	}
	// err("T",T,ans);
	return ans;
}
const int inv6=mdinv(6);
il int sum2(int x)
{
	if(x<=0) return 0;
	return mul(x,x+1,2*x+1,inv6);
}
il int sum(int x)
{
	if(x<=0) return 0;
	return mul(x,x+1,inv2);
}
int solve(int l,int r) // [ , )
{
	// err("S",l,r);
	if(r-l<=3)
	{
		int ans=0;
		for(ri i=l; i<r; ++i) inc(ans,calc(i));
		return ans;
	}
	int g[3][4]; // C, B, A
	for(ri i=0; i<3; ++i)
	{
		g[i][0]=1;
		for(ri j=1; j<3; ++j) g[i][j]=mul(g[i][j-1],l+i);
		g[i][3]=calc(l+i);
		// err(g[i][3]);
	}
	for(ri i=0; i<3; ++i)
	{
		int iv=mdinv(g[i][i]);
		for(ri j=i; j<4; ++j) g[i][j]=mul(g[i][j],iv);
		for(ri j=0; j<3; ++j)
			if(i!=j&&g[j][i])
			{
				for(ri k=3; k>=i; --k) dec(g[j][k],mul(g[j][i],g[i][k]));
			}
	}
	int A=g[2][3],B=g[1][3],C=g[0][3];
	int ans=0;
	inc(ans,mul(A,sub(sum2(r-1),sum2(l-1))));
	inc(ans,mul(B,sub(sum(r-1),sum(l-1))));
	inc(ans,mul(C,r-l));
	return ans;
}
int T;
int tim[N*N],cntt;
signed main()
{
#ifdef M207
	freopen("in.in","r",stdin);
	// freopen("ot.out","w",stdout);
#endif
	in(n,T); int mn=0;
	for(ri i=1; i<=n; ++i)
	{
		in(pt[i].x,pt[i].y);
		ckmin(mn,min(pt[i].x,pt[i].y));
	}
	for(ri i=1; i<=n; ++i) pt[i].x-=mn,pt[i].y-=mn;
	tim[++cntt]=0,tim[++cntt]=T+1;
	for(ri i=1; i<=n; ++i)
		for(ri j=1; j<i; ++j)
		{
			int d=max(abs(pt[i].x-pt[j].x),abs(pt[i].y-pt[j].y));
			tim[++cntt]=(d+1)/2;
			if(tim[cntt]>T) --cntt;
		}
	sort(tim+1,tim+1+cntt);
	cntt=unique(tim+1,tim+1+cntt)-tim-1;
	int ans=0;
	// for(ri i=0; i<=T; ++i) inc(ans,calc(i));
	for(ri i=1; i<cntt; ++i) inc(ans,solve(tim[i],tim[i+1]));
	ans=sub(mul(T+1,calc(T)),ans);
	out(ans);
	return 0;
}
#pragma region
}
signed main()
{
	i207M::main();
	return 0;
}
#pragma endregion

#include<bits/stdc++.h>
#define mod 998244353
#define inv6 166374059
#define inv2 499122177
#define maxn 200005
using namespace std;
int Ha[maxn];
int sum[maxn],cnt[maxn];
int add(int a,int b){a+=b; return a>=mod?a-mod:a;}
int ksm(int a,int b)
{
	int s=1;
	for(;b;b>>=1,a=1ll*a*a%mod)
		if(b&1) s=1ll*s*a%mod;
	return s;
}
void Modify(int p,int l,int r,int x,int y,int v)
{
	if(r<=x||l>=y) return;
	if(x<=l&&r<=y)
	{
		cnt[p]+=v;
		sum[p]=cnt[p]?Ha[r]-Ha[l]:(r-l==1?0:sum[p<<1]+sum[p<<1|1]);
		return;
	}
	int mid=(l+r)>>1;
	Modify(p<<1,l,mid,x,y,v);
	Modify(p<<1|1,mid,r,x,y,v);
	sum[p]=cnt[p]?Ha[r]-Ha[l]:sum[p<<1]+sum[p<<1|1];
}
struct atom
{
	int x,l,r,ty;//all coordinates are on the edges
}d[maxn]; int tot;
int cmp(atom a,atom b){return (a.x==b.x)?a.ty<b.ty:a.x<b.x;}
int n,t;
int Get()
{
	Ha[0]=0;
	for(int i=1;i<=tot;i++)
	{
		Ha[++Ha[0]]=d[i].l;
		Ha[++Ha[0]]=d[i].r;
	}
	sort(Ha+1,Ha+Ha[0]+1);
	Ha[0]=unique(Ha+1,Ha+Ha[0]+1)-Ha-1;
	for(int i=1;i<=tot;i++)
	{
		d[i].l=lower_bound(Ha+1,Ha+Ha[0]+1,d[i].l)-Ha;
		d[i].r=lower_bound(Ha+1,Ha+Ha[0]+1,d[i].r)-Ha;
	}
	int ret=0;
	sort(d+1,d+tot+1,cmp);
	for(int i=1;i<=tot;i++)
	{
		if(i!=1) ret=add(ret,1ll*(d[i].x-d[i-1].x)*sum[1]%mod);
		if(d[i].ty==1) Modify(1,1,Ha[0],d[i].l,d[i].r,1);
		else Modify(1,1,Ha[0],d[i].l,d[i].r,-1);
	}
	return ret;
}
int Poly[15],A[15],B[15];
void PolyGet(int n,int *x,int *y,int *res)
{
	static int P[15],inv[15],tmp[15];
	memset(P,0,sizeof(P));
	memset(tmp,0,sizeof(tmp));
	for(int i=1;i<=n;i++)
		inv[i]=ksm(x[i],mod-2);
	P[0]=1;
	for(int i=1;i<=n;i++)
		for(int j=n;j>=0;j--)
			P[j]=add(1ll*P[j]*(mod-x[i])%mod,P[j-1]);
	for(int i=1;i<=n;i++)
	{
		tmp[0]=1ll*P[0]*inv[i]%mod,tmp[0]=mod-tmp[0]; int div=1;
		for(int j=1;j<=n;j++) if(i!=j) div=1ll*div*add(x[i],mod-x[j])%mod;
		for(int j=1;j<=n-1;j++)
			tmp[j]=1ll*add(tmp[j-1],mod-P[j])*inv[i]%mod;
		div=ksm(div,mod-2);
		for(int j=0;j<=n-1;j++) res[j]=add(res[j],1ll*tmp[j]*y[i]%mod*div%mod);
	}
}
int getsq(int x)
{
	return 1ll*x*(x+1)%mod*(2*x+1)%mod*inv6%mod;
}
int getli(int x)
{
	return 1ll*x*(x+1)%mod*inv2%mod;
}
int px[maxn],py[maxn];
int ti[maxn];
int main()
{
	scanf("%d%d",&n,&t);
	if(!t) return puts("0"),0;
	for(int i=1;i<=n;i++)
		scanf("%d%d",&px[i],&py[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
		{
			ti[++ti[0]]=max((abs(px[i]-px[j])-1)/2,(abs(py[i]-py[j])-1)/2);
			if(ti[ti[0]]>=t-1) ti[0]--;
		}
	ti[++ti[0]]=0;
	sort(ti+1,ti+ti[0]+1);
	ti[0]=unique(ti+1,ti+ti[0]+1)-ti-1;
	ti[++ti[0]]=t-1;
	int la=0,ans=0;
	for(int i=1;i<=ti[0];i++)
	{
		if(ti[i]-la+1<3)
		{
			for(int nt=la;nt<=ti[i];nt++)
			{
				tot=0;
				for(int j=1;j<=n;j++)
				{
					d[++tot]=(atom){px[j]-nt-1,py[j]-nt-1,py[j]+nt,1};
					d[++tot]=(atom){px[j]+nt,py[j]-nt-1,py[j]+nt,-1};
				}
				ans=add(ans,Get());
			}
		}
		else
		{
			for(int nt=la;nt<la+3;nt++)
			{
				tot=0;
				for(int j=1;j<=n;j++)
				{
					d[++tot]=(atom){px[j]-nt-1,py[j]-nt-1,py[j]+nt,1};
					d[++tot]=(atom){px[j]+nt,py[j]-nt-1,py[j]+nt,-1};
				}
				A[nt-la+1]=Get();
				B[nt-la+1]=nt;
			}
			memset(Poly,0,sizeof(Poly));
			PolyGet(3,B,A,Poly);
			ans=add(ans,1ll*Poly[2]*add(getsq(ti[i]),la?mod-getsq(la-1):0)%mod);
			ans=add(ans,1ll*Poly[1]*add(getli(ti[i]),la?mod-getli(la-1):0)%mod);
			ans=add(ans,1ll*Poly[0]*(ti[i]-la+1)%mod);
		}
		la=ti[i]+1;
	}
	tot=0;
	for(int i=1;i<=n;i++)
	{
		d[++tot]=(atom){px[i]-t-1,py[i]-t-1,py[i]+t,1};
		d[++tot]=(atom){px[i]+t,py[i]-t-1,py[i]+t,-1};
	}
	ans=add(mod-ans,1ll*t*Get()%mod);
	printf("%d\n",ans);
	return 0;
}

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define N 505
#define ll long long
#define mod 998244353
#define ls (q << 1)
#define rs (q << 1 | 1)
int n, T;
int X[N], Y[N], l[N], d[N];
struct node
{
	int lev, val;
	int sum;
}t[N << 2];
struct data
{
	int p, c, u, d;
	data(){}
	data(int pp, int cc, int dd, int uu){p = pp, c = cc, d = dd, u = uu;}
	bool operator < (data b)const{return p < b.p;}
}h[N];
int Pow(int a, int k)
{
	if (!k)return 1;
	int p = Pow(a, k / 2);
	if (k & 1)
		return (ll)p * p % mod * a % mod;
	return (ll)p * p % mod;
}
void Pushup(int q)
{
	if (t[q].lev)
		t[q].sum = t[q].val;
	else
		t[q].sum = t[ls].sum + t[rs].sum;
}
void Build(int q, int l, int r)
{
	if (l == r)
	{
		t[q].lev = 0;
		t[q].sum = 0;
		t[q].val = d[l] - d[l - 1];
        return;
    }
	t[q].lev = 0;
	t[q].sum = 0;
	t[q].val = d[r] - d[l - 1];
	int mid = (l + r) >> 1;
	Build(ls, l, mid);
	Build(rs, mid + 1, r);
}
void Update(int q, int l, int r, int L, int R, int c)
{
	if (L <= l && R >= r)
	{
		t[q].lev += c;
		Pushup(q);
		return;
	}
	int mid = (l + r) >> 1;
	if (L <= mid)
		Update(ls, l, mid, L, R, c);
	if (R > mid)
		Update(rs, mid + 1, r, L, R, c);
	Pushup(q);
}
ll Calc(int tim)
{
	int cnth = 0, cntl = 0, cntd = 0;
	for (int i = 1; i <= n; i++)
	{
		h[++cnth] = data(X[i] - tim, 1, Y[i] - tim, Y[i] + tim);
		h[++cnth] = data(X[i] + tim + 1, -1, Y[i] - tim, Y[i] + tim);
		l[++cntl] = Y[i] + tim;
		l[++cntl] = Y[i] - tim;
	}
	sort(h + 1, h + cnth + 1);
	sort(l + 1, l + cntl + 1);
	cntl = unique(l + 1, l + cntl + 1) - l - 1;
	d[0] = l[1] - 1;
	for (int i = 1; i <= cntl; i++)
	{
		d[++cntd] = l[i];
		if (i != cntl && l[i + 1] != l[i] + 1)
			d[++cntd] = l[i + 1] - 1;
	}
	Build(1, 1, cntd);
	int ret = 0;
	for (int i = 1; i <= cnth; i++)
	{
		if (i != 1)
			ret = (ret + (ll)t[1].sum * (h[i].p - h[i - 1].p)) % mod;
		h[i].u = lower_bound(d + 1, d + cntd + 1, h[i].u) - d;
		h[i].d = lower_bound(d + 1, d + cntd + 1, h[i].d) - d;
		Update(1, 1, cntd, h[i].d, h[i].u, h[i].c);
	}
	if (ret < 0)ret += mod;
	return ret;
}
int nr[2505], cnt;
ll px[5], py[5];
int Sqr(int n){return (ll)n * (n + 1) % mod * (2 * n + 1) % mod * 166374059 % mod;}
int Sum(int n){return (ll)n * (n + 1) % mod * 499122177 % mod;}
int main()
{
	scanf("%d%d", &n, &T);
	for (int i = 1; i <= n; i++)
		scanf("%d%d", &X[i], &Y[i]);
	nr[++cnt]=0;
	for (int i = 1; i <= n; i++)
		for (int j = i + 1; j <= n; j++)
		{
			int yu = max((abs(X[i] - X[j]) + 1) / 2, (abs(Y[i] - Y[j]) + 1) / 2);
			nr[++cnt] = yu;
		}
	nr[++cnt] = T;
	sort(nr + 1, nr + cnt + 1);
	cnt = unique(nr + 1, nr + cnt + 1) - nr - 1;
	int ans = (ll)T * Calc(T) % mod;
	for (int i = 1; i <= cnt; i++)
	{
		if (nr[i] == T)break;
		int tot = 0;
        int ti = nr[i];
        while (ti - nr[i] < 3 && ti != nr[i+1])
		{
			px[++tot] = ti;
			py[tot] = Calc(ti);
			++ti;
		}
        if (tot <= 2)
		{
			for (int j = 1; j <= tot; j++)
				ans = (ans - py[j]) % mod;
		}
		else
		{
            int A = 0,B = 0,C = 0;
            for (int j = 1; j <= tot; j++)
			{
                int lp = py[j];
                int ss = 0, sc = 1;
				for (int k = 1; k <= tot; k++)
				{
					if (k == j)
						continue;
					lp = (ll)lp * Pow(px[j] - px[k], mod - 2) % mod;
                    ss = (ss + px[k]) % mod;
                    sc = (ll)sc * px[k] % mod;
				}
				A = (A + lp) % mod;
				B = (B - (ll)lp * ss) % mod;
				C = (C + (ll)lp * sc) % mod;
			}
			int st = nr[i], nd = nr[i + 1] - 1;
			ans = (ans - ((ll)A * (Sqr(nd) - Sqr(st - 1)) % mod + (ll)B * (Sum(nd) - Sum(st - 1)) % mod + (ll)C * (nd - st + 1) % mod)) % mod;
		}
	}
	if (ans < 0)ans += mod;
	printf("%d\n", ans);
}

#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int N, T;
  cin >> N >> T;
  vector<int> x(N), y(N);
  for (int i = 0; i < N; i++) {
    cin >> x[i] >> y[i];
  }
  vector imp = {0, T + 1};
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= T) {
        imp.emplace_back(t);
      }
    }
  }
  auto func = [&] (auto & vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  func(imp);
  auto calc_single = [&] (int t) {
    vector<int> appx, appy;
    for (int i = 0; i < N; i++) {
      appx.emplace_back(x[i] - t);
      appx.emplace_back(x[i] + t + 1);
      appy.emplace_back(y[i] - t);
      appy.emplace_back(y[i] + t + 1);
    }
    func(appx);
    func(appy);
    auto find = [&] (auto & vec, int v) {
      return lower_bound(vec.begin(), vec.end(), v) - vec.begin();
    };
    vector<vector<tuple<int, int, int> > > eve(appx.size());
    for (int i = 0; i < N; i++) {
      int xl = find(appx, x[i] - t), xr = find(appx, x[i] + t + 1);
      int yl = find(appy, y[i] - t), yr = find(appy, y[i] + t + 1);
      eve[xl].emplace_back(yl, yr, 1);
      eve[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(appy.size());
    int res = 0;
    for (int i = 0; i < appx.size() - 1; i++) {
      for (auto &[l, r, v] : eve[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j < appy.size() - 1; j++) {
        if (val[j]) {
          int dx = appx[i + 1] - appx[i], dy = appy[j + 1] - appy[j];
          res = (res + (ll)dx * dy) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (auto & vec, int n) {
    const static array inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = vec.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      cur = (ll)cur * (n - i) % MOD;
      pre[i] = cur;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      cur = (ll)cur * (n - i) % MOD;
      suf[i] = cur;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int val = (ll)inv[i] * inv[m - i] % MOD;
      val = (ll)val * vec[i] % MOD;
      if (i) {
        val = (ll)val * pre[i - 1] % MOD;
      }
      if (i < m) {
        val = (ll)val * suf[i + 1] % MOD;
      }
      if (m - i + 1 & 1) {
        res = (res + val) % MOD;
      } else {
        res = (res - val + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc_single(i)) % MOD;
      }
      return res;
    };
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc_single(l + i);
      if (i) {
        val[i] = (val[i - 1] + val[i]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(T + 1) * calc_single(T) % MOD;
  for (int i = 1; i < imp.size(); i++) {
    ans = (ans - calc_sum(imp[i - 1], imp[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int mo=998244353;
const int N=105;
int n,x[N],y[N];
int T,q[N*N];
int Area(int T){
	static int qx[N],qy[N];
	*qx=*qy=0;
	For(i,1,n){
		qx[++*qx]=x[i]-T;
		qx[++*qx]=x[i]+T+1;
		qy[++*qy]=y[i]-T;
		qy[++*qy]=y[i]+T+1;
	}
	sort(qx+1,qx+*qx+1);
	sort(qy+1,qy+*qy+1);
	*qx=unique(qx+1,qx+*qx+1)-qx-1;
	*qy=unique(qy+1,qy+*qy+1)-qy-1;
	static int sum[N][N];
	memset(sum,0,sizeof(sum));
	For(i,1,n){
		int x1=lower_bound(qx+1,qx+*qx+1,x[i]-T)-qx;
		int x2=lower_bound(qx+1,qx+*qx+1,x[i]+T+1)-qx;
		int y1=lower_bound(qy+1,qy+*qy+1,y[i]-T)-qy;
		int y2=lower_bound(qy+1,qy+*qy+1,y[i]+T+1)-qy;
		sum[x1][y1]++; sum[x2][y2]++;
		sum[x1][y2]--; sum[x2][y1]--;
	}
	For(i,1,*qx) For(j,1,*qy) sum[i][j]+=sum[i][j-1];
	For(i,1,*qx) For(j,1,*qy) sum[i][j]+=sum[i-1][j];
	ll ans=0;
	For(i,1,(*qx)-1) For(j,1,(*qy)-1)
		if (sum[i][j]) ans+=1ll*(qx[i+1]-qx[i])*(qy[j+1]-qy[j]);
	return ans%mo;
}
int S0(int l,int r){
	return r-l+1;
}
int S1(int l,int r){
	return 1ll*(l+r)*(r-l+1)/2%mo;
}
int S2(int l,int r){
	int vr=1ll*r*(r+1)%mo*(r*2+1)%mo;
	int vl=1ll*l*(l-1)%mo*(l*2-1)%mo;
	return (vr+mo-vl)*1ll*(mo+1)/6%mo;
}
int Func(int l,int r){
	int f0=Area(l);
	int f1=Area(l+1);
	int f2=Area(l+2);
	int a=(f2+f0+2ll*mo-f1-f1)*(mo+1)/2%mo;
	int b=(f1+2ll*mo-f0-1ll*(2*l+1)*a%mo)%mo;
	int c=(f0+2ll*mo-1ll*l*l%mo*a%mo-1ll*l*b%mo)%mo;
	assert((1ll*l*l%mo*a+1ll*l*b+c)%mo==f0);
	assert((1ll*(l+1)*(l+1)%mo*a+1ll*(l+1)*b+c)%mo==f1);
	assert((1ll*(l+2)*(l+2)%mo*a+1ll*(l+2)*b+c)%mo==f2);
	return (1ll*a*S2(l,r)+1ll*b*S1(l,r)+1ll*c*S0(l,r))%mo;
}
/*
3-al
al^2
a(l+1)^2
a(l+2)^2
*/
int main(){
	scanf("%d%d",&n,&T);
	For(i,1,n) scanf("%d%d",&x[i],&y[i]);
	For(i,1,n) For(j,i+1,n)
		q[++*q]=(max(abs(x[i]-x[j]),abs(y[i]-y[j]))+1)/2;
	q[++*q]=T+1;
	sort(q+1,q+*q+1);
	*q=unique(q+1,q+*q+1)-q-1;
	for (;q[*q]!=T+1;--*q);
	int top=*q; q[0]=0;
	int ans=1ll*Area(T)*(T+1)%mo;
	For(i,1,top) ans=(ans+mo-Func(q[i-1],q[i]-1))%mo;
	printf("%d\n",ans);
}
/*
41
17
2
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

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 FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#define unordered_map __fast_unordered_map
template<class Key, class Value, class Hash = std::hash<Key>>
using unordered_map = __gnu_pbds::gp_hash_table<Key, Value, Hash>;

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

const int Mod = 998'244'353;

int PowMod(int a, int n) {
  int r = 1;
  while (n) {
    if (n & 1) { r = (LL)r * a % Mod; }
    n >>= 1;
    a = (LL)a * a % Mod;
  }
  return r;
}

struct Point {
  int x, y;
};

const int MaxN = 64;

Point pts[MaxN];
int N, T;

LL GetNumCovered(int tm) {
  struct Event {
    int x;
    int y1, y2;
    int coef;

    bool operator<(const Event &other) const {
      return x < other.x;
    }
  };

  vector<int> all_ys;

  vector<Event> events;
  for (int i = 0; i < N; ++i) {
    events.push_back(Event{pts[i].x - tm, pts[i].y - tm, pts[i].y + tm + 1, 1});
    events.push_back(Event{pts[i].x + tm + 1, pts[i].y - tm, pts[i].y + tm + 1, -1});
    all_ys.PB(pts[i].y + tm + 1);
    all_ys.PB(pts[i].y - tm);
  }

  sort(ALL(events));
  sort(ALL(all_ys));
  all_ys.resize(unique(ALL(all_ys)) - all_ys.begin());
  vector<int> count_covers(SZ(all_ys));

  int last_x = -1e9;
  LL answer = 0;
  LL total_y = 0;

  for (auto &event : events) {
    const int x = event.x;
    answer += (x - last_x) * total_y;
    last_x = x;

    const int start_y = lower_bound(ALL(all_ys), event.y1) - all_ys.begin();
    const int end_y = lower_bound(ALL(all_ys), event.y2) - all_ys.begin();

    for (int i = start_y; i < end_y; ++i)
      count_covers[i] += event.coef;

    total_y = 0;
    for (int i = 0; i < SZ(all_ys) - 1; ++i) {
      if (count_covers[i]) {
        total_y += all_ys[i + 1] - all_ys[i];
      }
    }

    //debug(all_ys, count_covers);
  }

  return answer;
}

LL GetIncrNumCovered(int tm) {
  return GetNumCovered(tm) - GetNumCovered(tm - 1);
}

const int Inv2 = PowMod(2, Mod - 2);
const int Inv6 = PowMod(6, Mod - 2);

int SumQuad(int A, int B, int C, int n) {
  LL ans = (LL)C * n % Mod;
  LL bcoef = (n * (n + 1)) % Mod * Inv2 % Mod;
  ans = (ans + bcoef * B) % Mod;
  LL acoef = (n * (n + 1)) % Mod * (2 * n + 1) % Mod * Inv6 % Mod;
  ans = (ans + acoef * A) % Mod;
  return ans;
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);

  cin >> N >> T;
  for (int i = 0; i < N; ++i) {
    cin >> pts[i].x >> pts[i].y;
  }

  int cur_tm = 2;
  LL p0 = GetIncrNumCovered(2);
  LL p1 = GetIncrNumCovered(1);
  debug(p0, p1);
  LL answer = 0;
  if (T >= 1) { answer = (answer + p1) % Mod; }
  if (T >= 2) { answer = (answer + 2LL * p0) % Mod; }
  if (T <= 2) {
    cout << answer << "\n";
    return 0;
  }

  while (cur_tm < T) {
    int left_lin = cur_tm;
    int right_lin = T;

    while (right_lin - left_lin > 1) {
      const int mid_lin = (left_lin + right_lin) / 2;
      const LL pmid = GetIncrNumCovered(mid_lin);
      debug(p0, p1, mid_lin, pmid);

      if (p0 + (mid_lin - cur_tm) * (p0 - p1) == pmid) {
        left_lin = mid_lin;
      } else {
        right_lin = mid_lin;
      }
    }

    debug(left_lin);
    const LL A = (p0 - p1) % Mod;
    const LL B = (p0 + cur_tm * (p0 - p1)) % Mod;
    const LL C = (p0 % Mod) * cur_tm % Mod;

    debug(A, B, C);
    answer = (answer + SumQuad(A, B, C, left_lin - cur_tm)) % Mod;

    p1 = GetIncrNumCovered(left_lin);
    p0 = GetIncrNumCovered(left_lin + 1);
    cur_tm = left_lin + 1;
    answer = (answer + (LL)(p0 % Mod * cur_tm)) % Mod;
    debug(cur_tm, answer);
  }

  cout << answer << "\n";
}

#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int maxn = 100 * 64, inf = 2e8;
vector<pair<int,int>> loc;
vector<int> dif;
const int p = 998244353, inv = p - p/2, inv6 = 166374059;
ll res;
void add(ll &a, ll v) {
	a += v - p;
	a += (a>>63) & p;
}
#define L(i) ptr[i].l
#define R(i) ptr[i].r
#define S(i) ptr[i].sum
#define C(i) ptr[i].cnt
#define LEN(i) ptr[i].len
#define V(i) (ptr[i].cnt ? ptr[i].len : ptr[i].sum)
struct node {
	int l, r, sum, cnt, len;
}ptr[maxn];
struct sgt {
	int mem;
	void reset() {
		mem = 1;
		ptr[1] = {0, 0, 0, 0, (inf << 1)+1};
	}
	int new_node(int l, int r) {
		return ptr[++mem] = {0, 0, 0, 0, r-l+1}, mem;
	}
	void update(int i) {
		S(i) = V(L(i)) + V(R(i));
	}
	void add(int al, int ar, int d, int l = 0, int r = inf << 1, int i = 1) {
		if (al > r || ar < l) return;
		int m = l + r >> 1;
		//cerr << "Add " << al << ' ' << ar << " : " << d << " L R " << l << ' ' << r << '\n';
		if (al <= l && ar >= r) {
			C(i) += d;
			return;
		}
		if (!L(i)) L(i) = new_node(l, m);
		if (!R(i)) R(i) = new_node(m+1, r);
		add(al, ar, d, l, m, L(i));
		add(al, ar, d, m+1, r, R(i));
		update(i);
	}
	ll query() {
		return V(1);
	}
}tree;
struct info {
	int l, r, d;
};
ll area(int t) {
	tree.reset();
	map<int, vector<info>> seg;
	for (const auto &[x, y] : loc) {
		seg[x-t].push_back({y-t, y+t, 1});
		seg[x+t+1].push_back({y-t, y+t, -1});
	}
	ll lsta = 0, lstx = 0, res = 0;
	for (const auto &[x, v] : seg) {
		lsta = tree.query();
		//cerr << "X " << x << " lst area " << lsta << '\n';
		res += lsta * (x-lstx) ;
		lstx = x;
		for (const auto &[l, r, d] : v)
			tree.add(l, r, d);
	}
	//cerr << "AREA  " << t << " : " << res << '\n';
	return res;
}
ll sum(ll a, ll d, ll n) {
	a %= p, d %= p;
	return (a + a + d * (n-1)) % p * n % p * inv % p;
}
ll ss(ll w) {
	return w * (w+1) % p * (w + w + 1) % p * inv6 % p;
}
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
//	for (int i = 1;i <= 10;++i)
//		cout << ss(i) << ' ';
//	return 0;
	int n, t;
	cin >> n >> t;
	loc.resize(n);
	for (auto &[x, y] : loc) cin >> x >> y, x += inf, y += inf;
	auto dis = [&](int a, int b) {
		return (max(abs(loc[a].first-loc[b].first), abs(loc[a].second - loc[b].second))-1) >> 1;
	};
	for (int i = 0;i < n;++i)
		for (int j = i+1;j < n;++j)
			if (dis(i, j) <= t) dif.pb(dis(i, j));//  if (dis(i, j) == 15) cerr << "I J " << i << ' ' << j << '\n'; }
	dif.pb(0);
	dif.pb(t);
	sort(dif.begin(), dif.end());
	dif.resize(distance(dif.begin(), unique(dif.begin(), dif.end())));
//	for (int i = 1;i <= t;++i)
//		res += area(i);
//	cout << res << '\n';
//	return 0;
//	vector<ll> A(21);
//	for (int i = 1;i <= 20;++i)
//		cout << area(i) << ' ', A[i] = area(i);
//	cout << '\n';
//	for (int i = 1;i <= 20;++i)
//		cout << A[i]-A[i-1] << ' ';
//	cout << '\n';
		ll tmp = 0;

	for (int i = 1;i < dif.size();++i) {
		int lst = dif[i-1], now = dif[i];
		//for (int i = lst+1;i <= now;++i) tmp += area(i);
		if (now <= lst+5) {
			for (int i = lst+1;i <= now;++i)
				add(res, area(i) % p);//, cerr << "ADD " << area(i) << '\n';
			continue;
		}
//			vector<ll> A;
//			for (int i = lst+1;i <= now;++i)
//				A.pb(area(i));
//			for (int i = 1;i < A.size();++i)
//				cout << A[i]-A[i-1] << ' ';
//			cout << '\n';

		ll a = area(lst+1), b = area(lst+2), c = area(lst+3), d = (c-b) - (b-a), f = b-a, w = now-lst-1;
		//cout << "D " << d << '\n';
		add(res, a % p * (w+1) % p);
		add(res, sum(f, f, w));
		add(res, sum(d % p * w, d % p * w, w-1));
		add(res, ss(w-1) * -d % p + p);
		//cout << "NOW " << now << ' ' << res << " VS " << tmp << '\n';
		//if (now >= 15) return 0;
	}
//	if (t <= 100000) {
//		for (int i= 1; i <= t;++i) tmp += area(i);
//		cerr << res << ' ' << tmp << '\n';
//		res = tmp;
//	}

	//cout << res << '\n';
	ll o = -res - n + (t+1) * (area(t) % p);
	o %= p;
	if (o < 0) o += p;
	cout << o << '\n';
}

#include<bits/stdc++.h>
#define mem(f) memset(f,0,sizeof(f))
using namespace std;
typedef long long ll;
const int N=55,mod=998244353,i2=499122177,i6=166374059;

int n,t,ans,b[N*N],num,tot,cot;
bool exi[N];ll a[5];
struct P{
	int x,y;
	bool operator<(const P&ky)const{return (x^ky.x)?x<ky.x:y<ky.y;}
}p[N];
struct Q{
	int x,id;bool v;
	bool operator<(const Q&ky)const{return x<ky.x;}
}q[N<<1],c[N<<1];

inline void ad(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline int dc(int x,int y){x-=y;return x<0?x+mod:x;}

inline int F(int t)
{
	int i,j,k,l,re=0,res,nw;tot=0;
	for(i=1;i<=n;++i){
		q[++tot]={p[i].x-t,i,true};
		q[++tot]={p[i].x+t+1,i,false};
	}
	memset(exi,false,sizeof(exi));
	sort(q+1,q+tot+1);
	for(i=j=1;i<=tot;i=j){
		for(;j<=tot && q[j].x==q[i].x;++j)
		  exi[q[j].id]=q[j].v;
		for(cot=0,k=1;k<=n;++k)
		  if(exi[k]) c[++cot]={p[k].y-t,0,true},c[++cot]={p[k].y+t+1,0,false};
		sort(c+1,c+cot+1);res=nw=0;
		for(k=l=1;k<=cot;k=l){
			for(;l<=cot && c[l].x==c[k].x;++l) res+=c[l].v?1:(-1);
			if(res && l<=cot) ad(nw,c[l].x-c[l-1].x);
		}
		if(j<=tot) ad(re,(ll)nw*(q[j].x-q[j-1].x)%mod);
	}
	return re;
}

inline int cal(ll x)
{
	a[0]=a[0]*i2%mod;a[2]=a[2]*i2%mod;
	int re=((a[0]-a[1]+a[2])%mod+mod)%mod*x%mod*(x+1)%mod*(x+x+1)%mod*(ll)i6%mod;
	ad(re,((-3LL*a[0]+a[1]+a[1]-a[2])%mod+mod)%mod*x%mod*(x+1)%mod*(ll)i2%mod);
	ad(re,(x+1)*a[0]*2%mod);return re;
}

int main(){
	int i,j,k;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;++i) scanf("%d%d",&p[i].x,&p[i].y);
    sort(p+1,p+n+1);
	for(i=1;i<=n;++i)
	 for(j=i+1;j<=n;++j)
	  b[++num]=(max(p[j].x-p[i].x,abs(p[j].y-p[i].y))+1)>>1;
	b[++num]=0;b[++num]=t;sort(b+1,b+num+1);
	for(i=1;b[i]<t;++i){
		k=b[i+1]-b[i];
		for(j=0;j<min(3,k);++j) a[j]=F(b[i]+j);
		if(k>3) ad(ans,cal(k-1));else
		for(j=0;j<k;++j) ad(ans,a[j]);
	}
	printf("%d",dc((ll)t*F(t)%mod,ans));
	return 0;
}

#include <bits/stdc++.h>
#define fi first
#define se second
#define gc getchar() //(p1==p2&&(p2=(p1=buf)+fread(buf,1,size,stdin),p1==p2)?EOF:*p1++)
#define mk make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define IT iterator
#define V vector
#define TP template <class o>
#define TPP template <typename t1, typename t2>
#define SZ(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define REP(i, a, b) for (int i = b; i >= a; i--)
#define FOR(i,n) rep(i,1,n)
#define debug(x) cerr << #x << " = " << x << endl
using namespace std;
typedef unsigned ui;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
const int N = 55, size = 1 << 20, mod = 998244353, inf = 2e9;
const ll INF = 1e15;

// char buf[size],*p1=buf,*p2=buf;
TP void qr(o& x) {
    char c = gc;
    x = 0;
    int f = 1;
    while (!isdigit(c)) {
        if (c == '-')
            f = -1;
        c = gc;
    }
    while (isdigit(c))
        x = x * 10 + c - '0', c = gc;
    x *= f;
}
TP void qw(o x) {
    if (x / 10)
        qw(x / 10);
    putchar(x % 10 + '0');
}
TP void pr1(o x) {
    if (x < 0)
        x = -x, putchar('-');
    qw(x);
    putchar(' ');
}
TP void pr2(o x) {
    if (x < 0)
        x = -x, putchar('-');
    qw(x);
    putchar('\n');
}

// math
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll power(ll a, ll b = mod - 2, ll p = mod) {
    ll c = 1;
    while (b) {
        if (b & 1)
            c = c * a % p;
        b /= 2;
        a = a * a % p;
    }
    return c;
}

TP void cmax(o& x, o y) {
    if (x < y)
        x = y;
}
TP void cmin(o& x, o y) {
    if (x > y)
        x = y;
}
TPP void ad(t1& x, t2 y) {
    x += y;
    if (x >= mod)
        x -= mod;
}
TPP void dl(t1& x, t2 y) {
    x -= y;
    if (x < 0)
        x += mod;
}

int n,x[N],y[N],t,in[N*N],tot;

namespace rec {
	const int N=210;
	struct node {int c,l;} tr[N<<2];
	#define lc x<<1
	#define rc x<<1|1
	int val[N],num;
	void add(int x,int l,int r,int L,int R,int d) {
		if(L <= l && r <= R) {
			tr[x].c += d;
			if(tr[x].c) tr[x].l=val[r+1]-val[l];
			else if(l == r) tr[x].l=0;
			else tr[x].l=tr[lc].l+tr[rc].l;
			return ;
		}
		int mid=(l+r)/2;
		if(L <= mid) add(lc,l,mid,L,R,d);
		if( R > mid) add(rc,mid+1,r,L,R,d);
		if(!tr[x].c) tr[x].l=tr[lc].l+tr[rc].l;
	}

	int get(int x) {return lower_bound(val+1,val+num+1,x)-val;}

	struct E {int l,r,d;} ;
	V<E> eve[N];

	ll f(int t) {
		val[num=0]=0;
		rep(i,1,n) {
			val[++num]=x[i]-t;
			val[++num]=x[i]+t+1;
			val[++num]=y[i]-t;
			val[++num]=y[i]+t+1;
		}
		sort(val+1,val+num+1); num=unique(val+1,val+num+1)-(val+1);
		FOR(i,num) eve[i].clear();
		FOR(i,n) {
			int xx=get(x[i]-t),X=get(x[i]+t+1),yy=get(y[i]-t),Y=get(y[i]+t+1)-1;
			eve[xx].pb((E){yy,Y,1});
			eve[X].pb((E){yy,Y,-1});
		}
		ll ans=0;
		FOR(i,num) {
			ad(ans,(ll)tr[1].l*(val[i+1]-val[i])%mod);
			for(auto j:eve[i]) add(1,1,num-1,j.l,j.r,j.d);
		}
		return ans;
	}
}

ll inv2=(mod+1)/2,inv3=(mod+1)/3,inv6=inv2*inv3%mod;

ll s1(ll x) {x %= mod; return (x+1)*x/2%mod;}
ll s2(ll x) {x %= mod; return x*(x+1)%mod*(2*x+1)%mod*inv6%mod;}

int main() {
	qr(n); qr(t);
	FOR(i,n) qr(x[i]),qr(y[i]);
	in[tot=1]=0; in[++tot]=t;
	FOR(i,n) rep(j,i+1,n) {
		int tmp=max(abs(x[i]-x[j]),abs(y[i]-y[j]))>>1;
		if(tmp <= t) in[++tot]=tmp;
		if(++tmp <= t) in[++tot]=tmp;
	}
	sort(in+1,in+tot+1); tot=unique(in+1,in+tot+1)-(in+1);
	ll ans=rec::f(t)*t%mod; tot--;
	FOR(i,tot) {
		int l=in[i],r=in[i+1];
		if(l+3>r) {
			while(l<r)
				dl(ans,rec::f(l++));
		}
		else {
			ll u=rec::f(l),v=rec::f(l+1),w=rec::f(l+2);
			ll a=(u+w-2*(v-mod))*inv2%mod;
			ll b=((v-u-a)%mod+mod)%mod;
			dl(ans,a*s2(r-l-1)%mod);
			dl(ans,b*s1(r-l-1)%mod);
			dl(ans,u*(r-l)%mod);
		}
	}
	pr2(ans);
	return 0;
}

#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define ls(_o) (_o<<1)
#define rs(_o) ((_o<<1)|1)
#define ll long long
#define p 998244353
#define abs(_o) ((_o<0)?-(_o):_o)
using namespace std;
namespace ywy{
	inline ll mi(int a,int b){
		ll ans=1,tmp=a;while(b){
			if(b&1)ans=(ans*tmp)%p;tmp=(tmp*tmp)%p;b>>=1;
		}return(ans);
	}int lsh[300],cnt[2001];int data[2001];
	inline void up(int tree,int l,int r){
		if(cnt[tree])data[tree]=lsh[r]-lsh[l-1];else data[tree]=data[ls(tree)]+data[rs(tree)];
	}
	void add(int rl,int rr,int l,int r,int tree,int x){
		if(rl==l&&rr==r){
			cnt[tree]+=x;if(!cnt[tree]){
				if(l==r)data[tree]=0;else data[tree]=data[ls(tree)]+data[rs(tree)];
			}else data[tree]=lsh[r]-lsh[l-1];return;
		}int mid=(l+r)>>1;if(rl>mid)add(rl,rr,mid+1,r,rs(tree),x);else{
			if(rr<=mid)add(rl,rr,l,mid,ls(tree),x);else{
				add(rl,mid,l,mid,ls(tree),x);add(mid+1,rr,mid+1,r,rs(tree),x);
			}
		}up(tree,l,r);
	}ll inv2,inv6;
	inline ll sig2(ll n){
		ll cjr=n;cjr*=(n+1);cjr%=p;cjr*=(n*2+1);cjr%=p;cjr*=inv6;return(cjr%p);
	}
	inline ll sig(ll n){
		ll cjr=n;cjr*=(n-1);cjr%=p;cjr*=inv2;return(cjr%p);
	}
	typedef struct _n{
		int l;int r;
	}node;vector<node> adds[300],dels[300];
	inline void clear(vector<node> &v){
		vector<node> tmp;v=tmp;
	}int xs[60],ys[60];int n;
	void build(int l,int r,int tree){
		cnt[tree]=data[tree]=0;if(l==r)return;int mid=(l+r)>>1;build(l,mid,ls(tree));build(mid+1,r,rs(tree));
	}
	inline ll getS(int t){
		int ptr=1;for(register int i=1;i<=n;i++){
			lsh[ptr]=xs[i]-t-1;ptr++;lsh[ptr]=xs[i]+t;ptr++;lsh[ptr]=ys[i]-t-1;ptr++;lsh[ptr]=ys[i]+t;ptr++;
		}ptr--;sort(lsh+1,lsh+1+ptr);ptr=unique(lsh+1,lsh+1+ptr)-lsh-1;build(1,ptr,1);
		for(register int i=1;i<=ptr;i++)clear(adds[i]),clear(dels[i]);
		for(register int i=1;i<=n;i++){
			node cjr;cjr.l=lower_bound(lsh+1,lsh+1+ptr,ys[i]-t-1)-lsh+1;
			cjr.r=lower_bound(lsh+1,lsh+1+ptr,ys[i]+t)-lsh;int l=lower_bound(lsh+1,lsh+1+ptr,xs[i]-t-1)-lsh;
			int r=lower_bound(lsh+1,lsh+1+ptr,xs[i]+t)-lsh;adds[l].push_back(cjr);dels[r].push_back(cjr);
		}ll ans=0;for(register int i=1;i<=ptr;i++){
			ans=(ans+data[1]*(ll)(lsh[i]-lsh[i-1]))%p;
			for(register int j=0;j<adds[i].size();j++)add(adds[i][j].l,adds[i][j].r,1,ptr,1,1);
			for(register int j=0;j<dels[i].size();j++)add(dels[i][j].l,dels[i][j].r,1,ptr,1,-1);
		}return(ans);
	}int tme[100001];
	void ywymain(){
		inv2=mi(2,p-2);inv6=mi(6,p-2);int t;cin>>n>>t;
		for(register int i=1;i<=n;i++)cin>>xs[i]>>ys[i];int ptr=1;for(register int i=1;i<=n;i++){
			for(register int j=1;j<i;j++){
				tme[ptr]=max(abs(xs[i]-xs[j]),abs(ys[i]-ys[j]))/2;if(tme[ptr]<=t)ptr++;
			}
		}tme[ptr]=0;ptr++;tme[ptr]=t;sort(tme+1,tme+1+ptr);ptr=unique(tme+1,tme+1+ptr)-tme-1;
		ll ans=(getS(t)*t)%p;for(register int i=1;i<ptr;i++){
			if(tme[i+1]-tme[i]<=2){
				for(register int j=tme[i];j<tme[i+1];j++)ans=(ans+p-getS(j))%p;continue;
			}ll c=getS(tme[i]),A=getS(tme[i]+1),B=getS(tme[i]+2);
			ll a=(B-A*2+c)*inv2;a%=p;a+=p;a%=p;ll b=A-c-a;b%=p;b+=p;b%=p;
			ans-=a*sig2(tme[i+1]-tme[i]-1);ans%=p;ans+=p;ans%=p;
			ans-=b*sig(tme[i+1]-tme[i]-1);ans%=p;ans+=p;ans%=p;
			ans-=c*(tme[i+1]-tme[i]);ans%=p;ans+=p;ans%=p;
		}cout<<ans<<endl;
	}
}
int main(){
	ywy::ywymain();return(0);
}

#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define ls(_o) (_o<<1)
#define rs(_o) ((_o<<1)|1)
#define ll long long
#define p 998244353
#define abs(_o) ((_o<0)?-(_o):_o)
using namespace std;
namespace ywy{
	inline ll mi(int a,int b){
		ll ans=1,tmp=a;while(b){
			if(b&1)ans=(ans*tmp)%p;tmp=(tmp*tmp)%p;b>>=1;
		}return(ans);
	}int lsh[300],cnt[2001];int data[2001];
	inline void up(int tree,int l,int r){
		if(cnt[tree])data[tree]=lsh[r]-lsh[l-1];else data[tree]=data[ls(tree)]+data[rs(tree)];
	}
	void add(int rl,int rr,int l,int r,int tree,int x){
		if(rl==l&&rr==r){
			cnt[tree]+=x;if(!cnt[tree]){
				if(l==r)data[tree]=0;else data[tree]=data[ls(tree)]+data[rs(tree)];
			}else data[tree]=lsh[r]-lsh[l-1];return;
		}int mid=(l+r)>>1;if(rl>mid)add(rl,rr,mid+1,r,rs(tree),x);else{
			if(rr<=mid)add(rl,rr,l,mid,ls(tree),x);else{
				add(rl,mid,l,mid,ls(tree),x);add(mid+1,rr,mid+1,r,rs(tree),x);
			}
		}up(tree,l,r);
	}ll inv2,inv6;
	inline ll sig2(ll n){
		ll cjr=n;cjr*=(n+1);cjr%=p;cjr*=(n*2+1);cjr%=p;cjr*=inv6;return(cjr%p);
	}
	inline ll sig(ll n){
		ll cjr=n;cjr*=(n-1);cjr%=p;cjr*=inv2;return(cjr%p);
	}
	typedef struct _n{
		int l;int r;
	}node;vector<node> adds[300],dels[300];
	inline void clear(vector<node> &v){
		vector<node> tmp;v=tmp;
	}int xs[60],ys[60];int n;
	void build(int l,int r,int tree){
		cnt[tree]=data[tree]=0;if(l==r)return;int mid=(l+r)>>1;build(l,mid,ls(tree));build(mid+1,r,rs(tree));
	}
	inline ll getS(int t){
		int ptr=1;for(register int i=1;i<=n;i++){
			lsh[ptr]=xs[i]-t-1;ptr++;lsh[ptr]=xs[i]+t;ptr++;lsh[ptr]=ys[i]-t-1;ptr++;lsh[ptr]=ys[i]+t;ptr++;
		}ptr--;sort(lsh+1,lsh+1+ptr);ptr=unique(lsh+1,lsh+1+ptr)-lsh-1;build(1,ptr,1);
		for(register int i=1;i<=ptr;i++)clear(adds[i]),clear(dels[i]);
		for(register int i=1;i<=n;i++){
			node cjr;cjr.l=lower_bound(lsh+1,lsh+1+ptr,ys[i]-t-1)-lsh+1;
			cjr.r=lower_bound(lsh+1,lsh+1+ptr,ys[i]+t)-lsh;int l=lower_bound(lsh+1,lsh+1+ptr,xs[i]-t-1)-lsh;
			int r=lower_bound(lsh+1,lsh+1+ptr,xs[i]+t)-lsh;adds[l].push_back(cjr);dels[r].push_back(cjr);
		}ll ans=0;for(register int i=1;i<=ptr;i++){
			ans=(ans+data[1]*(ll)(lsh[i]-lsh[i-1]))%p;
			for(register int j=0;j<adds[i].size();j++)add(adds[i][j].l,adds[i][j].r,1,ptr,1,1);
			for(register int j=0;j<dels[i].size();j++)add(dels[i][j].l,dels[i][j].r,1,ptr,1,-1);
		}return(ans);
	}int tme[100001];
	void ywymain(){
		inv2=mi(2,p-2);inv6=mi(6,p-2);int t;cin>>n>>t;
		for(register int i=1;i<=n;i++)cin>>xs[i]>>ys[i];int ptr=1;for(register int i=1;i<=n;i++){
			for(register int j=1;j<i;j++){
				tme[ptr]=max(abs(xs[i]-xs[j]),abs(ys[i]-ys[j]))/2;if(tme[ptr]<=t)ptr++;
				tme[ptr]=max(abs(xs[i]-xs[j]),abs(ys[i]-ys[j]))/2+1;if(tme[ptr]<=t)ptr++;
			}
		}tme[ptr]=0;ptr++;tme[ptr]=t;sort(tme+1,tme+1+ptr);ptr=unique(tme+1,tme+1+ptr)-tme-1;
		ll ans=(getS(t)*t)%p;for(register int i=1;i<ptr;i++){
			if(tme[i+1]-tme[i]<=2){
				for(register int j=tme[i];j<tme[i+1];j++)ans=(ans+p-getS(j))%p;continue;
			}ll c=getS(tme[i]),A=getS(tme[i]+1),B=getS(tme[i]+2);
			ll a=(B-A*2+c)*inv2;a%=p;a+=p;a%=p;ll b=A-c-a;b%=p;b+=p;b%=p;
			ans-=a*sig2(tme[i+1]-tme[i]-1);ans%=p;ans+=p;ans%=p;
			ans-=b*sig(tme[i+1]-tme[i]-1);ans%=p;ans+=p;ans%=p;
			ans-=c*(tme[i+1]-tme[i]);ans%=p;ans+=p;ans%=p;
		}cout<<ans<<endl;
	}
}
int main(){
	ywy::ywymain();return(0);
}

//CLOCKS_PER_SEC
using namespace std;
#include<bits/stdc++.h>
#define sqr(x) (x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while (((c=getchar())==' ')||c=='\n');x=c;}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define si set<int>
#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define rep0(i,x) forup ((i),0,(x)-1)
#define rep0d(i,x) fordo ((i),((int)(x))-1,0)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x1bbbbbbbbbbbbbbbll
#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
const int mod=998244353;
int n,m,i,j,k,tx[55],ty[55],ans,fac[15],inv[15],fi[15];
vector<int> all;
struct pnt
{
	int x,y;
}p[55];
bool cmp(pnt x,pnt y)
{
	return x.x<y.x;
}
int calc(int x)
{
	int ans=0,i,j;
	vector<int> vy;
	rep(i,n){
		vy.push_back(p[i].y-x);
		vy.push_back(p[i].y+x+1);
	}
	sort(vy.begin(),vy.end());
	vy.resize(unique(all(vy))-vy.begin());
	rep0(i,vy.size()-1){
		int lst=-0x3f3f3f3f;
		rep(j,n){
			if(vy[i]<p[j].y-x||vy[i]>p[j].y+x||p[j].x+x<=lst) continue;
			ans=(ans+1ll*(vy[i+1]-vy[i])*(p[j].x+x-max(lst,p[j].x-x-1)))%mod;
			lst=p[j].x+x;
		}
	}
	return ans;
}
int main()
{
	fac[0]=fac[1]=inv[1]=fi[0]=fi[1]=1;
	forup(i,2,10){
		fac[i]=1ll*fac[i-1]*i%mod;
		inv[i]=1ll*(mod-mod/i)*inv[mod%i]%mod;
		fi[i]=1ll*fi[i-1]*inv[i]%mod;
	}
	read(n);read(m);
	all.push_back(0);
	all.push_back(m);
	rep(i,n){
		read(p[i].x);
		read(p[i].y);
	}
	sort(p+1,p+n+1,cmp);
	rep(i,n){
		rep(j,i-1){
			all.push_back((max(abs(p[i].x-p[j].x),abs(p[i].y-p[j].y))+1)/2);
		}
	}
	sort(all.begin(),all.end());
	all.resize(unique(all(all))-all.begin());
	while(all.back()>m) all.pop_back();
	rep0(i,((int)all.size())-1){
		int len=all[i+1]-all[i];
		rep0(j,min(3,len)){
			tx[j]=all[i]+j;
			ty[j]=calc(tx[j]);
		}
		if(len<=3){
			rep0(j,len){
				ans=(ans+ty[j])%mod;
			}
		}
		else{
			ans=(0ll+ans+(1ll*ty[0]*inv[2]%mod-ty[1]+1ll*ty[2]*inv[2]%mod)%mod*ty[1]%mod*(len-1)%mod*len%mod*(2*len-1)%mod*inv[6])%mod;
			ans=(0ll+ans+(mod-3ll*ty[0]*inv[2]%mod+2ll*ty[1]%mod-1ll*ty[2]*inv[2]%mod)%mod*(len-1)%mod*len%mod*inv[2]%mod)%mod;
			ans=(0ll+ans+1ll*ty[0]*len)%mod;
			if(ans<0) ans+=mod;
		}
	}
	cout<<(1ll*m*calc(m)-ans+mod)%mod<<endl;
	return 0;
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using std::min;
using std::lower_bound;
using std::sort;
using std::unique;
using std::vector;
inline int abs(int x)
{
	return x<0?-x:x;
}
const int mod=998244353;
inline int add(int a,int b)
{
	return (a+=b)>=mod?a-mod:a;
}
inline int sub(int a,int b)
{
	return (a-=b)<0?a+mod:a;
}
inline int mul(int a,int b)
{
	return (long long)a*b%mod;
}
inline int qpow(int a,int b)
{
	int res=1;
	for(;b;a=mul(a,a),b>>=1)
		if(b&1)
			res=mul(res,a);
	return res;
}
const int N=105;
int n,t,ans;
struct cell
{
	int x,y;
}c[N];
vector<int> V,Vx,Vy;
int sw,w[N],sumw[N];
struct task
{
	int t,l,r,k;
};
vector<task> ta;
int f[N];
namespace lglr
{
	int n;
	int x[N],y[N];
	// inline void print()
	// {
	// 	register int i;
	// 	for(i=1;i<=n;i++)
	// 		fprintf(stderr,"x:%d y:%d\n",x[i],y[i]);
	// 	return;
	// }
	inline int get(int x0)
	{
		int res=0,cur;
		register int i,j;
		for(i=1;i<=n;i++)
		{
			cur=1;
			for(j=1;j<=n;j++)
				if(i!=j)
					cur=mul(cur,mul(sub(x0,x[j]),qpow(sub(x[i],x[j]),mod-2)));
			res=add(res,mul(cur,y[i]));
		}
		return res;
	}
}
namespace zkw
{
	int M;
	int Min[N<<2],lazy[N<<2],cnt[N<<2];
	inline void push_up(int x)
	{
		Min[x]=min(Min[x<<1],Min[x<<1|1])+lazy[x];
		cnt[x]=(Min[x<<1]+lazy[x]==Min[x])*cnt[x<<1]+(Min[x<<1|1]+lazy[x]==Min[x])*cnt[x<<1|1];
		return;
	}
	inline void build(int n)
	{
		register int i;
		for(M=1;M<=n;M<<=1);
		memset(lazy,0,sizeof(int)*(M<<1));
		memset(cnt,0,sizeof(int)*(M<<1));
		for(i=1;i<=n;i++)
			Min[M+i]=0,cnt[M+i]=w[i];
		for(i=M-1;i;i--)
			push_up(i);
		return;
	}
	inline void modify(int l,int r,int k)
	{
		for(l=M+l-1,r=M+r+1;l^r^1;l>>=1,r>>=1,push_up(l),push_up(r))
			(l&1)?0:(Min[l^1]+=k,lazy[l^1]+=k),(r&1)?(Min[r^1]+=k,lazy[r^1]+=k):0;
		for(l>>=1;l;l>>=1)
			push_up(l);
		return;
	}
	inline int query()
	{
		return sw-(Min[1]==0)*cnt[1];
	}
}
inline int calc(int t)
{
	int cl,cr,res=0;
	register int i;
	Vx.clear();Vy.clear();
	for(i=1;i<=n;i++)
	{
		Vx.push_back(c[i].x-t);
		Vx.push_back(c[i].x+t+1);
		Vy.push_back(c[i].y-t);
		Vy.push_back(c[i].y+t+1);
	}
	sort(Vx.begin(),Vx.end());
	Vx.erase(unique(Vx.begin(),Vx.end()),Vx.end());
	sort(Vy.begin(),Vy.end());
	Vy.erase(unique(Vy.begin(),Vy.end()),Vy.end());
	sw=0;
	for(i=1;i<(int)Vy.size();i++)
		w[i]=Vy[i]-Vy[i-1],sw+=w[i];
	ta.clear();
	for(i=1;i<=n;i++)
	{
		cl=lower_bound(Vy.begin(),Vy.end(),c[i].y-t)-Vy.begin()+1;
		cr=lower_bound(Vy.begin(),Vy.end(),c[i].y+t+1)-Vy.begin();
		ta.push_back(task{c[i].x-t,cl,cr,1});
		ta.push_back(task{c[i].x+t+1,cl,cr,-1});
	}
	sort(ta.begin(),ta.end(),[](task a,task b)->bool
	{
		return a.t<b.t;
	});
	zkw::build((int)Vy.size()-1);
	for(i=0;i<(int)ta.size()-1;i++)
	{
		// fprintf(stderr,"%d:%d %d %d\n",ta[i].t,ta[i].l,ta[i].r,ta[i].k);
		zkw::modify(ta[i].l,ta[i].r,ta[i].k);
		// fprintf(stderr,"q:%d %d\n",ta[i+1].t-ta[i].t,zkw::query());
		res=add(res,mul(ta[i+1].t-ta[i].t,zkw::query()%mod));
	}
	// fprintf(stderr,"%d:OK(%d)\n",t,res);
	return res;
}
inline int solve(int l,int r)
{
	int res=0;
	register int i;
	if(r-l+1<3)
	{
		for(i=l;i<=r;i++)
			res=add(res,calc(i));
		return res;
	}
	for(i=l;i<=l+2;i++)
		f[i-l]=calc(i);
	// fprintf(stderr,"hhhh\n");
	for(i=l+1;i<=l+2;i++)
		f[i-l]=add(f[i-l],f[i-l-1]);
	lglr::n=4;
	lglr::x[1]=l;lglr::y[1]=0;
	for(i=l;i<=l+2;i++)
		lglr::x[i-l+2]=i+1,lglr::y[i-l+2]=f[i-l];
	// fprintf(stderr,"hhhh\n");
	// lglr::print();
	return sub(lglr::get(r+1),lglr::get(l));
}
signed main()
{
	int d;
	register int i,j;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;i++)
		scanf("%d%d",&c[i].x,&c[i].y);
	V.push_back(0);V.push_back(t+1);
	for(i=1;i<=n;i++)
		for(j=i+1;j<=n;j++)
			if((d=(min(abs(c[i].x-c[j].x),abs(c[i].y-c[j].y))+1)/2)<=t)
			V.push_back(d);
	sort(V.begin(),V.end());
	V.erase(unique(V.begin(),V.end()),V.end());
	for(i=0;i<(int)V.size()-1;i++)
		ans=add(ans,solve(V[i],V[i+1]-1));
	// fprintf(stderr,"%d\n",ans);
	ans=sub(mul(t+1,calc(t)),ans);
	printf("%d\n",ans);
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
#define il inline
using namespace std;
struct dat
{
	int x,l,r,k;
	void mem(int a,int b,int c,int d){x=a;l=b;r=c;k=d;}
	bool operator<(const dat&a)const{return x<a.x;}
}p[111];
int n,x[55],y[55],h[111],a[111];
il ll gets(int k)
{
	int i,j,cnt=0,l,r;ll ans=0;
	for (i=1;i<=n;i++)
	{
		p[++cnt].mem(x[i]-k,y[i]-k,y[i]+k+1,1);h[cnt]=y[i]+k+1;
		p[++cnt].mem(x[i]+k+1,y[i]-k,y[i]+k+1,-1);h[cnt]=y[i]-k;
	}
	sort(p+1,p+cnt+1);sort(h+1,h+cnt+1);
	cnt=unique(h+1,h+cnt+1)-h-1;
	for (i=1;i<=2*n;i++)
	{
		if (p[i].x!=p[i-1].x) for (j=1;j<cnt;j++)
			if (a[j]) ans+=(ll)(p[i].x-p[i-1].x)*(h[j+1]-h[j]);
		l=lower_bound(h+1,h+cnt+1,p[i].l)-h,r=lower_bound(h+1,h+cnt+1,p[i].r)-h;
		for (j=l;j<r;j++) a[j]+=p[i].k;
	}
	return ans;
}
il ll diff(int x){if (!x) return 0;return gets(x)-gets(x-1);}
const ll inv6=166374059;
int main()
{
	int T,i,nw=0,l,r,to;ll ans=0;cin>>n>>T;for (i=1;i<=n;i++) cin>>x[i]>>y[i];
	while (nw<=T)
	{
		l=to=nw;r=T;ll g=diff(nw),e=diff(nw+1)-g;
		while (l<=r)
		{
			int mid=(l+r)>>1;ll t=diff(mid);if (t!=g+(mid-nw)*e) r=mid-1;
			else l=mid+1,to=mid;
		}
		ll t=e*(to-nw)%mod*(to-nw+1)%mod*(to-nw+2)%mod*inv6%mod;
		(ans+=gets(nw)*(to-nw+1)%mod+t+g)%=mod;nw=to+1;
	}
	cout<<((gets(T)%mod*(T+1)%mod)-ans+mod)%mod;
}

#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
#define il inline
using namespace std;
struct dat
{
	int x,l,r,k;
	void mem(int a,int b,int c,int d){x=a;l=b;r=c;k=d;}
	bool operator<(const dat&a)const{return x<a.x;}
}p[111];
int n,x[55],y[55],h[111],a[111];
il ll gets(int k)
{
	int i,j,cnt=0,l,r;ll ans=0;
	for (i=1;i<=n;i++)
	{
		p[++cnt].mem(x[i]-k,y[i]-k,y[i]+k+1,1);h[cnt]=y[i]+k+1;
		p[++cnt].mem(x[i]+k+1,y[i]-k,y[i]+k+1,-1);h[cnt]=y[i]-k;
	}
	sort(p+1,p+cnt+1);sort(h+1,h+cnt+1);
	cnt=unique(h+1,h+cnt+1)-h-1;
	for (i=1;i<=2*n;i++)
	{
		if (p[i].x!=p[i-1].x) for (j=1;j<cnt;j++)
			if (a[j]) ans+=(ll)(p[i].x-p[i-1].x)*(h[j+1]-h[j]);
		l=lower_bound(h+1,h+cnt+1,p[i].l)-h,r=lower_bound(h+1,h+cnt+1,p[i].r)-h;
		for (j=l;j<r;j++) a[j]+=p[i].k;
	}
	return ans;
}
il ll diff(int x){if (!x) return 0;return gets(x)-gets(x-1);}
const ll inv2=499122177,inv6=166374059;
int main()
{
	int T,i,nw=0,l,r,to;ll ans=0;cin>>n>>T;for (i=1;i<=n;i++) cin>>x[i]>>y[i];
	while (nw<=T)
	{
		l=to=nw;r=T;ll g=diff(nw),e=diff(nw+1)-g;
		while (l<=r)
		{
			int mid=(l+r)>>1;ll t=diff(mid);if (t!=g+(mid-nw)*e) r=mid-1;
			else l=mid+1,to=mid;
		}
		ll t=e*(to-nw)%mod*(to-nw+1)%mod*(to-nw+2)%mod*inv6%mod;
		(g*=(to-nw)%mod*(to-nw+1)%mod*inv2%mod)%=mod;
		(ans+=gets(nw)%mod*(to-nw+1)%mod+t+g)%=mod;nw=to+1;
	}
	cout<<((gets(T)%mod*(T+1)%mod)-ans+mod)%mod;
}

#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
#define il inline
using namespace std;
struct dat
{
	int x,l,r,k;
	void mem(int a,int b,int c,int d){x=a;l=b;r=c;k=d;}
	bool operator<(const dat&a)const{return x<a.x;}
}p[111];
int n,x[55],y[55],h[111],a[111];
il ll gets(int k)
{
	int i,j,cnt=0,l,r;ll ans=0;
	for (i=1;i<=n;i++)
	{
		p[++cnt].mem(x[i]-k,y[i]-k,y[i]+k+1,1);h[cnt]=y[i]+k+1;
		p[++cnt].mem(x[i]+k+1,y[i]-k,y[i]+k+1,-1);h[cnt]=y[i]-k;
	}
	sort(p+1,p+cnt+1);sort(h+1,h+cnt+1);
	cnt=unique(h+1,h+cnt+1)-h-1;
	for (i=1;i<=2*n;i++)
	{
		if (p[i].x!=p[i-1].x) for (j=1;j<cnt;j++)
			if (a[j]) ans+=(ll)(p[i].x-p[i-1].x)*(h[j+1]-h[j]);
		l=lower_bound(h+1,h+cnt+1,p[i].l)-h,r=lower_bound(h+1,h+cnt+1,p[i].r)-h;
		for (j=l;j<r;j++) a[j]+=p[i].k;
	}
	return ans;
}
il ll diff(int x){if (!x) return 0;return gets(x)-gets(x-1);}
const ll inv6=166374059;
int main()
{
	int T,i,nw=0,l,r,to;ll ans=0;cin>>n>>T;for (i=1;i<=n;i++) cin>>x[i]>>y[i];
	while (nw<=T)
	{
		l=to=nw;r=T;ll g=diff(nw),e=diff(nw+1)-g;
		while (l<=r)
		{
			int mid=(l+r)>>1;ll t=diff(mid);if (t!=g+(mid-nw)*e) r=mid-1;
			else l=mid+1,to=mid;
		}
		ll t=e*(to-nw)%mod*(to-nw+1)%mod*(to-nw+2)%mod*inv6%mod;
		(ans+=gets(nw)%mod*(to-nw+1)%mod+t+g)%=mod;nw=to+1;
	}
	cout<<((gets(T)%mod*(T+1)%mod)-ans+mod)%mod;
}

#include <iostream>
#include <cstdio>

#include <array>
#include <algorithm>
#include <vector>
#include <cassert>

using namespace std;

const int MOD = 998244353;

typedef long long ll;
#define tll(X) static_cast<ll>(X)
#define ti(X) static_cast<int>(X)

int sum(int a, int b) {return ti((tll(a) + tll(b))%MOD);}
int dif(int a, int b) {return ti((tll(a) - tll(b) + (tll(MOD)<<6LL))%MOD);}
int prd(int a, int b) {return ti((tll(a) * tll(b))%MOD);}
int sqr(int a) {return prd(a, a);}
int pw(int b, int p) {
  int r = 1;
  for(;p;p>>=1, b=prd(b, b)) if(p&1) r = prd(r, b);
  return r;
}

int dv2;
int sumlin(int v) {
  if(v < 0) return 0;
  return prd(prd(v, v + 1), dv2);
}
int sumlin(int l, int r) {
  return sumlin(r - 1) - sumlin(l - 1);
}
int dv6;
int sumsqr(int v) {
  if(v < 0) return 0;
  return prd(prd(v, v + 1), prd((v << 1) + 1, dv6));
}
int sumsqr(int l, int r) {
  return sumsqr(r - 1) - sumsqr(l - 1);
}

typedef array<int, 2> ar2;
typedef array<int, 3> ar3;
typedef vector<int> vi;
typedef vector<ar2> va2;

int get(const ar3& a, int b) {
  return sum(prd(a[2], prd(b, b)), sum(prd(a[1], b), a[0]));
}
int get(const vi& a, int l, int r) {
  int f = 0;
  f = sum(f, prd(a[2], sumsqr(l, r)));
  f = sum(f, prd(a[1], sumlin(l, r)));
  f = sum(f, prd(a[0], r - l));
  return f;
}
ar3 operator + (const ar3& a, const ar3& b) {
  return {sum(a[0], b[0]), sum(a[1], b[1]), sum(a[2], b[2])};
}

typedef array<int, 2> pt;
typedef array<int, 4> ar4;

const int MAXN = 60;
int N, T;
pt I[MAXN];

template <class T> void compress(T * n, int& s) {
  sort(n, n + s);
  s = unique(n, n + s) - n;
}

int y[MAXN << 1];
int ys;

template <int MAXS = MAXN * 4> struct ST {
public:
  ar2 v[MAXS];
  int z[MAXS];
  int s;
  ar2 cmb(const ar2& a, const ar2& b) {
    if(a[0] == b[0]) return {a[0], a[1] + b[1]};
    if(b[0] < a[0]) return b;
    return a;
  }
  void init(int n, int nl, int nr) {
    if(nr - nl > 1) {
      int m = nl + ((nr - nl)>>1);
      init(n<<1, nl, m); init(n<<1|1, m, nr);
      v[n] = {0, y[nr] - y[nl]}, z[n] = 0;
    } else v[n] = {0, y[nr] - y[nl]}, z[n] = 0;
  }
  void init(int S) {
    init(1, 0, s = S);
  }
  void prop(int n, int nl, int nr) {
    v[n][0] += z[n];
    if(nr - nl > 1)
      z[n<<1] += z[n], z[n<<1|1] += z[n];
    z[n] = 0;
  }
  void upd(int gl, int gr, int q, int n, int nl, int nr) {
    if(gl <= nl and nr <= gr) {
      z[n] += q;
      prop(n, nl, nr);
    } else {
      int m = nl + ((nr - nl)>>1);
      prop(n, nl, nr);
      if(gl < m) upd(gl, gr, q, n<<1, nl, m); else prop(n<<1, nl, m);
      if(m < gr) upd(gl, gr, q, n<<1|1, m, nr); else prop(n<<1|1, m, nr);
      v[n] = cmb(v[n<<1], v[n<<1|1]);
    }
  }
  void upd(int gl, int gr, int q) {return upd(gl, gr, q, 1, 0, s);}
  int qry() {prop(1, 0, s); return v[1][0] == 0 ? (y[s] - y[0]) - v[1][1] : (y[s] - y[0]);}    //# of non-zeroes
};
ST<> st;
ar4 x[MAXN << 1];
int calc(int t) {
  for(int i = 0;i < N;i++) y[i<<1] = I[i][1] - t, y[i<<1|1] = I[i][1] + t + 1, x[i<<1] = {I[i][0] - t, I[i][1] - t, I[i][1] + t + 1, 1}, x[i<<1|1] = {I[i][0] + t + 1, I[i][1] - t, I[i][1] + t + 1, 0};
  compress(y, ys = N<<1);
  for(int i = 0;i < N<<1;i++) x[i][1] = lower_bound(y, y + ys, x[i][1]) - y, x[i][2] = lower_bound(y, y + ys, x[i][2]) - y;
  st.init(--ys);

  ll f = 0;

  sort(x, x + (N<<1), [](const ar4& a, const ar4& b){return a[0] < b[0];});

  int c = 0;
  for(int i = 0, j;i < N<<1;i=j) {
    for(j = i;j < N<<1 and x[i][0] == x[j][0];j++) {
      if(x[j][3]) st.upd(x[j][1], x[j][2], 1);
      else st.upd(x[j][1], x[j][2], -1);
    }
    if((c = st.qry())) f += tll(c) * (x[j][0] - x[i][0]);
  }
  return ti(f%MOD);
}

int operator * (const pt& a, const pt& b) {
  return max((1 + abs(a[0] - b[0]))>>1, (1 + abs(a[1] - b[1]))>>1);
}

int c[MAXN * MAXN];

vi operator * (const vi& a, const vi& b) {
  vi r(a.size() + b.size() - 1, 0);
  for(int i = 0;i < a.size();i++) for(int j = 0;j < b.size();j++) r[i + j] = sum(r[i + j], prd(a[i], b[j]));
  return r;
}
vi operator *= (vi& a, const int& b) {
  for(int i = 0;i < a.size();i++) a[i] = prd(a[i], b);
  return a;
}
vi operator += (vi& a, const vi& b) {
  assert(not(a.size() < b.size()));
  for(int i = 0;i < b.size();i++) a[i] = sum(a[i], b[i]);
  return b;
}

vi interpolate(const va2& p) {
  vi r(p.size(), 0);
  for(int i = 0;i < p.size();i++) {
    vi n(1, 1);
    int d = 1;
    for(int j = 0;j < p.size();j++) if(j != i) {
      n = n * vi{dif(0, p[j][0]), 1};
      d = prd(d, dif(p[i][0], p[j][0]));
    }
    n *= prd(pw(d, MOD - 2), p[i][1]);
    assert(n.size() == r.size());
    r += n;
  }
  return r;
}

int solve(int t1, int t2) {
  if(t2 - t1 < 3) {
    int f = 0;
    for(int i = t1;i < t2;i++) f = sum(f, ti(calc(i)%MOD));
    return f;
  }

  vi q = interpolate(va2{{t1, calc(t1)}, {t1 + 1, calc(t1 + 1)}, {t1 + 2, calc(t1 + 2)}});
  //cerr << q[0] << " " << q[1] << " " << q[2] << "\n";
  //cerr << get(q, t1, t2) << "\n";
  return get(q, t1, t2);
}

int main() {
  dv2 = pw(2, MOD - 2);
  dv6 = pw(6, MOD - 2);

  scanf("%d%d", &N, &T);
  for(int i = 0;i < N;i++) scanf("%d%d", &I[i][0], &I[i][1]), y[i] = I[i][1];

  //sort(I, I + N, [](const pt& a, const pt& b) {return a[0] < b[0] or (not(b[0] < a[0]) and a[1] < b[1]);});

  for(int i = 0, t = 0;i < N;i++) for(int j = i + 1;j < N;j++) c[t++] = I[i] * I[j];
  sort(c, c + (N*(N - 1)>>1));
  ll f = 0LL;
  int p = 0;
  for(int i = 0;i < (N*(N-1))>>1;p = c[i++]) {
    if(c[i] < T) f = sum(f, solve(p, c[i])); else break;
  }
  f = sum(f, solve(p, T));

  printf("%d\n", dif(prd(T, calc(T)), f));

  return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int ha = 998244353;
const int inv2 = 499122177;
const int inv6 = 166374059;
const int MAXN = 300+5;
std::vector<LL> Sx,Sy;

namespace DS{
	int sm[MAXN<<2],tag[MAXN<<2];
	#define lc ((x)<<1)
	#define rc ((x)<<1|1)

	inline void modify(int x,int l,int r,int L,int R,int d){
		// int len = Sy[r-1]-(l==1?Sy[0]:Sy[l-2]);
		int len = Sy[r]-Sy[l-1];
		// if(l == 1 && r == 2) DEBUG(Sy[r]),DEBUG(Sy[l-1]);
		// DEBUG(l);DEBUG(r);DEBUG(len);
		if(l == L && r == R){
			tag[x] += d;
			sm[x] = tag[x] ? len : (l==r?0:(sm[lc]+sm[rc])%ha);
			return;
		}
		int mid = (l + r) >> 1;
		if(R <= mid) modify(lc,l,mid,L,R,d);
		else if(L > mid) modify(rc,mid+1,r,L,R,d);
		else modify(lc,l,mid,L,mid,d),modify(rc,mid+1,r,mid+1,R,d);
		sm[x] = tag[x]?len:(l==r?0:(sm[lc]+sm[rc])%ha);
	}
}
using DS::modify;

int x[MAXN],y[MAXN],n;

inline void add(int &x,int y){
	x += y;if(x >= ha) x -= ha;
}

struct Node{
	int x1,y1,x2,y2;//(x1,y1) <= (x2,y2)
	Node(int x1=0,int y1=0,int x2=0,int y2=0) : x1(x1),y1(y1),x2(x2),y2(y2) {}
}a[MAXN];

std::vector<std::pair<P,int> > G[MAXN];

inline int f(int k){
	Sx.clear();Sy.clear();
	FOR(i,1,n){
		a[i] = Node(x[i]-k,y[i]-k,x[i]+k+1,y[i]+k+1);
		Sx.pb(x[i]-k);Sy.pb(y[i]-k);Sx.pb(x[i]+k+1);Sy.pb(y[i]+k+1);
		// DEBUG(x[i]+k+1);DEBUG(y[i]+k+1);
	}
	std::sort(all(Sx));Sx.erase(std::unique(all(Sx)),Sx.end());
	std::sort(all(Sy));Sy.erase(std::unique(all(Sy)),Sy.end());
	// Sx.pb(Sx[0]-1);Sy.pb(Sy[0]-1);
	// std::sort(all(Sx));std::sort(all(Sy));
	int m = Sx.size(),M = Sy.size();
	FOR(i,0,m+1) G[i].clear();
	FOR(i,1,n){
		a[i].x1 = std::lower_bound(all(Sx),a[i].x1)-Sx.begin()+1;
		a[i].x2 = std::lower_bound(all(Sx),a[i].x2)-Sx.begin()+1;
		a[i].y1 = std::lower_bound(all(Sy),a[i].y1)-Sy.begin()+1;
		a[i].y2 = std::lower_bound(all(Sy),a[i].y2)-Sy.begin()+1;
		// printf("%d %d %d %d\n",a[i].x1,a[i].y1,a[i].x2,a[i].y2);
		G[a[i].x1].pb(MP(MP(a[i].y1,a[i].y2),1));
		G[a[i].x2].pb(MP(MP(a[i].y1,a[i].y2),-1));
	}
	Sy.pb(Sy.back());
	// Sy.pb(Sy[0]-1);std::sort(all(Sy));
	// exit(0);
	CLR(DS::sm,0);CLR(DS::tag,0);
	int ans = 0;
	FOR(i,1,m){
		int t = (Sx[i-1]-Sx[std::max(i-2,0)])%ha;
		// DEBUG(t);
		// DEBUG(DS::sm[1]);
		(ans += 1ll*t*DS::sm[1]%ha) %= ha;
		for(auto x:G[i]) modify(1,1,M,x.fi.fi,x.fi.se-1,x.se);//,DEBUG(x.fi.fi),DEBUG(x.fi.se-1),DEBUG(x.se);
	}
	return ans;
}

inline int sm2(int n){
	int res = 0;if(n < 0) return 0;
	if(n <= 5){
		FOR(i,1,n) add(res,i*i);
	}
	else{
		res = 1ll*n*(n+1)%ha*(2ll*n+1)%ha*inv6%ha;
	}
	return res;
}

inline int sm(int n){
	int res = 0;if(n < 0) return 0;
	if(n <= 5){
		FOR(i,1,n) add(res,i);
	}
	else{
		res = 1ll*n*(n+1)%ha*inv2%ha;
	}
	return res;
}

inline int sm(int l,int r){
	return (sm(r)+ha-sm(l-1))%ha;
}

inline int sm2(int l,int r){
	return (sm2(r)+ha-sm2(l-1))%ha;
}

int main(){
	int t;scanf("%d%d",&n,&t);
	// t = 100000;
	FOR(i,1,n) scanf("%d%d",x+i,y+i);
	std::vector<int> part;part.pb(0);part.pb(t);
	FOR(i,1,n){
		FOR(j,i+1,n){
			int d = std::max(std::abs(x[i]-x[j]),std::abs(y[i]-y[j]));
			d = (d+1)/2;
			if(d >= t) continue;
			part.pb(d);
			// if(d-1 > 0) part.pb(d-1);
			// if(d+1 < t) part.pb(d+1);
		}
	}
	// DEBUG(f(t));
	// exit(0);
	// DEBUG(1ll*(400000000ll+1)*(400000000+1)%ha);
	// exit(0);
	// int ttt = 0;
	// FOR(i,0,t-1) add(ttt,f(i));
	// DEBUG(ttt);
	std::sort(all(part));part.erase(std::unique(all(part)),part.end());
	int ans = 0;
	FOR(i,1,(int)part.size()-1){
		int l = part[i-1],r = part[i]-1;
		// DEBUG(l);DEBUG(r);
		if(r-l+1 <= 3){
			FOR(k,l,r) add(ans,f(k));
			continue;
		}
		int x[3],y[3];
		FOR(j,0,2) y[j] = f(x[j]=l+j);
		int a = 1ll*y[0]*inv2%ha;
		add(a,ha-y[1]);add(a,1ll*y[2]*inv2%ha);
		int b = 1ll*y[0]*inv2%ha*(x[1]+x[2])%ha;
		add(b,ha-1ll*y[1]*((x[0]+x[2])%ha));
		add(b,1ll*y[2]*inv2%ha*(x[1]+x[0])%ha);
		b = ha-b;

		int c = 1ll*x[1]*x[2]%ha*y[0]%ha*inv2%ha;
		add(c,ha-1ll*x[0]*x[2]%ha*y[1]%ha);
		add(c,1ll*x[0]*x[1]%ha*y[2]%ha*inv2%ha);
		// DEBUG(a);DEBUG(b);DEBUG(c);
		// DEBUG(sm(l,r));
		// int tt = 0;
		// FOR(i,l,r) add(tt,i);
		// DEBUG(tt);
		add(ans,1ll*sm2(l,r)*a%ha);
		// DEBUG(sm2(l,r));
		add(ans,1ll*sm(l,r)*b%ha);
		add(ans,1ll*(r-l+1)*c%ha);
	}
	// DEBUG(ans);
	// DEBUG(ans);
	// int _ = 400000000ll*400000000%ha;
	add(ans,ha-1ll*t*f(t)%ha);
	ans = (ha-ans)%ha;
	printf("%d\n",ans);
	return 0;
}
/*
设 f(i) 表示 i 时间有多少个格子着火了
答案就是 tf(t)-\sum_{i=0}^{t-1}f(i)
单次询问 f(i) 是可以求矩阵面积并的,但是你不能询问1e8次
考虑用容斥原理将矩形面积并变成交
观察一个子集 发现只有在某两个矩形由不交变成相交的时候才会分段
所以只有 n^2 段 插值 每一段需要做3/4次矩形面积并
矩形面积并就是离散化后排序 支持区间加删线段 全局查询 修改到对应线段即可
*/

#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int ha = 998244353;
const int inv2 = 499122177;
const int MAXN = 300+5;
std::vector<LL> S;

namespace DS{
	int sm[MAXN<<2],tag[MAXN<<2];
	#define lc ((x)<<1)
	#define rc ((x)<<1|1)

	inline void modify(int x,int l,int r,int L,int R,int d){
		if(l == L && r == R){
			tag[x] += d;
			sm[x] = tag[x] ? S[r]-S[l-1]:(l==r?0:(sm[lc]+sm[rc])%ha);
			return;
		}
		int mid = (l + r) >> 1;
		if(R <= mid) modify(lc,l,mid,L,R,d);
		else if(L > mid) modify(rc,mid+1,r,L,R,d);
		else modify(lc,l,mid,L,mid,d),modify(rc,mid+1,r,mid+1,R,d);
		sm[x] = tag[x]?S[r]-S[l-1]:(l==r?0:(sm[lc]+sm[rc])%ha);
	}
}
using DS::modify;

int x[MAXN],y[MAXN],n;

inline void add(int &x,int y){
	x += y;if(x >= ha) x -= ha;
}

struct Node{
	int x1,y1,x2,y2;//(x1,y1) <= (x2,y2)
	Node(int x1=0,int y1=0,int x2=0,int y2=0) : x1(x1),y1(y1),x2(x2),y2(y2) {}
}a[MAXN];

std::vector<std::pair<P,int> > G[MAXN];

inline int f(int k){
	S.clear();
	FOR(i,1,n){
		a[i] = Node(x[i]-k,y[i]-k,x[i]+k,y[i]+k);
		S.pb(x[i]-k);S.pb(y[i]-k);S.pb(x[i]+k);S.pb(y[i]+k);
	}
	std::sort(all(S));S.erase(std::unique(all(S)),S.end());
	S.pb(S[0]-1);std::sort(all(S));
	int m = S.size()-1;
	FOR(i,1,n){
		a[i].x1 = std::lower_bound(all(S),a[i].x1)-S.begin();
		a[i].x2 = std::lower_bound(all(S),a[i].x2)-S.begin();
		a[i].y1 = std::lower_bound(all(S),a[i].y1)-S.begin();
		a[i].y2 = std::lower_bound(all(S),a[i].y2)-S.begin();
		G[a[i].x1].pb(MP(MP(a[i].y1,a[i].y2),1));
		G[a[i].x2+1].pb(MP(MP(a[i].y1,a[i].y2),-1));
	}
	CLR(DS::sm,0);CLR(DS::tag,0);
	int ans = 0;
	FOR(i,1,m){
		int t = (S[i]-S[i-1])%ha;
		(ans += 1ll*t*DS::sm[1]%ha) %= ha;
		for(auto x:G[i]) modify(1,1,m,x.fi.fi,x.fi.se,x.se);
	}
	return ans;
}

inline int sm2(int n){
	int res = 0;if(n < 0) return 0;
	if(n <= 5){
		FOR(i,1,n) add(res,i*i);
	}
	else{
		res = 1ll*n*(n-1)%ha*(2*n%ha+ha-1)%ha*inv2%ha;
	}
	return res;
}

inline int sm(int n){
	int res = 0;if(n < 0) return 0;
	if(n <= 5){
		FOR(i,1,n) add(res,i);
	}
	else{
		res = 1ll*n*(n-1)%ha*inv2%ha;
	}
	return res;
}

inline int sm(int l,int r){
	return (sm(r)+ha-sm(l-1))%ha;
}

inline int sm2(int l,int r){
	return (sm2(r)+ha-sm2(l-1))%ha;
}

int main(){
	int t;scanf("%d%d",&n,&t);
	FOR(i,1,n) scanf("%d%d",x+i,y+i);
	std::vector<int> part;part.pb(0);part.pb(t);
	FOR(i,1,n){
		FOR(j,i+1,n){
			int d = std::max(std::abs(x[i]-x[j]),std::abs(y[i]-y[j]));
			d = (d+1)/2;
			if(d >= t) continue;
			part.pb(d);
		}
	}
	std::sort(all(part));part.erase(std::unique(all(part)),part.end());
	int ans = 0;
	FOR(i,1,(int)part.size()-1){
		int l = part[i-1],r = part[i]-1;
		if(r-l+1 <= 3){
			FOR(k,l,r) (ans += f(k)) %= ha;
			continue;
		}
		int x[3],y[3];
		FOR(j,0,2) y[j] = f(x[j]=l+j);
		int a = 1ll*y[0]*inv2%ha;
		add(a,ha-y[1]);add(a,1ll*inv2*y[2]%ha);
		int b = ha-1ll*x[0]*y[0]%ha;
		add(b,2ll*x[1]%ha*y[1]%ha);add(b,ha-1ll*x[2]*y[2]%ha);
		int c = 1ll*y[0]*x[0]%ha*x[0]%ha*inv2%ha;
		add(c,ha-1ll*y[1]*x[1]%ha*x[a]%ha);add(c,1ll*y[2]*x[2]%ha*x[2]%ha*inv2%ha);
		add(ans,1ll*sm2(l,r)*a%ha);
		add(ans,1ll*sm(l,r)*b%ha);
		add(ans,1ll*(r-l+1)*c%ha);
	}
	add(ans,ha-1ll*t*f(t)%ha);
	ans = (ha-ans)%ha;
	printf("%d\n",ans);
	return 0;
}
/*
设 f(i) 表示 i 时间有多少个格子着火了
答案就是 tf(t)-\sum_{i=0}^{t-1}f(i)
单次询问 f(i) 是可以求矩阵面积并的,但是你不能询问1e8次
考虑用容斥原理将矩形面积并变成交
观察一个子集 发现只有在某两个矩形由不交变成相交的时候才会分段
所以只有 n^2 段 插值 每一段需要做3/4次矩形面积并
矩形面积并就是离散化后排序 支持区间加删线段 全局查询 修改到对应线段即可
*/

#include <bits/stdc++.h>

using namespace std;

const int max_n = 55, inf = 1000111222;
const int mod = 998244353;

int mul(int x, int y) {
    return 1LL * x * y % mod;
}

int power(int x, int y) {
    if (y == 0) {
        return 1;
    }
    if (y % 2 == 0) {
        return power(mul(x, x), y / 2);
    }
    return mul(x, power(x, y - 1));
}

int inv(int x) {
    return power(x, mod - 2);
}

int n, t, x[max_n], y[max_n];
vector<int> xs, ys;
multiset<int> q;

int add(int x, int len) {
    auto it = q.insert(x);
    int l = x;
    if (it != q.begin()) {
        --it;
        l = max(*it + len, x);
        ++it;
    }
    ++it;
    int r = x + len;
    if (it != q.end()) {
        r = min(r, *it);
    }
    return max(0, r - l);
}

int del(int x, int len) {
    q.erase(q.find(x));
    int res = add(x, len);
    q.erase(q.find(x));
    return res;
}

int f(int t) {
    vector<pair<int, pair<int, int>>> v;
    for (int i = 0; i < n; ++i) {
        v.push_back({x[i] - t, {0, y[i]}});
        v.push_back({x[i] + t + 1, {1, y[i]}});
    }
    sort(v.begin(), v.end());
    int res = 0, cur = 0;
    for (int i = 0; i < v.size(); ) {
        int pos = i;
        while (i < v.size() && v[pos].first == v[i].first) {
            if (v[i].second.first == 0) {
                cur += add(v[i].second.second, 2 * t + 1);
            } else {
                cur -= del(v[i].second.second, 2 * t + 1);
            }
            ++i;
        }
        if (i < v.size()) {
            //cout << "[" << v[pos].first << " " << v[i].first << "): " << cur << endl;
            res += mul(cur, v[i].first - v[pos].first);
            res %= mod;
        }
    }
    //cout << t << ": " << res << endl;
    return res;
}

int triv(int t) {
    int res = mul(t, f(t));
    for (int i = 0; i < t; ++i) {
        res += mod - f(i);
        res %= mod;
    }
    return res;
}

const int max_p = 3;

struct interpolation {
    int x[max_p], y[max_p];
    int rev[max_p];

    void init() {
        for (int i = 1; i < max_p; ++i) {
            rev[i] = inv(i);
        }
    }

    int interpolate(int X) const {
        int res = 0;
        for (int i = 0; i < max_p; ++i) {
            int add = y[i];
            for (int j = 0; j < max_p; ++j) {
                if (i != j) {
                    add = mul(add, abs(X - x[j]));
                    add = mul(add, rev[abs(x[i] - x[j])]);
                }
            }
            res += add;
            res %= mod;
        }
        return res;
    }
};

int solve(int t) {
    vector<int> all;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            int d = max(abs(x[i] - x[j]), abs(y[i] - y[j]));
            all.push_back((d + 1) / 2);
        }
    }
    all.push_back(0);
    sort(all.begin(), all.end());
    all.erase(unique(all.begin(), all.end()), all.end());
    while (!all.empty() && all.back() >= t) {
        all.pop_back();
    }
    all.push_back(t);
    int res = 0;
    interpolation inter;
    for (int i = 0; i + 1 < all.size(); ++i) {
        int l = all[i], r = all[i + 1];
        if (r - l < 5) {
            for (int j = l; j < r; ++j) {
                res += f(j);
                res %= mod;
            }
        } else {
            int cur = 0;
            for (int j = l; j < l + max_p; ++j) {
                cur += f(j);
                cur %= mod;
                inter.x[j] = j;
                inter.y[j] = cur;
            }
            res += inter.interpolate(r - 1);
            res %= mod;
        }
    }
    res = (mul(t, f(t)) + mod - res) % mod;
    return res;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> t;
    for (int i = 0; i < n; ++i) {
        cin >> x[i] >> y[i];
    }
    cout << solve(t) << endl;
    return 0;
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 50;
const int MOD = 998244353;
int pow_mod(int b, int p) {
	int ret = 1;
	while( p ) {
		if( p & 1 ) ret = 1LL*ret*b%MOD;
		b = 1LL*b*b%MOD;
		p >>= 1;
	}
	return ret;
}
inline int add(int a, int b) {return (a + b)%MOD;}
inline int mul(int a, int b) {return 1LL*a*b%MOD;}
inline int sub(int a, int b) {return add(a, (MOD - b)%MOD);}
inline int inv(int x) {return pow_mod(x, MOD - 2);}
vector<int>v1[2*MAXN + 5], v2[2*MAXN + 5];
int x[MAXN + 5], y[MAXN + 5], n;
int dx[2*MAXN + 5], dy[2*MAXN + 5], xcnt, ycnt;
int tag[2*MAXN + 5];
int func(int t) {
	xcnt = ycnt = 0;
	for(int i=1;i<=n;i++) {
		dx[++xcnt] = x[i] + t + 1, dx[++xcnt] = x[i] - t;
		dy[++ycnt] = y[i] + t + 1, dy[++ycnt] = y[i] - t;
	}
	sort(dx + 1, dx + xcnt + 1), xcnt = unique(dx + 1, dx + xcnt + 1) - dx - 1;
	sort(dy + 1, dy + ycnt + 1), ycnt = unique(dy + 1, dy + ycnt + 1) - dy - 1;
	for(int i=1;i<=xcnt;i++) v1[i].clear(), v2[i].clear();
	for(int i=1;i<=n;i++) {
		int l = lower_bound(dx + 1, dx + xcnt + 1, x[i] - t) - dx;
		int r = lower_bound(dx + 1, dx + xcnt + 1, x[i] + t + 1) - dx;
		v1[l].push_back(i), v2[r].push_back(i);
	}
	int ans = 0;
	for(int i=1;i<=xcnt;i++) {
		int tmp = 0;
		for(int j=1;j<=ycnt;j++) {
			if( tmp ) ans = add(ans, mul(dy[j] - dy[j-1], dx[i] - dx[i-1]));
			tmp += tag[j];
		}
		for(int j=0;j<v1[i].size();j++) {
			int p = v1[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]++, tag[d]--;
		}
		for(int j=0;j<v2[i].size();j++) {
			int p = v2[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]--, tag[d]++;
		}
	}
	return ans;
}
struct point{
	int x, y;
	point(int _x=0, int _y=0):x(_x), y(_y) {}
};
void func3(point p1, point p2, point p3, int &a, int &b, int &c) {
	int d = 0; a = b = c = 0;
	d = mul(p1.y, mul(inv(p1.x - p2.x), inv(p1.x - p3.x)));
	a = add(a, d), b = sub(b, mul(add(p2.x, p3.x), d)), c = add(c, mul(mul(p2.x, p3.x), d));
	d = mul(p2.y, mul(inv(p2.x - p1.x), inv(p2.x - p3.x)));
	a = add(a, d), b = sub(b, mul(add(p1.x, p3.x), d)), c = add(c, mul(mul(p1.x, p3.x), d));
	d = mul(p3.y, mul(inv(p3.x - p2.x), inv(p3.x - p1.x)));
	a = add(a, d), b = sub(b, mul(add(p1.x, p2.x), d)), c = add(c, mul(mul(p1.x, p2.x), d));
}
int s0(int x) {return x;}
int s1(int x) {return mul(x, mul(x + 1, inv(2)));}
int s2(int x) {return mul(x, mul(x + 1, mul(mul(2, x) + 1, inv(6))));}
int func2(int l, int r) {
	if( r - l + 1 >= 3 ) {
		int a, b, c;
		func3(point(l, func(l)), point(l+1, func(l+1)), point(l+2, func(l+2)), a, b, c);
		a = mul(a, sub(s2(r), s2(l - 1)));
		b = mul(b, sub(s1(r), s1(l - 1)));
		c = mul(c, sub(s0(r), s0(l - 1)));
		return (add(add(a, b), c) + MOD) % MOD;
	}
	else if( r - l + 1 == 1 )
		return func(l);
	else if( r - l + 1 == 2 )
		return func(l) + func(r);
}
int a[MAXN*MAXN + 5], cnt;
int main() {
	int t; scanf("%d%d", &n, &t);
	for(int i=1;i<=n;i++)
		scanf("%d%d", &x[i], &y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++) {
			int p = max((abs(x[i] - x[j]) + 1) >> 1, (abs(y[i] - y[j]) + 1) >> 1);
			if( p <= t ) a[++cnt] = p;
		}
	a[++cnt] = t;
	sort(a + 1, a + cnt + 1), cnt = unique(a + 1, a + cnt + 1) - a - 1;
	int ans = mul(t + 1, func(t)), lst = 0;
	for(int i=1;i<=cnt;i++)
		ans = sub(ans, func2(lst, a[i])), lst = a[i] + 1;
	printf("%d\n", ans);
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 50;
const int MOD = 998244353;
int pow_mod(int b, int p) {
	int ret = 1;
	while( p ) {
		if( p & 1 ) ret = 1LL*ret*b%MOD;
		b = 1LL*b*b%MOD;
		p >>= 1;
	}
	return ret;
}
inline int add(int a, int b) {return (a + b)%MOD;}
inline int mul(int a, int b) {return 1LL*a*b%MOD;}
inline int sub(int a, int b) {return add(a, (MOD - b)%MOD);}
inline int inv(int x) {return pow_mod(x, MOD - 2);}
vector<int>v1[2*MAXN + 5], v2[2*MAXN + 5];
int x[MAXN + 5], y[MAXN + 5], n;
int dx[2*MAXN + 5], dy[2*MAXN + 5], xcnt, ycnt;
int tag[2*MAXN + 5];
int func(int t) {
	xcnt = ycnt = 0;
	for(int i=1;i<=n;i++) {
		dx[++xcnt] = x[i] + t + 1, dx[++xcnt] = x[i] - t;
		dy[++ycnt] = y[i] + t + 1, dy[++ycnt] = y[i] - t;
	}
	sort(dx + 1, dx + xcnt + 1), xcnt = unique(dx + 1, dx + xcnt + 1) - dx - 1;
	sort(dy + 1, dy + ycnt + 1), ycnt = unique(dy + 1, dy + ycnt + 1) - dy - 1;
	for(int i=1;i<=xcnt;i++) v1[i].clear(), v2[i].clear();
	for(int i=1;i<=n;i++) {
		int l = lower_bound(dx + 1, dx + xcnt + 1, x[i] - t) - dx;
		int r = lower_bound(dx + 1, dx + xcnt + 1, x[i] + t + 1) - dx;
		v1[l].push_back(i), v2[r].push_back(i);
	}
	int ans = 0;
	for(int i=1;i<=xcnt;i++) {
		int tmp = 0;
		for(int j=1;j<=ycnt;j++) {
			if( tmp ) ans = add(ans, mul(dy[j] - dy[j-1], dx[i] - dx[i-1]));
			tmp += tag[j];
		}
		for(int j=0;j<v1[i].size();j++) {
			int p = v1[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]++, tag[d]--;
		}
		for(int j=0;j<v2[i].size();j++) {
			int p = v2[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]--, tag[d]++;
		}
	}
	return ans;
}
struct point{
	int x, y;
	point(int _x=0, int _y=0):x(_x), y(_y) {}
};
int debug(int a, int b, int c, int x) {
	return add(mul(x, add(mul(x, a), b)), c);
}
void func3(point p1, point p2, point p3, int &a, int &b, int &c) {
	int d = 0; a = b = c = 0;
	d = mul(p1.y, mul(inv(p1.x - p2.x), inv(p1.x - p3.x)));
	a = add(a, d), b = add(b, MOD - mul(add(p2.x, p3.x), d)), c = add(c, mul(mul(p2.x, p3.x), d));
	d = mul(p2.y, mul(inv(p2.x - p1.x), inv(p2.x - p3.x)));
	a = add(a, d), b = add(b, MOD - mul(add(p1.x, p3.x), d)), c = add(c, mul(mul(p1.x, p3.x), d));
	d = mul(p3.y, mul(inv(p3.x - p2.x), inv(p3.x - p1.x)));
	a = add(a, d), b = add(b, MOD - mul(add(p1.x, p2.x), d)), c = add(c, mul(mul(p1.x, p2.x), d));
}
int s0(int x) {return x;}
int s1(int x) {return mul(x, mul(x + 1, inv(2)));}
int s2(int x) {return mul(x, mul(x + 1, mul(mul(2, x) + 1, inv(6))));}
int func2(int l, int r) {
	if( r - l + 1 >= 3 ) {
		int a, b, c;
		func3(point(l, func(l)), point(l+1, func(l+1)), point(l+2, func(l+2)), a, b, c);
		a = mul(a, sub(s2(r), s2(l - 1)));
		b = mul(b, sub(s1(r), s1(l - 1)));
		c = mul(c, sub(s0(r), s0(l - 1)));
		return (add(add(a, b), c) + MOD) % MOD;
	}
	else if( r - l + 1 == 1 )
		return func(l);
	else if( r - l + 1 == 2 )
		return func(l) + func(r);
}
int a[MAXN*MAXN + 5], cnt;
int main() {
	int t; scanf("%d%d", &n, &t);
	for(int i=1;i<=n;i++)
		scanf("%d%d", &x[i], &y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++) {
			int p = max((abs(x[i] - x[j]) + 1) >> 1, (abs(y[i] - y[j]) + 1) >> 1);
			if( p <= t ) a[++cnt] = p;
		}
	a[++cnt] = t;
	sort(a + 1, a + cnt + 1), cnt = unique(a + 1, a + cnt + 1) - a - 1;
	int ans = mul(t + 1, func(t)), lst = 0;
	for(int i=1;i<=cnt;i++)
		ans = sub(ans, func2(lst, a[i])), lst = a[i] + 1;
	printf("%d\n", ans);
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 50;
const int MOD = 998244353;
int pow_mod(int b, int p) {
	int ret = 1;
	while( p ) {
		if( p & 1 ) ret = 1LL*ret*b%MOD;
		b = 1LL*b*b%MOD;
		p >>= 1;
	}
	return ret;
}
inline int add(int a, int b) {return (a + b)%MOD;}
inline int mul(int a, int b) {return 1LL*a*b%MOD;}
inline int sub(int a, int b) {return add(a, (MOD - b)%MOD);}
inline int inv(int x) {return pow_mod(x, MOD - 2);}
vector<int>v1[2*MAXN + 5], v2[2*MAXN + 5];
int x[MAXN + 5], y[MAXN + 5], n;
int dx[2*MAXN + 5], dy[2*MAXN + 5], xcnt, ycnt;
int tag[2*MAXN + 5];
int func(int t) {
	xcnt = ycnt = 0;
	for(int i=1;i<=n;i++) {
		dx[++xcnt] = x[i] + t + 1, dx[++xcnt] = x[i] - t;
		dy[++ycnt] = y[i] + t + 1, dy[++ycnt] = y[i] - t;
	}
	sort(dx + 1, dx + xcnt + 1), xcnt = unique(dx + 1, dx + xcnt + 1) - dx - 1;
	sort(dy + 1, dy + ycnt + 1), ycnt = unique(dy + 1, dy + ycnt + 1) - dy - 1;
	for(int i=1;i<=xcnt;i++) v1[i].clear(), v2[i].clear();
	for(int i=1;i<=n;i++) {
		int l = lower_bound(dx + 1, dx + xcnt + 1, x[i] - t) - dx;
		int r = lower_bound(dx + 1, dx + xcnt + 1, x[i] + t + 1) - dx;
		v1[l].push_back(i), v2[r].push_back(i);
	}
	int ans = 0;
	for(int i=1;i<=xcnt;i++) {
		int tmp = 0;
		for(int j=1;j<=ycnt;j++) {
			if( tmp ) ans = add(ans, mul(dy[j] - dy[j-1], dx[i] - dx[i-1]));
			tmp += tag[j];
		}
		for(int j=0;j<v1[i].size();j++) {
			int p = v1[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]++, tag[d]--;
		}
		for(int j=0;j<v2[i].size();j++) {
			int p = v2[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]--, tag[d]++;
		}
	}
	return ans;
}
struct point{
	int x, y;
	point(int _x=0, int _y=0):x(_x), y(_y) {}
};
void func3(point p1, point p2, point p3, int &a, int &b, int &c) {
	int d = 0; a = b = c = 0;
	d = mul(p1.y, mul(inv(p1.x - p2.x), inv(p1.x - p3.x)));
	a = add(a, d), b = sub(b, mul(add(p2.x, p3.x), d)), c = add(c, mul(mul(p2.x, p3.x), d));
	d = mul(p2.y, mul(inv(p2.x - p1.x), inv(p2.x - p3.x)));
	a = add(a, d), b = sub(b, mul(add(p1.x, p3.x), d)), c = add(c, mul(mul(p1.x, p3.x), d));
	d = mul(p3.y, mul(inv(p3.x - p2.x), inv(p3.x - p1.x)));
	a = add(a, d), b = sub(b, mul(add(p1.x, p2.x), d)), c = add(c, mul(mul(p1.x, p2.x), d));
}
int s0(int x) {return x;}
int s1(int x) {return mul(x, mul(x + 1, inv(2)));}
int s2(int x) {return mul(x, mul(x + 1, mul(mul(2, x) + 1, inv(6))));}
int func2(int l, int r) {
	if( r - l + 1 >= 3 ) {
		int a, b, c;
		func3(point(l, func(l)), point(l+1, func(l+1)), point(l+2, func(l+2)), a, b, c);
		a = mul(a, sub(s2(r), s2(l - 1)));
		b = mul(b, sub(s1(r), s1(l - 1)));
		c = mul(c, sub(s0(r), s0(l - 1)));
		return (add(add(a, b), c) + MOD) % MOD;
	}
	else if( r - l + 1 == 1 )
		return func(l);
	else if( r - l + 1 == 2 )
		return func(l) + func(r);
}
int a[MAXN*MAXN + 5], cnt;
int main() {
	int t; scanf("%d%d", &n, &t);
	for(int i=1;i<=n;i++)
		scanf("%d%d", &x[i], &y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++) {
			int p = max((abs(x[i] - x[j])) >> 1, (abs(y[i] - y[j])) >> 1);
			if( p <= t ) a[++cnt] = p;
		}
	a[++cnt] = t;
	sort(a + 1, a + cnt + 1), cnt = unique(a + 1, a + cnt + 1) - a - 1;
	int ans = mul(t + 1, func(t)), lst = 0;
	for(int i=1;i<=cnt;i++)
		ans = sub(ans, func2(lst, a[i])), lst = a[i] + 1;
	printf("%d\n", ans);
}

#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 50;
const int MOD = 998244353;
int pow_mod(int b, int p) {
	int ret = 1;
	while( p ) {
		if( p & 1 ) ret = 1LL*ret*b%MOD;
		b = 1LL*b*b%MOD;
		p >>= 1;
	}
	return ret;
}
inline int add(int a, int b) {return (a + b)%MOD;}
inline int mul(int a, int b) {return 1LL*a*b%MOD;}
inline int sub(int a, int b) {return add(a, MOD - b);}
inline int inv(int x) {return pow_mod(x, MOD - 2);}
vector<int>v1[2*MAXN + 5], v2[2*MAXN + 5];
int x[MAXN + 5], y[MAXN + 5], n;
int dx[2*MAXN + 5], dy[2*MAXN + 5], xcnt, ycnt;
int tag[2*MAXN + 5];
int func(int t) {
	xcnt = ycnt = 0;
	for(int i=1;i<=n;i++) {
		dx[++xcnt] = x[i] + t + 1, dx[++xcnt] = x[i] - t;
		dy[++ycnt] = y[i] + t + 1, dy[++ycnt] = y[i] - t;
	}
	sort(dx + 1, dx + xcnt + 1), xcnt = unique(dx + 1, dx + xcnt + 1) - dx - 1;
	sort(dy + 1, dy + ycnt + 1), ycnt = unique(dy + 1, dy + ycnt + 1) - dy - 1;
	for(int i=1;i<=xcnt;i++) v1[i].clear(), v2[i].clear();
	for(int i=1;i<=n;i++) {
		int l = lower_bound(dx + 1, dx + xcnt + 1, x[i] - t) - dx;
		int r = lower_bound(dx + 1, dx + xcnt + 1, x[i] + t + 1) - dx;
		v1[l].push_back(i), v2[r].push_back(i);
	}
	int ans = 0;
	for(int i=1;i<=xcnt;i++) {
		int tmp = 0;
		for(int j=1;j<=ycnt;j++) {
			if( tmp ) ans = add(ans, mul(dy[j] - dy[j-1], dx[i] - dx[i-1]));
			tmp += tag[j];
		}
		for(int j=0;j<v1[i].size();j++) {
			int p = v1[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]++, tag[d]--;
		}
		for(int j=0;j<v2[i].size();j++) {
			int p = v2[i][j];
			int u = lower_bound(dy + 1, dy + ycnt + 1, y[p] - t) - dy;
			int d = lower_bound(dy + 1, dy + ycnt + 1, y[p] + t + 1) - dy;
			tag[u]--, tag[d]++;
		}
	}
	return ans;
}
struct point{
	int x, y;
	point(int _x=0, int _y=0):x(_x), y(_y) {}
};
int debug(int a, int b, int c, int x) {
	return add(mul(x, add(mul(x, a), b)), c);
}
void func3(point p1, point p2, point p3, int &a, int &b, int &c) {
	int d = 0; a = b = c = 0;
	d = mul(p1.y, mul(inv(p1.x - p2.x), inv(p1.x - p3.x)));
	a = add(a, d), b = add(b, MOD - mul(add(p2.x, p3.x), d)), c = add(c, mul(mul(p2.x, p3.x), d));
	d = mul(p2.y, mul(inv(p2.x - p1.x), inv(p2.x - p3.x)));
	a = add(a, d), b = add(b, MOD - mul(add(p1.x, p3.x), d)), c = add(c, mul(mul(p1.x, p3.x), d));
	d = mul(p3.y, mul(inv(p3.x - p2.x), inv(p3.x - p1.x)));
	a = add(a, d), b = add(b, MOD - mul(add(p1.x, p2.x), d)), c = add(c, mul(mul(p1.x, p2.x), d));
}
int s0(int x) {return x;}
int s1(int x) {return mul(x, mul(x + 1, inv(2)));}
int s2(int x) {return mul(x, mul(x + 1, mul(mul(2, x) + 1, inv(6))));}
int func2(int l, int r) {
	if( r - l + 1 >= 3 ) {
		int a, b, c;
		func3(point(l, func(l)), point(l+1, func(l+1)), point(l+2, func(l+2)), a, b, c);
		a = mul(a, sub(s2(r), s2(l - 1)));
		b = mul(b, sub(s1(r), s1(l - 1)));
		c = mul(c, sub(s0(r), s0(l - 1)));
		return (add(add(a, b), c) + MOD) % MOD;
	}
	else if( r - l + 1 == 1 )
		return func(l);
	else if( r - l + 1 == 2 )
		return func(l) + func(r);
}
int a[MAXN*MAXN + 5], cnt;
int main() {
	int t; scanf("%d%d", &n, &t);
	for(int i=1;i<=n;i++)
		scanf("%d%d", &x[i], &y[i]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++) {
			int p = max((abs(x[i] - x[j]) + 1) >> 1, (abs(y[i] - y[j]) + 1) >> 1);
			if( p <= t ) a[++cnt] = p;
		}
	a[++cnt] = t;
	sort(a + 1, a + cnt + 1), cnt = unique(a + 1, a + cnt + 1) - a - 1;
	int ans = mul(t + 1, func(t)), lst = 0;
	for(int i=1;i<=cnt;i++)
		ans = sub(ans, func2(lst, a[i])), lst = a[i] + 1;
	printf("%d\n", ans);
}

#pragma region
#ifndef M207
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
#endif
#include <bits/stdc++.h>
using namespace std;
#define ri register int
#define il inline
#define LL long long
#define uint unsigned int
#define ull unsigned long long
#define solid const auto &
#define pb emplace_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define gm int mid((l+r)/2)
#define space putchar(' ')
#define enter putchar('\n')
#define rd() ({ri t;in(t);t;})
#define Size(x) ((int)x.size())
#define mem(x,y) memset(x,y,sizeof(x))
template<class T>il void in(T &x)
{
	x=0; char c=getchar(); bool f=0;
	while(!isdigit(c)) f|=(c=='-'),c=getchar();
	while(isdigit(c)) x=x*10+(c^'0'),c=getchar();
	f?x=-x:0;
}
template<class T>il void out(T x,const char c='\n')
{
	static short st[40]; short m=0;
	if(x<0) putchar('-'),x=-x;
	do st[++m]=x%10,x/=10; while(x);
	while(m) putchar(st[m--]|'0');
	putchar(c);
}
template<class T>il void err(const T &x,const char c='\n') {cerr<<x<<c;}
template<class T,class ...Args>il void in(T &x,Args &...args) {in(x); in(args...);}
template<class T,class ...Args>il void out(const T &x,const Args &...args) {out(x,' '); out(args...);}
template<class T,class ...Args>il void err(const T &x,const Args &...args) {err(x,' '); err(args...);}
template<class T>il void prt(T a,int n) {for(ri i=0; i<n; ++i) out(a[i],i==n-1?'\n':' ');}
template<class T>il void clr(T a[],int n) {memset(a,0,sizeof(T)*n);}
template<class T>il void clr(T *a,T *b) {memset(a,0,sizeof(T)*(b-a));}
template<class T>il bool ckmax(T &a,const T &b) {return a<b?a=b,1:0;}
template<class T>il bool ckmin(T &a,const T &b) {return a>b?a=b,1:0;}
namespace MOD_CALC
{
const int md=998244353,inv2=(md+1)/2;
il int add(const int a,const int b) {return a+b>=md?a+b-md:a+b;}
il int sub(const int a,const int b) {return a-b<0?a-b+md:a-b;}
il int mul(const int a,const int b) {return (LL)a*b%md;}
il void inc(int &a,const int b) {(a+=b)>=md?a-=md:0;}
il void dec(int &a,const int b) {(a-=b)<0?a+=md:0;}
il int qpow(int a,int b) {int r=1; for(; b; b>>=1,a=mul(a,a)) if(b&1) r=mul(r,a); return r;}
il int qpow(int a,int b,const int p) {int r=1; for(; b; b>>=1,a=(LL)a*a%p) if(b&1) r=(LL)r*a%p; return r;}
il int mdinv(const int a) {return qpow(a,md-2);}
template<class ...Args>il int add(const int a,const int b,const Args &...args) {return add(add(a,b),args...);}
template<class ...Args>il int mul(const int a,const int b,const Args &...args) {return mul(mul(a,b),args...);}
} using namespace MOD_CALC;
namespace i207M
{
#pragma endregion
#define N 55
struct Node
{
	int x,y;
	Node() {}
	Node(const int _x,const int _y) {x=_x,y=_y;}
} pt[N];
int n;
int calc(int T)
{
	static int xp[N]; int cntx=0;
	for(ri i=1; i<=n; ++i)
		xp[++cntx]=pt[i].x-T,xp[++cntx]=pt[i].x+T+1;
	sort(xp+1,xp+1+cntx);
	cntx=unique(xp+1,xp+1+cntx)-xp-1;
	int ans=0;
	for(ri i=1; i<cntx; ++i)
	{
		static pii yp[N]; int cnty=0;
		for(ri j=1; j<=n; ++j)
			if(pt[j].x-T<=xp[i]&&xp[i]<=pt[j].x+T)
			{
				yp[++cnty]=mp(pt[j].y-T,1);
				yp[++cnty]=mp(pt[j].y+T+1,-1);
			}
		sort(yp+1,yp+1+cnty);
		cnty=unique(yp+1,yp+1+cnty)-yp-1;
		int sum=0,sq=0;
		for(ri j=1; j<cnty; ++j)
		{
			sum+=yp[j].se;
			while(j<cnty&&yp[j+1].fi==yp[j].fi) sum+=yp[++j].se;
			if(sum>0) sq+=yp[j+1].fi-yp[j].fi;
		}
		// err("A",xp[i],xp[i+1],sq);
		inc(ans,mul(sq,xp[i+1]-xp[i]));
	}
	// err("T",T,ans);
	return ans;
}
const int inv6=mdinv(6);
il int sum2(int x)
{
	if(x<=0) return 0;
	return mul(x,x+1,2*x+1,inv6);
}
il int sum(int x)
{
	if(x<=0) return 0;
	return mul(x,x+1,inv2);
}
int solve(int l,int r) // [ , )
{
	// err("S",l,r);
	if(r-l<=3)
	{
		int ans=0;
		for(ri i=l; i<r; ++i) inc(ans,calc(i));
		return ans;
	}
	int g[3][4]; // C, B, A
	for(ri i=0; i<3; ++i)
	{
		g[i][0]=1;
		for(ri j=1; j<3; ++j) g[i][j]=mul(g[i][j-1],l+i);
		g[i][3]=calc(l+i);
	}
	for(ri i=0; i<3; ++i)
	{
		int iv=mdinv(g[i][i]);
		for(ri j=i; j<4; ++j) g[i][j]=mul(g[i][j],iv);
		for(ri j=0; j<3; ++j)
			if(i!=j&&g[j][i])
			{
				for(ri k=3; k>=i; --k) dec(g[j][k],mul(g[j][i],g[i][k]));
			}
	}
	int A=g[2][3],B=g[1][3],C=g[0][3];
	int ans=0;
	inc(ans,mul(A,sub(sum2(r-1),sum2(l-1))));
	inc(ans,mul(B,sub(sum(r-1),sum(l-1))));
	inc(ans,mul(C,r-l));
	return ans;
}
int T;
int tim[N*N],cntt;
signed main()
{
#ifdef M207
	freopen("in.in","r",stdin);
	// freopen("ot.out","w",stdout);
#endif
	in(n,T); int mn=0;
	for(ri i=1; i<=n; ++i)
	{
		in(pt[i].x,pt[i].y);
		ckmin(mn,min(pt[i].x,pt[i].y));
	}
	for(ri i=1; i<=n; ++i) pt[i].x-=mn,pt[i].y-=mn;
	tim[++cntt]=0,tim[++cntt]=T+1;
	for(ri i=1; i<=n; ++i)
		for(ri j=1; j<i; ++j)
		{
			int d=max(abs(pt[i].x-pt[j].x),abs(pt[i].y-pt[j].y));
			tim[++cntt]=(d+1)/2;
			if(tim[cntt]>T) --cntt;
		}
	sort(tim+1,tim+1+cntt);
	cntt=unique(tim+1,tim+1+cntt)-tim-1;
	int ans=0;
	for(ri i=1; i<cntt; ++i) inc(ans,solve(tim[i],tim[i+1]));
	ans=sub(mul(T+1,calc(T)),ans);
	out(ans);
	return 0;
}
#pragma region
}
signed main()
{
	i207M::main();
	return 0;
}
#pragma endregion

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
#define debug puts("wzpakking")
#define y1 ysghysgsygsh
using namespace std;
const int mo=1000000007;
const int N=105;
int n,x[N],y[N];
int T,q[N*N];
int Area(int T){
	static int qx[N],qy[N];
	*qx=*qy=0;
	For(i,1,n){
		qx[++*qx]=x[i]-T;
		qx[++*qx]=x[i]+T+1;
		qy[++*qy]=y[i]-T;
		qy[++*qy]=y[i]+T+1;
	}
	sort(qx+1,qx+*qx+1);
	sort(qy+1,qy+*qy+1);
	*qx=unique(qx+1,qx+*qx+1)-qx-1;
	*qy=unique(qy+1,qy+*qy+1)-qy-1;
	static int sum[N][N];
	memset(sum,0,sizeof(sum));
	For(i,1,n){
		int x1=lower_bound(qx+1,qx+*qx+1,x[i]-T)-qx;
		int x2=lower_bound(qx+1,qx+*qx+1,x[i]+T+1)-qx;
		int y1=lower_bound(qy+1,qy+*qy+1,y[i]-T)-qy;
		int y2=lower_bound(qy+1,qy+*qy+1,y[i]+T+1)-qy;
		sum[x1][y1]++; sum[x2][y2]++;
		sum[x1][y2]--; sum[x2][y1]--;
	}
	For(i,1,*qx) For(j,1,*qy) sum[i][j]+=sum[i][j-1];
	For(i,1,*qx) For(j,1,*qy) sum[i][j]+=sum[i-1][j];
	ll ans=0;
	For(i,1,(*qx)-1) For(j,1,(*qy)-1)
		if (sum[i][j]) ans+=1ll*(qx[i+1]-qx[i])*(qy[j+1]-qy[j]);
	return ans%mo;
}
int S0(int l,int r){
	return r-l+1;
}
int S1(int l,int r){
	return 1ll*(l+r)*(r-l+1)/2%mo;
}
int S2(int l,int r){
	int vr=1ll*r*(r+1)%mo*(r*2+1)%mo;
	int vl=1ll*l*(l-1)%mo*(l*2-1)%mo;
	return (vr+mo-vl)*1ll*(mo+1)/6%mo;
}
int Func(int l,int r){
	int f0=Area(l);
	int f1=Area(l+1);
	int f2=Area(l+2);
	int a=(f2+f0+2ll*mo-f1-f1)*(mo+1)/2%mo;
	int b=(f1+2ll*mo-f0-1ll*(2*l+1)*a)%mo;
	int c=(f0+2ll*mo-1ll*l*l%mo*a%mo-1ll*l*b%mo)%mo;
	assert((1ll*l*l%mo*a+1ll*l*b+c)%mo==f0);
	assert((1ll*(l+1)*(l+1)%mo*a+1ll*(l+1)*b+c)%mo==f1);
	assert((1ll*(l+2)*(l+2)%mo*a+1ll*(l+2)*b+c)%mo==f2);
	return (1ll*a*S2(l,r)+1ll*b*S1(l,r)+1ll*c*S0(l,r))%mo;
}
/*
3-al
al^2
a(l+1)^2
a(l+2)^2
*/
int main(){
	scanf("%d%d",&n,&T);
	For(i,1,n) scanf("%d%d",&x[i],&y[i]);
	For(i,1,n) For(j,i+1,n)
		q[++*q]=(max(abs(x[i]-x[j]),abs(y[i]-y[j]))+1)/2;
	q[++*q]=T+1;
	sort(q+1,q+*q+1);
	*q=unique(q+1,q+*q+1)-q-1;
	for (;q[*q]!=T+1;--*q);
	int top=*q; q[0]=0;
	int ans=1ll*Area(T)*(T+1)%mo;
	For(i,1,top) ans=(ans+mo-Func(q[i-1],q[i]-1))%mo;
	printf("%d\n",ans);
}

#include<bits/stdc++.h>
#define mem(f) memset(f,0,sizeof(f))
using namespace std;
typedef long long ll;
const int N=55,mod=998244353,i2=499122177,i6=166374059;

int n,t,ans,b[N*N],num,tot,cot;
bool exi[N];ll a[5];
struct P{
	int x,y;
	bool operator<(const P&ky)const{return (x^ky.x)?x<ky.x:y<ky.y;}
}p[N];
struct Q{
	int x,id;bool v;
	bool operator<(const Q&ky)const{return x<ky.x;}
}q[N<<1],c[N<<1];

inline void ad(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline int dc(int x,int y){x-=y;return x<0?x+mod:x;}

inline int F(int t)
{
	int i,j,k,l,re=0,res,nw;tot=0;
	for(i=1;i<=n;++i){
		q[++tot]={p[i].x-t,i,true};
		q[++tot]={p[i].x+t+1,i,false};
	}
	memset(exi,false,sizeof(exi));
	sort(q+1,q+tot+1);
	for(i=j=1;i<=tot;i=j){
		for(;j<=tot && q[j].x==q[i].x;++j)
		  exi[q[j].id]=q[j].v;
		for(cot=0,k=1;k<=n;++k)
		  if(exi[k]) c[++cot]={p[k].y-t,0,true},c[++cot]={p[k].y+t+1,0,false};
		sort(c+1,c+cot+1);res=nw=0;
		for(k=l=1;k<=cot;k=l){
			for(;l<=cot && c[l].x==c[k].x;++l) res+=c[l].v?1:(-1);
			if(res && l<=cot) ad(nw,c[l].x-c[l-1].x);
		}
		if(j<=tot) ad(re,(ll)nw*(q[j].x-q[j-1].x)%mod);
	}
	return re;
}

inline int cal(ll x)
{
	a[0]=a[0]*i2%mod;a[2]=a[2]*i2%mod;
	int re=((a[0]-a[1]+a[2])%mod+mod)%mod*x%mod*(x+1)%mod*(x+x+1)%mod*(ll)i6%mod;
	ad(re,((-3LL*a[0]+a[1]+a[1]-a[2])%mod+mod)%mod*x%mod*(x+1)%mod*(ll)i2%mod);
	ad(re,(x+1)*a[0]%mod);return re;
}

int main(){
	int i,j,k;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;++i) scanf("%d%d",&p[i].x,&p[i].y);
	for(i=1;i<=n;++i)
	 for(j=i+1;j<=n;++j)
	  b[++num]=(max(p[j].x-p[i].x,abs(p[j].y-p[i].y))+1)>>1;
	b[++num]=0;b[++num]=t;sort(b+1,b+num+1);
	for(i=1;b[i]<t;++i){
		k=b[i+1]-b[i];
		for(j=0;j<min(3,k);++j) a[j]=F(b[i]+j);
		if(k>3) ad(ans,cal(k-1));else
		for(j=0;j<k;++j) ad(ans,a[j]);
	}
	printf("%d",dc((ll)t*F(t)%mod,ans));
	return 0;
}

#include<bits/stdc++.h>
#define mem(f) memset(f,0,sizeof(f))
using namespace std;
typedef long long ll;
const int N=55,mod=998244353,i2=499122177,i6=166374059;

int n,t,ans,b[N*N],num,tot,cot;
bool exi[N];ll a[5];
struct P{
	int x,y;
	bool operator<(const P&ky)const{return (x^ky.x)?x<ky.x:y<ky.y;}
}p[N];
struct Q{
	int x,id;bool v;
	bool operator<(const Q&ky)const{return x<ky.x;}
}q[N<<1],c[N<<1];

inline void ad(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline int dc(int x,int y){x-=y;return x<0?x+mod:x;}

inline int F(int t)
{
	int i,j,k,l,re=0,len,res,nw;tot=0;
	for(i=1;i<=n;++i){
		q[++tot]={p[i].x-t,i,true};
		q[++tot]={p[i].x+t+1,i,false};
	}
	memset(exi,false,sizeof(exi));
	sort(q+1,q+tot+1);
	for(i=j=1;i<=tot;i=j){
		for(;j<=tot && q[j].x==q[i].x;++j)
		  exi[q[j].id]=q[j].v;
		for(cot=0,k=1;k<=n;++k)
		  if(exi[k]) c[++cot]={p[k].y-t,0,true},c[++cot]={p[k].y+t+1,0,false};
		sort(c+1,c+cot+1);res=nw=0;
		for(k=l=1;k<=cot;k=l){
			for(;l<=cot && c[l].x==c[k].x;++l) res+=c[l].v?1:(-1);
			if(res && l<=cot) ad(nw,c[l].x-c[l-1].x);
		}
		if(j<=tot) ad(re,(ll)nw*(q[j].x-q[j-1].x)%mod);
	}
	return re;
}

inline int cal(ll x)
{
	a[0]=a[0]*i2%mod;a[2]=a[2]*i2%mod;
	int re=((a[0]-a[1]+a[2])%mod+mod)*x%mod*(x+1)%mod*(x+x+1)%mod*(ll)i6%mod;
	ad(re,((-3LL*a[0]+a[1]+a[1]-a[2])%mod+mod)*x%mod*(x+1)%mod*(ll)i2%mod);
	ad(re,(x+1)*a[0]%mod);return re;
}

int main(){
	int i,j,k;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;++i) scanf("%d%d",&p[i].x,&p[i].y);
	for(i=1;i<=n;++i)
	 for(j=i+1;j<=n;++j)
	  b[++num]=(max(p[j].x-p[i].x,abs(p[j].y-p[i].y))+1)>>1;
	b[++num]=0;b[++num]=t;sort(b+1,b+num+1);
	for(i=1;b[i]<t;++i){
		k=b[i+1]-b[i];
		for(j=0;j<min(3,k);++j) a[j]=F(b[i]+j);
		if(k>3) ad(ans,cal(k-1));else
		for(j=0;j<k;++j) ad(ans,a[j]);
	}
	printf("%d",dc((ll)t*F(t)%mod,ans));
	return 0;
}

#include<bits/stdc++.h>
#define mem(f) memset(f,0,sizeof(f))
using namespace std;
typedef long long ll;
const int N=55,mod=998244353,i2=499122177,i6=166374059;

int n,t,a[5],ans,b[N*N],num,tot,cot;
bool exi[N];
struct P{
	int x,y;
	bool operator<(const P&ky)const{return (x^ky.x)?x<ky.x:y<ky.y;}
}p[N];
struct Q{
	int x,id;bool v;
	bool operator<(const Q&ky)const{return x<ky.x;}
}q[N<<1],c[N<<1];

inline void ad(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline int dc(int x,int y){x-=y;return x<0?x+mod:x;}

inline int F(int t)
{
	int i,j,k,l,re=0,len,res,nw;tot=0;
	for(i=1;i<=n;++i){
		q[++tot]={p[i].x-t,i,true};
		q[++tot]={p[i].x+t+1,i,false};
	}
	memset(exi,false,sizeof(exi));
	sort(q+1,q+tot+1);
	for(i=j=1;i<=tot;i=j){
		for(;j<=tot && q[j].x==q[i].x;++j)
		  exi[q[j].id]=q[j].v;
		for(cot=0,k=1;k<=n;++k)
		  if(exi[k]) c[++cot]={p[k].y-t,0,true},c[++cot]={p[k].y+t+1,0,false};
		sort(c+1,c+cot+1);res=nw=0;
		for(k=l=1;k<=cot;k=l){
			for(;l<=cot && c[l].x==c[k].x;++l) res+=c[l].v?1:(-1);
			if(res && l<=cot) ad(nw,c[l].x-c[l-1].x);
		}
		if(j<=tot) ad(re,(ll)nw*(q[j].x-q[j-1].x)%mod);
	}
	return re;
}

inline int cal(ll x)
{
	a[0]=(ll)a[0]*i2%mod;a[2]=(ll)a[2]*i2%mod;
	int re=((a[0]-a[1]+a[2])%mod+mod)*x%mod*(x+1)%mod*(x+x+1)%mod*(ll)i6%mod;
	ad(re,((-3LL*a[0]+a[1]+a[1]-a[2])%mod+mod)*x%mod*(x+1)%mod*(ll)i2%mod);
	ad(re,(x+1)*a[0]%mod);return re;
}

int main(){
	int i,j,k;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;++i) scanf("%d%d",&p[i].x,&p[i].y);
	for(i=1;i<=n;++i)
	 for(j=i+1;j<=n;++j)
	  b[++num]=(max(p[j].x-p[i].x,abs(p[j].y-p[i].y))+1)>>1;
	b[++num]=0;b[++num]=t;sort(b+1,b+num+1);
	for(i=1;b[i]<t;++i){
		k=b[i+1]-b[i];
		for(j=0;j<min(3,k);++j) a[j]=F(b[i-1]+j);
		if(k>3) ad(ans,cal(k-1));else
		for(j=0;j<k;++j) ad(ans,a[j]);
	}
	printf("%d",dc((ll)t*F(t)%mod,ans));
	return 0;
}

#include<bits/stdc++.h>
#define mem(f) memset(f,0,sizeof(f))
using namespace std;
typedef long long ll;
const int N=55,mod=998244353,i2=499122177,i6=166374059;

int n,t,ans,b[N*N],num,tot,cot;
bool exi[N];ll a[5];
struct P{
	int x,y;
	bool operator<(const P&ky)const{return (x^ky.x)?x<ky.x:y<ky.y;}
}p[N];
struct Q{
	int x,id;bool v;
	bool operator<(const Q&ky)const{return x<ky.x;}
}q[N<<1],c[N<<1];

inline void ad(int &x,int y){x+=y;if(x>=mod) x-=mod;}
inline int dc(int x,int y){x-=y;return x<0?x+mod:x;}

inline int F(int t)
{
	int i,j,k,l,re=0,len,res,nw;tot=0;
	for(i=1;i<=n;++i){
		q[++tot]={p[i].x-t,i,true};
		q[++tot]={p[i].x+t+1,i,false};
	}
	memset(exi,false,sizeof(exi));
	sort(q+1,q+tot+1);
	for(i=j=1;i<=tot;i=j){
		for(;j<=tot && q[j].x==q[i].x;++j)
		  exi[q[j].id]=q[j].v;
		for(cot=0,k=1;k<=n;++k)
		  if(exi[k]) c[++cot]={p[k].y-t,0,true},c[++cot]={p[k].y+t+1,0,false};
		sort(c+1,c+cot+1);res=nw=0;
		for(k=l=1;k<=cot;k=l){
			for(;l<=cot && c[l].x==c[k].x;++l) res+=c[l].v?1:(-1);
			if(res && l<=cot) ad(nw,c[l].x-c[l-1].x);
		}
		if(j<=tot) ad(re,(ll)nw*(q[j].x-q[j-1].x)%mod);
	}
	return re;
}

inline int cal(ll x)
{
	a[0]=a[0]*i2%mod;a[2]=a[2]*i2%mod;
	int re=((a[0]-a[1]+a[2])%mod+mod)*x%mod*(x+1)%mod*(x+x+1)%mod*(ll)i6%mod;
	ad(re,((-3LL*a[0]+a[1]+a[1]-a[2])%mod+mod)*x%mod*(x+1)%mod*(ll)i2%mod);
	ad(re,(x+1)*a[0]%mod);return re;
}

int main(){
	int i,j,k;
	scanf("%d%d",&n,&t);
	for(i=1;i<=n;++i) scanf("%d%d",&p[i].x,&p[i].y);
	for(i=1;i<=n;++i)
	 for(j=i+1;j<=n;++j)
	  b[++num]=(max(p[j].x-p[i].x,abs(p[j].y-p[i].y))+1)>>1;
	b[++num]=0;b[++num]=t;sort(b+1,b+num+1);
	for(i=1;b[i]<t;++i){
		k=b[i+1]-b[i];
		for(j=0;j<min(3,k);++j) a[j]=F(b[i-1]+j);
		if(k>3) ad(ans,cal(k-1));else
		for(j=0;j<k;++j) ad(ans,a[j]);
	}
	printf("%d",dc((ll)t*F(t)%mod,ans));
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int maxn = 55, P = 998244353;
int n, T, x[maxn], y[maxn], tag[maxn << 1];
vector<pair<int, int>> V[maxn << 1];

int qp(int x, int y) {
    int z = 1;
    for (; y; y >>= 1, x = 1LL * x * x % P) {
        if (y & 1) z = 1LL * z * x % P;
    }
    return z;
}

int main() {
    scanf("%d %d", &n, &T);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &x[i], &y[i]);
    }
    auto F = [&](int t) {
        vector<int> V1, V2;
        for (int i = 1; i <= n; i++) {
            V1.push_back(x[i] - t), V1.push_back(x[i] + t + 1);
            V2.push_back(y[i] - t), V2.push_back(y[i] + t + 1);
        }
        sort(V1.begin(), V1.end()), sort(V2.begin(), V2.end());
        V1.resize(unique(V1.begin(), V1.end()) - V1.begin());
        V2.resize(unique(V2.begin(), V2.end()) - V2.begin());
        for (int i = 0; i < V1.size(); i++) {
            V[i].clear();
        }
        for (int i = 1; i <= n; i++) {
            int l = lower_bound(V1.begin(), V1.end(), x[i] - t) - V1.begin(),
                r = lower_bound(V1.begin(), V1.end(), x[i] + t + 1) - V1.begin();
            V[l].emplace_back(i, 1), V[r].emplace_back(i, -1);
        }
        memset(tag, 0, sizeof(tag));
        int ans = 0;
        for (int i = 0; i < V1.size() - 1; i++) {
            for (auto p : V[i]) {
                int l = lower_bound(V2.begin(), V2.end(), y[p.first] - t) -
                    V2.begin(), r = lower_bound(V2.begin(), V2.end(), y[p.first]
                    + t + 1) - V2.begin();
                tag[l] += p.second, tag[r] -= p.second;
            }
            for (int j = 0, cur = 0; j < V2.size() - 1; j++) {
                if (cur += tag[j]) ans = (ans + 1LL * (V1[i + 1] - V1[i]) *
                    (V2[j + 1] - V2[j])) % P;
            }
        }
        return ans;
    };
    auto lagrange = [&](int n, int l, vector<int> V) {
        int ans = 0;
        for (int i = 0; i < 4; i++) {
            int sum = 0;
            for (int j = 0; j < 4; j++) if (i ^ j) {
                sum = (sum + 1LL * (n - l - i) * qp(i - j, P - 2)) % P;
            }
            ans = (ans + 1LL * V[i] * sum) % P;
        }
        return ans;
    };
    auto solve = [&](int l, int r) {
        if (r - l <= 2) {
            int ans = 0;
            for (int i = l; i <= r; i++) {
                (ans += F(i)) %= P;
            }
            return ans;
        }
        vector<int> V = {F(l), F(l + 1), F(l + 2), F(l + 3)};
        for (int i = 1; i < 4; i++) (V[i] += V[i - 1]) %= P;
        return (lagrange(r, l, V) - lagrange(l - 1, l, V) + P) % P;
    };
    int ans = 1LL * T * F(T) % P;
    vector<int> tim = {0, T};
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            int t = max(abs(x[i] - x[j]) + 1, abs(y[i] - y[j]) + 1) >> 1;
            if (t < T) tim.push_back(t);
        }
    }
    sort(tim.begin(), tim.end());
    tim.resize(unique(tim.begin(), tim.end()) - tim.begin());
    for (int i = 0; i < tim.size() - 1; i++) {
        ans = (ans - solve(tim[i], tim[i + 1] - 1) + P) % P;
    }
    printf("%d\n", ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int maxn = 55, P = 998244353;
int n, T, x[maxn], y[maxn], tag[maxn << 1];
vector<pair<int, int>> V[maxn << 1];

int qp(int x, int y) {
    int z = 1;
    for (; y; y >>= 1, x = 1LL * x * x % P) {
        if (y & 1) z = 1LL * z * x % P;
    }
    return z;
}

int main() {
    scanf("%d %d", &n, &T);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &x[i], &y[i]);
    }
    auto F = [&](int t) {
        vector<int> V1, V2;
        for (int i = 1; i <= n; i++) {
            V1.push_back(x[i] - t), V1.push_back(x[i] + t + 1);
            V2.push_back(y[i] - t), V2.push_back(y[i] + t + 1);
        }
        sort(V1.begin(), V1.end()), sort(V2.begin(), V2.end());
        V1.resize(unique(V1.begin(), V1.end()) - V1.begin());
        V2.resize(unique(V2.begin(), V2.end()) - V2.begin());
        for (int i = 0; i < V1.size(); i++) {
            V[i].clear();
        }
        for (int i = 1; i <= n; i++) {
            int l = lower_bound(V1.begin(), V1.end(), x[i] - t) - V1.begin(),
                r = lower_bound(V1.begin(), V1.end(), x[i] + t + 1) - V1.begin();
            V[l].emplace_back(i, 1), V[r].emplace_back(i, -1);
        }
        memset(tag, 0, sizeof(tag));
        int ans = 0;
        for (int i = 0; i < V1.size() - 1; i++) {
            for (auto p : V[i]) {
                int l = lower_bound(V2.begin(), V2.end(), y[p.first] - t) -
                    V2.begin(), r = lower_bound(V2.begin(), V2.end(), y[p.first]
                    + t + 1) - V2.begin();
                tag[l] += p.second, tag[r] -= p.second;
            }
            for (int j = 0, cur = 0; j < V2.size() - 1; j++) {
                if (cur += tag[j]) ans = (ans + 1LL * (V1[i + 1] - V1[i]) *
                    (V2[j + 1] - V2[j])) % P;
            }
        }
        return ans;
    };
    auto lagrange = [&](int n, int l, vector<int> V) {
        int ans = 0;
        for (int i = 0; i < 4; i++) {
            int sum = 0;
            for (int j = 0; j < 4; j++) if (i ^ j) {
                sum = (sum + 1LL * (n - l - j) * qp(i - j, P - 2)) % P;
            }
            ans = (ans + 1LL * V[i] * sum) % P;
        }
        return ans;
    };
    auto solve = [&](int l, int r) {
        if (r - l <= 2) {
            int ans = 0;
            for (int i = l; i <= r; i++) {
                (ans += F(i)) %= P;
            }
            return ans;
        }
        vector<int> V = {F(l), F(l + 1), F(l + 2), F(l + 3)};
        for (int i = 1; i < 4; i++) (V[i] += V[i - 1]) %= P;
        return (lagrange(r, l, V) - lagrange(l - 1, l, V) + P) % P;
    };
    int ans = 1LL * T * F(T) % P;
    vector<int> tim = {0, T};
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            int t = max(abs(x[i] - x[j]) + 1, abs(y[i] - y[j]) + 1) >> 1;
            if (t < T) tim.push_back(t);
        }
    }
    sort(tim.begin(), tim.end());
    tim.resize(unique(tim.begin(), tim.end()) - tim.begin());
    for (int i = 0; i < tim.size() - 1; i++) {
        ans = (ans - solve(tim[i], tim[i + 1] - 1) + P) % P;
    }
    printf("%d\n", ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int maxn = 55, P = 998244353;
int n, T, x[maxn], y[maxn], tag[maxn << 1];
vector<pair<int, int>> V[maxn << 1];

int qp(int x, int y) {
    int z = 1;
    for (; y; y >>= 1, x = 1LL * x * x % P) {
        if (y & 1) z = 1LL * z * x % P;
    }
    return z;
}

int main() {
    scanf("%d %d", &n, &T);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &x[i], &y[i]);
    }
    auto F = [&](int t) {
        vector<int> V1, V2;
        for (int i = 1; i <= n; i++) {
            V1.push_back(x[i] - t), V1.push_back(x[i] + t + 1);
            V2.push_back(y[i] - t), V2.push_back(y[i] + t + 1);
        }
        sort(V1.begin(), V1.end()), sort(V2.begin(), V2.end());
        V1.resize(unique(V1.begin(), V1.end()) - V1.begin());
        V2.resize(unique(V2.begin(), V2.end()) - V2.begin());
        for (int i = 0; i < V1.size(); i++) {
            V[i].clear();
        }
        for (int i = 1; i <= n; i++) {
            int l = lower_bound(V1.begin(), V1.end(), x[i] - t) - V1.begin(),
                r = lower_bound(V1.begin(), V1.end(), x[i] + t + 1) - V1.begin();
            V[l].emplace_back(i, 1), V[r].emplace_back(i, -1);
        }
        memset(tag, 0, sizeof(tag));
        int ans = 0;
        for (int i = 0; i < V1.size() - 1; i++) {
            for (auto p : V[i]) {
                int l = lower_bound(V2.begin(), V2.end(), y[p.first] - t) -
                    V2.begin(), r = lower_bound(V2.begin(), V2.end(), y[p.first]
                    + t + 1) - V2.begin();
                tag[l] += p.second, tag[r] -= p.second;
            }
            for (int j = 0, cur = 0; j < V2.size() - 1; j++) {
                if (cur += tag[j]) ans = (ans + 1LL * (V1[i + 1] - V1[i]) *
                    (V2[j + 1] - V2[j])) % P;
            }
        }
        return ans;
    };
    auto lagrange = [&](int n, vector<int> V) {
        int ans = 0;
        for (int i = 0; i < 4; i++) {
            int sum = 0;
            for (int j = 0; j < 4; j++) if (i ^ j) {
                sum = (sum + 1LL * (n - j) * qp(i - j + P, P - 2)) % P;
            }
            ans = (ans + 1LL * V[i] * sum) % P;
        }
        return ans;
    };
    auto solve = [&](int l, int r) {
        if (r - l <= 2) {
            int ans = 0;
            for (int i = l; i <= r; i++) {
                (ans += F(i)) %= P;
            }
            return ans;
        }
        vector<int> V = {F(l), F(l + 1), F(l + 2), F(l + 3)};
        for (int i = 1; i < 4; i++) (V[i] += V[i - 1]) %= P;
        return lagrange(r - l, V);
    };
    int ans = 1LL * T * F(T) % P;
    vector<int> tim = {0, T};
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            int t = max(abs(x[i] - x[j]) + 1, abs(y[i] - y[j]) + 1) >> 1;
            if (t < T) tim.push_back(t);
        }
    }
    sort(tim.begin(), tim.end());
    tim.resize(unique(tim.begin(), tim.end()) - tim.begin());
    for (int i = 0; i < tim.size() - 1; i++) {
        ans = (ans - solve(tim[i], tim[i + 1] - 1) + P) % P;
    }
    printf("%d\n", ans);
    return 0;
}

#define DEBUG 0

#include <bits/stdc++.h>
using namespace std;

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------
#define MOD 998244353
#define INV2 499122177
#define INV6 166374059

int x[50],y[50];
vi v;
LLI getNum(int t,int n) {
    if (t == 0) return n;
    int i,j;
    LLI c = 0;
    for (i = 0; i < n; i++) {
        int l1 = x[i]-t,r1 = x[i]+t-1,l2 = x[i]-t+1,r2 = x[i]+t;
        int d1 = y[i]-t,u1 = y[i]+t-1,d2 = y[i]-t+1,u2 = y[i]+t;
        for (j = 0; j < n; j++) {
            if (i == j) continue;
            int l,r,d,u;
            if (j > i) l = x[j]-t+1,r = x[j]+t-1,d = y[j]-t+1,u = y[j]+t-1;
            else l = x[j]-t,r = x[j]+t,d = y[j]-t,u = y[j]+t;
            if ((y[i]+t >= d) && (y[i]+t <= u)) {
                if (l <= l1) l1 = max(l1,r+1);
                if (r >= r1) r1 = min(r1,l-1);
            }
            if ((y[i]-t >= d) && (y[i]-t <= u)) {
                if (l <= l2) l2 = max(l2,r+1);
                if (r >= r2) r2 = min(r2,l-1);
            }
            if ((x[i]-t >= l) && (x[i]-t <= r)) {
                if (d <= d1) d1 = max(d1,u+1);
                if (u >= u1) u1 = min(u1,d-1);
            }
            if ((x[i]+t >= l) && (x[i]+t <= r)) {
                if (d <= d2) d2 = max(d2,u+1);
                if (u >= u2) u2 = min(u2,d-1);
            }
        }
        c += max(r1-l1+1,0)+max(r2-l2+1,0)+max(u1-d1+1,0)+max(u2-d2+1,0);
    }
    return c;
}
int main() {
    int i;
    int n,t;
    scanf("%d %d",&n,&t);
    for (i = 0; i < n; i++) scanf("%d %d",&x[i],&y[i]);

    int j;
    LLI ans = 0;
    v.pb(0),v.pb(1),v.pb(t+1);
    for (i = 0; i < n; i++) {
        for (j = i+1; j < n; j++) v.pb(min(abs(x[i]-x[j]),abs(y[i]-y[j]))/2);
    }
    sort(v.begin(),v.end());
    while (v.back() > t+1) v.pop_back();
    v.resize(unique(v.begin(),v.end())-v.begin());
    for (i = 0; i < v.size()-1; i++) {
        if (v[i+1] == v[i]+1) ans += getNum(v[i],n)*v[i],ans %= MOD;
        else {
            LLI p = getNum(v[i],n) % MOD,q = getNum(v[i]+1,n) % MOD;
            LLI a = (q-p+MOD) % MOD,b = (p-(q-p)*v[i]) % MOD;
            if (b < 0) b += MOD;
            LLI s1 = ((((((LLI) (v[i]-1)*v[i]) % MOD)*(2*v[i]-1)) % MOD)*INV6) % MOD;
            LLI s2 = ((((((LLI) (v[i+1]-1)*v[i+1]) % MOD)*(2*v[i+1]-1)) % MOD)*INV6) % MOD;
            ans += (s2-s1+MOD)*a,ans %= MOD;
            s1 = ((((LLI) (v[i]-1)*v[i]) % MOD)*INV2) % MOD;
            s2 = ((((LLI) (v[i+1]-1)*v[i+1]) % MOD)*INV2) % MOD;
            ans += (s2-s1+MOD)*b,ans %= MOD;
        }
    }
    printf("%d\n",(int) ans);

    return 0;
}

#define DEBUG 0

#include <bits/stdc++.h>
using namespace std;

#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;}
#define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;}

// advanced debugging class
// debug 1,2,'A',"test";
class _Debug {
    public:
        template<typename T>
        _Debug& operator,(T val) {
            cout << val << endl;
            return *this;
        }
};
#define debug _Debug(),
#else
#define printLine(l)
#define printLine2(l,c)
#define printVar(n)
#define printArr(a,l)
#define print2dArr(a,r,c)
#define print2dArr2(a,r,c,l)
#define debug
#endif

// define
#define MAX_VAL 999999999
#define MAX_VAL_2 999999999999999999LL
#define EPS 1e-6
#define mp make_pair
#define pb push_back

// typedef
typedef unsigned int UI;
typedef long long int LLI;
typedef unsigned long long int ULLI;
typedef unsigned short int US;
typedef pair<int,int> pii;
typedef pair<LLI,LLI> plli;
typedef vector<int> vi;
typedef vector<LLI> vlli;
typedef vector<pii> vpii;
typedef vector<plli> vplli;

// ---------- END OF TEMPLATE ----------
#define MOD 998244353
#define INV2 499122177
#define INV6 166374059

int x[50],y[50];
vi v;
LLI getNum(int t,int n) {
    if (t == 0) return n;
    int i,j;
    LLI c = 0;
    for (i = 0; i < n; i++) {
        int l1 = x[i]-t,r1 = x[i]+t-1,l2 = x[i]-t+1,r2 = x[i]+t;
        int d1 = y[i]-t,u1 = y[i]+t-1,d2 = y[i]-t+1,u2 = y[i]+t;
        for (j = 0; j < n; j++) {
            if (i == j) continue;
            int l,r,d,u;
            if (j > i) l = x[j]-t+1,r = x[j]+t-1,d = y[j]-t+1,u = y[j]+t-1;
            else l = x[j]-t,r = x[j]+t,d = y[j]-t,u = y[j]+t;
            if ((y[i]+t >= d) && (y[i]+t <= u)) {
                if (l <= l1) l1 = max(l1,r+1);
                if (r >= r1) r1 = min(r1,l-1);
            }
            if ((y[i]-t >= d) && (y[i]-t <= u)) {
                if (l <= l2) l2 = max(l2,r+1);
                if (r >= r2) r2 = min(r2,l-1);
            }
            if ((x[i]-t >= l) && (x[i]-t <= r)) {
                if (d <= d1) d1 = max(d1,u+1);
                if (u >= u1) u1 = min(u1,d-1);
            }
            if ((x[i]+t >= l) && (x[i]+t <= r)) {
                if (d <= d2) d2 = max(d2,u+1);
                if (u >= u2) u2 = min(u2,d-1);
            }
        }
        c += max(r1-l1+1,0)+max(r2-l2+1,0)+max(u1-d1+1,0)+max(u2-d2+1,0);
    }
    return c;
}
int main() {
    int i;
    int n,t;
    scanf("%d %d",&n,&t);
    for (i = 0; i < n; i++) scanf("%d %d",&x[i],&y[i]);

    int j;
    LLI ans = 0;
    v.pb(0),v.pb(1),v.pb(t+1);
    for (i = 0; i < n; i++) {
        for (j = i+1; j < n; j++) v.pb(min(abs(x[i]-x[j]),abs(y[i]-y[j]))/2);
    }
    sort(v.begin(),v.end());
    v.resize(unique(v.begin(),v.end())-v.begin());
    for (i = 0; i < v.size()-1; i++) {
        if (v[i+1] == v[i]+1) ans += getNum(v[i],n)*v[i],ans %= MOD;
        else {
            LLI p = getNum(v[i],n) % MOD,q = getNum(v[i]+1,n) % MOD;
            LLI a = (q-p+MOD) % MOD,b = (p-(q-p)*v[i]) % MOD;
            if (b < 0) b += MOD;
            LLI s1 = ((((((LLI) (v[i]-1)*v[i]) % MOD)*(2*v[i]-1)) % MOD)*INV6) % MOD;
            LLI s2 = ((((((LLI) (v[i+1]-1)*v[i+1]) % MOD)*(2*v[i+1]-1)) % MOD)*INV6) % MOD;
            ans += (s2-s1+MOD)*a,ans %= MOD;
            s1 = ((((LLI) (v[i]-1)*v[i]) % MOD)*INV2) % MOD;
            s2 = ((((LLI) (v[i+1]-1)*v[i+1]) % MOD)*INV2) % MOD;
            ans += (s2-s1+MOD)*b,ans %= MOD;
        }
    }
    printf("%d\n",(int) ans);

    return 0;
}

#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>

inline int rint () {
	int x = 0, f = 1; char s = getchar ();
	for ( ; s < '0' || '9' < s; s = getchar () ) f = s == '-' ? -f : f;
	for ( ; '0' <= s && s <= '9'; s = getchar () ) x = x * 10 + ( s ^ '0' );
	return x * f;
}

template<typename Tp>
inline void wint ( Tp x ) {
	if ( x < 0 ) putchar ( '-' ), x = ~ x + 1;
	if ( 9 < x ) wint ( x / 10 );
	putchar ( x % 10 ^ '0' );
}

inline int abs_ ( const int x ) { return x < 0 ? -x : x; }

inline int max_ ( const int a, const int b ) { return a < b ? b : a; }

const int MAXN = 50, MOD = 998244353, INV2 = 499122177, INV6 = 166374059;
int n, t, x[MAXN + 5], y[MAXN + 5];

namespace MatrixInter {

int tmp[MAXN << 2];

class SegmentTree {
private:
	int cover[MAXN << 4], cnt[MAXN << 4];

public:
	inline void clear ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] = 0;
		if ( l == r ) return ;
		int mid = l + r >> 1;
		clear ( rt << 1, l, mid ), clear ( rt << 1 | 1, mid + 1, r );
	}
	inline void pushup ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] ? tmp[r] - tmp[l - 1] : cover[rt << 1] + cover[rt << 1 | 1];
	}
	inline void add ( const int rt, const int al, const int ar, const int l, const int r, const int v ) {
		if ( al <= l && r <= ar ) {
			if ( ! ( cnt[rt] += v ) ) cover[rt] = l == r ? 0 : cover[rt << 1] + cover[rt << 1 | 1];
			else cover[rt] = tmp[r] - tmp[l - 1];
			return ;
		}
		int mid = l + r >> 1;
		if ( al <= mid ) add ( rt << 1, al, ar, l, mid, v );
		if ( mid < ar ) add ( rt << 1 | 1, al, ar, mid + 1, r, v );
		pushup ( rt, l, r );
	}
	inline int getTop () { return cover[1]; }
} st;

struct Event { int l, r, opt; };
std :: vector<Event> evt[MAXN * 4 + 5];

inline int calcS ( const int t ) {
	int cnt = 0;
	for ( int i = 1; i <= n; ++ i ) {
		tmp[++ cnt] = x[i] - t - 1, tmp[++ cnt] = x[i] + t;
		tmp[++ cnt] = y[i] - t - 1, tmp[++ cnt] = y[i] + t;
	}
	std :: sort ( tmp + 1, tmp + cnt + 1 );
	cnt = std :: unique ( tmp + 1, tmp + cnt + 1 ) - tmp - 1;
	st.clear ( 1, 1, cnt );
	for ( int i = 1; i <= cnt; ++ i ) evt[i].clear ();
	for ( int i = 1, up, dn, le, ri; i <= n; ++ i ) {
		up = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] - t - 1 ) - tmp + 1;
		dn = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] + t ) - tmp;
		le = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] - t - 1 ) - tmp;
		ri = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] + t ) - tmp;
		evt[le].push_back ( { up, dn, true } ), evt[ri].push_back ( { up, dn, false } );
	}
	int ret = 0;
	for ( int i = 1; i <= cnt; ++ i ) {
		ret = ( ret + 1ll * st.getTop () * ( tmp[i] - tmp[i - 1] ) % MOD ) % MOD;
		for ( Event e: evt[i] ) st.add ( 1, e.l, e.r, 1, cnt, e.opt ? 1 : -1 );
	}
	return ret;
}

} // namespace MatrixInter.

int itime[MAXN * MAXN + 5];

inline int preS ( const int n ) { return n * ( n + 1ll ) % MOD * INV2 % MOD; }

inline int sqrS ( const int n ) { return n * ( n + 1ll ) % MOD * ( n * 2ll | 1 ) % MOD * INV6; }

int main () {
#define MI MatrixInter
	n = rint (), t = rint ();
	for ( int i = 1; i <= n; ++ i ) x[i] = rint (), y[i] = rint ();
	int icnt = 0;
	for ( int i = 1; i < n; ++ i ) {
		for ( int j = i + 1, tmpt; j <= n; ++ j ) {
			tmpt = max_ ( abs_ ( x[i] - x[j] ), abs ( y[i] - y[j] ) ) >> 1;
			if ( tmpt <= t ) itime[++ icnt] = tmpt;
			if ( ++ tmpt <= t ) itime[++ icnt] = tmpt;
		}
	}
	itime[++ icnt] = 0, itime[++ icnt] = t;
	std :: sort ( itime + 1, itime + icnt + 1 );
	icnt = std :: unique ( itime + 1, itime + icnt + 1 ) - itime - 1;
	int ans = 1ll * t * MI :: calcS ( t ) % MOD;
	for ( int i = 1, tl, tr, a, b, c, ta, tb; i < icnt; ++ i ) {
		if ( ( tl = itime[i] ) + 3 > ( tr = itime[i + 1] ) ) {
			for ( ; tl < tr; ++ tl ) ans = ( ans - MI :: calcS ( tl ) + MOD ) % MOD;
			continue;
		}
		c = MI :: calcS ( tl ), ta = MI :: calcS ( tl + 1 ), tb = MI :: calcS ( tl + 2 );
		a = ( ( tb - ta * 2ll % MOD + c ) % MOD + MOD ) % MOD * INV2 % MOD;
		b = ( ( ta - c - a ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * a * sqrS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * b * preS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * c * ( tr - tl ) % MOD + MOD ) % MOD;
	}
	return wint ( ans ), putchar ( '\n' ), 0;
}

#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>

inline int rint () {
	int x = 0, f = 1; char s = getchar ();
	for ( ; s < '0' || '9' < s; s = getchar () ) f = s == '-' ? -f : f;
	for ( ; '0' <= s && s <= '9'; s = getchar () ) x = x * 10 + ( s ^ '0' );
	return x * f;
}

template<typename Tp>
inline void wint ( Tp x ) {
	if ( x < 0 ) putchar ( '-' ), x = ~ x + 1;
	if ( 9 < x ) wint ( x / 10 );
	putchar ( x % 10 ^ '0' );
}

inline int abs_ ( const int x ) { return x < 0 ? -x : x; }

inline int max_ ( const int a, const int b ) { return a < b ? b : a; }

const int MAXN = 50, MOD = 998244353, INV2 = 499122177, INV6 = 166374059;
int n, t, x[MAXN + 5], y[MAXN + 5];

namespace MatrixInter {

int tmp[MAXN * 4 + 5];

class SegmentTree {
private:
	int cover[MAXN << 4], cnt[MAXN << 4];

public:
	inline void clear ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] = 0;
		if ( l == r ) return ;
		int mid = l + r >> 1;
		clear ( rt << 1, l, mid ), clear ( rt << 1 | 1, mid + 1, r );
	}
	inline void pushup ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] ? tmp[r] - tmp[l - 1] : cover[rt << 1] + cover[rt << 1 | 1];
	}
	inline void add ( const int rt, const int al, const int ar, const int l, const int r, const int v ) {
		if ( al <= l && r <= ar ) {
			if ( ! ( cnt[rt] += v ) ) cover[rt] = l == r ? 0 : cover[rt << 1] + cover[rt << 1 | 1];
			else cover[rt] = tmp[r] - tmp[l - 1];
			return ;
		}
		int mid = l + r >> 1;
		if ( al <= mid ) add ( rt << 1, al, ar, l, mid, v );
		if ( mid < ar ) add ( rt << 1 | 1, al, ar, mid + 1, r, v );
		pushup ( rt, l, r );
	}
	inline int getTop () { return cover[1]; }
} st;

struct Event { int l, r, opt; };
std :: vector<Event> evt[MAXN * 4 + 5];

inline int calcS ( const int t ) {
	int cnt = 0;
	for ( int i = 1; i <= n; ++ i ) {
		tmp[++ cnt] = x[i] - t - 1, tmp[++ cnt] = x[i] + t;
		tmp[++ cnt] = y[i] - t - 1, tmp[++ cnt] = y[i] + t;
	}
	std :: sort ( tmp + 1, tmp + cnt + 1 );
	cnt = std :: unique ( tmp + 1, tmp + cnt + 1 ) - tmp - 1;
	st.clear ( 1, 1, cnt );
	for ( int i = 1; i <= cnt; ++ i ) evt[i].clear ();
	for ( int i = 1, up, dn, le, ri; i <= n; ++ i ) {
		up = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] - t - 1 ) - tmp + 1;
		dn = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] + t ) - tmp;
		le = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] - t - 1 ) - tmp;
		ri = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] + t ) - tmp;
		evt[le].push_back ( { up, dn, true } ), evt[ri].push_back ( { up, dn, false } );
	}
	int ret = 0;
	for ( int i = 1; i <= cnt; ++ i ) {
		ret = ( ret + 1ll * st.getTop () * ( tmp[i] - tmp[i - 1] ) % MOD ) % MOD;
		for ( Event e: evt[i] ) st.add ( 1, e.l, e.r, 1, cnt, e.opt ? 1 : -1 );
	}
	return ret;
}

} // namespace MatrixInter.

int itime[MAXN * MAXN + 5];

inline int preS ( const int n ) { return n * ( n + 1ll ) % MOD * INV2 % MOD; }

inline int sqrS ( const int n ) { return n * ( n + 1ll ) % MOD * ( n * 2ll | 1 ) % MOD * INV6; }

int main () {
#define MI MatrixInter
	n = rint (), t = rint ();
	for ( int i = 1; i <= n; ++ i ) x[i] = rint (), y[i] = rint ();
	int icnt = 0;
	for ( int i = 1; i < n; ++ i ) {
		for ( int j = i + 1, tmpt; j <= n; ++ j ) {
			tmpt = max_ ( abs_ ( x[i] - x[j] ), abs ( y[i] - y[j] ) ) >> 1;
			if ( tmpt <= t ) itime[++ icnt] = tmpt;
			if ( ++ tmpt <= t ) itime[++ icnt] = tmpt;
		}
	}
	itime[++ icnt] = 0, itime[++ icnt] = t;
	std :: sort ( itime + 1, itime + icnt + 1 );
	icnt = std :: unique ( itime + 1, itime + icnt + 1 ) - itime - 1;
	int ans = 1ll * t * MI :: calcS ( t ) % MOD;
	for ( int i = 1, tl, tr, a, b, c, ta, tb; i < icnt; ++ i ) {
		if ( ( tl = itime[i] ) + 3 > ( tr = itime[i + 1] ) ) {
			for ( ; tl < tr; ++ tl ) ans = ( ans - MI :: calcS ( tl ) + MOD ) % MOD;
			continue;
		}
		c = MI :: calcS ( tl ), ta = MI :: calcS ( tl + 1 ), tb = MI :: calcS ( tl + 2 );
		a = ( ( tb - ta * 2ll % MOD + c ) % MOD + MOD ) % MOD * INV2 % MOD;
		b = ( ( ta - c - a ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * a * sqrS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * b * preS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * c * ( tr - tl ) % MOD + MOD ) % MOD;
	}
	return wint ( ans ), putchar ( '\n' ), 0;
}

#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>

inline int rint () {
	int x = 0, f = 1; char s = getchar ();
	for ( ; s < '0' || '9' < s; s = getchar () ) f = s == '-' ? -f : f;
	for ( ; '0' <= s && s <= '9'; s = getchar () ) x = x * 10 + ( s ^ '0' );
	return x * f;
}

template<typename Tp>
inline void wint ( Tp x ) {
	if ( x < 0 ) putchar ( '-' ), x = ~ x + 1;
	if ( 9 < x ) wint ( x / 10 );
	putchar ( x % 10 ^ '0' );
}

inline int abs_ ( const int x ) { return x < 0 ? -x : x; }

inline int max_ ( const int a, const int b ) { return a < b ? b : a; }

const int MAXN = 50, MOD = 998244353, INV2 = 499122177, INV6 = 166374059;
int n, t, x[MAXN + 5], y[MAXN + 5];

namespace MatrixInter {

int tmp[MAXN * 2 + 5];

class SegmentTree {
private:
	int cover[MAXN << 4], cnt[MAXN << 4];

public:
	inline void clear ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] = 0;
		if ( l == r ) return ;
		int mid = l + r >> 1;
		clear ( rt << 1, l, mid ), clear ( rt << 1 | 1, mid + 1, r );
	}
	inline void pushup ( const int rt, const int l, const int r ) {
		cover[rt] = cnt[rt] ? tmp[r] - tmp[l - 1] : cover[rt << 1] + cover[rt << 1 | 1];
	}
	inline void add ( const int rt, const int al, const int ar, const int l, const int r, const int v ) {
		if ( al <= l && r <= ar ) {
			if ( ! ( cnt[rt] += v ) ) cover[rt] = l == r ? 0 : cover[rt << 1] + cover[rt << 1 | 1];
			else cover[rt] = tmp[r] - tmp[l - 1];
			return ;
		}
		int mid = l + r >> 1;
		if ( al <= mid ) add ( rt << 1, al, ar, l, mid, v );
		if ( mid < ar ) add ( rt << 1 | 1, al, ar, mid + 1, r, v );
		pushup ( rt, l, r );
	}
	inline int getTop () { return cover[1]; }
} st;

struct Event { int l, r, opt; };
std :: vector<Event> evt[MAXN * 4 + 5];

inline int calcS ( const int t ) {
	int cnt = 0;
	for ( int i = 1; i <= n; ++ i ) {
		tmp[++ cnt] = x[i] - t - 1, tmp[++ cnt] = x[i] + t;
		tmp[++ cnt] = y[i] - t - 1, tmp[++ cnt] = y[i] + t;
	}
	std :: sort ( tmp + 1, tmp + cnt + 1 );
	cnt = std :: unique ( tmp + 1, tmp + cnt + 1 ) - tmp - 1;
	st.clear ( 1, 1, cnt );
	for ( int i = 1; i <= cnt; ++ i ) evt[i].clear ();
	for ( int i = 1, up, dn, le, ri; i <= n; ++ i ) {
		up = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] - t - 1 ) - tmp + 1;
		dn = std :: lower_bound ( tmp + 1, tmp + cnt + 1, y[i] + t ) - tmp;
		le = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] - t - 1 ) - tmp;
		ri = std :: lower_bound ( tmp + 1, tmp + cnt + 1, x[i] + t ) - tmp;
		evt[le].push_back ( { up, dn, true } ), evt[ri].push_back ( { up, dn, false } );
	}
	int ret = 0;
	for ( int i = 1; i <= cnt; ++ i ) {
		ret = ( ret + 1ll * st.getTop () * ( tmp[i] - tmp[i - 1] ) % MOD ) % MOD;
		for ( Event e: evt[i] ) st.add ( 1, e.l, e.r, 1, cnt, e.opt ? 1 : -1 );
	}
	return ret;
}

} // namespace MatrixInter.

int itime[MAXN * MAXN + 5];

inline int preS ( const int n ) { return n * ( n + 1ll ) % MOD * INV2 % MOD; }

inline int sqrS ( const int n ) { return n * ( n + 1ll ) % MOD * ( n * 2ll | 1 ) % MOD * INV6; }

int main () {
#define MI MatrixInter
	n = rint (), t = rint ();
	for ( int i = 1; i <= n; ++ i ) x[i] = rint (), y[i] = rint ();
	int icnt = 0;
	for ( int i = 1; i < n; ++ i ) {
		for ( int j = i + 1, tmpt; j <= n; ++ j ) {
			tmpt = max_ ( abs_ ( x[i] - x[j] ), abs ( y[i] - y[j] ) ) >> 1;
			if ( tmpt <= t ) itime[++ icnt] = tmpt;
			if ( ++ tmpt <= t ) itime[++ icnt] = tmpt;
		}
	}
	itime[++ icnt] = 0, itime[++ icnt] = t;
	std :: sort ( itime + 1, itime + icnt + 1 );
	icnt = std :: unique ( itime + 1, itime + icnt + 1 ) - itime - 1;
	int ans = 1ll * t * MI :: calcS ( t ) % MOD;
	for ( int i = 1, tl, tr, a, b, c, ta, tb; i < icnt; ++ i ) {
		if ( ( tl = itime[i] ) + 3 > ( tr = itime[i + 1] ) ) {
			for ( ; tl < tr; ++ tl ) ans = ( ans - MI :: calcS ( tl ) + MOD ) % MOD;
			continue;
		}
		c = MI :: calcS ( tl ), ta = MI :: calcS ( tl + 1 ), tb = MI :: calcS ( tl + 2 );
		a = ( ( tb - ta * 2ll % MOD + c ) % MOD + MOD ) % MOD * INV2 % MOD;
		b = ( ( ta - c - a ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * a * sqrS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * b * preS ( tr - tl - 1 ) % MOD + MOD ) % MOD;
		ans = ( ans - 1ll * c * ( tr - tl ) % MOD + MOD ) % MOD;
	}
	return wint ( ans ), putchar ( '\n' ), 0;
}

/*Lucky_Glass*/
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int N=55,MOD=998244353;

inline int Add(const int &A,const int &B){return A+B>=MOD? A+B-MOD:A+B;}
inline int Sub(const int &A,const int &B){return A-B<0? A-B+MOD:A-B;}
inline int Mul(const int &A,const int &B){return 1ll*A*B%MOD;}
inline int Pow(int A,int B){int r=1;while(B){if(B&1)r=Mul(r,A);A=Mul(A,A),B>>=1;}return r;}

vector<int> uni,tpo;

struct OPT{
	int pos,le,ri,key;
	OPT(){}
	OPT(int p,int l,int r,int k):pos(p),le(l),ri(r),key(k){}
}Op[N<<1];
bool operator <(const OPT &A,const OPT &B){return A.pos<B.pos;}

int n,m;
int poi[N][2],et[N][2];
int cov[N<<1];

#define uniq(x) (lower_bound(uni.begin(),uni.end(),x)-uni.begin())
void Cover(int le,int ri,int key){
	for(int i=le;i<ri;i++)
		cov[i]+=key;
}
int Query(int n){
	int ret=0;
	for(int i=0;i<n-1;i++)
		if(cov[i])
			ret+=uni[i+1]-uni[i];
	return ret;
}
int Calc(int t){
	uni.clear();
	int cnt=0,ret=0;
	for(int i=1;i<=n;i++)
		uni.push_back(poi[i][1]-t),uni.push_back(poi[i][1]+t+1);
	sort(uni.begin(),uni.end());
	uni.erase(unique(uni.begin(),uni.end()),uni.end());
	for(int i=1;i<=n;i++){
		int le=uniq(poi[i][1]-t),ri=uniq(poi[i][1]+t+1);
		Op[++cnt]=OPT(poi[i][0]-t,le,ri,1);
		Op[++cnt]=OPT(poi[i][0]+t+1,le,ri,-1);
	}
	sort(Op+1,Op+1+cnt);
	int L=1,R=uni.size();
	for(int i=1,las=-1e9;i<=cnt;i++){
		int cur=Op[i].pos,j=i;
		while(j<=cnt && Op[j].pos==cur) j++;
		ret=Add(ret,Mul(cur-las,Query(R)));
		for(int k=i;k<j;k++) Cover(Op[k].le,Op[k].ri,Op[k].key);
		i=j-1;
		las=cur;
	}
	return ret;
}
int Poly(int x){
	int ret=0;
	for(int i=0;i<5;i++){
		int ovr=et[i][1],blw=1;
		for(int j=0;j<5;j++)
			if(j!=i)
				ovr=Mul(ovr,Sub(x,et[j][0])),
				blw=Mul(blw,Sub(et[i][0],et[j][0]));
		ret=Add(ret,Mul(ovr,blw));
	}
	return ret;
}
int ABS(int x){return x<0? -x:x;}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d%d",&poi[i][0],&poi[i][1]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int cur=max(ABS(poi[i][0]-poi[j][0]),ABS(poi[i][1]-poi[j][1]));
			if(cur>m) continue;
			tpo.push_back(cur);
		}
	tpo.push_back(m);
	tpo.push_back(0);
	sort(tpo.begin(),tpo.end());
	tpo.erase(unique(tpo.begin(),tpo.end()),tpo.end());
	int siz=tpo.size(),res=n;
	for(int i=1;i<siz;i++){
		int le=tpo[i-1]+1,ri=tpo[i];
		if(ri-le+1>5){
			for(int j=0;j<5;j++)
				et[j][0]=le+j,et[j][1]=Add((j? et[j-1][1]:0),Calc(le+j));
			res=Add(res,Poly(ri));
		}
		else
			for(int j=le;j<=ri;j++)
				res=Add(res,Calc(j));
	}
	printf("%d\n",Sub(Mul(m+1,Calc(m)),res));
	return 0;
}

/*Lucky_Glass*/
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int N=55,MOD=998244353;

inline int Add(const int &a,const int &b){return a+b>=MOD? a+b-MOD:a+b;}
inline int Sub(const int &a,const int &b){return a-b<0? a-b+MOD:a-b;}
inline int Mul(const int &a,const int &b){return 1ll*a*b%MOD;}
inline int Pow(int a,int b){int r=1;while(b){if(b&1)r=Mul(r,a);a=Mul(a,a),b>>=1;}return r;}

int n,m;
int pnt[N][2],sav[N][2];
int cov[N<<1],ncov;
vector<int> tpo,uni;

struct OPT{
	int pos,le,ri,key;
	OPT(){}
	OPT(int p,int l,int r,int k):pos(p),le(l),ri(r),key(k){}
}Op[N<<1];
bool operator <(OPT A,OPT B){return A.pos<B.pos;}

#define uniq(x) (lower_bound(uni.begin(),uni.end(),x)-uni.begin())
void Cover(int le,int ri,int key){
	for(int i=le;i<ri;i++)
		cov[i]+=key;
}
int SumUp(int t){
	int ret=0;
	for(int i=0;i<t-1;i++)
		ret+=cov[i]? uni[i+1]-uni[i]:0;
	return ret;
}
int Calc(int t){
	for(int i=1;i<=n;i++){
		uni.push_back(pnt[i][1]-t);
		uni.push_back(pnt[i][1]+t+1);
	}
	sort(uni.begin(),uni.end());
	uni.erase(unique(uni.begin(),uni.end()),uni.end());
	int cnt=0;
	for(int i=1;i<=n;i++){
		Op[++cnt]=OPT(pnt[i][0]-t,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),1);
		Op[++cnt]=OPT(pnt[i][0]+t+1,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),-1);
	}
	sort(Op+1,Op+1+cnt);
	memset(cov,0,sizeof cov),ncov=0;
	int ret=0,siz=uni.size();
	for(int i=1,las=-1e9;i<=cnt;i++){
		int j=i,cur=Op[i].pos;
		while(j+1<=cnt && Op[j+1].pos==cur) j++;
		ret=Add(ret,Mul(Sub(cur,las),SumUp(siz)));
		for(int k=i;k<=j;k++) Cover(Op[k].le,Op[k].ri,Op[k].key);
		i=j,las=cur;
	}
	return ret;
}
int ABS(int x){return x<0? -x:x;}
int Poly(int x){
	int ret=0;
	for(int i=0;i<5;i++){
		int obv=sav[i][1],blw=1;
		for(int j=0;j<5;j++)
			if(i!=j){
				obv=Mul(obv,Sub(x,sav[j][0]));
				blw=Mul(blw,Sub(sav[i][0],sav[j][0]));
			}
		ret=Add(ret,Mul(obv,Pow(blw,MOD-2)));
	}
	return ret;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&pnt[i][0],&pnt[i][1]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int cur=max(ABS(pnt[i][0]-pnt[j][0]),ABS(pnt[i][1]-pnt[j][1]));
			if(cur>m) continue;
			tpo.push_back(cur);
		}
	tpo.push_back(0),tpo.push_back(m);
	sort(tpo.begin(),tpo.end());
	tpo.erase(unique(tpo.begin(),tpo.end()),tpo.end());
	int sum=n;
	for(int i=1,li=tpo.size();i<li;i++){
		int le=tpo[i-1]+1,ri=tpo[i];
		if(ri-le+1>=5){
			for(int k=0;k<5;k++)
				sav[k][0]=le+k,sav[k][1]=Calc(le+k);
			for(int k=1;k<5;k++)
				sav[k][1]=Add(sav[k][1],sav[k-1][1]);
			sum=Add(sum,Poly(ri));
		}
		else{
			for(int k=le;k<=ri;k++)
				sum=Add(sum,Calc(k));
		}
	}
	printf("%d\n",Sub(Mul(m+1,Calc(m)),sum));
	return 0;
}

/*Lucky_Glass*/
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int N=55,MOD=998244353;

inline int Add(const int &a,const int &b){return a+b>=MOD? a+b-MOD:a+b;}
inline int Sub(const int &a,const int &b){return a-b<0? a-b+MOD:a-b;}
inline int Mul(const int &a,const int &b){return 1ll*a*b%MOD;}
inline int Pow(int a,int b){int r=1;while(b){if(b&1)r=Mul(r,a);a=Mul(a,a),b>>=1;}return r;}

int n,m;
int pnt[N][2],sav[N][2];
int cov[N<<1],ncov;
vector<int> tpo,uni;

struct OPT{
	int pos,le,ri,key;
	OPT(){}
	OPT(int p,int l,int r,int k):pos(p),le(l),ri(r),key(k){}
}Op[N<<1];
bool operator <(OPT A,OPT B){return A.pos<B.pos;}

#define uniq(x) (lower_bound(uni.begin(),uni.end(),x)-uni.begin())
void Cover(int le,int ri,int key){
	for(int i=le;i<ri;i++)
		cov[i]+=key;
}
int SumUp(int t){
	int ret=0;
	for(int i=0;i<t-1;i++)
		ret+=cov[i]? uni[i+1]-uni[i]:0;
	return ret;
}
int Calc(int t){
	memset(cov,0,sizeof cov);
	uni.clear();
	for(int i=1;i<=n;i++){
		uni.push_back(pnt[i][1]-t);
		uni.push_back(pnt[i][1]+t+1);
	}
	sort(uni.begin(),uni.end());
	uni.erase(unique(uni.begin(),uni.end()),uni.end());
	int cnt=0;
	for(int i=1;i<=n;i++){
		Op[++cnt]=OPT(pnt[i][0]-t,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),1);
		Op[++cnt]=OPT(pnt[i][0]+t+1,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),-1);
	}
	sort(Op+1,Op+1+cnt);
	int ret=0,siz=uni.size();
	for(int i=1,las=-1e9;i<=cnt;i++){
		int j=i,cur=Op[i].pos;
		while(j+1<=cnt && Op[j+1].pos==cur) j++;
		ret=Add(ret,Mul(Sub(cur,las),SumUp(siz)));
		for(int k=i;k<=j;k++) Cover(Op[k].le,Op[k].ri,Op[k].key);
		i=j,las=cur;
	}
	return ret;
}
int ABS(int x){return x<0? -x:x;}
int Poly(int x){
	int ret=0;
	for(int i=0;i<5;i++){
		int obv=sav[i][1],blw=1;
		for(int j=0;j<5;j++)
			if(i!=j){
				obv=Mul(obv,Sub(x,sav[j][0]));
				blw=Mul(blw,Sub(sav[i][0],sav[j][0]));
			}
		ret=Add(ret,Mul(obv,Pow(blw,MOD-2)));
	}
	return ret;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&pnt[i][0],&pnt[i][1]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int cur=max(ABS(pnt[i][0]-pnt[j][0]),ABS(pnt[i][1]-pnt[j][1]));
			if(cur>m) continue;
			tpo.push_back(cur);
		}
	tpo.push_back(0),tpo.push_back(m);
	sort(tpo.begin(),tpo.end());
	tpo.erase(unique(tpo.begin(),tpo.end()),tpo.end());
	int sum=n;
	for(int i=1,li=tpo.size();i<li;i++){
		int le=tpo[i-1]+1,ri=tpo[i];
		if(ri-le+1>=5){
			for(int k=0;k<5;k++)
				sav[k][0]=le+k,sav[k][1]=Calc(le+k);
			for(int k=1;k<5;k++)
				sav[k][1]=Add(sav[k][1],sav[k-1][1]);
			sum=Add(sum,Poly(ri));
		}
		else{
			for(int k=le;k<=ri;k++)
				sum=Add(sum,Calc(k));
		}
	}
	printf("%d\n",Sub(Mul(m+1,Calc(m)),sum));
	return 0;
}

/*Lucky_Glass*/
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int N=55,MOD=998244353;

inline int Add(const int &a,const int &b){return a+b>=MOD? a+b-MOD:a+b;}
inline int Sub(const int &a,const int &b){return a-b<0? a-b+MOD:a-b;}
inline int Mul(const int &a,const int &b){return 1ll*a*b%MOD;}
inline int Pow(int a,int b){int r=1;while(b){if(b&1)r=Mul(r,a);a=Mul(a,a),b>>=1;}return r;}

int n,m;
int pnt[N][2],sav[N][2];
int cov[N<<1],ncov;
vector<int> tpo,uni;

struct OPT{
	int pos,le,ri,key;
	OPT(){}
	OPT(int p,int l,int r,int k):pos(p),le(l),ri(r),key(k){}
}Op[N<<1];
bool operator <(OPT A,OPT B){return A.pos<B.pos;}

#define uniq(x) (lower_bound(uni.begin(),uni.end(),x)-uni.begin())
void Cover(int le,int ri,int key){
	for(int i=le;i<ri;i++)
		cov[i]+=key;
}
int SumUp(int t){
	int ret=0;
	for(int i=0;i<t-1;i++)
		ret+=cov[i]? uni[i+1]-uni[i]:0;
	return ret;
}
int Calc(int t){
	memset(cov,0,sizeof cov);
	uni.clear();
	for(int i=1;i<=n;i++){
		uni.push_back(pnt[i][1]-t);
		uni.push_back(pnt[i][1]+t+1);
	}
	sort(uni.begin(),uni.end());
	uni.erase(unique(uni.begin(),uni.end()),uni.end());
	int cnt=0;
	for(int i=1;i<=n;i++){
		Op[++cnt]=OPT(pnt[i][0]-t,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),1);
		Op[++cnt]=OPT(pnt[i][0]+t+1,uniq(pnt[i][1]-t),uniq(pnt[i][1]+t+1),-1);
	}
	sort(Op+1,Op+1+cnt);
	int ret=0,siz=uni.size();
	for(int i=1,las=-1e9;i<=cnt;i++){
		int j=i,cur=Op[i].pos;
		while(j+1<=cnt && Op[j+1].pos==cur) j++;
		ret=Add(ret,Mul(Sub(cur,las),SumUp(siz)));
		for(int k=i;k<=j;k++) Cover(Op[k].le,Op[k].ri,Op[k].key);
		i=j,las=cur;
	}
	return ret;
}
int ABS(int x){return x<0? -x:x;}
int Poly(int x){
	int ret=0;
	for(int i=0;i<5;i++){
		int obv=sav[i][1],blw=1;
		for(int j=0;j<5;j++)
			if(i!=j){
				obv=Mul(obv,Sub(x,sav[j][0]));
				blw=Mul(blw,Sub(sav[i][0],sav[j][0]));
			}
		ret=Add(ret,Mul(obv,Pow(blw,MOD-2)));
	}
	return ret;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		scanf("%d%d",&pnt[i][0],&pnt[i][1]);
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++){
			int cur=max(ABS(pnt[i][0]-pnt[j][0]),ABS(pnt[i][1]-pnt[j][1]));
			cur=(cur-1)/2+1;
			if(cur>m) continue;
			tpo.push_back(cur);
		}
	tpo.push_back(0),tpo.push_back(m);
	sort(tpo.begin(),tpo.end());
	tpo.erase(unique(tpo.begin(),tpo.end()),tpo.end());
	int sum=n;
	for(int i=1,li=tpo.size();i<li;i++){
		int le=tpo[i-1]+1,ri=tpo[i];
		if(ri-le+1>=5){
			for(int k=0;k<5;k++)
				sav[k][0]=le+k,sav[k][1]=Calc(le+k);
			for(int k=1;k<5;k++)
				sav[k][1]=Add(sav[k][1],sav[k-1][1]);
			sum=Add(sum,Poly(ri));
		}
		else{
			for(int k=le;k<=ri;k++)
				sum=Add(sum,Calc(k));
		}
	}
	printf("%d\n",Sub(Mul(m+1,Calc(m)),sum));
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define db long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define MK make_pair
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define UPD(x,y) (((x)+=(y))>=mo?x-=mo:233)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
using namespace std;
const int mo=998244353;
int power(int x,int y){
	int s=1;
	for (;y;y/=2,x=1ll*x*x%mo)
		if (y&1) s=1ll*s*x%mo;
	return s;
}
const int N=105;
int n,t,spe[N*N];
int x[N],y[N],X[N],Y[N];
struct que{
	int l,r,v;
};
vector<que> Q[N];
int cnt[N];
int calc(int T){
	int ans=0; *X=*Y=0;
	For(i,1,N-1) Q[i].resize(0);
	CLR(cnt,0);
	For(i,1,n){
		X[++*X]=x[i]-T;
		X[++*X]=x[i]+T+1;
		Y[++*Y]=y[i]-T;
		Y[++*Y]=y[i]+T+1;
	}
	sort(X+1,X+*X+1);
	sort(Y+1,Y+*Y+1);
	*X=unique(X+1,X+*X+1)-X-1;
	*Y=unique(Y+1,Y+*Y+1)-Y-1;
	For(i,1,n){
		int p1=lower_bound(Y+1,Y+*Y+1,y[i]-T)-Y;
		int p2=lower_bound(Y+1,Y+*Y+1,y[i]+T+1)-Y-1;
		Q[lower_bound(X+1,X+*X+1,x[i]-T)-X].PB((que){p1,p2,1});
		Q[lower_bound(X+1,X+*X+1,x[i]+T+1)-X].PB((que){p1,p2,-1});
	}
	For(i,1,(*X)-1){
		for (auto j:Q[i])
			For(k,j.l,j.r) cnt[k]+=j.v;
		int sum=0;
		For(k,1,(*Y)-1)
			if (cnt[k]) sum+=Y[k+1]-Y[k];
		ans=(ans+1ll*sum*(X[i+1]-X[i]))%mo;
	}
	return ans;
}
int val[10],f[10],poly[10];
int main(){
	scanf("%d%d",&n,&t);
	spe[++*spe]=-1; spe[++*spe]=t-1;
	For(i,1,n) scanf("%d%d",&x[i],&y[i]);
	For(i,1,n) For(j,i+1,n){
		int val=abs(x[i]-x[j])+abs(y[i]-y[j]);
		if (val<t) spe[++*spe]=t;
	}
	sort(spe+1,spe+*spe+1);
	*spe=unique(spe+1,spe+*spe+1)-spe-1;
	int ans=1ll*t*calc(t)%mo;
	For(l,2,*spe){
		int st=spe[l-1]+1,ed=min(st+3,spe[l]),len=ed-st;
		For(j,st,ed) val[j-st]+=calc(j);
		For(j,1,len) val[j]=(val[j]+val[j-1])%mo;
		CLR(poly,0);
		For(i,0,len){
			int tmp=1;
			For(j,0,len) if (i!=j)
				tmp=1ll*tmp*(i+mo-j)%mo;
			int v=1ll*val[i]*power(tmp,mo-2)%mo;
			//printf("%d\n",v);
			CLR(f,0); f[0]=1;
			For(j,0,len) if (i!=j){
				Rep(k,len,1) f[k]=(1ll*f[k]*(mo-j)+f[k-1])%mo;
				f[0]=1ll*f[0]*(mo-j)%mo;
			}
			For(j,0,len)
				poly[j]=(poly[j]+1ll*v*f[j])%mo;
		}
		//printf("%d %d %d %d\n",len,poly[0],poly[1],poly[2]);
		ans=(ans+mo-poly[0])%mo;
		ans=(ans+mo-1ll*len*poly[1]%mo)%mo;
		ans=(ans+mo-1ll*len*len%mo*poly[2]%mo)%mo;
		ans=(ans+mo-1ll*len*len%mo*len%mo*poly[3]%mo)%mo;
	}
	printf("%d",ans);
}
/*
*/

#include <algorithm>
#include <cstdio>
#include <map>

const int P=998244353;
inline int mul(const int &a,const int &b){return 1ll*a*b%P;}
inline int sub(int a,const int &b){a-=b;return (a<0)?a+P:a;}
inline int add(int a,const int &b){a+=b;return(a>=P)?a-P:a;}
int qsm(int a,int b){
	int ans=1;
	while(b){
		if(b&1)ans=mul(ans,a);
		a=mul(a,a);
		b>>=1;
	}
	return ans;
}
int inv2=qsm(2,P-2),inv6=qsm(6,P-2);
int n,t,time[100001],top,orig[110];
std::pair<int,int>p[101];
std::map<int,int>map;
struct ope{
	int l,r,t,ord;
}num[110];
bool cmp(ope a,ope b){return (a.t<b.t)||(a.t==b.t&&a.ord<b.ord);}
int abs(int x){return x<0?-x:x;}
int se[200001],mn[200001],lazy[200001];
void build(int root,int l,int r){
	mn[root]=lazy[root]=0,se[root]=orig[r+1]-orig[l];
	if(l==r)return;
	build(root<<1,l,(l+r)>>1);
	build(root<<1|1,((l+r)>>1)+1,r);
}
void pushdown(int x,int y){
	mn[x]+=y;
	lazy[x]+=y;
}
void spread(int x){
	if(lazy[x]){
		pushdown(x<<1,lazy[x]);
		pushdown(x<<1|1,lazy[x]);
		lazy[x]=0;
	}
}
void pushup(int x){
	mn[x]=std::min(mn[x<<1],mn[x<<1|1]);
	se[x]=0;
	if(mn[x<<1]==mn[x])se[x]+=se[x<<1];
	if(mn[x<<1|1]==mn[x])se[x]+=se[x<<1|1];
}
void update(int root,int l,int r,int el,int er,int x){
	if(el>r||er<l)return;
	if(el<=l&&er>=r){
		pushdown(root,x);
		return;
	}
	spread(root);
	update(root<<1,l,(l+r)>>1,el,er,x);
	update(root<<1|1,((l+r)>>1)+1,r,el,er,x);
	pushup(root);
}
int f(int x){
	if(map.count(x))return map[x];
	for(int i=1;i<=n;i++)orig[(i<<1)-1]=p[i].first-x,orig[i<<1]=p[i].first+x+1;
	std::sort(orig+1,orig+(n<<1)+1);
	int lim=std::unique(orig+1,orig+(n<<1)+1)-orig-1;
//	for(int i=1;i<=lim;i++)printf("%d ",orig[i]);putchar('\n');
	for(int i=1;i<=n;i++){
		int l=std::lower_bound(orig+1,orig+lim+1,p[i].first-x)-orig,
			r=std::lower_bound(orig+1,orig+lim+1,p[i].first+x+1)-orig-1;
		num[(i<<1)-1]=(ope){l,r,p[i].second-x,1};
		num[i<<1]=(ope){l,r,p[i].second+x+1,-1};
	}
	std::sort(num+1,num+(n<<1)+1,cmp);
	build(1,1,lim-1);
	int ans=0;
	for(int i=1;i<=n<<1;i++){
//		printf("update %d %d %d\n",num[i].l,num[i].r,num[i].ord);
//		printf("%d %d\n",se[1],mn[1]);
		update(1,1,lim-1,num[i].l,num[i].r,num[i].ord);
		ans=add(ans,mul(sub(orig[lim]-orig[1],mn[1]?0:se[1]),num[i+1].t-num[i].t));
//		printf("%d\n",ans);
	}
//	printf("f(%d)=%d\n",x,ans);
	return map[x]=ans;
}
int sum1(int x){return mul(mul(1+x,x),inv2);}
int sum2(int x){return mul(mul(x,x+1),mul(2*x+1,inv6));}
int solve(int l,int r){
	if(l>r)return 0;
	int ans=0;
	ans=mul(sub(f(l),f(l-1)),l);
	++l;
	if(r-l+1<3){
		for(int i=l;i<=r;i++)ans=add(ans,mul(sub(f(i),f(i-1)),i));
//		printf("%d\n",ans);
		return ans;
	}
	int f1=sub(f(l),f(l-1)),f2=sub(f(l+1),f(l)),k=sub(f2,f1),b=sub(f1,mul(k,l));
	return add(ans,add(mul(k,sub(sum2(r),sum2(l-1))),mul(b,sub(sum1(r),sum1(l-1)))));
}
int main(){
	scanf("%d%d",&n,&t);
	time[++top]=t;
	for(int i=1;i<=n;i++)scanf("%d%d",&p[i].first,&p[i].second);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			time[++top]=std::max(abs(p[i].first-p[j].first)>>1,abs(p[i].second-p[j].second)>>1);
	time[++top]=0;
	std::sort(time+1,time+top+1);
	long long ans=0;
	for(int i=1;i<=top;i++){
		if(time[i]>=t)break;
		ans+=solve(time[i]+1,time[i+1]);
	}
	printf("%lld",ans%P);
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()
#define all(x) beg(x), en(x)
#define resz resize

const int MOD = 998244353;
const ll INF = 1e18;
const int MX = 100001;
const ld PI = 4*atan((ld)1);

template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }

namespace io {
    // TYPE ID (StackOverflow)

    template<class T> struct like_array : is_array<T>{};
    template<class T, size_t N> struct like_array<array<T,N>> : true_type{};
    template<class T> struct like_array<vector<T>> : true_type{};
    template<class T> bool is_like_array(const T& a) { return like_array<T>::value; }

    // I/O

    void setIn(string s) { freopen(s.c_str(),"r",stdin); }
    void setOut(string s) { freopen(s.c_str(),"w",stdout); }
    void setIO(string s = "") {
        ios_base::sync_with_stdio(0); cin.tie(0);
        if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
    }

    // INPUT

    template<class T> void re(T& x) { cin >> x; }
    template<class Arg, class... Args> void re(Arg& first, Args&... rest);
    void re(double& x) { string t; re(t); x = stod(t); }
    void re(ld& x) { string t; re(t); x = stold(t); }

    template<class T> void re(complex<T>& x);
    template<class T1, class T2> void re(pair<T1,T2>& p);
    template<class T> void re(vector<T>& a);
    template<class T, size_t SZ> void re(array<T,SZ>& a);

    template<class Arg, class... Args> void re(Arg& first, Args&... rest) { re(first); re(rest...); }
    template<class T> void re(complex<T>& x) { T a,b; re(a,b); x = cd(a,b); }
    template<class T1, class T2> void re(pair<T1,T2>& p) { re(p.f,p.s); }
    template<class T> void re(vector<T>& a) { F0R(i,sz(a)) re(a[i]); }
    template<class T, size_t SZ> void re(array<T,SZ>& a) { F0R(i,SZ) re(a[i]); }

    // OUTPUT

    template<class T1, class T2> ostream& operator<<(ostream& os, const pair<T1,T2>& a) {
        os << '{' << a.f << ", " << a.s << '}'; return os;
    }
    template<class T> ostream& printArray(ostream& os, const T& a, int SZ) {
        os << '{';
        F0R(i,SZ) {
            if (i) {
                os << ", ";
                if (is_like_array(a[i])) cout << "\n";
            }
            os << a[i];
        }
        os << '}';
        return os;
    }
    template<class T, size_t SZ> ostream& operator<<(ostream& os, const array<T,SZ>& a) {
        return printArray(os,a,SZ);
    }
    template<class T> ostream& operator<<(ostream& os, const vector<T>& a) {
        return printArray(os,a,sz(a));
    }
    template<class T> ostream& operator<<(ostream& os, const set<T>& a) {
        os << vector<T>(all(a)); return os;
    }
    template<class T1, class T2> ostream& operator<<(ostream& os, const map<T1,T2>& a) {
        os << vector<pair<T1,T2>>(all(a)); return os;
    }

    template<class T> void pr(const T& x) { cout << x << '\n'; }
    template<class Arg, class... Args> void pr(const Arg& first, const Args&... rest) {
        cout << first << ' '; pr(rest...);
    }
}

using namespace io;

namespace modOp {
    int ad(int a, int b, int mod = MOD) { return (a+b)%mod; }
    int sub(int a, int b, int mod = MOD) { return (a-b+mod)%mod; }
    int mul(int a, int b, int mod = MOD) { return (ll)a*b%mod; }

    int AD(int& a, int b, int mod = MOD) { return a = ad(a,b,mod); }
    int SUB(int& a, int b, int mod = MOD) { return a = sub(a,b,mod); }
    int MUL(int& a, int b, int mod = MOD) { return a = mul(a,b,mod); }

    int po (int b, int p, int mod = MOD) { return !p?1:mul(po(mul(b,b,mod),p/2,mod),p&1?b:1,mod); }
    int inv (int b, int mod = MOD) { return po(b,mod-2,mod); }

    int invGeneral(int a, int b) { // 0 < a < b, gcd(a,b) = 1
        if (a == 0) return b == 1 ? 0 : -1;
        int x = invGeneral(b%a,a);
        return x == -1 ? -1 : ((1-(ll)b*x)/a+b)%b;
    }
}

using namespace modOp;

namespace vecOp {
    template<class T> T operator+=(T& l, const T& r) { return l = l+r; }
    template<class T> T operator-=(T& l, const T& r) { return l = l-r; }
    template<class T> T operator*=(T& l, const T& r) { return l = l*r; }

    vi rev(vi v) { reverse(all(v)); return v; }
    vi operator+(const vi& l, const vi& r) {
        vi res(max(sz(l),sz(r)));
        F0R(i,sz(l)) res[i] = l[i];
        F0R(i,sz(r)) AD(res[i],r[i]);
        return res;
    }
    vi operator-(const vi& l, const vi& r) {
        vi res(max(sz(l),sz(r)));
        F0R(i,sz(l)) res[i] = l[i];
        F0R(i,sz(r)) SUB(res[i],r[i]);
        return res;
    }
    vi operator*(const vi& l, const vi& r) {
        if (min(sz(l),sz(r)) == 0) return {};
        vi x(sz(l)+sz(r)-1);
        F0R(i,sz(l)) F0R(j,sz(r)) AD(x[i+j],mul(l[i],r[j]));
        return x;
    }
    vi operator*(const vi& l, const int& r) {
        int R = (r%MOD+MOD)%MOD;
        vi L = l;
        for (int& i: L) MUL(i,R);
        return L;
    }
    vi operator*(const int& l, const vi& r) { return r*l; }
    vi operator*=(vi& l, const int& r) { return l = l*r; }

    vi rem(vi a, vi b) {
        while (sz(b) && b.back() == 0) b.pop_back();
        assert(sz(b)); b *= inv(b.back());
        while (sz(a) >= sz(b)) {
            int k = a.back();
            F0R(i,sz(b)) SUB(a[sz(a)-sz(b)+i],mul(k,b[i]));
            while (sz(a) && a.back() == 0) a.pop_back();
        }
        return a;
    }

    vi interpolate(vpi v) {
        vi ret;
        F0R(i,sz(v)) {
            vi prod = {1};
            int todiv = 1;
            F0R(j,sz(v)) if (i != j) {
                MUL(todiv,sub(v[i].f,v[j].f));
                vi tmp = {sub(0,v[j].f),1};
                prod *= tmp;
            }
            ret += prod*mul(inv(todiv),v[i].s);
        }
        return ret;
    }
}

using namespace vecOp;

int n,t,ans;
vpi v;
vi ti;

int solve(multiset<pi>& m) {
    int l = -MOD;
    int ans = 0;
    trav(x,m) {
        ckmax(l,x.f-1);
        ans += max(x.s-l,0);
        ckmax(l,x.s);
    }
    return ans;
}

ll f(int x) {
    multiset<pi> m;
    vector<array<int,4>> ev;
    trav(z,v) ev.pb({z.f-x,1,z.s-x,z.s+x});
    trav(z,v) ev.pb({z.f+x+1,-1,z.s-x,z.s+x});
    sort(all(ev));
    ll ret = 0;
    F0R(i,sz(ev)) {
        if (i) ret += (ev[i][0]-ev[i-1][0])*solve(m);
        if (ev[i][1] == -1) m.erase(m.find({ev[i][2],ev[i][3]}));
        else m.insert({ev[i][2],ev[i][3]});
    }
    return ret;
}

int getRange(int l, int r) {
    vpi v = {{l-1,0}};
    FOR(i,l,l+3) v.pb({i,(v.back().s+f(i))%MOD});
    // pr(v);
    // pr(interpolate(v));
    vi V = interpolate(v);
    int ret = 0, fac = 1;
    F0R(i,sz(v)) {
        AD(ret,mul(V[i],fac));
        MUL(fac,r);
    }
    return ret;
}

int main() {
    // you should actually read the stuff at the bottom
    setIO(); re(n,t); v.resz(n); re(v);
    ti.pb(0), ti.pb(t);
    F0R(i,n) FOR(j,i+1,n) {
        int dif = max(abs(v[i].f-v[j].f),abs(v[i].s-v[j].s));
        dif = (dif+1)/2;
        if (dif <= t) ti.pb(dif);
    }
    sort(all(ti)); ti.erase(unique(all(ti)),ti.end());
    ans = mul(t,f(t)%MOD);
    F0R(i,sz(ti)-1) SUB(ans,getRange(ti[i],ti[i+1]-1));
    pr(ans);
    // t*f(t)-f(0)-f(1)-...-f(t-1)

    // you should actually read the stuff at the bottom
}

/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/

#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, lim;
  cin >> n >> lim;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> time = {0, lim + 1};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= lim) {
        time.push_back(t);
      }
    }
  }
  auto apply = [&] (vector<int> &vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  auto find = [&] (vector<int> &vec, int val) {
    return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
  };
  apply(time);
  auto calc = [&] (int t) {
    vector<int> vec_x, vec_y;
    for (int i = 0; i < n; i++) {
      vec_x.push_back(x[i] - t);
      vec_x.push_back(x[i] + t + 1);
      vec_y.push_back(y[i] - t);
      vec_y.push_back(y[i] + t + 1);
    }
    apply(vec_x);
    apply(vec_y);
    vector<vector<tuple<int, int, int> > > add(vec_x.size());
    for (int i = 0; i < n; i++) {
      int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
      int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
      add[xl].emplace_back(yl, yr, 1);
      add[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(vec_y.size());
    int res = 0;
    for (int i = 0; i + 1 < vec_x.size(); i++) {
      for (auto [l, r, v] : add[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j + 1 < vec_y.size(); j++) {
        if (val[j]) {
          res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[i + 1] - vec_y[i])) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (vector<int> &val, int pos) {
    static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = val.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      pre[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      suf[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
      if (i) {
        tmp = (ll)tmp * pre[i - 1] % MOD;
      }
      if (i != m) {
        tmp = (ll)tmp * suf[i + 1] % MOD;
      }
      if (m - i & 1) {
        res = (res + tmp) % MOD;
      } else {
        res = (res - tmp + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l + 1 <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc(i)) % MOD;
      }
      return res;
    }
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc(l + i);
      if (i) {
        val[i] = (val[i] + val[i - 1]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(lim + 1) * calc(lim);
  for (int i = 1; i < time.size(); i++) {
    ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, lim;
  cin >> n >> lim;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> time = {0, lim + 1};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= lim) {
        time.push_back(t);
      }
    }
  }
  auto apply = [&] (vector<int> &vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  auto find = [&] (vector<int> &vec, int val) {
    return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
  };
  apply(time);
  auto calc = [&] (int t) {
    vector<int> vec_x, vec_y;
    for (int i = 0; i < n; i++) {
      vec_x.push_back(x[i] - t);
      vec_x.push_back(x[i] + t + 1);
      vec_y.push_back(y[i] - t);
      vec_y.push_back(y[i] + t + 1);
    }
    apply(vec_x);
    apply(vec_y);
    vector<vector<tuple<int, int, int> > > add(vec_x.size());
    for (int i = 0; i < n; i++) {
      int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
      int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
      add[xl].emplace_back(yl, yr, 1);
      add[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(vec_y.size());
    int res = 0;
    for (int i = 0; i + 1 < vec_x.size(); i++) {
      for (auto [l, r, v] : add[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j + 1 < vec_y.size(); j++) {
        if (val[j]) {
          res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[i + 1] - vec_y[i])) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (vector<int> &val, int pos) {
    static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = val.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      pre[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      suf[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
      if (i) {
        tmp = (ll)tmp * pre[i - 1] % MOD;
      }
      if (i != m) {
        tmp = (ll)tmp * suf[i + 1] % MOD;
      }
      if (m - i & 1) {
        res = (res + tmp) % MOD;
      } else {
        res = (res - tmp + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc(i)) % MOD;
      }
      return res;
    }
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc(l + i);
      if (i) {
        val[i] = (val[i] + val[i - 1]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(lim + 1) * calc(lim) % MOD;
  for (int i = 1; i < time.size(); i++) {
    ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, lim;
  cin >> n >> lim;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> time = {0, lim + 1};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= lim) {
        time.push_back(t);
      }
    }
  }
  auto apply = [&] (vector<int> &vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  auto find = [&] (vector<int> &vec, int val) {
    return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
  };
  apply(time);
  auto calc = [&] (int t) {
    vector<int> vec_x, vec_y;
    for (int i = 0; i < n; i++) {
      vec_x.push_back(x[i] - t);
      vec_x.push_back(x[i] + t + 1);
      vec_y.push_back(y[i] - t);
      vec_y.push_back(y[i] + t + 1);
    }
    apply(vec_x);
    apply(vec_y);
    vector<vector<tuple<int, int, int> > > add(vec_x.size());
    for (int i = 0; i < n; i++) {
      int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
      int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
      add[xl].emplace_back(yl, yr, 1);
      add[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(vec_y.size());
    int res = 0;
    for (int i = 0; i + 1 < vec_x.size(); i++) {
      for (auto [l, r, v] : add[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j + 1 < vec_y.size(); j++) {
        if (val[j]) {
          res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[j + 1] - vec_y[j])) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (vector<int> &val, int pos) {
    static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = val.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      pre[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      suf[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
      if (i) {
        tmp = (ll)tmp * pre[i - 1] % MOD;
      }
      if (i != m) {
        tmp = (ll)tmp * suf[i + 1] % MOD;
      }
      if (m - i + 1 & 1) {
        res = (res + tmp) % MOD;
      } else {
        res = (res - tmp + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc(i)) % MOD;
      }
      return res;
    }
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc(l + i);
      if (i) {
        val[i] = (val[i] + val[i - 1]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(lim + 1) * calc(lim) % MOD;
  for (int i = 1; i < time.size(); i++) {
    ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, lim;
  cin >> n >> lim;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> time = {0, lim + 1};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= lim) {
        time.push_back(t);
      }
    }
  }
  auto apply = [&] (vector<int> &vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  auto find = [&] (vector<int> &vec, int val) {
    return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
  };
  apply(time);
  auto calc = [&] (int t) {
    vector<int> vec_x, vec_y;
    for (int i = 0; i < n; i++) {
      vec_x.push_back(x[i] - t);
      vec_x.push_back(x[i] + t + 1);
      vec_y.push_back(y[i] - t);
      vec_y.push_back(y[i] + t + 1);
    }
    apply(vec_x);
    apply(vec_y);
    vector<vector<tuple<int, int, int> > > add(vec_x.size());
    for (int i = 0; i < n; i++) {
      int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
      int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
      add[xl].emplace_back(yl, yr, 1);
      add[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(vec_y.size());
    int res = 0;
    for (int i = 0; i + 1 < vec_x.size(); i++) {
      for (auto [l, r, v] : add[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j + 1 < vec_y.size(); j++) {
        if (val[j]) {
          res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[i + 1] - vec_y[i])) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (vector<int> &val, int pos) {
    static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = val.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      pre[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      suf[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
      if (i) {
        tmp = (ll)tmp * pre[i - 1] % MOD;
      }
      if (i != m) {
        tmp = (ll)tmp * suf[i + 1] % MOD;
      }
      if (m - i + 1 & 1) {
        res = (res + tmp) % MOD;
      } else {
        res = (res - tmp + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l + 1 <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc(i)) % MOD;
      }
      return res;
    }
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc(l + i);
      if (i) {
        val[i] = (val[i] + val[i - 1]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(lim + 1) * calc(lim) % MOD;
  for (int i = 1; i < time.size(); i++) {
    ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#define MOD 998244353
using namespace std;
typedef long long ll;
int main()
{
  do {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
  } while (false);
  int n, lim;
  cin >> n >> lim;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
  }
  vector<int> time = {0, lim + 1};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      int t = (max(abs(x[i] - x[j]), abs(y[i] - y[j])) - 1) / 2;
      if (t <= lim) {
        time.push_back(t);
      }
    }
  }
  auto apply = [&] (vector<int> &vec) {
    sort(vec.begin(), vec.end());
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
  };
  auto find = [&] (vector<int> &vec, int val) {
    return lower_bound(vec.begin(), vec.end(), val) - vec.begin();
  };
  apply(time);
  auto calc = [&] (int t) {
    vector<int> vec_x, vec_y;
    for (int i = 0; i < n; i++) {
      vec_x.push_back(x[i] - t);
      vec_x.push_back(x[i] + t + 1);
      vec_y.push_back(y[i] - t);
      vec_y.push_back(y[i] + t + 1);
    }
    apply(vec_x);
    apply(vec_y);
    vector<vector<tuple<int, int, int> > > add(vec_x.size());
    for (int i = 0; i < n; i++) {
      int xl = find(vec_x, x[i] - t), xr = find(vec_x, x[i] + t + 1);
      int yl = find(vec_y, y[i] - t), yr = find(vec_y, y[i] + t + 1);
      add[xl].emplace_back(yl, yr, 1);
      add[xr].emplace_back(yl, yr, -1);
    }
    vector<int> val(vec_y.size());
    int res = 0;
    for (int i = 0; i + 1 < vec_x.size(); i++) {
      for (auto [l, r, v] : add[i]) {
        for (int j = l; j < r; j++) {
          val[j] += v;
        }
      }
      for (int j = 0; j + 1 < vec_y.size(); j++) {
        if (val[j]) {
          res = (res + (ll)(vec_x[i + 1] - vec_x[i]) * (vec_y[i + 1] - vec_y[i])) % MOD;
        }
      }
    }
    return res;
  };
  auto lagrange = [&] (vector<int> &val, int pos) {
    static vector inv = {1, 1, (MOD + 1) / 2, (MOD + 1) / 6};
    int m = val.size() - 1;
    vector<int> pre(m + 1), suf(m + 1);
    for (int i = 0, cur = 1; i <= m; i++) {
      pre[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    for (int i = m, cur = 1; i >= 0; i--) {
      suf[i] = cur;
      cur = (ll)cur * (pos - i) % MOD;
    }
    int res = 0;
    for (int i = 0; i <= m; i++) {
      int tmp = (ll)val[i] * inv[i] % MOD * inv[m - i] % MOD;
      if (i) {
        tmp = (ll)tmp * pre[i - 1] % MOD;
      }
      if (i != m) {
        tmp = (ll)tmp * suf[i + 1] % MOD;
      }
      if (m - i + 1 & 1) {
        res = (res + tmp) % MOD;
      } else {
        res = (res - tmp + MOD) % MOD;
      }
    }
    return res;
  };
  auto calc_sum = [&] (int l, int r) {
    const int D = 3;
    if (r - l + 1 <= D) {
      int res = 0;
      for (int i = l; i <= r; i++) {
        res = (res + calc(i)) % MOD;
      }
      return res;
    }
    vector<int> val(D + 1);
    for (int i = 0; i <= D; i++) {
      val[i] = calc(l + i);
      if (i) {
        val[i] = (val[i] + val[i - 1]) % MOD;
      }
    }
    return lagrange(val, r - l);
  };
  int ans = (ll)(lim + 1) * calc(lim);
  for (int i = 1; i < time.size(); i++) {
    ans = (ans - calc_sum(time[i - 1], time[i] - 1) + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}

#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int maxn = 100 * 64, inf = 2e8;
vector<pair<int,int>> loc;
vector<int> dif;
const int p = 998244353, inv = p - p/2, inv6 = 166374059;
ll res;
void add(ll &a, ll v) {
	a += v - p;
	a += (a>>63) & p;
}
#define L(i) ptr[i].l
#define R(i) ptr[i].r
#define S(i) ptr[i].sum
#define C(i) ptr[i].cnt
#define LEN(i) ptr[i].len
#define V(i) (ptr[i].cnt ? ptr[i].len : ptr[i].sum)
struct node {
	int l, r, sum, cnt, len;
}ptr[maxn];
struct sgt {
	int mem;
	void reset() {
		mem = 1;
		ptr[1] = {0, 0, 0, 0, (inf << 1)+1};
	}
	int new_node(int l, int r) {
		return ptr[++mem] = {0, 0, 0, 0, r-l+1}, mem;
	}
	void update(int i) {
		S(i) = V(L(i)) + V(R(i));
	}
	void add(int al, int ar, int d, int l = 0, int r = inf << 1, int i = 1) {
		if (al > r || ar < l) return;
		int m = l + r >> 1;
		//cerr << "Add " << al << ' ' << ar << " : " << d << " L R " << l << ' ' << r << '\n';
		if (al <= l && ar >= r) {
			C(i) += d;
			return;
		}
		if (!L(i)) L(i) = new_node(l, m);
		if (!R(i)) R(i) = new_node(m+1, r);
		add(al, ar, d, l, m, L(i));
		add(al, ar, d, m+1, r, R(i));
		update(i);
	}
	ll query() {
		return V(1);
	}
}tree;
struct info {
	int l, r, d;
};
ll area(int t) {
	tree.reset();
	map<int, vector<info>> seg;
	for (const auto &[x, y] : loc) {
		seg[x-t].push_back({y-t, y+t, 1});
		seg[x+t+1].push_back({y-t, y+t, -1});
	}
	ll lsta = 0, lstx = 0, res = 0;
	for (const auto &[x, v] : seg) {
		lsta = tree.query();
		//cerr << "X " << x << " lst area " << lsta << '\n';
		res += lsta * (x-lstx) ;
		lstx = x;
		for (const auto &[l, r, d] : v)
			tree.add(l, r, d);
	}
	//cerr << "AREA  " << t << " : " << res << '\n';
	return res;
}
ll sum(ll a, ll d, ll n) {
	a %= p, d %= p;
	return (a + a + d * (n-1)) % p * n % p * inv % p;
}
ll ss(ll w) {
	return w * (w+1) % p * (w + w + 1) % p * inv6 % p;
}
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
//	for (int i = 1;i <= 10;++i)
//		cout << ss(i) << ' ';
//	return 0;
	int n, t;
	cin >> n >> t;
	loc.resize(n);
	for (auto &[x, y] : loc) cin >> x >> y, x += inf, y += inf;
	auto dis = [&](int a, int b) {
		return max(abs(loc[a].first-loc[b].first), abs(loc[a].second - loc[b].second)) >> 1;
	};
	for (int i = 0;i < n;++i)
		for (int j = i+1;j < n;++j)
			if (dis(i, j) <= t) dif.pb(dis(i, j));
	dif.pb(0);
	dif.pb(t);
	sort(dif.begin(), dif.end());
	dif.resize(distance(dif.begin(), unique(dif.begin(), dif.end())));
//	for (int i = 1;i <= t;++i)
//		res += area(i);
//	cout << res << '\n';
//	return 0;
//	vector<ll> A(21);
//	for (int i = 1;i <= 20;++i)
//		cout << area(i) << ' ', A[i] = area(i);
//	cout << '\n';
//	for (int i = 1;i <= 20;++i)
//		cout << A[i]-A[i-1] << ' ';
//	cout << '\n';
	for (int i = 1;i < dif.size();++i) {
		int lst = dif[i-1], now = dif[i];
		if (now <= lst+5) {
			for (int i = lst+1;i <= now;++i)
				add(res, area(i) % p);//, cerr << "ADD " << area(i) << '\n';
			continue;
		}
		ll a = area(lst+1), b = area(lst+2), c = area(lst+3), d = (c-b) - (b-a), f = b-a, w = now-lst-1;
		add(res, a % p * (w+1) % p);
		add(res, sum(f, f, w));
		add(res, sum(d % p * w, d % p * w, w-1));
		add(res, ss(w-1) * -d % p + p);

	}
//	if (t <= 100000) {
//		ll tmp = 0;
//		for (int i= 1; i <= t;++i) tmp += area(i);
//		cerr << res << ' ' << tmp << '\n';
//		res = tmp;
//	}

	//cout << res << '\n';
	ll o = -res - n + (t+1) * (area(t) % p);
	o %= p;
	if (o < 0) o += p;
	cout << o << '\n';
}

#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int maxn = 100 * 64, inf = 2e8;
vector<pair<int,int>> loc;
vector<int> dif;
const int p = 998244353, inv = p - p/2;
ll res;
void add(ll &a, ll v) {
	a += v - p;
	a += (a>>63) & p;
}
#define L(i) ptr[i].l
#define R(i) ptr[i].r
#define S(i) ptr[i].sum
#define C(i) ptr[i].cnt
#define LEN(i) ptr[i].len
#define V(i) (ptr[i].cnt ? ptr[i].len : ptr[i].sum)
struct node {
	int l, r, sum, cnt, len;
}ptr[maxn];
struct sgt {
	int mem;
	void reset() {
		mem = 1;
		ptr[1] = {0, 0, 0, 0, (inf << 1)+1};
	}
	int new_node(int l, int r) {
		return ptr[++mem] = {0, 0, 0, 0, r-l+1}, mem;
	}
	void update(int i) {
		S(i) = V(L(i)) + V(R(i));
	}
	void add(int al, int ar, int d, int l = 0, int r = inf << 1, int i = 1) {
		if (al > r || ar < l) return;
		int m = l + r >> 1;
		//cerr << "Add " << al << ' ' << ar << " : " << d << " L R " << l << ' ' << r << '\n';
		if (al <= l && ar >= r) {
			C(i) += d;
			return;
		}
		if (!L(i)) L(i) = new_node(l, m);
		if (!R(i)) R(i) = new_node(m+1, r);
		add(al, ar, d, l, m, L(i));
		add(al, ar, d, m+1, r, R(i));
		update(i);
	}
	ll query() {
		return V(1);
	}
}tree;
struct info {
	int l, r, d;
};
ll area(int t) {
	tree.reset();
	map<int, vector<info>> seg;
	for (const auto &[x, y] : loc) {
		seg[x-t].push_back({y-t, y+t, 1});
		seg[x+t+1].push_back({y-t, y+t, -1});
	}
	ll lsta = 0, lstx = 0, res = 0;
	for (const auto &[x, v] : seg) {
		lsta = tree.query();
		//cerr << "X " << x << " lst area " << lsta << '\n';
		res += lsta * (x-lstx) ;
		lstx = x;
		for (const auto &[l, r, d] : v)
			tree.add(l, r, d);
	}
	//cerr << "AREA  " << t << " : " << res << '\n';
	return res;
}
ll sum(ll a, ll d, ll n) {
	a %= p, d %= p;
	return (a + a + d * (n-1)) % p * n % p * inv % p;
}
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	int n, t;
	cin >> n >> t;
	loc.resize(n);
	for (auto &[x, y] : loc) cin >> x >> y, x += inf, y += inf;
	auto dis = [&](int a, int b) {
		return max(abs(loc[a].first-loc[b].first), abs(loc[a].second - loc[b].second)) >> 1;
	};
	for (int i = 0;i < n;++i)
		for (int j = i+1;j < n;++j)
			if (dis(i, j) <= t) dif.pb(dis(i, j));
	dif.pb(0);
	dif.pb(t);
	sort(dif.begin(), dif.end());
	dif.resize(distance(dif.begin(), unique(dif.begin(), dif.end())));
//	for (int i = 1;i <= t;++i)
//		res += area(i);
//	cout << res << '\n';
//	return 0;
	for (int i = 1;i < dif.size();++i) {
		int lst = dif[i-1], now = dif[i];
		if (now <= lst+5) {
			for (int i = lst+1;i <= now;++i)
				add(res, area(i) % p);//, cerr << "ADD " << area(i) << '\n';
			continue;
		}
		ll a = area(lst+1), b = area(lst+2), d = b-a;
		add(res, sum(a, d, now-lst));
	}
	if (t <= 100000) {
		ll tmp = 0;
		for (int i= 1; i <= t;++i) tmp += area(i);
		res = tmp;
	}

	//cout << res << '\n';
	ll o = -res - n + (t+1) * (area(t) % p);
	o %= p;
	if (o < 0) o += p;
	cout << o << '\n';
}

#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int maxn = 100 * 64, inf = 2e8;
vector<pair<int,int>> loc;
vector<int> dif;
const int p = 998244353, inv = p - p/2;
ll res;
void add(ll &a, ll v) {
	a += v - p;
	a += (a>>63) & p;
}
#define L(i) ptr[i].l
#define R(i) ptr[i].r
#define S(i) ptr[i].sum
#define C(i) ptr[i].cnt
#define LEN(i) ptr[i].len
#define V(i) (ptr[i].cnt ? ptr[i].len : ptr[i].sum)
struct node {
	int l, r, sum, cnt, len;
}ptr[maxn];
struct sgt {
	int mem;
	void reset() {
		mem = 1;
		ptr[1] = {0, 0, 0, 0, (inf << 1)+1};
	}
	int new_node(int l, int r) {
		return ptr[++mem] = {0, 0, 0, 0, r-l+1}, mem;
	}
	void update(int i) {
		S(i) = V(L(i)) + V(R(i));
	}
	void add(int al, int ar, int d, int l = 0, int r = inf << 1, int i = 1) {
		if (al > r || ar < l) return;
		int m = l + r >> 1;
		//cerr << "Add " << al << ' ' << ar << " : " << d << " L R " << l << ' ' << r << '\n';
		if (al <= l && ar >= r) {
			C(i) += d;
			return;
		}
		if (!L(i)) L(i) = new_node(l, m);
		if (!R(i)) R(i) = new_node(m+1, r);
		add(al, ar, d, l, m, L(i));
		add(al, ar, d, m+1, r, R(i));
		update(i);
	}
	ll query() {
		return V(1);
	}
}tree;
struct info {
	int l, r, d;
};
ll area(int t) {
	tree.reset();
	map<int, vector<info>> seg;
	for (const auto &[x, y] : loc) {
		seg[x-t].push_back({y-t, y+t, 1});
		seg[x+t+1].push_back({y-t, y+t, -1});
	}
	ll lsta = 0, lstx = 0, res = 0;
	for (const auto &[x, v] : seg) {
		lsta = tree.query();
		//cerr << "X " << x << " lst area " << lsta << '\n';
		res += lsta * (x-lstx) ;
		lstx = x;
		for (const auto &[l, r, d] : v)
			tree.add(l, r, d);
	}
	//cerr << "AREA  " << t << " : " << res << '\n';
	return res;
}
ll sum(ll a, ll d, ll n) {
	a %= p, d %= p;
	return (a + a + d * (n-1)) % p * n % p * inv % p;
}
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	int n, t;
	cin >> n >> t;
	loc.resize(n);
	for (auto &[x, y] : loc) cin >> x >> y, x += inf, y += inf;
	auto dis = [&](int a, int b) {
		return max(abs(loc[a].first-loc[b].first), abs(loc[a].second - loc[b].second)) >> 1;
	};
	for (int i = 0;i < n;++i)
		for (int j = i+1;j < n;++j)
			if (dis(i, j) <= t) dif.pb(dis(i, j));
	dif.pb(0);
	dif.pb(t);
	sort(dif.begin(), dif.end());
	dif.resize(distance(dif.begin(), unique(dif.begin(), dif.end())));
//	for (int i = 1;i <= t;++i)
//		res += area(i);
//	cout << res << '\n';
//	return 0;
	for (int i = 1;i < dif.size();++i) {
		int lst = dif[i-1], now = dif[i];
		if (now <= lst+5) {
			for (int i = lst+1;i <= now;++i)
				add(res, area(i) % p);//, cerr << "ADD " << area(i) << '\n';
			continue;
		}
		ll a = area(lst+1), b = area(lst+2), d = b-a;
		add(res, sum(a, d, now-lst));
	}
	//cout << res << '\n';
	ll o = -res - n + (t+1) * area(t);
	o %= p;
	if (o < 0) o += p;
	cout << o << '\n';
}

#include<bits/stdc++.h>
#define pb emplace_back
using namespace std;
using ll = long long;
const int maxn = 100 * 64, inf = 2e8;
vector<pair<int,int>> loc;
vector<int> dif;
const int p = 998244353, inv = p - p/2;
ll res;
void add(ll &a, ll v) {
	a += v - p;
	a += (a>>63) & p;
}
#define L(i) ptr[i].l
#define R(i) ptr[i].r
#define S(i) ptr[i].sum
#define C(i) ptr[i].cnt
#define LEN(i) ptr[i].len
#define V(i) (ptr[i].cnt ? ptr[i].len : ptr[i].sum)
struct node {
	int l, r, sum, cnt, len;
}ptr[maxn];
struct sgt {
	int mem;
	void reset() {
		mem = 1;
		ptr[1] = {0, 0, 0, 0, (inf << 1)+1};
	}
	int new_node(int l, int r) {
		return ptr[++mem] = {0, 0, 0, 0, r-l+1}, mem;
	}
	void update(int i) {
		S(i) = V(L(i)) + V(R(i));
	}
	void add(int al, int ar, int d, int l = 0, int r = inf << 1, int i = 1) {
		if (al > r || ar < l) return;
		int m = l + r >> 1;
		//cerr << "Add " << al << ' ' << ar << " : " << d << " L R " << l << ' ' << r << '\n';
		if (al <= l && ar >= r) {
			C(i) += d;
			return;
		}
		if (!L(i)) L(i) = new_node(l, m);
		if (!R(i)) R(i) = new_node(m+1, r);
		add(al, ar, d, l, m, L(i));
		add(al, ar, d, m+1, r, R(i));
		update(i);
	}
	ll query() {
		return V(1);
	}
}tree;
struct info {
	int l, r, d;
};
ll area(int t) {
	tree.reset();
	map<int, vector<info>> seg;
	for (const auto &[x, y] : loc) {
		seg[x-t].push_back({y-t, y+t, 1});
		seg[x+t+1].push_back({y-t, y+t, -1});
	}
	ll lsta = 0, lstx = 0, res = 0;
	for (const auto &[x, v] : seg) {
		lsta = tree.query();
		//cerr << "X " << x << " lst area " << lsta << '\n';
		res += lsta * (x-lstx) ;
		lstx = x;
		for (const auto &[l, r, d] : v)
			tree.add(l, r, d);
	}
	//cerr << "AREA  " << t << " : " << res << '\n';
	return res;
}
ll sum(ll a, ll d, ll n) {
	a %= p, d %= p;
	return (a + a + d * (n-1)) % p * n % p * inv % p;
}
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	int n, t;
	cin >> n >> t;
	loc.resize(n);
	for (auto &[x, y] : loc) cin >> x >> y, x += inf, y += inf;
	auto dis = [&](int a, int b) {
		return max(abs(loc[a].first-loc[b].first), abs(loc[a].second - loc[b].second)) >> 1;
	};
	for (int i = 0;i < n;++i)
		for (int j = i+1;j < n;++j)
			if (dis(i, j) <= t) dif.pb(dis(i, j));
	dif.pb(0);
	dif.pb(t);
	sort(dif.begin(), dif.end());
	dif.resize(distance(dif.begin(), unique(dif.begin(), dif.end())));
//	for (int i = 1;i <= t;++i)
//		res += area(i);
//	cout << res << '\n';
//	return 0;
	for (int i = 1;i < dif.size();++i) {
		int lst = dif[i-1], now = dif[i];
		if (now <= lst+5) {
			for (int i = lst+1;i <= now;++i)
				add(res, area(i) % p);//, cerr << "ADD " << area(i) << '\n';
			continue;
		}
		ll a = area(lst+1), b = area(lst+2), d = b-a;
		add(res, sum(a, d, now-lst));
	}
	if (t <= 100000) {
		ll tmp = 0;
		for (int i= 1; i <= t;++i) tmp += area(i);
		res = tmp;
	}

	//cout << res << '\n';
	ll o = -res - n + (t+1) * area(t);
	o %= p;
	if (o < 0) o += p;
	cout << o << '\n';
}

#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif

#define MEMO 1

#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>

struct tree{int x,y;};
std::vector<tree> trees;

#if MEMO
#include<unordered_map>
std::unordered_map<int,int64_t> totalarea_memo;
#endif

int64_t totalarea(int t){
	// compute total number of lattice points in the union of rectangles
	// [x-t..x+t, y-t..y+t]
	if(t<0)return 0; // ...
	if(t==0)return trees.size();

#if MEMO
	auto iter=totalarea_memo.find(t);
	if(iter!=totalarea_memo.end())return iter->second;
#endif

	struct rect{int firstx,lastx,firsty,lasty;};
	std::vector<rect> rects(trees.size());
	std::transform(trees.begin(),trees.end(),rects.begin(),
	[t](tree a){return rect{a.x-t,a.x+t+1,a.y-t,a.y+t+1};});

	std::vector<int> xcoord,ycoord;
	xcoord.reserve(trees.size()*2);
	ycoord.reserve(trees.size()*2);
	for(auto r:rects){
		xcoord.push_back(r.firstx);
		xcoord.push_back(r.lastx);
		ycoord.push_back(r.firsty);
		ycoord.push_back(r.lasty);
	}
	std::sort(xcoord.begin(),xcoord.end());
	std::sort(ycoord.begin(),ycoord.end());
	xcoord.erase(std::unique(xcoord.begin(),xcoord.end()),xcoord.end());
	ycoord.erase(std::unique(ycoord.begin(),ycoord.end()),ycoord.end());
	std::vector<std::vector<int>> acm(xcoord.size(),std::vector<int>(ycoord.size()));
#define FIND(x,vec) (int(std::lower_bound(vec.begin(),vec.end(),x)-vec.begin()))
	for(auto r:rects){
		r.firstx=FIND(r.firstx,xcoord);
		r.lastx=FIND(r.lastx,xcoord);
		r.firsty=FIND(r.firsty,ycoord);
		r.lasty=FIND(r.lasty,ycoord);
		++acm[r.firstx][r.firsty];
		--acm[r.firstx][r.lasty];
		--acm[r.lastx][r.firsty];
		++acm[r.lastx][r.lasty];
	}
#undef FIND

	for(unsigned row=1;row<xcoord.size();++row)
		for(unsigned col=0;col<ycoord.size();++col)
			acm[row][col]+=acm[row-1][col];
	for(unsigned row=0;row<xcoord.size();++row)
		for(unsigned col=1;col<ycoord.size();++col)
			acm[row][col]+=acm[row][col-1];
	int64_t ans=0;
	for(unsigned row=0;row<xcoord.size()-1;++row)
		for(unsigned col=0;col<ycoord.size()-1;++col){
			if(acm[row][col])
				ans+=(xcoord[row+1]-xcoord[row])*int64_t(ycoord[col+1]-ycoord[col]);
		}

#if MEMO
	totalarea_memo.emplace(t,ans);
#endif

	return ans;
}

// a piecewise linear function with (time)
int64_t ncellwithval(int time){
	return totalarea(time)-totalarea(time-1);
}

int constexpr MOD=998244353;

template<class T,T f>
int sumfn(int min,int max,int64_t fmin,int64_t fmax){
	// compute sum(f(i)*i for integer i, min<=i<=max)%MOD

#ifdef _GLIBCXX_DEBUG
	assert(fmin==f(min));
	assert(fmax==f(max));
	int64_t ans1=0;
	for(int i=min;i<=max;++i)
		ans1+=i*f(i)%MOD;
	ans1%=MOD;
#endif

	if(min==max){
		int ans=fmin%MOD*min%MOD;
		return ans;
	}
	if(min+1==max){
		int ans=(fmin%MOD*min+fmax%MOD*max)%MOD;
		return ans;
	}
	int mid=min+(max-min)*2/3;
	int64_t fmid=f(mid);
	auto const d1=fmid-fmin,d2=fmax-fmin;
	auto const q1=d1/(mid-min),r1=d1%(mid-min);
	auto const q2=d2/(max-min),r2=d2%(max-min);
	if(r1==0&&r2==0&&q1==q2){
		// formula from Mathematica :)
		int64_t ans = ((1 + max - min)*((
			3*fmin%MOD*(max + min) +
			(max + 2LL*max*max - max*(int64_t)min - min*(1LL + min))%MOD*(q1%MOD)%MOD)
				%MOD));
		ans=ans%MOD*166374059 /* 1/6 */ %MOD;
		if(ans<0)ans+=MOD;
		return ans;
	}else{
		int64_t ans=
			(sumfn<T,f>(min,mid,fmin,fmid)+sumfn<T,f>(mid+1,max,f(mid+1),fmax))%MOD;
		return ans;
	}
}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int ntree,time;std::cin>>ntree>>time;
	trees.resize(ntree);for(auto& t:trees)std::cin>>t.x>>t.y;
	if(time==0)std::cout<<"0\n";
	else std::cout<<sumfn<decltype(&ncellwithval),ncellwithval>
			(1,time,ncellwithval(1),ncellwithval(time))<<'\n';
}

#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif

#define MEMO 1

#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>

struct tree{int x,y;};
std::vector<tree> trees;

#if MEMO
#include<unordered_map>
std::unordered_map<int,int64_t> totalarea_memo;
#endif

int64_t totalarea(int t){
	// compute total number of lattice points in the union of rectangles
	// [x-t..x+t, y-t..y+t]
	if(t<0)return 0; // ...
	if(t==0)return trees.size();

#if MEMO
	auto iter=totalarea_memo.find(t);
	if(iter!=totalarea_memo.end())return iter->second;
#endif

	struct rect{int firstx,lastx,firsty,lasty;};
	std::vector<rect> rects(trees.size());
	std::transform(trees.begin(),trees.end(),rects.begin(),
	[t](tree a){return rect{a.x-t,a.x+t+1,a.y-t,a.y+t+1};});

	std::vector<int> xcoord,ycoord;
	xcoord.reserve(trees.size()*2);
	ycoord.reserve(trees.size()*2);
	for(auto r:rects){
		xcoord.push_back(r.firstx);
		xcoord.push_back(r.lastx);
		ycoord.push_back(r.firsty);
		ycoord.push_back(r.lasty);
	}
	std::sort(xcoord.begin(),xcoord.end());
	std::sort(ycoord.begin(),ycoord.end());
	xcoord.erase(std::unique(xcoord.begin(),xcoord.end()),xcoord.end());
	ycoord.erase(std::unique(ycoord.begin(),ycoord.end()),ycoord.end());
	std::vector<std::vector<int>> acm(xcoord.size(),std::vector<int>(ycoord.size()));
#define FIND(x,vec) (int(std::lower_bound(vec.begin(),vec.end(),x)-vec.begin()))
	for(auto r:rects){
		r.firstx=FIND(r.firstx,xcoord);
		r.lastx=FIND(r.lastx,xcoord);
		r.firsty=FIND(r.firsty,ycoord);
		r.lasty=FIND(r.lasty,ycoord);
		++acm[r.firstx][r.firsty];
		--acm[r.firstx][r.lasty];
		--acm[r.lastx][r.firsty];
		++acm[r.lastx][r.lasty];
	}
#undef FIND

	for(unsigned row=1;row<xcoord.size();++row)
		for(unsigned col=0;col<ycoord.size();++col)
			acm[row][col]+=acm[row-1][col];
	for(unsigned row=0;row<xcoord.size();++row)
		for(unsigned col=1;col<ycoord.size();++col)
			acm[row][col]+=acm[row][col-1];
	int64_t ans=0;
	for(unsigned row=0;row<xcoord.size()-1;++row)
		for(unsigned col=0;col<ycoord.size()-1;++col){
			if(acm[row][col])
				ans+=(xcoord[row+1]-xcoord[row])*int64_t(ycoord[col+1]-ycoord[col]);
		}

#if MEMO
	totalarea_memo.emplace(t,ans);
#endif

	return ans;
}

// a piecewise linear function with (time)
int64_t ncellwithval(int time){
	return totalarea(time)-totalarea(time-1);
}

int constexpr MOD=998244353;

template<class T,T f>
int sumfn(int min,int max,int64_t fmin,int64_t fmax){
	// compute sum(f(i)*i for integer i, min<=i<=max)%MOD

#ifdef _GLIBCXX_DEBUG
	assert(fmin==f(min));
	assert(fmax==f(max));
	int64_t ans1=0;
	for(int i=min;i<=max;++i)
		ans1+=i*f(i)%MOD;
	ans1%=MOD;
#endif

	if(min==max){
		int ans=fmin%MOD*min%MOD;
		return ans;
	}
	if(min+1==max){
		int ans=(fmin%MOD*min+fmax%MOD*max)%MOD;
		return ans;
	}
	int mid1=min+(max-min)*2/3;
	int mid2=max-(max-min)*2/3;
	int64_t fmid1=f(mid1),fmid2=f(mid2);
	auto const d1=fmid1-fmin,d2=fmid2-fmin,d3=fmax-fmin;
	auto const q1=d1/(mid1-min),r1=d1%(mid1-min);
	auto const q2=d2/(mid2-min),r2=d2%(mid2-min);
	auto const q3=d3/(max-min),r3=d3%(max-min);
	if(r1==0&&r2==0&&r3==0&&q1==q2&&q2==q3){
		// formula from Mathematica :)
		int64_t ans = ((1 + max - min)*((
			3*fmin%MOD*(max + min) +
			(max + 2LL*max*max - max*(int64_t)min - min*(1LL + min))%MOD*(q1%MOD)%MOD)
				%MOD));
		ans=ans%MOD*166374059 /* 1/6 */ %MOD;
		if(ans<0)ans+=MOD;
#ifdef _GLIBCXX_DEBUG
		assert(ans==ans1);
#endif
		return ans;
	}else{
		int64_t ans=
			(sumfn<T,f>(min,mid1,fmin,fmid1)+sumfn<T,f>(mid1+1,max,f(mid1+1),fmax))%MOD;
#ifdef _GLIBCXX_DEBUG
		assert(ans==ans1);
#endif
		return ans;
	}
}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int ntree,time;std::cin>>ntree>>time;
	trees.resize(ntree);for(auto& t:trees)std::cin>>t.x>>t.y;
	if(time==0)std::cout<<"0\n";
	else std::cout<<sumfn<decltype(&ncellwithval),ncellwithval>
			(1,time,ncellwithval(1),ncellwithval(time))<<'\n';
}

#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif

#define MEMO 1

#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>

struct tree{int x,y;};
std::vector<tree> trees;

#if MEMO
#include<unordered_map>
std::unordered_map<int,int64_t> totalarea_memo;
#endif

int64_t totalarea(int t){
	// compute total number of lattice points in the union of rectangles
	// [x-t..x+t, y-t..y+t]
	if(t<0)return 0; // ...
	if(t==0)return trees.size();

#if MEMO
	auto iter=totalarea_memo.find(t);
	if(iter!=totalarea_memo.end())return iter->second;
#endif

	struct rect{int firstx,lastx,firsty,lasty;};
	std::vector<rect> rects(trees.size());
	std::transform(trees.begin(),trees.end(),rects.begin(),
	[t](tree a){return rect{a.x-t,a.x+t+1,a.y-t,a.y+t+1};});

	std::vector<int> xcoord,ycoord;
	xcoord.reserve(trees.size()*2);
	ycoord.reserve(trees.size()*2);
	for(auto r:rects){
		xcoord.push_back(r.firstx);
		xcoord.push_back(r.lastx);
		ycoord.push_back(r.firsty);
		ycoord.push_back(r.lasty);
	}
	std::sort(xcoord.begin(),xcoord.end());
	std::sort(ycoord.begin(),ycoord.end());
	xcoord.erase(std::unique(xcoord.begin(),xcoord.end()),xcoord.end());
	ycoord.erase(std::unique(ycoord.begin(),ycoord.end()),ycoord.end());
	std::vector<std::vector<int>> acm(xcoord.size(),std::vector<int>(ycoord.size()));
#define FIND(x,vec) (int(std::lower_bound(vec.begin(),vec.end(),x)-vec.begin()))
	for(auto r:rects){
		r.firstx=FIND(r.firstx,xcoord);
		r.lastx=FIND(r.lastx,xcoord);
		r.firsty=FIND(r.firsty,ycoord);
		r.lasty=FIND(r.lasty,ycoord);
		++acm[r.firstx][r.firsty];
		--acm[r.firstx][r.lasty];
		--acm[r.lastx][r.firsty];
		++acm[r.lastx][r.lasty];
	}
#undef FIND

	for(unsigned row=1;row<xcoord.size();++row)
		for(unsigned col=0;col<ycoord.size();++col)
			acm[row][col]+=acm[row-1][col];
	for(unsigned row=0;row<xcoord.size();++row)
		for(unsigned col=1;col<ycoord.size();++col)
			acm[row][col]+=acm[row][col-1];
	int64_t ans=0;
	for(unsigned row=0;row<xcoord.size()-1;++row)
		for(unsigned col=0;col<ycoord.size()-1;++col){
			if(acm[row][col])
				ans+=(xcoord[row+1]-xcoord[row])*int64_t(ycoord[col+1]-ycoord[col]);
		}

#if MEMO
	totalarea_memo.emplace(t,ans);
#endif

	return ans;
}

// a piecewise linear function with (time)
int64_t ncellwithval(int time){
	return totalarea(time)-totalarea(time-1);
}

int constexpr MOD=998244353;

template<class T,T f>
int sumfn(int min,int max,int64_t fmin,int64_t fmax){
	// compute sum(f(i)*i for integer i, min<=i<=max)%MOD

#ifdef _GLIBCXX_DEBUG
	assert(fmin==f(min));
	assert(fmax==f(max));
	int64_t ans1=0;
	for(int i=min;i<=max;++i)
		ans1+=i*f(i)%MOD;
	ans1%=MOD;
#endif

	if(min==max){
		int ans=fmin%MOD*min%MOD;
		return ans;
	}
	if(min+1==max){
		int ans=(fmin%MOD*min+fmax%MOD*max)%MOD;
		return ans;
	}
	int mid=min+(max-min)/2;
	int64_t fmid=f(mid);
	auto const d1=fmid-fmin,d2=fmax-fmin;
	auto const q1=d1/(mid-min),r1=d1%(mid-min);
	auto const q2=d2/(max-min),r2=d2%(max-min);
	if(r1==0&&r2==0&&q1==q2){
		// formula from Mathematica :)
		int64_t ans = ((1 + max - min)*((
			3*fmin%MOD*(max + min) +
			(max + 2LL*max*max - max*(int64_t)min - min*(1LL + min))%MOD*(q1%MOD)%MOD)
				%MOD));
		ans=ans%MOD*166374059 /* 1/6 */ %MOD;
		if(ans<0)ans+=MOD;
		return ans;
	}else{
		int64_t ans=
			(sumfn<T,f>(min,mid,fmin,fmid)+sumfn<T,f>(mid+1,max,f(mid+1),fmax))%MOD;
		return ans;
	}
}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int ntree,time;std::cin>>ntree>>time;
	trees.resize(ntree);for(auto& t:trees)std::cin>>t.x>>t.y;
	if(time==0)std::cout<<"0\n";
	else std::cout<<sumfn<decltype(&ncellwithval),ncellwithval>
			(1,time,ncellwithval(1),ncellwithval(time))<<'\n';
}

#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif

#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>

struct tree{int x,y;};
std::vector<tree> trees;
int64_t totalarea(int t){
	// compute total number of lattice points in the union of rectangles
	// [x-t..x+t, y-t..y+t]
	if(t<0)return 0; // ...
	if(t==0)return trees.size();

	struct rect{int firstx,lastx,firsty,lasty;};
	std::vector<rect> rects(trees.size());
	std::transform(trees.begin(),trees.end(),rects.begin(),
	[t](tree a){return rect{a.x-t,a.x+t+1,a.y-t,a.y+t+1};});

	std::vector<int> xcoord,ycoord;
	xcoord.reserve(trees.size()*2);
	ycoord.reserve(trees.size()*2);
	for(auto r:rects){
		xcoord.push_back(r.firstx);
		xcoord.push_back(r.lastx);
		ycoord.push_back(r.firsty);
		ycoord.push_back(r.lasty);
	}
	std::sort(xcoord.begin(),xcoord.end());
	std::sort(ycoord.begin(),ycoord.end());
	xcoord.erase(std::unique(xcoord.begin(),xcoord.end()),xcoord.end());
	ycoord.erase(std::unique(ycoord.begin(),ycoord.end()),ycoord.end());
	std::vector<std::vector<int>> acm(xcoord.size(),std::vector<int>(ycoord.size()));
#define FIND(x,vec) (int(std::lower_bound(vec.begin(),vec.end(),x)-vec.begin()))
	for(auto r:rects){
		r.firstx=FIND(r.firstx,xcoord);
		r.lastx=FIND(r.lastx,xcoord);
		r.firsty=FIND(r.firsty,ycoord);
		r.lasty=FIND(r.lasty,ycoord);
		++acm[r.firstx][r.firsty];
		--acm[r.firstx][r.lasty];
		--acm[r.lastx][r.firsty];
		++acm[r.lastx][r.lasty];
	}
#undef FIND

	for(unsigned row=1;row<xcoord.size();++row)
		for(unsigned col=0;col<ycoord.size();++col)
			acm[row][col]+=acm[row-1][col];
	for(unsigned row=0;row<xcoord.size();++row)
		for(unsigned col=1;col<ycoord.size();++col)
			acm[row][col]+=acm[row][col-1];
	int64_t ans=0;
	for(unsigned row=0;row<xcoord.size()-1;++row)
		for(unsigned col=0;col<ycoord.size()-1;++col){
			if(acm[row][col])
				ans+=(xcoord[row+1]-xcoord[row])*int64_t(ycoord[col+1]-ycoord[col]);
		}
	return ans;
}

// a piecewise linear function with (time)
int64_t ncellwithval(int time){
	return totalarea(time)-totalarea(time-1);
}

int constexpr MOD=998244353;

template<class T,T f>
int sumfn(int min,int max,int64_t fmin,int64_t fmax){
	// compute sum(f(i)*i for integer i, min<=i<=max)%MOD

#ifdef _GLIBCXX_DEBUG
	assert(fmin==f(min)%MOD);
	assert(fmax==f(max)%MOD);
	int64_t ans1=0;
	for(int i=min;i<=max;++i)
		ans1+=i*f(i)%MOD;
	ans1%=MOD;
#endif

	if(min==max){
		int ans=fmin%MOD*min%MOD;
		return ans;
	}
	if(min+1==max){
		int ans=(fmin%MOD*min+fmax%MOD*max)%MOD;
		return ans;
	}
	int mid=min+(max-min)/2;
	int64_t fmid=f(mid);
	auto const d1=fmid-fmin,d2=fmax-fmin;
	auto const q1=d1/(mid-min),r1=d1%(mid-min);
	auto const q2=d2/(max-min),r2=d2%(max-min);
	if(r1==0&&r2==0&&q1==q2){
		// formula from Mathematica :)
		int64_t ans = ((1 + max - min)*((
			3*fmin%MOD*(max + min) +
			(max + 2LL*max*max - max*(int64_t)min - min*(1LL + min))%MOD*(q1%MOD)%MOD)
				%MOD));
		ans=ans%MOD*166374059 /* 1/6 */ %MOD;
		if(ans<0)ans+=MOD;
		return ans;
	}else{
		int64_t ans=
			(sumfn<T,f>(min,mid,fmin,fmid)+sumfn<T,f>(mid+1,max,f(mid+1),fmax))%MOD;
		return ans;
	}
}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int ntree,time;std::cin>>ntree>>time;
	trees.resize(ntree);for(auto& t:trees)std::cin>>t.x>>t.y;
	if(time==0)std::cout<<"0\n";
	else std::cout<<sumfn<decltype(&ncellwithval),ncellwithval>
			(1,time,ncellwithval(1),ncellwithval(time))<<'\n';
}

#ifndef _GLIBCXX_DEBUG
#define NDEBUG
#endif

#include<iostream>
#include<vector>
#include<cassert>
#include<algorithm>

struct tree{int x,y;};
std::vector<tree> trees;
int64_t totalarea(int t){
	// compute total number of lattice points in the union of rectangles
	// [x-t..x+t, y-t..y+t]
	if(t<0)return 0; // ...
	if(t==0)return trees.size();

	struct rect{int firstx,lastx,firsty,lasty;};
	std::vector<rect> rects(trees.size());
	std::transform(trees.begin(),trees.end(),rects.begin(),
	[t](tree a){return rect{a.x-t,a.x+t+1,a.y-t,a.y+t+1};});

	std::vector<int> xcoord,ycoord;
	xcoord.reserve(trees.size()*2);
	ycoord.reserve(trees.size()*2);
	for(auto r:rects){
		xcoord.push_back(r.firstx);
		xcoord.push_back(r.lastx);
		ycoord.push_back(r.firsty);
		ycoord.push_back(r.lasty);
	}
	std::sort(xcoord.begin(),xcoord.end());
	std::sort(ycoord.begin(),ycoord.end());
	xcoord.erase(std::unique(xcoord.begin(),xcoord.end()),xcoord.end());
	ycoord.erase(std::unique(ycoord.begin(),ycoord.end()),ycoord.end());
	std::vector<std::vector<int>> acm(xcoord.size(),std::vector<int>(ycoord.size()));
#define FIND(x,vec) (int(std::lower_bound(vec.begin(),vec.end(),x)-vec.begin()))
	for(auto r:rects){
		r.firstx=FIND(r.firstx,xcoord);
		r.lastx=FIND(r.lastx,xcoord);
		r.firsty=FIND(r.firsty,ycoord);
		r.lasty=FIND(r.lasty,ycoord);
		++acm[r.firstx][r.firsty];
		--acm[r.firstx][r.lasty];
		--acm[r.lastx][r.firsty];
		++acm[r.lastx][r.lasty];
	}
#undef FIND

	for(unsigned row=1;row<xcoord.size();++row)
		for(unsigned col=0;col<ycoord.size();++col)
			acm[row][col]+=acm[row-1][col];
	for(unsigned row=0;row<xcoord.size();++row)
		for(unsigned col=1;col<ycoord.size();++col)
			acm[row][col]+=acm[row][col-1];
	int64_t ans=0;
	for(unsigned row=0;row<xcoord.size()-1;++row)
		for(unsigned col=0;col<ycoord.size()-1;++col){
			if(acm[row][col])
				ans+=(xcoord[row+1]-xcoord[row])*int64_t(ycoord[col+1]-ycoord[col]);
		}
	return ans;
}

// a piecewise linear function with (time)
int64_t ncellwithval(int time){
	return totalarea(time)-totalarea(time-1);
}

int constexpr MOD=998244353;

template<class T,T f>
int sumfn(int min,int max,int64_t fmin,int64_t fmax){
	// compute sum(f(i)*i for integer i, min<=i<=max)%MOD

#ifdef _GLIBCXX_DEBUG
	assert(fmin==f(min)%MOD);
	assert(fmax==f(max)%MOD);
	int64_t ans1=0;
	for(int i=min;i<=max;++i)
		ans1+=i*f(i)%MOD;
	ans1%=MOD;
#endif

	if(min==max){
		int ans=fmin%MOD*min%MOD;
		return ans;
	}
	if(min+1==max){
		int ans=(fmin%MOD*min+fmax%MOD*max)%MOD;
		return ans;
	}
	int mid=min+(max-min)/2;
	int64_t fmid=f(mid);
	auto const d1=fmid-fmin,d2=fmax-fmin;
	auto const q1=d1/(mid-min),r1=d1%(mid-min);
	auto const q2=d2/(max-min),r2=d2%(max-min);
	if(r1==0&&r2==0&&q1==q2){
		// formula from Mathematica :)
		int64_t ans = ((1 + max - min)*((
			3*fmin%MOD*(max + min) +
			(max + 2LL*max*max - max*(int64_t)min - min*(1LL + min))%MOD*(q1%MOD)%MOD)
				%MOD));
		ans=ans%MOD*166374059 /* 1/6 */ %MOD;
		if(ans<0)ans+=MOD;
		return ans;
	}else{
		int64_t ans=
			(sumfn<T,f>(min,mid,fmin,fmid)+sumfn<T,f>(mid+1,max,f(mid+1),fmax))%MOD;
		return ans;
	}
}

int main(){
	std::ios::sync_with_stdio(0);std::cin.tie(0);
	int ntree,time;std::cin>>ntree>>time;
	trees.resize(ntree);for(auto& t:trees)std::cin>>t.x>>t.y;
	if(time==0)std::cout<<"0\n";
	else std::cout<<sumfn<decltype(&ncellwithval),ncellwithval>
			(1,time,ncellwithval(1)%MOD,ncellwithval(time)%MOD)<<'\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    vector<int> u;
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    vector<int> has(u.size());
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        //assert(len < 3);
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // qq[2]-qq[1] = a+b, qq[1]-qq[0] = b
            // interpolation
            // c + c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + ... -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ... -> += a * len * (len-1) * (len+1) / 6
            qq[2] = (qq[2]+MOD-qq[1]*2+qq[0])%MOD, qq[1] = (qq[1]+MOD-qq[0])%MOD;
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            // B[1] = 0, B[2] = 1, B[3] = 3, B[4] = 6
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len+1) % MOD * i6 % MOD)) % MOD;
            // A[1] = 0, A[2] = 1, A[3] = 4, A[4] = 10
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
int has[N];
vector<int> u;
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    u.clear();
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // interpolation
            // b -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ...
            qq[2] = (qq[2]+MOD-qq[1])%MOD, qq[1] = (qq[1]+MOD-qq[0])%MOD;
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len-2) % MOD * i6 % MOD)) % MOD;
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
int has[N];
vector<int> u;
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    u.clear();
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // interpolation
            // c + c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + ... -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ... -> += a * len * (len-1) * (len+1) / 6
            qq[2] = (qq[2]+MOD-qq[1])%MOD, qq[1] = (qq[1]+MOD-qq[0])%MOD;
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            ans = (ans + qq[2] * (len * (len-10) % MOD * (len+1) % MOD * i6 % MOD)) % MOD;
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

int n, T;
pair<int,int> v[N];
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    vector<int> u;
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    int res = 0;
    vector<int> has(u.size());
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + 1LL * (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        //assert(len < 3);
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // qq[2]-qq[1] = a+b, qq[1]-qq[0] = b
            // interpolation
            // c + c +  c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + 4b + ... -> += b * len * (len-1) / 2;
            // 0 + 0 +  a + 3a + 6a + ... -> += a * len * (len-1) * (len-2) / 6
            qq[2] = (qq[2]+MOD*2-qq[1]*2+qq[0])%MOD;
            qq[1] = (qq[1]+MOD-qq[0])%MOD; // b
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            // B[1] = 0, B[2] = 1, B[3] = 3, B[4] = 6
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len-2) % MOD * i6 % MOD)) % MOD;
            // A[1] = 0, A[2] = 1, A[3] = 4, A[4] = 10
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
int has[N];
vector<int> u;
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    u.clear();
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    for(int i = 0; i < u.size(); i++) has[i] = 0;
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        //assert(len < 3);
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // interpolation
            // c + c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + ... -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ... -> += a * len * (len-1) * (len+1) / 6
            qq[2] = (qq[2]+MOD-qq[1])%MOD, qq[1] = (qq[1]+MOD-qq[0])%MOD;
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len+1) % MOD * i6 % MOD)) % MOD;
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
int has[N];
vector<int> u;
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    u.clear();
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // interpolation
            // b -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ...
            qq[2] = (qq[2]+MOD-qq[1])%MOD, qq[1] = (qq[1]+MOD-qq[0])%MOD;
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len+1) % MOD * i6 % MOD)) % MOD;
            // 2 ->
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

#define int ll
int n, T;
pair<int,int> v[N];
int has[N];
vector<int> u;
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    u.clear();
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        assert(len < 3);
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // interpolation
            // c + c +  c +  c + ... -> += c * len
            // 0 + b + 2b + 3b + ... -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ... -> += a * len * (len-1) * (len+1) / 6
            qq[2] = (qq[2]+MOD-qq[1])%MOD, qq[1] = (qq[1]+MOD-qq[0])%MOD;
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len+1) % MOD * i6 % MOD)) % MOD;
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.

#pragma GCC optimize("Ofast")
#pragma loop_opt(on)
#include <bits/extc++.h>
#ifdef local
#define safe std::cerr<<__PRETTY_FUNCTION__<<" line "<<__LINE__<<" safe\n"
#define debug(...) qqbx(#__VA_ARGS__,  __VA_ARGS__)
template <typename H, typename ...T> constexpr void qqbx(const char *s, const H &h, T &&...args) {
    for(; *s && *s != ','; ++s) if(*s != ' ') std::cerr << *s;
    std::cerr << " = " << h << (sizeof...(T) ? ", " : "\n");
    if constexpr(sizeof...(T)) qqbx(++s, args...); // C++ 17!
}
#else
#include <bits/stdc++.h>
#define debug(...) ((void)0)
#define safe ((void)0)
#endif // local
#define all(v) begin(v),end(v)
#define get_pos(v,x) (lower_bound(begin(v),end(v),x)-begin(v))
#define sort_uni(v) sort(begin(v),end(v)),v.erase(unique(begin(v),end(v)),end(v))
#define pb emplace_back
#define ff first
#define ss second
#define mem(v,x) memset(v,x,sizeof v)

using namespace std;
using namespace __gnu_pbds;
typedef int64_t ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
template <typename T> using max_heap = std::priority_queue<T,vector<T>,less<T> >;
template <typename T> using min_heap = std::priority_queue<T,vector<T>,greater<T> >;
template <typename T> using rbt = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
constexpr ld PI = acos(-1), eps = 1e-7;
constexpr ll N = 125, INF = 1e18, MOD = 998244353, K = 256, inf = 1e9;
constexpr inline ll cdiv(ll x, ll m) { return x/m + ((x<0 ^ m>0) && (x%m)); } // ceiling divide
constexpr inline ll modpow(ll e,ll p,ll m=MOD) { ll r=1; for(e%=m;p;p>>=1,e=e*e%m) if(p&1) r=r*e%m; return r; }

int n, T;
pair<int,int> v[N];
int has[N];
vector<int> u;
ll calc(int t) { // calc area in the square radius t
    struct Event {
        int x;
        int l, r;
        int coef;
    };
    u.clear();
    for(int i = 0; i < n; i++) u.pb(v[i].ss-t), u.pb(v[i].ss+t+1);
    sort_uni(u);
    vector<Event> evt;
    for(int i = 0; i < n; i++) {
        int l = get_pos(u, v[i].ss-t), r = get_pos(u, v[i].ss+t+1);
        evt.push_back({v[i].ff-t, l, r, 1});
        evt.push_back({v[i].ff+t+1, l, r, -1});
    }
    sort(all(evt), [](Event &a, Event &b){return a.x < b.x;});
    ll res = 0;
    for(int i = 0; i+1 < evt.size(); i++) {
        int dx = evt[i+1].x - evt[i].x;
        for(int j = evt[i].l; j < evt[i].r; j++) has[j] += evt[i].coef;
        for(int j = 0; j+1 < u.size(); j++) if(has[j]) res = (res + (u[j+1] - u[j]) * dx) % MOD;
    }
    return res;
}
signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    cin >> n >> T;
    for(int i = 0; i < n; i++) cin >> v[i].ff >> v[i].ss;
    vector<int> bb;
    bb.pb(0);
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < i; j++) {
            int t = max(abs(v[i].ff-v[j].ff), abs(v[i].ss-v[j].ss));
            if((t+1)/2 < T) bb.pb((t+1)/2);
        }
    }
    bb.pb(T);
    sort_uni(bb);
    sort(v,v+n);
    ll ans = 0;
    const ll i2 = modpow(2, MOD-2), i6 = modpow(6, MOD-2);
    for(int i = 0; i+1 < bb.size(); i++) {
        int len = bb[i+1] - bb[i];
        if(len < 3) {
            for(int j = 0; j < len; j++) ans = (ans + calc(bb[i] + j));
        } else {
            ll qq[3];
            for(int j = 0; j < 3; j++) qq[j] = calc(bb[i] + j);
            // interpolation
            // b -> += b * len * (len-1) / 2;
            // 0 + a + 3a + 6a + ...
            qq[2] -= qq[1], qq[1] -= qq[0];
            ans = (ans + qq[0] * len) % MOD;
            ans = (ans + qq[1] * (len * (len-1) % MOD * i2 % MOD)) % MOD;
            ans = (ans + qq[2] * (len * (len-1) % MOD * (len-2) % MOD * i6 % MOD)) % MOD;
        }
    }
    cout << (calc(T)*T - ans + MOD) % MOD << '\n';
}

#include <bits/stdc++.h>

using Linear = std::array<int, 2>;

const int N = 50;
const int MOD = 998244353;
const int INV2 = 499122177;
const int INV6 = 166374059;

int n, t, x[N], y[N], rank[N << 1], xorder[N << 1], yorder[N << 1],
    count[N << 1];
Linear dys[N << 1];

struct Comparer {
  Comparer(int t, int *a) : t(t), a(a) {}

  int v(int i) const { return a[i >> 1] + (i & 1 ? t + 1 : -t); }

  bool operator()(int i, int j) const {
    return v(i) != v(j) ? v(i) < v(j) : (i & 1) < (j & 1);
  }

  int t;
  int *a;
};

Linear boundary(int *a, int i) {
  if (i & 1) {
    return {a[i >> 1] + 1, 1};
  } else {
    return {a[i >> 1], MOD - 1};
  }
}

int add(int x, int a) {
  x += a;
  if (x >= MOD) {
    x -= MOD;
  }
  return x;
}

void update(int &x, int a) { x = add(x, a); }

Linear subtract(const Linear &a, const Linear &b) {
  return {add(a[0], MOD - b[0]), add(a[1], MOD - b[1])};
}

int sum1(int n)
{
  return n * (n - 1LL) % MOD * INV2 % MOD;
}

int sum2(int n)
{
  return n * (n - 1LL) % MOD * (n + n - 1) * INV6 % MOD;
}

int main() {
  while (scanf("%d%d", &n, &t) == 2) {
    for (int i = 0; i < n; ++i) {
      scanf("%d%d", x + i, y + i);
    }
    std::vector<int> time{0, t, t + 1};
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (x[i] < x[j]) {
          time.push_back(x[j] - x[i] >> 1);
        }
        if (y[i] < y[j]) {
          time.push_back(y[j] - y[i] >> 1);
        }
      }
    }
    std::sort(time.begin(), time.end());
    time.erase(std::unique(time.begin(), time.end()), time.end());
    std::iota(xorder, xorder + (n << 1), 0);
    std::iota(yorder, yorder + (n << 1), 0);
    memset(count, 0, sizeof(count));
    int result = 0;
    for (int k = 0; k + 1 < time.size(); ++k) {
      // [time[k], time[k + 1])
      int t0 = time[k];
      int t1 = time[k + 1];
      std::sort(xorder, xorder + (n << 1), Comparer{t0, x});
      std::sort(yorder, yorder + (n << 1), Comparer{t0, y});
      for (int i = 0; i < n << 1; ++i) {
        rank[yorder[i]] = i;
      }
      for (int j = 1; j < n << 1; ++j) {
        dys[j] = subtract(boundary(y, yorder[j]), boundary(y, yorder[j - 1]));
      }
      int quad[]{0, 0, 0};
      for (int _i = 0; _i < n << 1; ++_i) {
        int i = xorder[_i];
        int delta = i & 1 ? -1 : 1;
        if (_i) {
          Linear dx = subtract(boundary(x, i), boundary(x, xorder[_i - 1]));
          for (int j = 1; j < n << 1; ++j) {
            if (count[j - 1]) {
              update(quad[0], 1LL * dx[0] * dys[j][0] % MOD);
              update(quad[1],
                     (1LL * dx[0] * dys[j][1] + 1LL * dx[1] * dys[j][0]) % MOD);
              update(quad[2], 1LL * dx[1] * dys[j][1] % MOD);
            }
          }
        }
        for (int j = rank[i & ~1]; j < rank[i | 1]; ++j) {
          count[j] += delta;
        }
      }
      int sum = 1LL * (t1 - t0) * quad[0] % MOD;
      update(sum, 1LL * (sum1(t1) + MOD - sum1(t0)) * quad[1] % MOD);
      update(sum, 1LL * (sum2(t1) + MOD - sum2(t0)) * quad[2] % MOD);
      update(result, t0 == t ? 1LL * t * sum % MOD : MOD - sum);
    }
    printf("%d\n", result);
  }
}

#include <bits/stdc++.h>

using Linear = std::array<int, 2>;

const int N = 50;
const int MOD = 998244353;
const int INV2 = 499122177;
const int INV6 = 166374059;

int n, t, x[N], y[N], rank[N << 1], xorder[N << 1], yorder[N << 1],
    count[N << 1];
Linear dys[N << 1];

struct Comparer {
  Comparer(int t, int *a) : t(t), a(a) {}

  int v(int i) const { return a[i >> 1] + (i & 1 ? t + 1 : -t); }

  bool operator()(int i, int j) const {
    return v(i) != v(j) ? v(i) < v(j) : (i & 1) < (j & 1);
  }

  int t;
  int *a;
};

Linear boundary(int *a, int i) {
  if (i & 1) {
    return {a[i >> 1] + 1, 1};
  } else {
    return {a[i >> 1], MOD - 1};
  }
}

int add(int x, int a) {
  x += a;
  if (x >= MOD) {
    x -= MOD;
  }
  return x;
}

void update(int &x, int a) { x = add(x, a); }

Linear subtract(const Linear &a, const Linear &b) {
  return {add(a[0], MOD - b[0]), add(a[1], MOD - b[1])};
}

int sum1(int n)
{
  return n * (n - 1LL) % MOD * INV2 % MOD;
}

int sum2(int n)
{
  return n * (n - 1LL) % MOD * (n + n - 1) % MOD * INV6 % MOD;
}

int main() {
  while (scanf("%d%d", &n, &t) == 2) {
    for (int i = 0; i < n; ++i) {
      scanf("%d%d", x + i, y + i);
    }
    std::vector<int> time{0, t, t + 1};
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        if (x[i] < x[j]) {
          time.push_back(x[j] - x[i] >> 1);
        }
        if (y[i] < y[j]) {
          time.push_back(y[j] - y[i] >> 1);
        }
      }
    }
    std::sort(time.begin(), time.end());
    time.erase(std::unique(time.begin(), time.end()), time.end());
    std::iota(xorder, xorder + (n << 1), 0);
    std::iota(yorder, yorder + (n << 1), 0);
    memset(count, 0, sizeof(count));
    int result = 0;
    for (int k = 0; k + 1 < time.size(); ++k) {
      // [time[k], time[k + 1])
      int t0 = time[k];
      int t1 = time[k + 1];
      std::sort(xorder, xorder + (n << 1), Comparer{t0, x});
      std::sort(yorder, yorder + (n << 1), Comparer{t0, y});
      for (int i = 0; i < n << 1; ++i) {
        rank[yorder[i]] = i;
      }
      for (int j = 1; j < n << 1; ++j) {
        dys[j] = subtract(boundary(y, yorder[j]), boundary(y, yorder[j - 1]));
      }
      int quad[]{0, 0, 0};
      for (int _i = 0; _i < n << 1; ++_i) {
        int i = xorder[_i];
        int delta = i & 1 ? -1 : 1;
        if (_i) {
          Linear dx = subtract(boundary(x, i), boundary(x, xorder[_i - 1]));
          for (int j = 1; j < n << 1; ++j) {
            if (count[j - 1]) {
              update(quad[0], 1LL * dx[0] * dys[j][0] % MOD);
              update(quad[1],
                     (1LL * dx[0] * dys[j][1] + 1LL * dx[1] * dys[j][0]) % MOD);
              update(quad[2], 1LL * dx[1] * dys[j][1] % MOD);
            }
          }
        }
        for (int j = rank[i & ~1]; j < rank[i | 1]; ++j) {
          count[j] += delta;
        }
      }
      int sum = 1LL * (t1 - t0) * quad[0] % MOD;
      update(sum, 1LL * (sum1(t1) + MOD - sum1(t0)) * quad[1] % MOD);
      update(sum, 1LL * (sum2(t1) + MOD - sum2(t0)) * quad[2] % MOD);
      update(result, t0 == t ? 1LL * t * sum % MOD : MOD - sum);
    }
    printf("%d\n", result);
  }
}

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
const int Q=1<<8;
int X[Q],Y[Q],n;
int uni[Q*Q];
int ux[Q],uy[Q];
int cnt[Q][Q];
#define G(aa,bb,cc) (lower_bound(aa+1,aa+(bb)+1,cc)-aa)
int Cov(int d)
{
	int mx=0,my=0;
	for(int i=1;i<=n;i++)
		ux[++mx]=X[i]-d,ux[++mx]=X[i]+d+1,
		uy[++my]=Y[i]-d,uy[++my]=Y[i]+d+1;
	sort(ux+1,ux+mx+1),sort(uy+1,uy+my+1);
	mx=unique(ux+1,ux+mx+1)-ux-1;
	my=unique(uy+1,uy+my+1)-uy-1;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++)
			cnt[i][j]=0;
	for(int i=1;i<=n;i++){
		int x0=G(ux,mx,X[i]-d),x1=G(ux,mx,X[i]+d+1),
		y0=G(uy,my,Y[i]-d),y1=G(uy,my,Y[i]+d+1);
		cnt[x0][y0]++,cnt[x1][y1]++;
		cnt[x0][y1]--,cnt[x1][y0]--;
	}
	int tmp=0;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++){
			cnt[i][j]+=cnt[i-1][j]+cnt[i][j-1]-cnt[i-1][j-1];
			if(cnt[i][j])tmp+=1LL*(ux[i+1]-ux[i])*(uy[j+1]-uy[j]);
		}
	return tmp%MOD;
}
int dd[4]={MOD-(MOD+1)/6,(MOD+1)/2,MOD-(MOD+1)/2,(MOD+1)/6};
int main()
{
	int k;
	scanf("%d%d",&n,&k);
	if(k==0)return 0&puts("0");
	for(int i=1;i<=n;i++)
		scanf("%d%d",&X[i],&Y[i]);
	int maxn=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			uni[++maxn]=(max(abs(X[i]-X[j]),abs(Y[i]-Y[j]))+1)>>1;
	uni[++maxn]=0;
	sort(uni+1,uni+maxn+1);
	maxn=unique(uni+1,uni+maxn+1)-uni-1;
	while(uni[maxn]>=k)--maxn;
	uni[++maxn]=k;
	ll als=0;
	for(int i=1;i<maxn;i++){
		if(uni[i+1]-uni[i]<=4){
			for(int j=uni[i];j<uni[i+1];j++)
				als+=Cov(j);
			continue;
		}
		for(int j=0;j<=3;j++){
			ll pi=1LL*Cov(uni[i]+j)*dd[j]%MOD;
			for(int k=0;k<4;k++)
				if(j!=k)pi=pi*(uni[i+1]-uni[i]-1-k)%MOD;
			als+=pi;
		}
	}
	printf("%lld\n",(1LL*Cov(k)*k%MOD-als%MOD+MOD)%MOD);
	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define MOD 998244353
using namespace std;
const int Q=1<<8;
int X[Q],Y[Q],n;
int uni[Q*Q];
int ux[Q],uy[Q];
int cnt[Q][Q];
#define G(aa,bb,cc) (lower_bound(aa+1,aa+(bb)+1,cc)-aa)
int Cov(int d)
{
	int mx=0,my=0;
	for(int i=1;i<=n;i++)
		ux[++mx]=X[i]-d,ux[++mx]=X[i]+d+1,
		uy[++my]=Y[i]-d,uy[++my]=Y[i]+d+1;
	sort(ux+1,ux+mx+1),sort(uy+1,uy+my+1);
	mx=unique(ux+1,ux+mx+1)-ux-1;
	my=unique(uy+1,uy+my+1)-uy-1;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++)
			cnt[i][j]=0;
	for(int i=1;i<=n;i++){
		int x0=G(ux,mx,X[i]-d),x1=G(ux,mx,X[i]+d+1),
		y0=G(uy,my,Y[i]-d),y1=G(uy,my,Y[i]+d+1);
		cnt[x0][y0]++,cnt[x1][y1]++;
		cnt[x0][y1]--,cnt[x1][y0]--;
	}
	ll tmp=0;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++){
			cnt[i][j]+=cnt[i-1][j]+cnt[i][j-1]-cnt[i-1][j-1];
			if(cnt[i][j])tmp+=1LL*(ux[i+1]-ux[i])*(uy[j+1]-uy[j]);
		}
	return tmp%MOD;
}
int dd[4]={MOD-(MOD+1)/6,(MOD+1)/2,MOD-(MOD+1)/2,(MOD+1)/6};
int main()
{
	int k;
	scanf("%d%d",&n,&k);
	if(k==0)return 0&puts("0");
	for(int i=1;i<=n;i++)
		scanf("%d%d",&X[i],&Y[i]);
	int maxn=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			uni[++maxn]=(max(abs(X[i]-X[j]),abs(Y[i]-Y[j]))+1)>>1;
	uni[++maxn]=0;
	sort(uni+1,uni+maxn+1);
	maxn=unique(uni+1,uni+maxn+1)-uni-1;
	while(uni[maxn]>=k)--maxn;
	uni[++maxn]=k;
	ll als=0;
	for(int i=1;i<maxn;i++){
		if(uni[i+1]-uni[i]<=4){
			for(int j=uni[i];j<uni[i+1];j++)
				als+=Cov(j);
			continue;
		}
		for(int j=0;j<=3;j++){
			ll pi=1LL*Cov(uni[i]+j)*dd[j]%MOD;
			for(int k=0;k<4;k++)
				if(j!=k)pi=pi*(uni[i+1]-uni[i]-1-k)%MOD;
			als+=pi;
		}
	}
	printf("%lld\n",(1LL*Cov(k)*k%MOD-als%MOD+MOD)%MOD);
	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
const int Q=1<<8;
int X[Q],Y[Q],n;
int uni[Q*Q];
int ux[Q],uy[Q];
int cnt[Q][Q];
#define G(aa,bb,cc) (lower_bound(aa+1,aa+(bb)+1,cc)-aa)
int Cov(int d)
{
	int mx=0,my=0;
	for(int i=1;i<=n;i++)
		ux[++mx]=X[i]-d,ux[++mx]=X[i]+d+1,
		uy[++my]=Y[i]-d,uy[++my]=Y[i]+d+1;
	sort(ux+1,ux+mx+1),sort(uy+1,uy+my+1);
	mx=unique(ux+1,ux+mx+1)-ux-1;
	my=unique(uy+1,uy+my+1)-uy-1;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++)
			cnt[i][j]=0;
	for(int i=1;i<=n;i++){
		int x0=G(ux,mx,X[i]-d),x1=G(ux,mx,X[i]+d+1),
		y0=G(uy,my,Y[i]-d),y1=G(uy,my,Y[i]+d+1);
		cnt[x0][y0]++,cnt[x1][y1]++;
		cnt[x0][y1]--,cnt[x1][y0]--;
	}
	ll tmp=0;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++){
			cnt[i][j]+=cnt[i-1][j]+cnt[i][j-1]-cnt[i-1][j-1];
			if(cnt[i][j])tmp+=1LL*(ux[i+1]-ux[i])*(uy[j+1]-uy[j]);
		}
	return tmp%MOD;
}
int dd[4]={MOD-(MOD+1)/6,(MOD+1)/2,MOD-(MOD+1)/2,(MOD+1)/6};
int main()
{
	int k;
	scanf("%d%d",&n,&k);
	if(k==0)return 0&puts("0");
	for(int i=1;i<=n;i++)
		scanf("%d%d",&X[i],&Y[i]);
	int maxn=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			uni[++maxn]=(max(abs(X[i]-X[j]),abs(Y[i]-Y[j]))+1)>>1;
	uni[++maxn]=0;
	sort(uni+1,uni+maxn+1);
	maxn=unique(uni+1,uni+maxn+1)-uni-1;
	while(uni[maxn]>=k)--maxn;
	uni[++maxn]=k;
	ll als=0;
	for(int i=1;i<maxn;i++){
		if(uni[i+1]-uni[i]<=4){
			for(int j=uni[i];j<uni[i+1];j++)
				als+=Cov(j);
			continue;
		}
		for(int j=0;j<=3;j++){
			ll pi=1LL*Cov(uni[i]+j)*dd[j]%MOD;
			for(int k=0;k<4;k++)
				if(j!=k)pi=pi*(uni[i+1]-uni[i]-1-k)%MOD;
			als+=pi;
		}
	}
	printf("%lld\n",(1LL*Cov(k)*k%MOD-als%MOD+MOD)%MOD);
	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
const int Q=1<<8;
int X[Q],Y[Q],n;
int uni[Q*Q];
int ux[Q],uy[Q];
int cnt[Q][Q];
#define G(aa,bb,cc) (lower_bound(aa+1,aa+(bb)+1,cc)-aa)
int Cov(int d)
{
	int mx=0,my=0;
	for(int i=1;i<=n;i++)
		ux[++mx]=X[i]-d,ux[++mx]=X[i]+d+1,
		uy[++my]=Y[i]-d,uy[++my]=Y[i]+d+1;
	sort(ux+1,ux+mx+1),sort(uy+1,uy+my+1);
	mx=unique(ux+1,ux+mx+1)-ux-1;
	my=unique(uy+1,uy+my+1)-uy-1;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++)
			cnt[i][j]=0;
	for(int i=1;i<=n;i++){
		int x0=G(ux,mx,X[i]-d),x1=G(ux,mx,X[i]+d+1),
		y0=G(uy,my,Y[i]-d),y1=G(uy,my,Y[i]+d+1);
		cnt[x0][y0]++,cnt[x1][y1]++;
		cnt[x0][y1]--,cnt[x1][y0]--;
	}
	ll tmp=0;
	for(int i=1;i<mx;i++)
		for(int j=1;j<my;j++){
			cnt[i][j]+=cnt[i-1][j]+cnt[i][j-1]-cnt[i-1][j-1];
			if(cnt[i][j])tmp+=1LL*(ux[i+1]-ux[i])*(uy[j+1]-uy[j]);
		}
	return tmp%MOD;
}
int dd[4]={MOD-(MOD+1)/6,(MOD+1)/2,MOD-(MOD+1)/2,(MOD+1)/6};
int main()
{
	int k;
	scanf("%d%d",&n,&k);
	if(k==0)return 0&puts("0");
	for(int i=1;i<=n;i++)
		scanf("%d%d",&X[i],&Y[i]);
	int maxn=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			uni[++maxn]=(max(abs(X[i]-X[j]),abs(Y[i]-Y[j]))+1)>>1;
	uni[++maxn]=0;
	sort(uni+1,uni+maxn+1);
	maxn=unique(uni+1,uni+maxn+1)-uni-1;
	while(uni[maxn]>=k)--maxn;
	uni[++maxn]=k;
	ll als=0;
	for(int i=1;i<maxn;i++){
		if(uni[i+1]-uni[i]<=4||1>0){
			for(int j=uni[i];j<uni[i+1];j++)
				als+=Cov(j);
			continue;
		}
		for(int j=0;j<=3;j++){
			ll pi=1LL*Cov(uni[i]+j)*dd[j]%MOD;
			for(int k=0;k<4;k++)
				if(j!=k)pi=pi*(uni[i+1]-uni[i]-1-k)%MOD;
			als+=pi;
		}
	}
	printf("%lld\n",(1LL*Cov(k)*k%MOD-als%MOD+MOD)%MOD);
	return 0;
}

#include<bits/stdc++.h>
#define ALL(A)  A.begin(),A.end()
#define maxn 55
#define maxm 10
#define modu 998244353
using namespace std;
typedef long long LL;

LL inv(LL a)
{
    LL ans=1;
    for (int k=modu-2;k;k>>=1)
    {
        if (k&1)
            ans=ans*a%modu;
        a=a*a%modu;
    }
    return ans;
}

int n,m;
int x[maxn],y[maxn];

vector<int> T;

LL calc(int T)
{
    vector<int> C,Y;
    struct node {
        int x,l,r,d;
        node(int _x,int _l,int _r,int _d)   {
            x=_x,l=_l,r=_r,d=_d;
        }
        bool operator < (const node& N) const   {
            return x<N.x;
        }
    };
    vector<node> X;
    for (int i=1;i<=n;++i)
    {
        int ly=y[i]-T,ry=y[i]+T+1;
        Y.push_back(ly);
        Y.push_back(ry);
        X.push_back(node(x[i]-T,ly,ry,1));
        X.push_back(node(x[i]+T+1,ly,ry,-1));
    }

    sort(ALL(X));
    sort(ALL(Y));
    Y.resize(unique(ALL(Y))-Y.begin());
    C.resize(Y.size(),0);

    LL ans=0;
    for (int i=0;i<X.size();++i)
    {
        int l=lower_bound(ALL(Y),X[i].l)-Y.begin(),r=lower_bound(ALL(Y),X[i].r)-Y.begin(),d=X[i].d;
        if (i)
            for (int j=0;j<Y.size();++j)
                if (C[j])
                {
                    assert(j!=Y.size()-1);
                    ans=(ans+1LL*(X[i].x-X[i-1].x)*(Y[j+1]-Y[j]))%modu;
                }
        for (int j=l;j<r;++j)
            C[j]+=d;
    }
    return ans;
}

LL X[maxm],Fx[maxm];

int main()
{
    scanf("%d%d",&n,&m);
    for (int i=1;i<=n;++i)
        scanf("%d%d",x+i,y+i);

    T.push_back(m);
    for (int i=1;i<=n;++i)
        for (int j=1;j<=n;++j)
        {
            int tx=abs(x[i]-x[j]),ty=abs(y[i]-y[j]),t=min((tx+1)>>1,(ty+1)>>1);
            if (t>m)    continue;
            T.push_back(t);
        }
    sort(ALL(T));
    T.resize(unique(T.begin(),T.end())-T.begin());

    LL ans=0;
    for (int i=0;i<T.size()-1;++i)
    {
        if (T[i]+4>=T[i+1])
        {
            for (int t=T[i];t<T[i+1];++t)
                ans=(ans+calc(t))%modu;
        } else
        {
            for (int j=1;j<=4;++j)
                X[j]=T[i]+j-1,Fx[j]=(calc(X[j])+Fx[j-1])%modu;

            LL sum=0,t=T[i+1]-1;
            for (int j=1;j<=4;++j)
            {
                LL p=1,q=1;
                for (int k=1;k<=4;++k)
                    if (k!=j)
                        p=p*(t-X[k]+modu)%modu,q=q*(X[j]-X[k]+modu)%modu;
                sum=(sum+p*inv(q)%modu*Fx[j])%modu;
            }
            ans=(ans+sum)%modu;
        }
    }

    ans=(m*calc(m)-ans+modu)%modu;
    printf("%lld\n",ans);
    return 0;
}

#include<bits/stdc++.h>
#define ALL(A)  A.begin(),A.end()
#define maxn 55
#define maxm 10
#define modu 998244353
using namespace std;
typedef long long LL;

LL inv(LL a)
{
    LL ans=1;
    for (int k=modu-2;k;k>>=1)
    {
        if (k&1)
            ans=ans*a%modu;
        a=a*a%modu;
    }
    return ans;
}

int n,m;
int x[maxn],y[maxn];

vector<int> T;

LL calc(int T)
{
    vector<int> C,Y;
    struct node {
        int x,l,r,d;
        node(int _x,int _l,int _r,int _d)   {
            x=_x,l=_l,r=_r,d=_d;
        }
        bool operator < (const node& N) const   {
            return x<N.x;
        }
    };
    vector<node> X;
    for (int i=1;i<=n;++i)
    {
        int ly=y[i]-T,ry=y[i]+T+1;
        Y.push_back(ly);
        Y.push_back(ry);
        X.push_back(node(x[i]-T,ly,ry,1));
        X.push_back(node(x[i]+T+1,ly,ry,-1));
    }

    sort(ALL(X));
    sort(ALL(Y));
    Y.resize(unique(ALL(Y))-Y.begin());
    C.resize(Y.size(),0);

    LL ans=0;
    for (int i=0;i<X.size();++i)
    {
        int l=lower_bound(ALL(Y),X[i].l)-Y.begin(),r=lower_bound(ALL(Y),X[i].r)-Y.begin(),d=X[i].d;
        if (i)
            for (int j=0;j<Y.size();++j)
                if (C[j])
                {
                    assert(j!=Y.size()-1);
                    ans=(ans+1LL*(X[i].x-X[i-1].x)*(Y[j+1]-Y[j]))%modu;
                }
        for (int j=l;j<r;++j)
            C[j]+=d;
    }
    return ans;
}

int X[maxm],Fx[maxm];

int main()
{
    scanf("%d%d",&n,&m);
    for (int i=1;i<=n;++i)
        scanf("%d%d",x+i,y+i);

    T.push_back(m);
    for (int i=1;i<=n;++i)
        for (int j=1;j<=n;++j)
        {
            int tx=abs(x[i]-x[j]),ty=abs(y[i]-y[j]),t=min((tx+1)>>1,(ty+1)>>1);
            if (t>m)    continue;
            T.push_back(t);
        }
    sort(ALL(T));
    T.resize(unique(T.begin(),T.end())-T.begin());

    LL ans=0;
    for (int i=0;i<T.size()-1;++i)
    {
        if (T[i]+4>=T[i+1])
        {
            for (int t=T[i];t<T[i+1];++t)
                ans=(ans+calc(t))%modu;
        } else
        {
            for (int j=1;j<=4;++j)
                X[j]=T[i]+j-1,Fx[j]=calc(X[j])+Fx[j-1];

            LL sum=0,t=T[i+1]-1;
            for (int j=1;j<=4;++j)
            {
                LL p=1,q=1;
                for (int k=1;k<=4;++k)
                    if (k!=j)
                        p=p*(t-X[k]+modu)%modu,q=q*(X[j]-X[k]+modu)%modu;
                sum=(sum+p*inv(q)%modu*Fx[j])%modu;
            }
            ans=(ans+sum)%modu;
        }
    }

    ans=(m*calc(m)-ans+modu)%modu;
    printf("%lld\n",ans);
    return 0;
}

#include<bits/stdc++.h>
#define ALL(A)  A.begin(),A.end()
#define maxn 55
#define maxm 10
#define modu 998244353
using namespace std;
typedef long long LL;

LL inv(LL a)
{
    LL ans=1;
    for (int k=modu-2;k;k>>=1)
    {
        if (k&1)
            ans=ans*a%modu;
        a=a*a%modu;
    }
    return ans;
}

int n,m;
int x[maxn],y[maxn];

vector<int> T;

LL calc(int T)
{
    vector<int> C,Y;
    struct node {
        int x,l,r,d;
        node(int _x,int _l,int _r,int _d)   {
            x=_x,l=_l,r=_r,d=_d;
        }
        bool operator < (const node& N) const   {
            return x<N.x;
        }
    };
    vector<node> X;
    for (int i=1;i<=n;++i)
    {
        int ly=y[i]-T,ry=y[i]+T+1;
        Y.push_back(ly);
        Y.push_back(ry);
        X.push_back(node(x[i]-T,ly,ry,1));
        X.push_back(node(x[i]+T+1,ly,ry,-1));
    }

    sort(ALL(X));
    sort(ALL(Y));
    Y.resize(unique(ALL(Y))-Y.begin());
    C.resize(Y.size(),0);

    LL ans=0;
    for (int i=0;i<X.size();++i)
    {
        int l=lower_bound(ALL(Y),X[i].l)-Y.begin(),r=lower_bound(ALL(Y),X[i].r)-Y.begin(),d=X[i].d;
        if (i)
            for (int j=0;j<Y.size();++j)
                if (C[j])
                {
                    assert(j!=Y.size()-1);
                    ans=(ans+1LL*(X[i].x-X[i-1].x)*(Y[j+1]-Y[j]))%modu;
                }
        for (int j=l;j<r;++j)
            C[j]+=d;
    }
    return ans;
}

LL X[maxm],Fx[maxm];

int main()
{
    scanf("%d%d",&n,&m);
    for (int i=1;i<=n;++i)
        scanf("%d%d",x+i,y+i);

    T.push_back(m);
    for (int i=1;i<=n;++i)
        for (int j=1;j<=n;++j)
        {
            int tx=abs(x[i]-x[j]),ty=abs(y[i]-y[j]),t=min((tx+1)>>1,(ty+1)>>1);
            if (t>m)    continue;
            T.push_back(t);
        }
    sort(ALL(T));
    T.resize(unique(T.begin(),T.end())-T.begin());

    LL ans=0;
    for (int i=0;i<T.size()-1;++i)
    {
        if (T[i]+4>=T[i+1])
        {
            for (int t=T[i];t<T[i+1];++t)
                ans=(ans+calc(t))%modu;
        } else
        {
            for (int j=1;j<=4;++j)
                X[j]=T[i]+j-1,Fx[j]=calc(X[j])+Fx[j-1];

            LL sum=0,t=T[i+1]-1;
            for (int j=1;j<=4;++j)
            {
                LL p=1,q=1;
                for (int k=1;k<=4;++k)
                    if (k!=j)
                        p=p*(t-X[k]+modu)%modu,q=q*(X[j]-X[k]+modu)%modu;
                sum=(sum+p*inv(q)%modu*Fx[j])%modu;
            }
            ans=(ans+sum)%modu;
        }
    }

    ans=(m*calc(m)-ans+modu)%modu;
    printf("%lld\n",ans);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

const i64 mod = 998244353;
const int maxN = 2234;

int n, t, x[maxN], y[maxN];
vector<int> row, col;

int finddist(int px, int py) {
	int ans = t + 1;
	for (int i = 0; i < n; i++)
		ans = min(ans, max(abs(px - x[i]), abs(py - y[i])));
	return ans;
}

i64 finds(i64 p, i64 q) {
	if (p > q) return 0;
	return (p + q) * (q - p + 1) / 2 % mod;
}

i64 solverow(i64 len, i64 c1, i64 c2) {
	if (c1 > c2) swap(c1, c2);
	return (finds(c1 + 1, c2) + c1 * (len - c2 + c1)) % mod;
}

i64 inv[maxN], invfac[maxN];

void init(int deg) {
	invfac[0] = 1;
	invfac[1] = 1;
	inv[1] = 1;
	for (int i = 2; i <= deg; i++) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
		invfac[i] = invfac[i - 1] * inv[i] % mod;
	}
}

i64 interpol(i64 *p, int deg, i64 x) {
	if (x <= deg) return p[deg];
	i64 mul1[10], mul2[10];
	mul1[0] = 1;
	mul2[0] = 1;
	for (int i = 0; i <= deg; i++) {
		mul1[i + 1] = mul1[i] * (x - i) % mod;
		mul2[i + 1] = mul2[i] * (x - deg + i) % mod;
	}

	i64 ans = 0;
	for (int i = 0; i <= deg; i++) {
		i64 t = invfac[i] * invfac[deg - i] % mod * mul1[i] % mod * mul2[deg - i] % mod * p[i] % mod;
		if ((deg - i) & 1) ans = ans - t;
		else ans = ans + t;
	}
	ans = ans % mod;
	if (ans < 0) ans += mod;
	return ans;

}

struct calc {
	int d00, d01, d10, d11, ly;
	int getx(int x, int d0, int d1) {
		if (d0 < d1) swap(d0, d1), x = ly - 1 - x;
		return max(d0 - x, d1);
	}
	int findl(int x) {
		return getx(x, d00, d10);
	}
	int findr(int x) {
		return getx(x, d01, d11);
	}
};

i64 solves(int l, int r, calc & op) {
//	printf("ss %d %d\n", l, r);
	auto findx = [&](int x) {
		return solverow(op.ly, op.findl(x), op.findr(x));
	};
	if (r - l <= 10) {
		i64 ans = 0;
		for (int i = l; i <= r; i++) {
//			printf("%d %lld\n", i, findx(i));
			ans = (ans + findx(i)) % mod;
		}
		return ans;
	} else {
		i64 p[5];
		for (int i = 0; i <= 4; i++) p[i] = findx(l + i);
		if (interpol(p, 4, r - l) == findx(r) && interpol(p, 4, r - l - 1) == findx(r - 1)) {
			for (int i = 1; i <= 4; i++) p[i] = (p[i - 1] + p[i]) % mod;
			return interpol(p, 4, r - l);
		} else {
			int mid = (l + r) / 2;
			return (solves(l, mid, op) + solves(mid + 1, r, op)) % mod;
		}
	}
}

i64 solve2d(int lx, int ly, int d00, int d01, int d10, int d11) {
	if (lx > ly) swap(lx, ly), swap(d01, d10);
	calc op = (calc) {d00, d01, d10, d11, ly};
	return solves(0, lx - 1, op);
}

i64 solve(int px, int qx, int py, int qy) {
	i64 d[10];
	d[0] = finddist(px, py);
	d[1] = finddist(px, qy);
	d[2] = finddist(qx, py);
	d[3] = finddist(qx, qy);
	int cnt = 0;
	for (int i = 0; i < 4; i++) cnt += (d[0] > t);
	assert(cnt == 0 || cnt == 4);
	if (cnt == 4) return 0;
	return solve2d(qx - px + 1, qy - py + 1, d[0], d[1], d[2], d[3]);
}

int main() {
	init(100);
//	i64 ff[]={1,3,6,10};
	scanf("%d%d", &n, &t);
//	n = 50; t = 100000000;
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);
//		x[i] = rand() % 200000001 - 100000000;
//		y[i] = rand() % 200000001 - 100000000;
		row.push_back(x[i] - t);
		row.push_back(x[i]);
		row.push_back(x[i] + 1);
		row.push_back(x[i] + 1 + t);
		col.push_back(y[i] - t);
		col.push_back(y[i]);
		col.push_back(y[i] + 1);
		col.push_back(y[i] + 1 + t);
	}
	sort(row.begin(), row.end());
	row.erase(unique(row.begin(), row.end()), row.end());
	sort(col.begin(), col.end());
	col.erase(unique(col.begin(), col.end()), col.end());
	i64 ans = 0;
	for (int i = 0; i + 1 < row.size(); i++) {
		for (int j = 0; j + 1 < col.size(); j++) {
			ans = (ans + solve(row[i], row[i + 1] - 1, col[j], col[j + 1] - 1)) % mod;
//			printf("aaa %d %d %d %d %d %d %lld\n", i, j, row[i], row[i + 1] - 1, col[j], col[j + 1] - 1, solve(row[i], row[i + 1] - 1, col[j], col[j + 1] - 1));
		}
	}
	printf("%lld\n", ans);
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

const i64 mod = 998244353;
const int maxN = 2234;

int n, t, x[maxN], y[maxN];
vector<int> row, col;

int finddist(int px, int py) {
	int ans = t + 1;
	for (int i = 0; i < n; i++)
		ans = min(ans, max(abs(px - x[i]), abs(py - y[i])));
	return ans;
}

i64 finds(i64 p, i64 q) {
	if (p > q) return 0;
	return (p + q) * (q - p + 1) / 2 % mod;
}

i64 solverow(i64 len, i64 c1, i64 c2) {
	if (c1 > c2) swap(c1, c2);
	return (finds(c1 + 1, c2) + c1 * (len - c2 + c1)) % mod;
}

i64 inv[maxN], invfac[maxN];

void init(int deg) {
	invfac[0] = 1;
	invfac[1] = 1;
	inv[1] = 1;
	for (int i = 2; i <= deg; i++) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
		invfac[i] = invfac[i - 1] * inv[i] % mod;
	}
}

i64 interpol(i64 *p, int deg, i64 x) {
	if (x <= deg) return p[deg];
	i64 mul1[10], mul2[10];
	mul1[0] = 1;
	mul2[0] = 1;
	for (int i = 0; i <= deg; i++) {
		mul1[i + 1] = mul1[i] * (x - i) % mod;
		mul2[i + 1] = mul2[i] * (x - deg + i) % mod;
	}

	i64 ans = 0;
	for (int i = 0; i <= deg; i++) {
		i64 t = invfac[i] * invfac[deg - i] % mod * mul1[i] % mod * mul2[deg - i] % mod * p[i] % mod;
		if ((deg - i) & 1) ans = ans - t;
		else ans = ans + t;
	}
	ans = ans % mod;
	if (ans < 0) ans += mod;
	return ans;

}

struct calc {
	int d00, d01, d10, d11, ly;
	int findl(int x) {
		return min(min(d00 + x, d10 + ly - 1 - x), max(d00, d10));
	}
	int findr(int x) {
		return min(min(d01 + x, d11 + ly - 1 - x), max(d01, d11));
	}
};

i64 solves(int l, int r, calc & op) {
//	printf("ss %d %d\n", l, r);
	auto findx = [&](int x) {
		return solverow(op.ly, op.findl(x), op.findr(x));
	};
	if (r - l <= 10) {
		i64 ans = 0;
		for (int i = l; i <= r; i++) {
//			printf("%d %lld\n", i, findx(i));
			ans = (ans + findx(i)) % mod;
		}
		return ans;
	} else {
		i64 p[5];
		for (int i = 0; i <= 4; i++) p[i] = findx(l + i);
		if (interpol(p, 4, r - l) == findx(r) && interpol(p, 4, r - l - 1) == findx(r - 1)) {
			for (int i = 1; i <= 4; i++) p[i] = (p[i - 1] + p[i]) % mod;
			return interpol(p, 4, r - l);
		} else {
			int mid = (l + r) / 2;
			return (solves(l, mid, op) + solves(mid + 1, r, op)) % mod;
		}
	}
}

i64 solve2d(int lx, int ly, int d00, int d01, int d10, int d11) {
	if (lx > ly) swap(lx, ly), swap(d01, d10);
	calc op = (calc) {d00, d01, d10, d11, ly};
	return solves(0, lx - 1, op);
}

i64 solve(int px, int qx, int py, int qy) {
	i64 d[10];
	d[0] = finddist(px, py);
	d[1] = finddist(px, qy);
	d[2] = finddist(qx, py);
	d[3] = finddist(qx, qy);
	int cnt = 0;
	for (int i = 0; i < 4; i++) cnt += (d[0] > t);
	assert(cnt == 0 || cnt == 4);
	if (cnt == 4) return 0;
	return solve2d(qx - px + 1, qy - py + 1, d[0], d[1], d[2], d[3]);
}

int main() {
	init(100);
//	i64 ff[]={1,3,6,10};
	scanf("%d%d", &n, &t);
//	n = 50; t = 100000000;
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);
//		x[i] = rand() % 200000001 - 100000000;
//		y[i] = rand() % 200000001 - 100000000;
		row.push_back(x[i] - t);
		row.push_back(x[i]);
		row.push_back(x[i] + 1);
		row.push_back(x[i] + 1 + t);
		col.push_back(y[i] - t);
		col.push_back(y[i]);
		col.push_back(y[i] + 1);
		col.push_back(y[i] + 1 + t);
	}
	sort(row.begin(), row.end());
	row.erase(unique(row.begin(), row.end()), row.end());
	sort(col.begin(), col.end());
	col.erase(unique(col.begin(), col.end()), col.end());
	i64 ans = 0;
	for (int i = 0; i + 1 < row.size(); i++) {
		for (int j = 0; j + 1 < col.size(); j++) {
			ans = (ans + solve(row[i], row[i + 1] - 1, col[j], col[j + 1] - 1)) % mod;
//			printf("aaa %d %d %d %d %d %d %lld\n", i, j, row[i], row[i + 1] - 1, col[j], col[j + 1] - 1, solve(row[i], row[i + 1] - 1, col[j], col[j + 1] - 1));
		}
	}
	printf("%lld\n", ans);
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

const i64 mod = 998244353;
const int maxN = 2234;

int n, t, x[maxN], y[maxN];
vector<int> row, col;

i64 inv[maxN], invfac[maxN];

void init(int deg) {
	invfac[0] = 1;
	invfac[1] = 1;
	inv[1] = 1;
	for (int i = 2; i <= deg; i++) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
		invfac[i] = invfac[i - 1] * inv[i] % mod;
	}
}

i64 interpol(i64 *p, int deg, i64 x) {
	i64 mul1[10], mul2[10];
	mul1[0] = 1;
	mul2[0] = 1;
	for (int i = 0; i <= deg; i++) {
		mul1[i + 1] = mul1[i] * (x - i) % mod;
		mul2[i + 1] = mul2[i] * (x - deg + i) % mod;
	}

	i64 ans = 0;
	for (int i = 0; i <= deg; i++) {
		i64 t = invfac[i] * invfac[deg - i] % mod * mul1[i] % mod * mul2[deg - i] % mod * p[i] % mod;
		if ((deg - i) & 1) ans = ans - t;
		else ans = ans + t;
	}
	ans = ans % mod;
	if (ans < 0) ans += mod;
	return ans;

}

vector<vector<int>> seg[123];
int cnt[123];
i64 len[123];
i64 solvet(int t) {
	vector<int> row, col;
	for (int i = 0; i < n; i++) {
		row.push_back(x[i] - t);
		row.push_back(x[i] + t + 1);
		col.push_back(y[i] - t);
		col.push_back(y[i] + t + 1);
	}
	sort(row.begin(), row.end());
	row.erase(unique(row.begin(), row.end()), row.end());
	sort(col.begin(), col.end());
	col.erase(unique(col.begin(), col.end()), col.end());
	int r = row.size(), c = col.size();
	for (int i = 0; i < r; i++) seg[i].clear();
	for (int j = 0; j + 1 < c; j++) {
		cnt[j] = 0;
		len[j] = col[j + 1] - col[j];
	}
	for (int i = 0; i < n; i++) {
		int px = lower_bound(row.begin(), row.end(), x[i] - t) - row.begin();
		int qx = lower_bound(row.begin(), row.end(), x[i] + t + 1) - row.begin();
		int py = lower_bound(col.begin(), col.end(), y[i] - t) - col.begin();
		int qy = lower_bound(col.begin(), col.end(), y[i] + t + 1) - col.begin();
		seg[px].push_back(vector<int> {py, qy, 1});
		seg[qx].push_back(vector<int> {py, qy, -1});
	}
	i64 ans = 0;
	for (int i = 0; i + 1 < r; i++) {
		for (auto p : seg[i]) {
			for (int j = p[0]; j < p[1]; j++) {
				cnt[j] += p[2];
			}
		}
		i64 rlen = row[i + 1] - row[i];
		for (int j = 0; j + 1 < c; j++)
			if (cnt[j] > 0) ans = ans + len[j] * rlen;
	}
	return ans;
}

vector<int> v;

i64 solve(int t1, int t2) {
	i64 d[10];
	for (int i = 0; i <= 3; i++) {
		d[i] = solvet(t1 + i) % mod;
	}
	for (int i = 1; i <= 3; i++) d[i] = (d[i - 1] + d[i]) % mod;
	return interpol(d, 3, t2 - t1);
}

int main() {
	init(100);
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);
	}
	v.push_back(0);
	v.push_back(t);
	for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) {
			int d = (abs(x[i] - x[j]) + abs(y[i] - y[j])) / 2;
			if (d < t) v.push_back(d);
		}
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	i64 ans = (solvet(t) % mod * (t + 1) - solvet(0)) % mod;
	for (int i = 0; i + 1 < v.size(); i++) {
		ans = (ans - solve(v[i] + 1, v[i + 1])) % mod;
	}
	if (ans < 0) ans += mod;
	printf("%lld\n", ans);
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

const i64 mod = 998244353;
const int maxN = 2234;

int n, t, x[maxN], y[maxN];
vector<int> row, col;

int finddist(int px, int py) {
	int ans = t + 1;
	for (int i = 0; i < n; i++)
		ans = min(ans, max(abs(px - x[i]), abs(py - y[i])));
	return ans;
}

i64 finds(i64 p, i64 q) {
	if (p > q) return 0;
	return (p + q) * (q - p + 1) / 2 % mod;
}

i64 solverow(i64 len, i64 c1, i64 c2) {
	// c1 + i <= c2 + len - 1 - i
	int md = (c2 + len - 1 - c1) / 2;
	return (finds(c1, c1 + md) + finds(c2, c2 + len - 2 - md)) % mod;
}

i64 inv[maxN], invfac[maxN];

void init(int deg) {
	invfac[0] = 1;
	invfac[1] = 1;
	inv[1] = 1;
	for (int i = 2; i <= deg; i++) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
		invfac[i] = invfac[i - 1] * inv[i] % mod;
	}
}

i64 interpol(i64 *p, int deg, i64 x) {
	if (x <= deg) return p[deg];
	i64 mul1[10], mul2[10];
	mul1[0] = 1;
	mul2[0] = 1;
	for (int i = 0; i <= deg; i++) {
		mul1[i + 1] = mul1[i] * (x - i) % mod;
		mul2[i + 1] = mul2[i] * (x - deg + i) % mod;
	}

	i64 ans = 0;
	for (int i = 0; i <= deg; i++) {
		i64 t = invfac[i] * invfac[deg - i] % mod * mul1[i] % mod * mul2[deg - i] % mod * p[i] % mod;
		if ((deg - i) & 1) ans = ans - t;
		else ans = ans + t;
	}
	ans = ans % mod;
	if (ans < 0) ans += mod;
	return ans;

}

struct calc {
	int d00, d01, d10, d11, ly;
	int findl(int x) {
		return min(d00 + x, d10 + ly - 1 - x);
	}
	int findr(int x) {
		return min(d01 + x, d11 + ly - 1 - x);
	}
};

i64 solves(int l, int r, calc & op) {
//	printf("ss %d %d\n", l, r);
	auto findx = [&](int x) {
		return solverow(op.ly, op.findl(x), op.findr(x));
	};
	if (r - l <= 10) {
		i64 ans = 0;
		for (int i = l; i <= r; i++)
			ans = (ans + findx(i)) % mod;
		return ans;
	} else {
		i64 p[5];
		for (int i = 0; i <= 4; i++) p[i] = findx(l + i);
		if (interpol(p, 4, r - l) == findx(r) && interpol(p, 4, r - l - 1) == findx(r - 1)) {
			for (int i = 1; i <= 4; i++) p[i] = (p[i - 1] + p[i]) % mod;
			return interpol(p, 4, r - l);
		} else {
			int mid = (l + r) / 2;
			return (solves(l, mid, op) + solves(mid + 1, r, op)) % mod;
		}
	}
}

i64 solve2d(int lx, int ly, int d00, int d01, int d10, int d11) {
	if (lx > ly) swap(lx, ly), swap(d01, d10);
	calc op = (calc) {d00, d01, d10, d11, ly};
	return solves(0, lx - 1, op);
}

i64 solve(int px, int qx, int py, int qy) {
	i64 d[10];
	d[0] = finddist(px, py);
	d[1] = finddist(px, qy);
	d[2] = finddist(qx, py);
	d[3] = finddist(qx, qy);
	int cnt = 0;
	for (int i = 0; i < 4; i++) cnt += (d[0] > t);
	assert(cnt == 0 || cnt == 4);
	if (cnt == 4) return 0;
	return solve2d(qx - px + 1, qy - py + 1, d[0], d[1], d[2], d[3]);
}

int main() {
	init(100);
//	i64 ff[]={1,3,6,10};
	scanf("%d%d", &n, &t);
//	n = 50; t = 100000000;
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);
//		x[i] = rand() % 200000001 - 100000000;
//		y[i] = rand() % 200000001 - 100000000;
		row.push_back(x[i] - t);
		row.push_back(x[i]);
		row.push_back(x[i] + 1);
		row.push_back(x[i] + 1 + t);
		col.push_back(y[i] - t);
		col.push_back(y[i]);
		col.push_back(y[i] + 1);
		col.push_back(y[i] + 1 + t);
	}
	sort(row.begin(), row.end());
	row.erase(unique(row.begin(), row.end()), row.end());
	sort(col.begin(), col.end());
	col.erase(unique(col.begin(), col.end()), col.end());
	i64 ans = 0;
	for (int i = 0; i + 1 < row.size(); i++) {
		for (int j = 0; j + 1 < col.size(); j++) {
			ans = (ans + solve(row[i], row[i + 1] - 1, col[j], col[j + 1] - 1)) % mod;
//			printf("faq %d %d %d %d %d %d %lld\n", i, j, row[i], row[i + 1] - 1, col[j], col[j + 1] - 1, solve(row[i], row[i + 1] - 1, col[j], col[j + 1] - 1));
		}
	}
	printf("%lld\n", ans);
}

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;

const i64 mod = 998244353;
const int maxN = 2234;

int n, t, x[maxN], y[maxN];
vector<int> row, col;

i64 inv[maxN], invfac[maxN];

void init(int deg) {
	invfac[0] = 1;
	invfac[1] = 1;
	inv[1] = 1;
	for (int i = 2; i <= deg; i++) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
		invfac[i] = invfac[i - 1] * inv[i] % mod;
	}
}

i64 interpol(i64 *p, int deg, i64 x) {
	i64 mul1[10], mul2[10];
	mul1[0] = 1;
	mul2[0] = 1;
	for (int i = 0; i <= deg; i++) {
		mul1[i + 1] = mul1[i] * (x - i) % mod;
		mul2[i + 1] = mul2[i] * (x - deg + i) % mod;
	}

	i64 ans = 0;
	for (int i = 0; i <= deg; i++) {
		i64 t = invfac[i] * invfac[deg - i] % mod * mul1[i] % mod * mul2[deg - i] % mod * p[i] % mod;
		if ((deg - i) & 1) ans = ans - t;
		else ans = ans + t;
	}
	ans = ans % mod;
	if (ans < 0) ans += mod;
	return ans;

}

vector<vector<int>> seg[123];
int cnt[123];
i64 len[123];
i64 solvet(int t) {
	vector<int> row, col;
	for (int i = 0; i < n; i++) {
		row.push_back(x[i] - t);
		row.push_back(x[i] + t + 1);
		col.push_back(y[i] - t);
		col.push_back(y[i] + t + 1);
	}
	sort(row.begin(), row.end());
	row.erase(unique(row.begin(), row.end()), row.end());
	sort(col.begin(), col.end());
	col.erase(unique(col.begin(), col.end()), col.end());
	int r = row.size(), c = col.size();
	for (int i = 0; i < r; i++) seg[i].clear();
	for (int j = 0; j + 1 < c; j++) {
		cnt[j] = 0;
		len[j] = col[j + 1] - col[j];
	}
	for (int i = 0; i < n; i++) {
		int px = lower_bound(row.begin(), row.end(), x[i] - t) - row.begin();
		int qx = lower_bound(row.begin(), row.end(), x[i] + t + 1) - row.begin();
		int py = lower_bound(col.begin(), col.end(), y[i] - t) - col.begin();
		int qy = lower_bound(col.begin(), col.end(), y[i] + t + 1) - col.begin();
		seg[px].push_back(vector<int> {py, qy, 1});
		seg[qx].push_back(vector<int> {py, qy, -1});
	}
	i64 ans = 0;
	for (int i = 0; i + 1 < r; i++) {
		for (auto p : seg[i]) {
			for (int j = p[0]; j < p[1]; j++) {
				cnt[j] += p[2];
			}
		}
		i64 rlen = row[i + 1] - row[i];
		for (int j = 0; j + 1 < c; j++)
			if (cnt[j] > 0) ans = ans + len[j] * rlen;
	}
	return ans;
}

vector<int> v;

i64 solve(int t1, int t2) {
	i64 d[10];
	for (int i = 0; i <= 3; i++) {
		d[i] = solvet(t1 + i) % mod;
//		printf("%d %lld\n", t1 + i, d[i]);
	}
	for (int i = 1; i <= 3; i++) d[i] = (d[i - 1] + d[i]) % mod;
	return interpol(d, 3, t2 - t1);
}

int main() {
	init(100);
	scanf("%d%d", &n, &t);
	for (int i = 0; i < n; i++) {
		scanf("%d%d", &x[i], &y[i]);
	}
	v.push_back(0);
	v.push_back(t);
	for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) {
			int d = max(abs(x[i] - x[j]), abs(y[i] - y[j])) / 2;
			if (d < t) v.push_back(d);
		}
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	i64 ans = (solvet(t) % mod * (t + 1) - solvet(0)) % mod;
	for (int i = 0; i + 1 < v.size(); i++) {
		ans = (ans - solve(v[i] + 1, v[i + 1])) % mod;
	}
	if (ans < 0) ans += mod;
	printf("%lld\n", ans);
}

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define SZ 666666
#define yn yyn
int n,t,x[SZ],y[SZ];
int ys[SZ],yn;
pair<int,pair<pii,int> > os[SZ]; int on;
const int M=128;
pii operator + (pii a,pii b)
{
	if(a.fi<b.fi) return a;
	if(b.fi<a.fi) return b;
	return pii(a.fi,a.se+b.se);
}
pii seg[SZ]; int tg[SZ],ls[SZ],rs[SZ];
void pd(int x)
{
	if(!tg[x]) return;
	seg[x].fi+=tg[x];
	if(x<=M)
		tg[x+x]+=tg[x],tg[x+x+1]+=tg[x];
	tg[x]=0;
}
void upd(int x)
{
	pd(x+x); pd(x+x+1);
	seg[x]=seg[x+x]+seg[x+x+1];
}
void edt(int x,int l,int r,int v)
{
	if(l>r||rs[x]<l||r<ls[x]) return;
	pd(x);
	if(l<=ls[x]&&rs[x]<=r)
	{
		tg[x]+=v; return;
	}
	edt(x+x,l,r,v);
	edt(x+x+1,l,r,v);
	upd(x);
}
map<int,ll> rss;
ll calc(int s)
{
	if(rss.count(s)) return rss[s];
	yn=0;
	for(int i=1;i<=n;++i)
		ys[++yn]=y[i]-s,ys[++yn]=y[i]+s+1;
	sort(ys+1,ys+1+yn); yn=unique(ys+1,ys+1+yn)-ys-1;
	int tot=ys[yn]-ys[1]; on=0;
	for(int i=1;i<=n;++i)
	{
		int L=lower_bound(ys+1,ys+1+yn,y[i]-s)-ys,
		R=lower_bound(ys+1,ys+1+yn,y[i]+s+1)-ys;
		os[++on]=mp(x[i]-s,mp(pii(L,R-1),1));
		os[++on]=mp(x[i]+s+1,mp(pii(L,R-1),-1));
	}
	sort(os+1,os+1+on);
	for(int i=1;i<=M+M;++i) seg[i]=pii(0,0),tg[i]=0;
	for(int i=1;i<yn;++i) seg[i+M]=pii(0,ys[i+1]-ys[i]);
	for(int i=M-1;i>=1;--i) seg[i]=seg[i+i]+seg[i+i+1];
	ll ans=0;
	for(int i=1;i<=on;++i)
		edt(1,os[i].se.fi.fi,os[i].se.fi.se,os[i].se.se),
		ans+=(tot-seg[1].se)*ll(os[i+1].fi-os[i].fi);
	return rss[s]=ans;
}
ll cd(int s)
{
	return calc(s)-calc(s-1);
}
const int MOD=998244353;
ll S1(ll x)
{return x*(x+1)/2%MOD;}
ll S2(ll x)
{
	ll t[]={x,x+1,2*x+1};
	for(int i=0;i<3;++i)
		if(t[i]%2==0) {t[i]/=2; break;}
	for(int i=0;i<3;++i)
		if(t[i]%3==0) {t[i]/=3; break;}
	return t[0]*(ll)t[1]%MOD*t[2]%MOD;
}
int main()
{
	for(int i=1;i<=M;++i) ls[i+M]=rs[i+M]=i;
	for(int i=M-1;i>=1;--i) ls[i]=ls[i+i],rs[i]=rs[i+i+1];
	cin>>n>>t;
	for(int i=1;i<=n;++i)
		cin>>x[i]>>y[i];
//	ll ans=0;
//	for(int i=1;i<=t;++i) ans+=cd(i)*i;
//	cout<<ans<<"\n";
	ll L=1,ans=0;
	while(L<=t)
	{
		if(L==t)
		{
			ans+=cd(L)%MOD*L;
			ans%=MOD;
			break;
		}
		ll u=cd(L+1)-cd(L);
		ll l=L+1,r=t;
		while(l<r)
		{
			ll m=(l+r+1)>>1;
			if(cd(m)-cd(m-1)!=u)
				r=m-1;
			else l=m;
		}
		ll b=cd(L),n=l-L;
		b%=MOD; u%=MOD;
		//(b+u*i)*(i+L)  i in [0,n]
		ans+=S2(n)*u+S1(n)*((u*L+b)%MOD)+L*b%MOD*(n+1);
		ans%=MOD;
		L=l+1;
	}
	ans=(ans%MOD+MOD)%MOD;
	cout<<ans<<"\n";
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(a) int(a.size())
#define clr(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int mod=998244353;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
string to_string(string s) { return '"'+s+'"'; }
string to_string(const char *s) { return to_string((string)s); }
template<typename A,typename B> string to_string(pair<A,B> p) {
    return "("+to_string(p.fi)+","+to_string(p.se)+")";
}
template<typename T> string to_string(T v) {
    int fst=1;string ret="{";
    for(auto x:v) {
        if(!fst) ret+=",";
        fst=0,ret+=to_string(x);
    }
    ret+="}";return ret;
}
void dbg_out() { cerr<<endl; }
template<typename Head,typename... Tail> void dbg_out(Head H,Tail... T) {
    cerr<<" "<<to_string(H);
    dbg_out(T...);
}
#define dbg(...) cerr<<"{"<<#__VA_ARGS__<<"}:",dbg_out(__VA_ARGS__)

const int N=120;

int n,t,x[N],y[N],sx[N],sy[N],tx=0,ty=0;

int qpow(int a,int b) {
    int ret=1;
    while(b) {
        if(b&1) ret=1ll*ret*a%mod;
        a=1ll*a*a%mod,b>>=1;
    }
    return ret;
}

int find(int *s,int t,int x) {
    return lower_bound(s+1,s+t+1,x)-s;
}

vector<pii> ins[N],del[N];
int cov[N];

int f(int t) {
    tx=ty=0;
    for(int i=1;i<=n;i++) {
        int x1=x[i]-t,x2=x[i]+t+1,y1=y[i]-t,y2=y[i]+t+1;
        sx[++tx]=x1,sx[++tx]=x2,sy[++ty]=y1,sy[++ty]=y2;
    }
    sort(sx+1,sx+tx+1);tx=unique(sx+1,sx+tx+1)-sx-1;
    sort(sy+1,sy+ty+1);ty=unique(sy+1,sy+ty+1)-sy-1;
    for(int i=1;i<=ty;i++) ins[i].clear(),del[i].clear();
    for(int i=1;i<=n;i++) {
        int x1=x[i]-t,x2=x[i]+t+1,y1=y[i]-t,y2=y[i]+t+1;
        x1=find(sx,tx,x1),x2=find(sx,tx,x2);
        y1=find(sy,ty,y1),y2=find(sy,ty,y2);
        ins[y1].pb(mp(x1,x2));del[y2].pb(mp(x1,x2));
    }
    memset(cov,0,sizeof(cov));
    int ret=0;
    for(int i=1;i<=ty;i++) {
        if(i>1) {
            int sum=0;
            for(int j=1;j<tx;j++) if(cov[j]) inc(sum,sub(sx[j+1],sx[j]));
            inc(ret,1ll*sum*(sy[i]-sy[i-1])%mod);
        }
        for(auto x:ins[i])
            for(int j=x.fi;j<x.se;j++) ++cov[j];
        for(auto x:del[i])
            for(int j=x.fi;j<x.se;j++) --cov[j];
    }
    return ret;
}

int ip(int *a,int d,int s,int x) {
    //d-deg poly
    //x=s,s+1,..,s+d
    //y=a_0,a_1,...,a_d
    int ret=0;
    for(int i=0;i<=d;i++) {
        int c=1;
        for(int j=0;j<=d;j++) if(i!=j) c=1ll*c*(x-(s+j))%mod*qpow(i-j,mod-2)%mod;
        inc(ret,1ll*c*a[i]%mod);
    }
    return ret;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
#endif
    n=gi(),t=gi();
    for(int i=1;i<=n;i++) x[i]=gi(),y[i]=gi();
    //dbg(f(0));return 0;
    vector<int> sec;
    sec.pb(0);sec.pb(t);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++) {
            int u=(max(abs(x[i]-y[i]),abs(x[j]-y[j]))-1)/2+1;
            if(u<=t) sec.pb(u);
        }
    sort(all(sec));
    sec.erase(unique(all(sec)),sec.end());
    int ans=1ll*t*f(t)%mod;
    for(int i=0;i<sz(sec)-1;i++) {
        int l=sec[i],r=sec[i+1]-1;
        if(r-l+1<=5) {
            for(int j=l;j<=r;j++) dec(ans,f(j));
        }
        else {
            int a[10];
            a[0]=f(l);
            for(int j=1;j<=3;j++) a[j]=add(a[j-1],f(l+j));
            dec(ans,sub(ip(a,3,l,r),ip(a,3,l,l-1)));
        }
    }
    //for(int i=0;i<=t;i++) dbg(i,f(i));
    printf("%d\n",ans);
    return 0;
}

#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(a) int(a.size())
#define clr(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int mod=998244353;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
string to_string(string s) { return '"'+s+'"'; }
string to_string(const char *s) { return to_string((string)s); }
template<typename A,typename B> string to_string(pair<A,B> p) {
    return "("+to_string(p.fi)+","+to_string(p.se)+")";
}
template<typename T> string to_string(T v) {
    int fst=1;string ret="{";
    for(auto x:v) {
        if(!fst) ret+=",";
        fst=0,ret+=to_string(x);
    }
    ret+="}";return ret;
}
void dbg_out() { cerr<<endl; }
template<typename Head,typename... Tail> void dbg_out(Head H,Tail... T) {
    cerr<<" "<<to_string(H);
    dbg_out(T...);
}
#define dbg(...) cerr<<"{"<<#__VA_ARGS__<<"}:",dbg_out(__VA_ARGS__)

const int N=120;

int n,t,x[N],y[N],sx[N],sy[N],tx=0,ty=0;

int qpow(int a,int b) {
    int ret=1;
    while(b) {
        if(b&1) ret=1ll*ret*a%mod;
        a=1ll*a*a%mod,b>>=1;
    }
    return ret;
}

int find(int *s,int t,int x) {
    return lower_bound(s+1,s+t+1,x)-s;
}

vector<pii> ins[N],del[N];
int cov[N];

int f(int t) {
    tx=ty=0;
    for(int i=1;i<=n;i++) {
        int x1=x[i]-t,x2=x[i]+t+1,y1=y[i]-t,y2=y[i]+t+1;
        sx[++tx]=x1,sx[++tx]=x2,sy[++ty]=y1,sy[++ty]=y2;
    }
    sort(sx+1,sx+tx+1);tx=unique(sx+1,sx+tx+1)-sx-1;
    sort(sy+1,sy+ty+1);ty=unique(sy+1,sy+ty+1)-sy-1;
    for(int i=1;i<=ty;i++) ins[i].clear(),del[i].clear();
    for(int i=1;i<=n;i++) {
        int x1=x[i]-t,x2=x[i]+t+1,y1=y[i]-t,y2=y[i]+t+1;
        x1=find(sx,tx,x1),x2=find(sx,tx,x2);
        y1=find(sy,ty,y1),y2=find(sy,ty,y2);
        ins[y1].pb(mp(x1,x2));del[y2].pb(mp(x1,x2));
    }
    memset(cov,0,sizeof(cov));
    int ret=0;
    for(int i=1;i<=ty;i++) {
        if(i>1) {
            int sum=0;
            for(int j=1;j<tx;j++) if(cov[j]) inc(sum,sub(sx[j+1],sx[j]));
            inc(ret,1ll*sum*sub(sy[i],sy[i-1])%mod);
        }
        for(auto x:ins[i])
            for(int j=x.fi;j<x.se;j++) ++cov[j];
        for(auto x:del[i])
            for(int j=x.fi;j<x.se;j++) --cov[j];
    }
    return ret;
}

int ip(int *a,int d,int s,int x) {
    //d-deg poly
    //x=s,s+1,..,s+d
    //y=a_0,a_1,...,a_d
    int ret=0;
    for(int i=0;i<=d;i++) {
        int c=1;
        for(int j=0;j<=d;j++) if(i!=j) c=1ll*c*(sub(x,add(s,j)))%mod*qpow(i-j,mod-2)%mod;
        inc(ret,1ll*c*a[i]%mod);
    }
    return ret;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
#endif
    n=gi(),t=gi();
    for(int i=1;i<=n;i++) x[i]=gi(),y[i]=gi();
    //dbg(f(0));return 0;
    vector<int> sec;
    sec.pb(0);sec.pb(t);
    for(int i=1;i<=n;i++)
        for(int j=i+1;j<=n;j++) {
            int u=(max(abs(x[i]-y[i]),abs(x[j]-y[j]))-1)/2+1;
            if(u<=t) sec.pb(u);
        }
    sort(all(sec));
    sec.erase(unique(all(sec)),sec.end());
    int ans=1ll*t*f(t)%mod;
    for(int i=0;i<sz(sec)-1;i++) {
        int l=sec[i],r=sec[i+1]-1;
        if(r-l+1<=5) {
            for(int j=l;j<=r;j++) dec(ans,f(j));
        }
        else {
            int a[10];
            a[0]=f(l);
            for(int j=1;j<=3;j++) a[j]=add(a[j-1],f(l+j));
            dec(ans,sub(ip(a,3,l,r),ip(a,3,l,l-1)));
        }
    }
    //for(int i=0;i<=t;i++) dbg(i,f(i));
    printf("%d\n",ans);
    return 0;
}

#include <bits/stdc++.h>
#define FR first
#define SE second
#define last last2
#define inf 0x3f3f3f3f
#define MOD 998244353
#define inv2 499122177
#define inv6 166374059

using namespace std;

typedef long long ll;
typedef pair<int,int> pr;

pr p[55];

int calc(int T,int n) {
  static pr a[105],b[205];
  int tot=0;
  for(int i=1;i<=n;i++) {
  	a[++tot]=pr(p[i].FR-T,i);
  	a[++tot]=pr(p[i].FR+T+1,-i);
  }
  sort(a+1,a+tot+1);
  int ans=0,cnt=0;
  for(int i=1,j=0;i<=tot;i=j+1) {
  	while (a[j+1].FR==a[i].FR) j++;
  	for(int k=i;k<=j;k++) {
  		int t=abs(a[k].SE);
  		if (a[k].SE>0) {
  			b[++cnt]=pr(p[t].SE-T,1);
  			b[++cnt]=pr(p[t].SE+T+1,-1);
		  }
		else {
			b[++cnt]=pr(p[t].SE-T,-1);
			b[++cnt]=pr(p[t].SE+T+1,1);
		}
	  }
	sort(b+1,b+cnt+1);
	int s=0,val=0;
	for(int k=1;k<=cnt;k++) {
		if (val) s+=b[k].FR-b[k-1].FR;
		val+=b[k].SE;
	}
	ans=(ans+(ll)s*(a[j+1].FR-a[i].FR))%MOD;
  }
  return ans;
}

inline ll S1(ll n) {
  return n*(n+1)%MOD*inv2%MOD;
}

inline ll S2(ll n) {
  return n*(n+1)%MOD*(2LL*n+1)%MOD*inv6%MOD;
}

int getsum(int l,int r,int n) {
  if (r-l<3) {
  	int ans=0;
  	for(int i=l;i<=r;i++) ans=(ans+calc(i,n))%MOD;
  	return ans;
  }
  else {
  	ll s1=calc(l,n),s2=calc(l+1,n),s3=calc(l+2,n);
  	ll v0=s1,v2=((s3-s1+MOD)*inv2-(s2-s1+MOD)%MOD+MOD)%MOD,v1=((s2-v0-v2)%MOD+MOD)%MOD;
  	return (v0*(r-l+1)+v1*S1(r-l)+v2*S2(r-l))%MOD;
  }
}

int a[2505];

int main() {
  int n,m;
  scanf("%d%d",&n,&m);
  for(int i=1;i<=n;i++) {
  	int x,y;
  	scanf("%d%d",&x,&y);
  	p[i]=pr(x,y);
  }
  int cnt=0;
  a[++cnt]=0;a[++cnt]=m;
  for(int i=1;i<=n;i++)
    for(int j=i+1;j<=n;j++) {
    	int x=max((abs(p[i].FR-p[j].FR)+1)>>1,(abs(p[i].SE-p[j].SE)+1)>>1);
    	if (x<m) a[++cnt]=x;
	}
  sort(a+1,a+cnt+1);
  cnt=unique(a+1,a+cnt+1)-a-1;
  int ans=(ll)m*calc(m,n)%MOD;
  for(int i=1;i<cnt;i++) ans=(ans-getsum(a[i],a[i+1]-1,n)+MOD)%MOD;
  printf("%d\n",ans);
  return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>&a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calc(int t){
	vpint qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int cur=0;

	vint ex(N);
	int pre=0;
	mint sum;
	while(cur<qs.size()){
		vpint lis;
		rep(i,N)if(ex[i]){
			lis.pb({Y[i]-t,Y[i]+t+1});
		}
		sort(all(lis));
		vpint lis2;
		for(auto p:lis){
			if(lis2.size()==0||lis2.back().se<p.fi)lis2.pb(p);
			else lis2.back().se=p.se;
		}
		mint s;
		for(auto p:lis2)s+=mint(p.se-p.fi);
		sum+=s*(qs[cur].fi-pre);

		pre=qs[cur].fi;
		int nex=cur;
		while(nex<qs.size()&&qs[nex].fi==qs[cur].fi){
			if(qs[nex].se%2){
				ex[qs[nex].se/2]=0;
			}
			else{
				ex[qs[nex].se/2]=1;
			}
			nex++;
		}
		cur=nex;
	}
	return sum;
}

vector<mint>lag(vector<mint>x,vector<mint>y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	vint ts;
	ts.pb(0);
	ts.pb(T);
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			int t=ma/2+1;
			if(t>T)continue;
			ts.pb(t);
		}
	}
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	mint ans;

	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		if(r-l<=2){
			for(int j=l;j<r;j++)ans-=calc(j);
			continue;
		}
		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calc(l+j);
		}
		vector<mint>p(3);
		for(int j=0;j<3;j++){
			vector<mint>pp=lag(x,y);
			rep(k,3)p[k]+=pp[k];
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}

		if(p[0]+p[1]*l+p[2]*l*l!=y[0])assert(0);
		if(p[0]+p[1]*(l+1)+p[2]*(l+1)*(l+1)!=y[1])assert(0);
		if(p[0]+p[1]*(l+2)+p[2]*(l+2)*(l+2)!=y[2])assert(0);

		ans-=p[0]*(r-l);
		ans-=p[1]*(mint(r-1)*r/2-mint(l-1)*l/2);
		ans-=p[2]*(mint(r-1)*r*(2*r-1)/6-mint(l-1)*l*(2*l-1)/6);
	}
	ans+=calc(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>&a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calc(int t){
	vpint qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int cur=0;

	vint ex(N);
	int pre=0;
	mint sum;
	while(cur<qs.size()){
		vpint lis;
		rep(i,N)if(ex[i]){
			lis.pb({Y[i]-t,Y[i]+t+1});
		}
		sort(all(lis));
		vpint lis2;
		for(auto p:lis){
			if(lis2.size()==0||lis2.back().se<p.fi)lis2.pb(p);
			else lis2.back().se=p.se;
		}
		mint s;
		for(auto p:lis2)s+=mint(p.se-p.fi);
		sum+=s*(qs[cur].fi-pre);

		pre=qs[cur].fi;
		int nex=cur;
		while(nex<qs.size()&&qs[nex].fi==qs[cur].fi){
			if(qs[nex].se%2){
				ex[qs[nex].se/2]=0;
			}
			else{
				ex[qs[nex].se/2]=1;
			}
			nex++;
		}
		cur=nex;
	}
	return sum;
}

vector<mint>lag(vector<mint>x,vector<mint>y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	vint ts;
	ts.pb(0);
	ts.pb(T);
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			int t=ma/2+1;
			if(t>T)continue;
			ts.pb(t);
		}
	}
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	mint ans;

	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		if(r-l<=2){
			for(int j=l;j<r;j++)ans-=calc(j);
			continue;
		}

		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calc(l+j);
		}
		vector<mint>p(3);
		for(int j=0;j<3;j++){
			vector<mint>pp=lag(x,y);
			rep(k,3)p[k]+=pp[k];
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}

		ans-=p[0]*(r-l);
		ans-=p[1]*(mint(r-1)*r/2-mint(l-1)*l/2);
		ans-=p[2]*(mint(r-1)*r*(2*r-1)/6-mint(l-1)*l*(2*l-1)/6);
	}
	ans+=calc(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calc(int t){
	vpint qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int cur=0;

	vint ex(N);
	int pre=0;
	mint sum;
	while(cur<qs.size()){
		vpint lis;
		rep(i,N)if(ex[i]){
			lis.pb({Y[i]-t,Y[i]+t+1});
		}
		sort(all(lis));
		vpint lis2;
		for(auto p:lis){
			if(lis2.size()==0||lis2.back().se<p.fi)lis2.pb(p);
			else lis2.back().se=p.se;
		}
		mint s;
		for(auto p:lis2)s+=mint(p.se-p.fi);
		sum+=s*(qs[cur].fi-pre);

		pre=qs[cur].fi;
		int nex=cur;
		while(nex<qs.size()&&qs[nex].fi==qs[cur].fi){
			if(qs[nex].se%2){
				ex[qs[nex].se/2]=0;
			}
			else{
				ex[qs[nex].se/2]=1;
			}
			nex++;
		}
		cur=nex;
	}
	return sum;
}

vector<mint>lag(vector<mint>x,vector<mint>y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2]*b;
	ret[1]=-(x[1]+x[2])*b;
	ret[2]=b;
	rep(i,3)ret[i]*=y[i];
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	vint ts;
	ts.pb(0);
	ts.pb(T);
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			int t=ma/2+1;
			if(t>T)continue;
			ts.pb(t);
		}
	}
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	mint ans;
	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		if(r-l<=2){
			for(int j=l;j<r;j++)ans-=calc(j);
			continue;
		}

		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calc(l+j);
		}
		vector<mint>p(3);
		for(int j=0;j<3;j++){
			vector<mint>pp=lag(x,y);
			rep(k,3)p[k]+=pp[k];
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		ans-=p[0]*(r-l);
		ans-=p[1]*(mint(r-1)*r/2-mint(l-1)*l/2);
		ans-=p[2]*(mint(r-1)*r*(2*r-1)/6-mint(l-1)*l*(2*l-1)/6);
	}
	ans+=calc(T)*T;
	cout<<ans.a<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calc(int t){
	vpint qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int cur=0;

	vint ex(N);
	int pre=0;
	mint sum;
	while(cur<qs.size()){
		vpint lis;
		rep(i,N)if(ex[i]){
			lis.pb({Y[i]-t,Y[i]+t+1});
		}
		sort(all(lis));
		vpint lis2;
		for(auto p:lis){
			if(lis2.size()==0||lis2.back().se<p.fi)lis2.pb(p);
			else lis2.back().se=p.se;
		}
		mint s;
		for(auto p:lis2)s+=mint(p.se-p.fi);
		sum+=s*(qs[cur].fi-pre);

		pre=qs[cur].fi;
		int nex=cur;
		while(nex<qs.size()&&qs[nex].fi==qs[cur].fi){
			if(qs[nex].se%2){
				ex[qs[nex].se/2]=0;
			}
			else{
				ex[qs[nex].se/2]=1;
			}
			nex++;
		}
		cur=nex;
	}
	return sum;
}

vector<mint>lag(vector<mint>x,vector<mint>y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2]*b;
	ret[1]=-(x[1]+x[2])*b;
	ret[2]=b;
	rep(i,3)ret[i]*=y[0];
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	vint ts;
	ts.pb(0);
	ts.pb(T);
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			int t=ma/2+1;
			if(t>T)continue;
			ts.pb(t);
		}
	}
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	mint ans;
	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		if(r-l<=2){
			for(int j=l;j<r;j++)ans-=calc(j);
			continue;
		}

		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calc(l+j);
		}
		vector<mint>p(3);
		for(int j=0;j<3;j++){
			vector<mint>pp=lag(x,y);
			rep(k,3)p[k]+=pp[k];
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		ans-=p[0]*(r-l);
		ans-=p[1]*(mint(r-1)*r/2-mint(l-1)*l/2);
		ans-=p[2]*(mint(r-1)*r*(2*r-1)/6-mint(l-1)*l*(2*l-1)/6);
	}
	ans+=calc(T)*T;
	cout<<ans.a<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calc(int t){
	vpint qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int cur=0;

	vint ex(N);
	int pre=0;
	mint sum;
	while(cur<qs.size()){
		vpint lis;
		rep(i,N)if(ex[i]){
			lis.pb({Y[i]-t,Y[i]+t+1});
		}
		sort(all(lis));
		vpint lis2;
		for(auto p:lis){
			if(lis2.size()==0||lis2.back().se<p.fi)lis2.pb(p);
			else lis2.back().se=p.se;
		}
		mint s;
		for(auto p:lis2)s+=mint(p.se-p.fi);
		sum+=s*(qs[cur].fi-pre);

		pre=qs[cur].fi;
		int nex=cur;
		while(nex<qs.size()&&qs[nex].fi==qs[cur].fi){
			if(qs[nex].se%2){
				ex[qs[nex].se/2]=0;
			}
			else{
				ex[qs[nex].se/2]=1;
			}
			nex++;
		}
		cur=nex;
	}
	return sum;
}

vector<mint>lag(vector<mint>x,vector<mint>y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2]*b;
	ret[1]=-(x[1]+x[2])*b;
	ret[2]=b;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	vint ts;
	ts.pb(0);
	ts.pb(T);
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			int t=ma/2+1;
			if(t>T)continue;
			ts.pb(t);
		}
	}
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	mint ans;
	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		if(r-l<=2){
			for(int j=l;j<r;j++)ans-=calc(j);
			continue;
		}

		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calc(l+j);
		}
		vector<mint>p(3);
		for(int j=0;j<3;j++){
			vector<mint>pp=lag(x,y);
			rep(k,3)p[k]+=pp[k];
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}
		ans-=p[0]*(r-l);
		ans-=p[1]*(mint(r-1)*r/2-mint(l-1)*l/2);
		ans-=p[2]*(mint(r-1)*r*(2*r-1)/6-mint(l-1)*l*(2*l-1)/6);
	}
	ans+=calc(T)*T;
	cout<<ans.a<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>&a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calcNumCovered(int t){
	vint ys;
	rep(i,N){
		ys.pb(Y[i]-t);
		ys.pb(Y[i]+t+1);
	}
	sort(all(ys));
	ys.erase(unique(all(ys)),ys.end());

	vector<pint>qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int lastX=0;

	mint ret=0;
	vint num(ys.size());
	rep(i,qs.size()){
		int x=qs[i].fi;
		int k=qs[i].se/2;

		int sum=0;
		for(int j=0;j+1<ys.size();j++)if(num[j])sum+=ys[j+1]-ys[j];
		ret+=mint(sum)*(x-lastX);
		lastX=x;

		int l=lower_bound(all(ys),Y[k]-t)-ys.begin();
		int r=lower_bound(all(ys),Y[k]+t+1)-ys.begin();
		int coef;
		if(qs[i].se&1)coef=-1;
		else coef=1;
		for(int j=l;j<r;j++)num[j]+=coef;
	}
	return ret;
}

vector<mint>lag(vector<mint>&x,vector<mint>&y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}
vector<mint>Lag(vector<mint>&x,vector<mint>&y){
	vector<mint>p(3);
	for(int j=0;j<3;j++){
		vector<mint>pp=lag(x,y);
		rep(k,3)p[k]+=pp[k];
		rotate(x.begin(),x.begin()+1,x.end());
		rotate(y.begin(),y.begin()+1,y.end());
	}
	return p;
}

//sum of p(x) (x=l,...,r-1)
mint calcSum(vector<mint>&p,int l,int r){
	mint ret;
	ret+=p[0]*(r-l);
	ret+=p[1]*(mint(r-1)*r-mint(l-1)*l)/2;
	ret+=p[2]*(mint(r-1)*r*(2*r-1)-mint(l-1)*l*(2*l-1))/6;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	mint ans;

	vint ts;
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]))/2+1;
			if(ma>T)continue;
			ts.pb(ma);
		}
	}
	ts.pb(0);ts.pb(T);
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());
	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calcNumCovered(l+j);
		}
		vector<mint>p=Lag(x,y);

		ans-=calcSum(p,l,r);
	}

	ans+=calcNumCovered(T)*T;
	cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<int64_t mod>struct ModInt{
	int64_t a;
	inline int64_t normalize(int64_t x){
		x%=mod;
		if(x<0)x+=mod;
		return x;
	}
	ModInt(const int64_t a=0):a(normalize(a)){}

	ModInt& operator+=(const ModInt &x){
		a+=x.a;
		if(a>=mod)a-=mod;
		return *this;
	}
	ModInt& operator-=(const ModInt &x){
		a-=x.a;
		if(a<0)a+=mod;
		return *this;
	}
	ModInt& operator*=(const ModInt &x){
		a=a*x.a%mod;
		return *this;
	}
	ModInt& operator/=(const ModInt &x){
		*this*=x.inv();
		return *this;
	}

	ModInt operator+(const ModInt x){return ModInt(*this)+=x;}
	ModInt operator-(const ModInt x){return ModInt(*this)-=x;}
	ModInt operator*(const ModInt x){return ModInt(*this)*=x;}
	ModInt operator/(const ModInt x){return ModInt(*this)/=x;}
	bool operator==(const ModInt x){return a==x.a;}
	bool operator!=(const ModInt x){return a!=x.a;}

	ModInt operator-(){return ModInt(0)-ModInt(*this);}
	ModInt pow(int64_t ex)const{
		int64_t x=a;
		int64_t res=1;
		while(ex){
			if(ex&1)res=res*x%mod;
			x=x*x%mod;
			ex>>=1;
		}
		return ModInt(res);
	}
	ModInt inv()const{return pow(mod-2);}
};

template<int64_t mod>
ostream& operator<<(ostream& out,const ModInt<mod>&a){
	return (out<<a.a);
}

using mint=ModInt<998244353>;

int N,T;
int X[55],Y[55];

mint calc(int t){
	vpint qs;
	rep(i,N){
		qs.pb({X[i]-t,i*2});
		qs.pb({X[i]+t+1,i*2+1});
	}
	sort(all(qs));
	int cur=0;

	vint ex(N);
	int pre=0;
	mint sum;
	while(cur<qs.size()){
		vpint lis;
		rep(i,N)if(ex[i]){
			lis.pb({Y[i]-t,Y[i]+t+1});
		}
		sort(all(lis));
		vpint lis2;
		for(auto p:lis){
			if(lis2.size()==0||lis2.back().se<p.fi)lis2.pb(p);
			else lis2.back().se=p.se;
		}
		mint s;
		for(auto p:lis2)s+=mint(p.se-p.fi);
		sum+=s*(qs[cur].fi-pre);

		pre=qs[cur].fi;
		int nex=cur;
		while(nex<qs.size()&&qs[nex].fi==qs[cur].fi){
			if(qs[nex].se%2){
				ex[qs[nex].se/2]=0;
			}
			else{
				ex[qs[nex].se/2]=1;
			}
			nex++;
		}
		cur=nex;
	}
	return sum;
}

vector<mint>lag(vector<mint>x,vector<mint>y){
	vector<mint>ret(3);
	mint b=(x[0]-x[1])*(x[0]-x[2]);
	b=b.inv();

	ret[0]=x[1]*x[2];
	ret[1]=-(x[1]+x[2]);
	ret[2]=1;
	rep(i,3)ret[i]*=y[0]*b;
	return ret;
}

signed main(){
	cin>>N>>T;
	rep(i,N)cin>>X[i]>>Y[i];

	vint ts;
	ts.pb(0);
	ts.pb(T);
	for(int i=0;i<N;i++){
		for(int j=i+1;j<N;j++){
			int ma=max(abs(X[i]-X[j]),abs(Y[i]-Y[j]));
			int t=ma/2+1;
			if(t>T)continue;
			ts.pb(t);
		}
	}
	sort(all(ts));ts.erase(unique(all(ts)),ts.end());

	mint ans;

	for(int i=0;i+1<ts.size();i++){
		int l=ts[i];
		int r=ts[i+1];

		if(r-l<=2){
			for(int j=l;j<r;j++)ans-=calc(j);
			continue;
		}
		vector<mint>x(3),y(3);
		rep(j,3){
			x[j]=mint(l+j);
			y[j]=calc(l+j);
		}
		vector<mint>p(3);
		for(int j=0;j<3;j++){
			vector<mint>pp=lag(x,y);
			rep(k,3)p[k]+=pp[k];
			rotate(x.begin(),x.begin()+1,x.end());
			rotate(y.begin(),y.begin()+1,y.end());
		}

		ans-=p[0]*(r-l);
		ans-=p[1]*(mint(r-1)*r/2-mint(l-1)*l/2);
		ans-=p[2]*(mint(r-1)*r*(2*r-1)/6-mint(l-1)*l*(2*l-1)/6);
	}
	ans+=calc(T)*T;
	cout<<ans<<endl;
}