Harryxun/stf_run huggingface dataset:
from collections import deque
n,d,a=map(int,input().split())
xh=[map(int,input().split()) for _ in range(n)]
xh.sort()
D=2*D
ans=0
total=0
q=deque()
for i in range(n):
  x,h=xh[i]
  while len(q)>=1 and x>q[0][0]:
    total-=q.popleft()[1]
  h-=total
  if h>0:
    num=(h-h%a)//a
    damage=a*nim
    ans+=num
    total+=damage
    q.append([x+D,damage])
print(ans)

### FIXED CODE ###

from collections import deque
n,d,a=map(int,input().split())
xh=[list(map(int,input().split())) for _ in range(n)]
xh.sort()
d=2*d
ans=0
total=0
q=deque()
for i in range(n):
  x,h=xh[i]
  while len(q)>=1 and x>q[0][0]:
    total-=q.popleft()[1]
  h-=total
  if h>0:
    num=(h-1)//a+1
    damage=a*num
    ans+=num
    total+=damage
    q.append([x+d,damage])
print(ans)
def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        if B != 1:
            a.append(A)
            b.append(B)

    ans = b[-1] - a[-1]%b[-1]
    if a[-1]%b[-1] == 0: ans = 0
    
    for i in range(1, len(a)):
        c = a[-(i+1)]+ans
        if c > b[-(i+1)]:
            dis = b[-(i+1)]-c%b[-(i+1)]
            ans += dis
        else:
            dis = b[-(i+1)] - c
            ans += dis

    return max(0, ans)
    

print(solve())


### FIXED CODE ###

def solve():
    n = int(input())
    a = []
    b = []
    for _ in range(n):
        A, B = map(int, input().split())
        a.append(A)
        b.append(B)

    ans = b[-1] - a[-1]%b[-1]
    if a[-1]%b[-1] == 0: ans = 0

    for i in range(1, n):
        c = a[-(i+1)]+ans
        if c%b[-(i+1)] == 0: continue
        
        if c > b[-(i+1)]:
            dis = b[-(i+1)]-c%b[-(i+1)]
            ans += dis
        else:
            dis = b[-(i+1)] - c
            ans += dis

    return max(0, ans)
    

print(solve())
def search():
    for i in range(0,101):
        for j in range(0,101):
            h=l[0][2]+abs(i-l[0][0])+abs(j-l[0][1])
            for a,b,c in l[1:]:
                hi=c+abs(i-a)+abs(j-b)
                if h!=hi:break
            else:
                return [i,j,hi]

l=[list(map(int,input().split())) for i in range(int(input()))]
a,b,c=search()
print(a,b,c)

### FIXED CODE ###

l=[list(map(int,input().split())) for i in range(int(input()))]
l.sort(key=lambda x:x[2])
for i in range(0,101):
    for j in range(0,101):
        h=l[-1][2]+abs(i-l[-1][0])+abs(j-l[-1][1])
        for a,b,c in l[:-1]:
            if c!=max(0,h-abs(i-a)-abs(j-b)):break
        else:
            print(i,j,h)
            exit()
a,b,c = list(map(int, input().split()))
    print(max(0, c-(a-b)))

### FIXED CODE ###

a,b,c = list(map(int, input().split()))
print(max(0, c-(a-b)))
def main():
    n = int(input())
    A = list(map(int, input().split()))
    A.sort()
    D = [True] * (2 * 10**5)
    ans = 0

    for i, a in enumerate(A):
        if not D[a]:
            continue
        if (i < n-1 and a != A[i+1]) or i == n-1:
            ans += 1

        j = a
        while (j < 2 * 10**5):
            D[j] = False
            j += a

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = int(input())
    A = list(map(int, input().split()))
    A.sort()
    D = [True] * (10**6 + 1)
    ans = 0

    for i, a in enumerate(A):
        if not D[a]:
            continue
        if (i < n-1 and a != A[i+1]) or i == n-1:
            ans += 1

        j = a
        while (j < 10**6 + 1):
            D[j] = False
            j += a

    print(ans)


if __name__ == '__main__':
    main()
c.sort()
ans = c[1]-c[0]

