h,w,n,d=map(int,input().split()) a=[[-1]*w for i in range(h)] s=[] r=list(range(n)) v=[1]*n def union(x,y): rx=root(x) ry=root(y) if rx>ry: rx,ry=ry,rx r[ry]=rx v[rx]+=v[ry] return def root(x): p=x l=[p] while r[p]!=p: p=r[p] l.append(p) for p in l: r[p]=l[-1] return r[x] dxdy=[] for dx in range(-d,d+1): for dy in range(-d,d+1): if 1<=abs(dx)+abs(dy)<=d: dxdy+=[(dx,dy)] for i in range(n): x,y=map(int,input().split()) x-=1 y-=1 a[x][y]=i s+=[(x,y)] for dx,dx in dxdy: xx=x+dx yy=y+dy if 0<=xx1])) g1=g0 g2=g0 for x in range(h): for y in range(w): if a[x][y]==-1: rr=[] f=0 for dx,dy in dxdy: xx=x+dx yy=y+dy if 0<=xx1: rr+=[a[xx][yy]] else: f=1 rr=set(rr) if len(rr)==0: g1=g0+f else: g2=min(g2,g0-len(rr)+1) print(g2,g1)