Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
x=[i for i,_ in z]
y=[j for _,j in z]
x.sort()
y.sort()
a=10**20
for i,l in enumerate(x):
    for r in x[i+1:]:
        for v,d in enumerate(y):
            for u in y[v+1:]:
                if sum([1for i,j in z if l<=i<=r and d<=j<=u])>=k:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
z=[tuple(map(int,input().split()))for _ in range(N)]
x=[i for i,_ in z]
y=[j for _,j in z]
x.sort()
y.sort()
a=10**20
for i in range(N):
    for j in range(i+1,N):
        for k in range(N):
            for l in range(k+1,N):
                l,r,d,u=x[i],x[j],y[k],y[l]
                if sum([1for v,w in z if l<=v<=r and d<=w<=u else 0])>=K:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
z=[tuple(map(int,input().split()))for _ in range(N)]
x=[i for i,_ in z]
y=[j for _,j in z]
x.sort()
y.sort()
a=10**20
for i in range(N):
    for j in range(i+1,N):
        for k in range(N):
            for l in range(k+1,N):
                l,r,d,u=x[i],x[j],y[k],y[l]
                if sum([l<=v<=r and d<=w<=u for v,w in z])>=K:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(N)]
x=[]
y=[]
for i,j in z:
    x.append(i)
    y.append(j)
x.sort()
y.sort()
a=10**20
for i in range(N):
    for j in range(i+1,N):
        for k in range(N):
            for l in range(k+1,N):
                l,r,d,u=x[i],x[j],y[k],y[l]
                if sum([l<=v<=r and d<=w<=u for v,w in z])>=K:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(N)]
x=[]
y=[]
for i,j in z:
    x.append(i)
    y.append(j)
x.sort()
y.sort()
a=10**20
for i in range(N):
    for j in range(i+1,N):
        for k in range(N):
            for l in range(k+1,N):
                l,r,d,u=x[i],x[j],y[k],y[l]
                if sum(l<=v<=r and d<=w<=u for v,w in z)>=K:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import*
n,k=map(int,input().split())
a=10**20
for z in combinations(sorted(list(map(int,input().split()))for _ in range(n)),k):
    y=[j for _,j in z]
    a=min(a,(z[-1][0]-z[0][0])*(max(y)-min(y)))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
x=[]
y=[]
for i,j in z:
    x.append(i)
    y.append(j)
x.sort()
y.sort()
a=10**20
for i,l in enumerate(x):
    for r in x[i+1:]:
        for v,d in enumerate(y):
            for u in y[v+1:]:
                if sum(l<=i<=r and d<=j<=u for i,j in z)>=k:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
x=[]
y=[]
for i,j in z:
    x.append(i)
    y.append(j)
x.sort()
y.sort()
a=10**20
for i,l in enumerate(x):
    for r in x[i+1:]:
        for v,d in enumerate(y):
            for u in y[v+1:]:
                if sum(l<=i<=r and d<=j<=u for i,j in z)>=k:
                    a=min(a,(r-l)*(u-d))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import*
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
x=[]
y=[]
for i,j in z:
    x.append(i)
    y.append(j)
x.sort()
y.sort()
a=10**20
for s,t in combinations(x,2):
    for u,v in combinations(y,2):
        c=sum(s<=i<=t and u<=j<=v for i,j in z)
        if c>=k:
            a=min(a,(t-s)*(v-u))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import*
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
x=[]
y=[]
for i,j in z:
    x.append(i)
    y.append(j)
x.sort()
y.sort()
a=10**20
for s,t in combinations(x,2):
    for u,v in combinations(y,2):
        c=sum(s<=i<=t and u<=j<=v for i,j in z)
        if c>=k:
            a=min(a,(t-s)*(v-u))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import*
n,k=map(int,input().split())
a=10**20
for z in combinations([list(map(int,input().split()))for _ in range(n)],k):
    x=[]
    y=[]
    for i,j in z:
        x.append(i)
        y.append(j)
    a=min(a,(max(x)-min(x))*(max(y)-min(y)))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import*
n,k=map(int,input().split())
a=10**20
for z in combinations([list(map(int,input().split()))for _ in range(n)],k):
    x=[]
    y=[]
    for i,j in z:
        x.append(i)
        y.append(j)
    a=min(a,(max(x)-min(x))*(max(y)-min(y)))
print(a)

Fixed submission:
n,k=map(int,input().split())
z=[list(map(int,input().split()))for _ in range(n)]
z.sort()
a=10**20
for i in range(n):
    for j in range(i+1,n):
        x=z[j][0]-z[i][0]
        l=sorted(t[1]for t in z[i:j+1])
        for u,v in zip(l,l[k-1:]):
            a=min(a,x*(v-u))
print(a)