for i in range(n-1):
    ans = gcd(ans,c[i+2]-c[i+1])

print(ans)

### FIXED CODE ###

n,x = map(int,input().split())

c = list(map(int,input().split()))
c.append(x)

def gcd(a,b):
    n = max(a,b)
    m = min(a,b)
    if n%m==0:
        return m
    else:
        return gcd(m,n%m)


c.sort()
ans = c[1]-c[0]

for i in range(n-1):
    ans = gcd(ans,c[i+2]-c[i+1])

print(ans)
N, L, T = list(map(int, input().split()))

X = []
W = []
X_after = []
for _ in range(N):
    x, w = list(map(int, input().split()))
    if w == 1:
        x_after = (x + T) % L
    else:
        x_after = (x - T) % L

    if x_after < 0:
        x_after = L + x_after

    X.append(x)
    W.append(w)
    X_after.append(x_after)

n_colide = 0
for i in range(1, N):
    if W[0] == 1 and W[i] == 2:
        dist = X[i] - X[0]
        n_colide += 2 * (T - (dist / 2)) // L + 1
    elif W[0] == 2 and W[i] == 1:
        dist = (L + X[0]) - X[i]
        n_colide += 2 * (T - (dist / 2)) // L + 1

if W[0] == 1:
    num_after = W[0] + (N % n_colide)
else:
    num_after = W[0] - (N % n_colide)
    num_after = num_after if num_after >= 0 else L + num_after

num_after = int(num_after)

last_info = [
    {"X": X_after[0], "num": num_after}
]

for i in range(1, N):
    num = num_after + i
    if num >= N:
        num = N - num
    last_info.append({
        "X": X_after[i],
        "num": num,
    })

sorted_info = sorted(last_info, key=lambda info: info["num"])

for info in sorted_info:
    print(info["X"])


### FIXED CODE ###

N, L, T = list(map(int, input().split()))

X = []
W = []
X_after = []
for _ in range(N):
    x, w = list(map(int, input().split()))
    if w == 1:
        x_a = (x + T) % L
    else:
        x_a = (x - T) % L
        x_a = x_a if x_a >= 0 else L + x_a
    X.append(x)
    W.append(w)
    X_after.append(x_a)

n_colide = 0
for i in range(1, N):
    if W[0] == 1 and W[i] == 2:
        dist = X[i] - X[0]
        n_colide += 2 * (T - (dist / 2)) // L + 1
    elif W[0] == 2 and W[i] == 1:
        dist = (L + X[0]) - X[i]
        n_colide += 2 * (T - (dist / 2)) // L + 1

if W[0] == 1:
    num_a0 = n_colide % N
else:
    num_a0 = N - (n_colide % N)

num_a0 = int(num_a0)

x_a0 = X_after[0]
X_after = sorted(X_after)
i = X_after.index(x_a0)
if W[0] == 1 and X_after.count(x_a0) == 2:
    i += 1
X_after = X_after[i-num_a0:] + X_after[:i-num_a0]

for x_a in X_after:
    print(x_a)
def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
  
def lcm(a,b): 
    return (a*b) // gcd(a,b) 

mod = 1000000007
n = int(input())
arr = input()
a = list(map(int, arr.split(' ')))
lc = a[0]
res = 0
for i in range(n):
    lc = lcm(lc, a[i])
for i in range(n):
    res = res + 1//a[i]
print(ans % mod)

### FIXED CODE ###

def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
  
def lcm(a,b): 
    return (a*b) // gcd(a,b) 
  
n = int(input())
arr = input()   # takes the whole line of n numbers
a = list(map(int,arr.split(' ')))
l = a[0]
ans = 0
for i in range(n):
    l = lcm(l, a[i])
for i in range(n):
    ans = ans + l//a[i]
print(ans%1000000007)
n=int(input())
ans=0
c=True
d=[]
for i in range(n):
    a,b=map(int,input().split())
    if a==b:
        d.append()
if len(d)<3:
    print("No")
else:
    j=0
    for i in range(1,len(d)):
      
        if d[i]-d[i-1]==1 and d[i+1]-d[i]==1:
            print("Yes")
            c=False
            break
 
    if c==False:
        print("No")

### FIXED CODE ###

n=int(input())
ans=0
c=True
d=[]
for i in range(n):
    a,b=map(int,input().split())
    if a==b:
        d.append(i)
if len(d)<3:
    print("No")
else:
    j=0
    for i in range(1,len(d)-1):

        if d[i]-d[i-1]==1 and d[i+1]-d[i]==1:
            print("Yes")
            c=False
            break

    if c==True:
        print("No")
# -*- coding: utf-8 -*-
import sys
import copy

def main():
	num = int(input())
	
	clocks = []
	for _ in range(num):
		clock = int(input())
		clocks.append(clock)
		
	ans = clocks[0]
	for clock in clocks:
		if clock == ans: continue
		ans = lcm(ans, clock)
	print(int(ans))
			
def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def lcm(a, b):
	g = gcd(a, b)
	return a / g * b
	
if __name__ == "__main__":
	main()
	

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy

def main():
	num = int(input())
	
	clocks = []
	for _ in range(num):
		clock = int(input())
		clocks.append(clock)
		
	ans = 1
	for clock in clocks:
		ans = lcm(ans, clock)
	print(ans)
			
def gcd(a, b):
	if a > b:
		a, b = b, a
		
	while a > 0:
		a, b = b % a, a
	return b
	
def lcm(a, b):
	g = gcd(a, b)
	return a // g * b
	
if __name__ == "__main__":
	main()
" ".join(map(str, sorted(map(int, raw_input().strip().sprit(" ")), lambda x , y: y - x)))

### FIXED CODE ###

l = map(int, raw_input().strip().split(" "));
print " ".join(map(str, sorted(l, lambda x, y: y - x)));
a=int(input())
s=str(input())

if(a>=3200):
  print('red')
 else:
  print(s)

### FIXED CODE ###

a=int(input())
s=str(input())

if(a>=3200):
  print(s)
else:
  print('red')
import functools
import math

N,X = map(int,input().rstrip().split())


x = list(map(int,input().rstrip().split()))
x.append(X)
x = sorted(x)

to = []
for i in range(len(x)-1):
	to.append(x[i+1] - x[i])

gcd = functools.reduce(math.gcd, to)
print(gcd)

### FIXED CODE ###

import numpy as np
import fractions
from functools import reduce
N,X = map(int,input().rstrip().split())
x = []
x = list(map(int,input().rstrip().split()))
x.append(X)
x.sort()


mini = []
for i in range(len(x)-1):
	mini.append(x[i+1] - x[i])
print(reduce(fractions.gcd, mini))
X = int(input())
A = int(input())

if 2*(N-A)%1000==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
A = int(input())

if N>=500 and N-500*int(N/500)<=A:
    print('Yes')
elif N<500 and A>=N:
    print('Yes')
else:
    print('No')
n = int(input())
sum = 0
for _ in range(n):
  x,u = input().split()
  if str(u) = "BTC":
    sum += int(x) * 380000.0
  else:
    sum += int(x)
print(sum)

### FIXED CODE ###

n = int(input())
sum = 0
for _ in range(n):
    x,u = input().split()
    if str(u) == "BTC":
        sum += float(x) * 380000.0
    else:
        sum += float(x)
print(sum)
import itertools
import collections
n,k=map(int,input().split())
candle=list(map(int,input().split()))
com=list(itertools.product([1,0], repeat=n))
ans=200000000
for i in range(2**n):
  count=collections.Counter(com[i])
  if count[1]==k:
    begin=0
    end=0
    cnt=0
    temp=0
    print(
    for j in range(n):
      if com[i][j]==1:
        cnt+=1
        if cnt==1:
          start=candle[j]
        elif cnt==k:
          end=candle[j]
          break;
    if start>=0:
      temp=abs(end)
      if temp<ans:
        ans=temp
    if end<=0:
      temp=abs(start)
      if temp<ans:
        ans=temp
    else:
      temp=min(abs(start), end)*2+max(abs(start), end)
      if temp<ans:
        ans=temp
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
candle=list(map(int,input().split()))
ans=2000000000
for i in range(n-k+1):
  if candle[i]<0 and candle[i+k-1]>0:
    temp=min(abs(candle[i]), candle[i+k-1])*2+max(abs(candle[i]), candle[i+k-1])
  elif candle[i+k-1]<=0:
    temp=abs(candle[i])
  elif candle[i]>=0:
    temp=candle[i+k-1]
  ans=min(temp, ans)
print(ans)
n, d = int(input().split())

if n/(2*d+1) == 0:
    print(n/(2*d+1))
else:
    print(n//(2*d+1)+1)

### FIXED CODE ###

n, d = map(int, input().split())
if n%(2*d+1) == 0:
    print(n//(2*d+1))
else:
    print(n//(2*d+1)+1)
import sys
for e in sys.stdin.readline():
    X, A = map(int, e.split())
    print(0 if X < A else 10)

### FIXED CODE ###

X,A = map(int,input().split())
 
print(0 if X<A else 10)
n = input()
m = list(n)
if int(n) % sum(m)==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = input()
m = sum(map(int,n))
if int(n) % m==0:
  print("Yes")
else:
  print("No")
n = input()
s = input()
i = input()

l = list(s)
for i, c in enumerate(l):
  if c != s[i-1]:
    l[i] = *
    
''.join(l)

print(l)

### FIXED CODE ###

n = input()
s = input()
i = int(input())
 
l = list(s)
for j, c in enumerate(l):
  if c != s[i-1]:
    l[j] = '*'
    
l = ''.join(l)
 
print(l)
i = 1
while true:
  x = int(input())
  if x==0: break
  print('Case ' i ': ' x)
  i += 1


### FIXED CODE ###

i,x = 1,input()
while x != "0":
  print('Case '+str(i)+': '+x)
  i,x = i+1,input()
S = input()

ans = "No"
for i in range(1:6):
    if S == "hi"*i:
        ans="Yes"
print(ans)

### FIXED CODE ###

S = input()

ans = "No"
for i in range(1,6):
    if S == "hi"*i:
        ans="Yes"
print(ans)
from collections import Counter
n=int(input())
string_list=[Counter(input()) for i in range(n)]
string_set=set(string_list)
cnt=0
for s in string_set:
  n=string_list.count(s)
  cnt+=int(n*(n-1)/2)
print(cnt)

### FIXED CODE ###

from collections import Counter
n=int(input())
string_list=["".join(sorted(list(input()))) for i in range(n)]
counter=Counter(string_list)
cnt=0
for k, v in counter.items():
  cnt+=int(v*(v-1)/2)
print(cnt)
n=int(input())

while(n%10==0):
	n//=10
    
k=str(n)
ans=0

for i in range(1,len(k),2):
	ans+=i*9 
    
if(len(k)%2==1):
	m=n//pow(10,len(n)-1)
	ans+=m-1

print(ans)

### FIXED CODE ###

n=int(input())

k=str(n)
ans=0

for i in range(1,len(k),2):
  s="9"
  s*=i
  ans+=int(s)-int(s)//10
    
if(len(k)%2==1):
	m=pow(10,len(k)-1)
	ans+=n-m+1

print(ans)
S,T=input().split()
S=int(S)
print('Yes' if T[:S//2]==T[S//2:] else 'No')


### FIXED CODE ###

S=int(input())
T=input()
S=int(S)
print('Yes' if T[:S//2]==T[S//2:] else 'No')
S = input()

ans = 0

## 4桁
for i in range(0, len(S)-3):
  for j in range(i+3, len(S)):
    #print(S[i:j+1])
    if int(S[i:j+1]) % 2019 == 0:
      ans += 1

print(ans)

### FIXED CODE ###

S, W = map(int, input().split())
 
if S <= W:
  print('unsafe')
else:
  print('safe')
AAAA = int(input( ))

if AAAA % 2 == 0:
  k1 = AAAA / 2
  Ans = k1 * k1
else:
  k2 = (AAAA + 1) / 2
  k3 = k2 - 1
  Ans = K1 * k2
print(Ans)
  

### FIXED CODE ###

asdf = int(input())
if asdf % 2 == 0:
  k1 = asdf / 2
  Ans = k1 * k1
else:
  k2 = (asdf + 1) / 2
  k3 = k2 - 1
  Ans = k2 * k3
print(int(Ans))
n, k = map(int,input().split())
s = input()
l = s[k - 1]
if l == "A":
    x = s[:(k - 1)] + "a" + s[(k + 1):]
elif l == "B":
    x = s[:(k - 1)] + "b" + s[(k + 1):]
print(x)

### FIXED CODE ###

n, k = map(int,input().split())
s = input()
l = s[k - 1]
if l == "A":
    x = s[:(k - 1)] + "a" + s[k:]
elif l == "B":
    x = s[:(k - 1)] + "b" + s[k:]
else:
    x = s[:(k - 1)] + "c" + s[k:]
print(x)
n,a = map(int, input().split())

print(n*n-a)

### FIXED CODE ###

n=int(input())
a=int(input())

print(n**2-a)
sx,sy,tx,ty=map(int,input().split())
ans=[[] for _ in range(4)]

x=sx
y=sy

while y!=ty or x!=tx:
    if y<ty:
        y+=1
        ans[0].append("U")
        ans[1].append("D")
    elif x<tx:
        x+=1
        ans[0].append("R")
        ans[1].append("L")
       
x=sx-1
y=sy
ans[2].append("L")
ans[3].append("R")

while 1:
    if y<ty+1:
        y+=1
        ans[2].append("U")
        ans[3].append("D")
    elif x<tx:
        x+=1
        ans[2].append("R")
        ans[3].append("L")
    else:
        ans[2].append("D")
        ans[3].append("U")
        break


print(*ans[0],*ans[1],*ans[2],*ans[3],sep="")
print()

### FIXED CODE ###

sx,sy,tx,ty=map(int,input().split())
ans=[[] for _ in range(4)]

x=sx
y=sy

while y!=ty or x!=tx:
    if y<ty:
        y+=1
        ans[0].append("U")
        ans[1].append("D")
    elif x<tx:
        x+=1
        ans[0].append("R")
        ans[1].append("L")
       
x=sx-1
y=sy
ans[2].append("L")
ans[3].append("R")

while 1:
    if y<ty+1:
        y+=1
        ans[2].append("U")
        ans[3].append("D")
    elif x<tx:
        x+=1
        ans[2].append("R")
        ans[3].append("L")
    else:
        ans[2].append("D")
        ans[3].append("U")
        break

li=[]

for i in range(4):
    for j in ans[i]:
        li.append(j)

print(''.join(li))

#print(*ans[0],*ans[1],*ans[2],*ans[3],sep="")
import math
import collections
import fractions
import itertools
import functools
import operator

def ncr(n, r):
    if n < r: return 0
    r = min(r, n-r)
    if r == 0: return 0
    numer = functools.reduce(operator.mul, range(n, n-r, -1), 1)
    denom = functools.reduce(operator.mul, range(1, r+1), 1)
    return numer / denom

def solve():
    n, k = map(int, input().split())
    for i in range(1,k+1):
        ans = (ncr(k-1, i-1) * ncr(n-k+1, i)) % (10**9+7)
        print(int(ans))
    return 0

if __name__ == "__main__":
    solve()

### FIXED CODE ###

import math
import collections
import fractions
import itertools
import functools
import operator

def ncr(n, r):
    if n < r: return 0
    r = min(r, n-r)
    if r == 0:
        return 1
    numer = functools.reduce(operator.mul, range(n, n-r, -1), 1)
    denom = functools.reduce(operator.mul, range(1, r+1), 1)
    return numer // denom % (10 ** 9 + 7)

def solve():
    n, k = map(int, input().split())
    for i in range(1,k+1):
        ans = (ncr(k-1, i-1) * ncr(n-k+1, i)) % (10**9+7)
        print(int(ans))
    return 0

if __name__ == "__main__":
    solve()
# -*- coding: utf-8 -*-

import numpy as np

def combinations(iterable, r):
    # combinations('ABCD', 2) --> AB AC AD BC BD CD
    # combinations(range(4), 3) --> 012 013 023 123
    pool = tuple(iterable)
    n = len(pool)
    if r > n:
        return
    indices = list(range(r))
    yield tuple(pool[i] for i in indices)
    while True:
        for i in reversed(range(r)):
            if indices[i] != i + n - r:
                break
        else:
            return
        indices[i] += 1
        for j in range(i+1, r):
            indices[j] = indices[j-1] + 1
        yield tuple(pool[i] for i in indices)

def main():

    N,M,X= map(int, input().split())
    matrix = [list(map(int, input().split())) for t in range(N)]

    l= []

    for i in range(N):
        for pair in combinations(matrix, i+1):
            row_sum = np.sum(pair, axis=0)
            for j in range(len(row_sum)):
                if j == 0:
                    continue
                if row_sum[j] < X:
                    break
                l.append(row_sum[0])
    if len(l) == 0:
        print('-1')
    else:
        print(min(l))


if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

import itertools
import numpy as np


def main():

    n, m, x= map(int, input().split())
    matrix = np.array([list(map(int, input().split())) for _ in range(n)], dtype=np.int32)

    out = 10**18
    for i in itertools.product([False,True], repeat=n):
        row_sum = np.sum(matrix[np.where(i)], axis=0)
        if m == np.count_nonzero(row_sum[1:] >= x):
            out = min(out, row_sum[0])

    if out == 10**18:
        print('-1')
    else:
        print(out)


if __name__ == '__main__':
    main()
q=[]
qq=[]
def dfs(j,q,icnt,count,n,qq):
    if len(qq)==n:
        count+=1
#        print("1",n,j,icnt,count,q[j],qq)
        return count
    icnt+=1
    
    for j2 in q[j]:
        if not j2 in qq:
            qq.append(j2)
#            print("2",n,j,icnt,count,q[j],qq)
            count=dfs(j2,q,icnt,count,n,qq)
            qq.pop()
#        print("3",n,j,icnt,count,q[j],qq)
    return count

n,m=map(int,input().split())
q=[[0]*2 for i in range(m)]
for i in range(m):
    q[i]=set(map(int,input().split()))

#n=3
#m=3
#ab=[[1,2],[1,3],[2,3]]

#n=7
#m=7
#ab=[[1,3],[2,7],[3,4],[4,5],[4,6],[5,6],[6,7]]

q=[[]*2 for i in range(n)]
for i in range(m):
    if not q[ab[i][1]-1] in q[ab[i][0]-1]:
        q[ab[i][0]-1].append(ab[i][1]-1)    
    if not q[ab[i][0]-1] in q[ab[i][1]-1]:
        q[ab[i][1]-1].append(ab[i][0]-1)    
#print(q)    

count=0
j=0
qq=[j]
icnt=1
count=dfs(j,q,icnt,count,n,qq)
print(count)


### FIXED CODE ###

n,m=map(int,input().split())
a=[]

for i in range(m):
    ai,bi=map(int,input().split())
    a.append([ai,bi])
              
ni=[0]*n
nii=[]
    
def pathm(n,a,bi,pcnt,ni):
    if n==1:
        pcnt=pcnt+1
#        print("2:","n:",n,"bi:",bi,"pcnt:",pcnt)
        return pcnt
    else:
        n=n-1
        nii.append(bi)
        for mm in range(m):
            if a[mm][0]==bi and not a[mm][1] in nii:
#            if a[mm][0]==bi :
                ni[a[mm][1]-1]=1
#                print("1:","n:",n,"mm:",mm,"a[mm][1]:",a[mm][1],"pcnt:",pcnt)
                pcnt=pathm(n,a,a[mm][1],pcnt,ni)
            if a[mm][1]==bi and not a[mm][0] in nii:
#            if a[mm][1]==bi  and ni[a[mm][0]-1]==0 :
                ni[a[mm][0]-1]=1
#                ni[mm]=1
#                print("1:","n:",n,"mm:",mm,"a[mm][0]:",a[mm][0],"pcnt:",pcnt)
                pcnt=pathm(n,a,a[mm][0],pcnt,ni)
        nii.pop()
        return pcnt       
                
pcnt=0
pcnt1=pathm(n,a,1,pcnt,ni)
print(pcnt1)
N = int(input())
xy = []
for _ in range(N):
    x, y = map(int, input().split())
    xy.append((x, y))

d = {}
for i in range(N):
    tmp = set()
    for j in range(N):
        if i == j:
            continue
        dx = xy[i][0] - xy[j][0]
        dy = xy[i][1] - xy[j][1]

        if (dx, dy) in tmp:
            continue
        if (dx, dy) not in d:
            d[(dx, dy)] = 1
        else:
            d[(dx, dy)] += 1
        tmp.add((dx, dy))

d = sorted(d.items(), key=lambda x: x[1], reverse=True)
cnt = d[0][1]
print(N - cnt)


### FIXED CODE ###

def main():
    N = int(input())
    if N == 1:
        print(1)
        return
    xy = []
    for _ in range(N):
        x, y = map(int, input().split())
        xy.append((x, y))

    d = {}
    for i in range(N):
        tmp = set()
        for j in range(N):
            if i == j:
                continue
            dx = xy[i][0] - xy[j][0]
            dy = xy[i][1] - xy[j][1]

            if (dx, dy) in tmp:
                continue
            if (dx, dy) not in d:
                d[(dx, dy)] = 1
            else:
                d[(dx, dy)] += 1
            tmp.add((dx, dy))

    d = sorted(d.items(), key=lambda x: x[1], reverse=True)
    cnt = d[0][1]
    print(N - cnt)

main()
N, K = list(map(int, input().split()))
links = [list(map(int, input().split())) for _ in range(N-1)]

mod = 1000000007

from scipy import special

d = {}
for a, b in links:
    if a in d:
        d[a].add(b)
    else:
        d[a] = {b}
    if b in d:
        d[b].add(a)
    else:
        d[b] = {a}

root = {1}
ans = K
while True:
    a = K - 2
    if 1 in root:
        a = K - 1
    children = set()
    for i in root:
        for j in d[i]:
            d[j].remove(i)
        b = len(d[i])
        if a < b:
            ans = 0
            break
        ans *= special.perm(a, b, exact=True)
        children |= d[i]
    else:
        if len(children) == 0:
            print(ans % mod)
            break
        root = children
        continue
    print(ans)
    break

### FIXED CODE ###

N, K = list(map(int, input().split()))
l = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = list(map(int, input().split()))
    l[a].append(b)
    l[b].append(a)

deg1 = [0] * (N + 1)
deg2 = [0] * (N + 1)
history = [True] * (N + 1)
stack = [1]
ans = 1

while stack:
    node = stack.pop()
    ans *= K - deg1[node] - deg2[node]
    ans %= 1000000007
    history[node] = False
    for child in l[node]:
        if history[child]:
            deg1[child] += 1
            deg2[child] += deg1[node]
            deg1[node] += 1
            stack.append(child)
            
print(ans)
x = str(input())
if x =='AAA':
  print(No)
  elif x =='BBB':
    print(No)
    else:
      print(Yes)

### FIXED CODE ###

x = input()
if x =='AAA':
  print('No')
elif x == 'BBB':
  print('No')
else:
  print('Yes')
def main():
    N = int(input())
    A = list(map(int, input().split()))

    M = max(A)
    L = M.bit_length()
    ans = 0
    mod = 10**9 + 7
    k = [0]*L
    k[0] = 1
    for i in range(1, L):
        k[i] = k[i-1]*2
    for j in range(L):
        count = 0
        for x in A:
            if (x >> j) % 2 == 1:
                count += 1
        ans += count*(N - count)*k[j]
    ans %= mod
    print(ans)


main()


### FIXED CODE ###



N = int(input())
A = list(map(int, input().split()))

ans = 0
mod = 10**9 + 7


b = bin(max(A))

l = len(b) - 2


for j in range(l):
    tmp = 0
    for i in range(N):
        if (A[i] >> j) % 2 == 1:
            tmp += 1

    ans += (2**j) * tmp * (N-tmp)
    ans %= mod
print(ans)