Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

def main():
    N = int(input())
    A = list(map(int,input().split()))
    ans = 0
    m0 = 10**9+7
    for i in range(0,N-1):
        sumtemp = 0
        for j in range(i+1,N):
            sumtemp = (sumtemp+A[j]) % m0
        ans = (ans + A[i] * sumtemp) % m0
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int,input().split()))
    ans = 0
    m0 = 10**9+7
    Ar = [0]*N
    sum0 = 0
    for i in reversed(range(N)):
        sum0 = (sum0 + A[i]) % m0
        Ar[i] = sum0

    for i in range(N-1):
        ans = (ans + A[i] * Ar[i+1]) % m0
    print(ans)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
dp = [float('inf')]*N
dp[0] = 0
 
 
for i in range(1,N):
    dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(i-K, 0), i))
    
print(dp[N-1])


### FIXED CODE ###

def test():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    dp = [float('inf')]*N
    dp[0] = 0
 
    for i in range(1, N):
        dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))
 
    print(dp[-1])
 
if __name__ == '__main__':
    test()
### BUGGY CODE ###

n=int(input())
a=[[0]*n]*n
l=[]

for i in range(n):
  a[i]=[int(x)-1 for x in input().split()]

t=0
f=True
while f==True:
  f=False
  for i in range(n):
    if len(a[i])==0:
      continue
    f=True
    if len(a[a[i][0]])==0:
      continue
    if i==a[a[i][0]][0]:
      if not(i in l):
        l.append(i)
      if not(a[i][0] in l):
        l.append(a[i][0])

  if f==False:
    break

  if len(l)!=0:
    t+=1
    while len(l)!=0:
      a[l.pop(0)].pop(0)
      a[l.pop(0)].pop(0)
  else:
    t = -1
    break
print(t)
 

### FIXED CODE ###

from collections import deque

def main():
  N=int(input())
  A=[deque(int(a)-1 for a in input().split()) for _ in range(N)]

  P,W=[0]*N,[-1]*N
  c=deque(range(N))

  while c:
    i=c.popleft()
    j=A[i].popleft()
    W[i]=j

    if W[j]==i:
      P[i]=P[j]=max(P[i],P[j])+1
      if A[i]:
        c.append(i)
      if A[j]:
        c.append(j)

  print(-1 if any(len(a) for a in A) else max(P))

main()
### BUGGY CODE ###

N = int(input())
Al = input().split()

A = []
for i in range(N):
  A.append(int(Al[i]))

num = 0

for i in range(N):
  for j in range(i+1, N):
    num += A[i]*A[j]

num = num % (10**9 + 7)
print(num)

### FIXED CODE ###

N = int(input())
Al = input().split()
A = list( map((lambda x: int(x)), Al))
num = 0
ma = 10**9 + 7
li = 0

for i in range(N-1, 0, -1):
  li += A[i]
  num += A[i-1] * li

num = num % ma
print(num)
### BUGGY CODE ###

import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

def primes(n):
    isp = [True for _ in range(n+1)]
    isp[0] = False
    isp[1] = False
    l = floor(sqrt(n))
    n += 1
    for i in range(4, n, 2):
        isp[i] = False
    for i in range(3, l, 2):
        if not isp[i]:
            continue
        for j in range(i*2, n, i):
            isp[j] = False
    return isp

q = int(input())
maxv = 10**5
isp = primes(maxv)
for _ in range(q):
    l, r = map(int, input().split())
    ans = 0
    for i in range(l, r+1):
        if isp[i] and isp[(i+1)//2]:
            ans+=1
    print(ans)

### FIXED CODE ###

import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))
# map(int, input().split())
# int(input())
# input().split()
# mojiretu = ','.join(str_list)
# sorted(input())

def primes(n):
    isp = [True for _ in range(n+1)]
    isp[0] = False
    isp[1] = False
    l = ceil(sqrt(n))
    n += 1
    for i in range(2, l):
        if not isp[i]: continue
        for j in range(i*2, n, i): isp[j] = False
    return isp

q = int(input())
maxv = 10**5
isp = primes(maxv)
cnt = [0 for _ in range(maxv + 1)]

for i in range(3, maxv+1):
    if i%2 and isp[i] and isp[(i+1)//2]:
        cnt[i] = 1
#print(cnt[:10])
acc = list(accumulate(cnt))
for _ in range(q):
    l, r = map(int, input().split())
    print(acc[r] - acc[l-1])
### BUGGY CODE ###

#!/usr/bin/env python3
s = input()
n = len(s)
dp = [[0] * (n + 2) for _ in range(n)]
dp[0][1] = 1
dp[0][2] = 1
dp[1][2] = dp[0][1] + (s[0] != s[1])
dp[1][3] = dp[0][1] + 1
for i in range(2, n):
    for j in [1, 2]:
        for k in [1, 2]:
            now = s[i - k:i]
            nxt = s[i:i + j]
            dp[i][i + j] = max(dp[i][i + j], dp[i - k][i] + (now != nxt))
print(dp[n - 1][n])


### FIXED CODE ###

#!/usr/bin/env python3
s = input()
n = len(s)
p = s[0]
i = 1
k = 1
while i < n:
    if s[i:i + 1] != p:
        p = s[i:i + 1]
        i += 1
    elif i < n - 1 and s[i:i + 2] != p:
        p = s[i:i + 2]
        i += 2
    else:
        k -= 1
        i += 1
    k += 1
print(k)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]
BC.sort(key=lambda x: -x[1])

extend = A.extend
[extend(list(ls[1] for _ in range(ls[0]))) for ls in BC]
A.sort(reverse=True)

print(sum(A[:n]))

### FIXED CODE ###

import sys

input = sys.stdin.readline
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]
BC.sort(key=lambda x: -x[1])

maxi = n*2
extend = A.extend
[extend([ls[1]] * ls[0]) for ls in BC if len(A) <= maxi]
A.sort(reverse=True)

print(sum(A[:n]))
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
cnt = 0

for i, a in enumerate(A):
    for j in range(n):
        if i >= j:
            continue
        if abs((i+1) - (j+1)) == (a + A[j]):
            cnt += 1
print(cnt)

### FIXED CODE ###

from collections import Counter
n = int(input())
A = list(map(int, input().split()))
cnt = 0

B = Counter(i + a for i, a in enumerate(A))
C = Counter(j - a for j, a in enumerate(A))
#print(B)
#print(C)
for k, v in B.items():
    cnt += C[k] * v
print(cnt)
### BUGGY CODE ###

import sys
import numpy as np

def is_enough(H, A, B, T):
    H = H - (B * T)
    H = H[(H > 0)]

    cnt = 0
    diff = A - B
    for h in H:
        cnt += (h + diff - 1) // diff
        if cnt > T:
            return False

    return True


def main():
    input = sys.stdin.readline
    N, A, B = map(int, input().split())
    H = np.array([int(input()) for _ in range(N)])

    R = (H.max() + B - 1) // B
    L = (H.min() + A - 1) // A
    while R != L:
        c = (R + L) // 2
        if is_enough(H,  A, B, c):
            R = c
        else:
            L = c + 1

    return L


if __name__ == '__main__':
    print(main())


### FIXED CODE ###

import sys

def is_enough(H, A, B, T):
    cnt = 0
    diff = A - B
    base = B * T
    for h in H:
        if h <= base:
            continue

        cnt += (h - base + diff - 1) // diff
        if cnt > T:
            return False

    return True


def main():
    input = sys.stdin.readline
    N, A, B = map(int, input().split())
    H = [int(input()) for _ in range(N)]

    R = (max(H) + B - 1) // B
    L = (min(H) + A - 1) // A
    while R != L:
        c = (R + L) // 2
        if is_enough(H,  A, B, c):
            R = c
        else:
            L = c + 1

    return L


if __name__ == '__main__':
    print(main())
### BUGGY CODE ###

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

ans = 0
numcnt = [0]*100001

for i in range(max(a)+1):
    numcnt[i]=a.count(i)
    
for x in range(max(a)+1):
    dx = [-1,0,1]
    subans = 0
    for i in dx:
        if x+i<0 or x+i>max(a):
            continue
        subans += numcnt[x+i]
        
    ans = max(ans,subans)
    
print(ans)

### FIXED CODE ###

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

ans = 0
numcnt = {i:0 for i in range(100001)}

for i in a:
    numcnt[i]+=1
    
for x in range(1,100000):
    subans = numcnt[x-1]+numcnt[x]+numcnt[x+1]
        
    ans = max(ans,subans)
    
print(ans)
### BUGGY CODE ###

def FindSumOfDigits(n):
    Sum=0
    while(n>0):
        Sum+=(int(n%10))
        n=n/10
    return Sum

N,A,B=map(int,input().split())
ans=0
ans_list=[]
sumlist=[]
for i in range(1,N+1):
    sumlist.append(FindSumOfDigits(i))
    if A<=FindSumOfDigits(i)<=B:
        ans+=i
        ans_list.append(i)
print(ans)
#print(ans_list)
#print(sum_list)

### FIXED CODE ###

N,A,B=map(int,input().split())
Z=[]
for n in range(1,N+1):
    ns=str(n)
    len_ns=len(ns)
    total=0
    for x in range(len_ns):
        total=total+int(ns[x])
    if A<=total<=B:
        Z.append(n)
print(sum(Z))
### BUGGY CODE ###

import numpy as np
MOD = 10**9 + 7
def solve(s, p=13):
    s = s[::-1]
    n = len(s)
    dp = np.zeros((n, p), dtype=int)
    if s[0] == "?":
        dp[0, :10] = 1
    else:
        dp[0, int(s[0])] = 1
    D = {str(i): [i] for i in range(10)}
    D["?"] = list(range(10))
    q = [(10**i) % p for i in range(6)]
    for i in range(1,n):
        for x in D[s[i]]:
            for j in range(p):
                k = (j + x * q[i%6]) % p
                dp[i, k] = (dp[i, k] + dp[i-1, j]) % MOD
    return dp[n-1, 5]

s = input()
print(solve(s))

### FIXED CODE ###

MOD = 10**9 + 7

def solve(s, p=13):
    a = [0] * p
    a[0] = 1
    for c in s:
        b = [0] * p
        for i in range(p):
            b[(i*10)%p] = a[i] % MOD
        b += b
        if c == "?":
            for i in range(p):
                a[i] = sum(b[i+4:i+p+1])
        else:
            for i in range(p):
                a[i] = b[i+p-int(c)]
    return a[5] % MOD

s = input()
print(solve(s))
### BUGGY CODE ###

n = int(input())
a = list(input().split())
b = []

for i in range(n//2):
    b.append(a.pop(0))
    b.insert(0, a.pop(0))

if len(a) == 1:
    b.append(a.pop(0))
    b.reverse()

for i in range(n):
    print(b[i], '', end='')

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

if n % 2:
    nums = a[::-2] + a[1::2]
else:
    nums = a[::-2] + a[::2]

for num in nums:
    print(num, '', end='')
### BUGGY CODE ###

import sys
if __name__ == "__main__":
    N = int(input())
    S = input()
    min = 100000
    for i in range(0, N):
        ws = S[0:i]
        es = S[i+1:N]
        cnt = 0
        cnt += ws.count('W')
        #for ele in ws:
        #    if ele == 'W':
        #        cnt += 1
        cnt += es.count('E')
        #for ele in es:
        #    if ele == 'E':
        #        cnt += 1
#        print(ws)
#        print(es)
#        print(cnt)
        if cnt < min:
            min = cnt
    print(min)

### FIXED CODE ###

# 解法：累積和
N = int(input())
S = input()
pos = 0
minpos = 0
mini = 0
# (1)WWWWEE
# (2)EEEWWW
# (3)WEWEEE
for i in range(N):
    if S[i] == "W":
        pos += 1
    else:
        pos -= 1
    if pos < minpos:
        minpos = pos
        mini = i

s1 = S[0:mini].count("W")
s2 = S[mini + 1:N].count("E")
print(s1 + s2)
### BUGGY CODE ###

n,*a=map(int,open(0).read().split())
a.sort()
for j in a:
    a = list(filter(lambda x: x%j >0,a)) + [j]*(a.count(j)==1)
print(len(a))

### FIXED CODE ###

_,*a = map(int, open(0).read().split())
a.sort()
m = -~a[-1]
c = [0]*m
for i in a:
    c[i] += 1
    if c[i] > 1:
        continue
    for j in range(i * 2, m, i):
        c[j] = 2
print(sum(c[i]==1for i in a))
### BUGGY CODE ###

import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix

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

v = [x-1]
u = [y-1]
for i in range(n-1):
    v.append(i)
    u.append(i+1)

csr = csr_matrix(([1]*n, (v, u)), shape=(n, n))
result = shortest_path(csr, method='D', directed=False)

for k in range(1, n):
    answer = np.sum(result==k) // 2
    print(answer)

### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix

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

v = [x-1]
u = [y-1]
for i in range(n-1):
    v.append(i)
    u.append(i+1)

csr = csr_matrix(([1]*n, (v, u)), shape=(n, n))
result = shortest_path(csr, method='D', directed=False).astype(int)
ans = np.bincount(result.ravel(), minlength=n) // 2
print(*ans[1:], sep='\n')
### BUGGY CODE ###

n = int(input())
blocks = []
for i in range(n):
    w_str, s_str, v_str = input().split(" ")
    w, s, v = int(w_str), int(s_str), int(v_str)
    blocks.append({"w": w, "s": s, "v": v})

blocks = sorted(blocks, key=lambda block: block["s"]) 

def dp(blocks, max_s):
    max_val = 0
    for i in range(len(blocks)):
        taken =  blocks[i]

        # klo constraint nya
        new_max_s = 0
        if max_s is None:
            new_max_s = taken["s"]
        else:
            new_max_s = min(max_s-taken["w"], taken["s"])

        # ini constraint nya
        if new_max_s < 0:
            continue

        # remaining blocks, taruh sini, biar ga diitung kalau jelas ga mungkin
        remaining_blocks = [blocks[x] for x in range(len(blocks)) if x != i]

        # ini nilai tambahan
        taken_val = taken["v"]
        new_val = taken_val + dp(remaining_blocks, new_max_s)
        if new_val > max_val:
            max_val = new_val

    return max_val

print(dp(blocks, None))

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
N = int(input())
WSV = list(tuple(map(int, input().split())) for _ in range(N))
WSV.sort(key=lambda x: x[0] + x[1])
U = 2 * 10 ** 4 + 100
dp = np.zeros(U, dtype=np.int64)
for w, s, v in WSV:
    dp[w:w+s+1] = np.maximum(dp[w:w+s+1], dp[:s+1] + v)
print(dp.max())
### BUGGY CODE ###

import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
  
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
  
N = int(input())
A = list(map(int, input().split()))

ans = 0
MOD = 10**9 + 7
GCD = gcd_list(A)
LCM = lcm_list(A)//GCD


for a in A:
  a = a//GCD
  ans += LCM//a
  ans = ans%MOD
  
print(ans)

### FIXED CODE ###

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

ans = 0
MOD = 10**9 + 7

LCM = A[0]
for i in range(1, N):
    LCM *= A[i]//fractions.gcd(LCM, A[i])
    
for a in A:
  ans += LCM//a
  
print(ans%MOD)
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
d1 = []
d2 = []
for i, ele in enumerate(a,1):
    d1.append(i + ele)
    d2.append(i - ele)

cnt = 0

for i in range(n):
    cnt += d2[i+1:].count(d1[i])

print(cnt)


### FIXED CODE ###

from collections import defaultdict

n = int(input())
a = list(map(int,input().split()))

cnt = 0
d = defaultdict(int)

for i in range(n):
    cnt += d[i-a[i]]
    d[i + a[i]] += 1

print(cnt)
### BUGGY CODE ###

n = int(input())
N = []
ans = 0
l = len(str(n))

for i in range(l):
    N.append(int(str(n)[-i-1]))
N.append(0)

for i in range(l+1):
    if N[i]<5:
        ans += N[i]
    elif N[i]>5:
        ans += 10-N[i]
        N[i+1] += 1
    elif N[i+1]>4:
        ans += 10-N[i]
        N[i+1] += 1
    else:
        ans += N[i]

print(ans)


### FIXED CODE ###

n = input()
N = []
ans = 0
l = len(str(n))

for i in range(l):
    N.append(int(n[-i-1]))
N.append(0)

for i in range(l+1):
    if N[i]<5:
        ans += N[i]
    elif N[i]>5:
        ans += 10-N[i]
        N[i+1] += 1
    elif N[i+1]>4:
        ans += 10-N[i]
        N[i+1] += 1
    else:
        ans += N[i]

print(ans)
### BUGGY CODE ###

B,W = map(int, input().split())
N = B+W

factorial = [1]
for i in range(N+1):
    factorial.append( factorial[-1] * (i+1))
# print(factorial)

mod = 10**9+7

de_factorial = [0] * (N+1)
de_factorial[N] = pow(  factorial[N] , mod-2, mod  )

for i in range( N, 0, -1):
    de_factorial[i-1] = de_factorial[i] * i

# print(de_factorial)

def comb(n,r):
    if n < r: return 0
    if n == r: return 1
    return (factorial[n] * de_factorial[r] * de_factorial[n-r]) % mod


p = [0] * (N+1) # Bを食べきった確率
q = [0] * (N+1) # Wを食べきった確率

de2 = de_factorial[2]

for i in range(1, N+1):
    # 確率はこの表現で本当に正しいのか？
    # p[i-1] と comb(i,B)は排他事象 ではない気がする。
    # comb(i,B)でもi-1 でB食べきってしまう p[i-1] の確率が存在するので　
    p[i] = p[i-1] + comb(i-1 ,B-1) * de2 % mod 
    q[i] = q[i-1] + comb(i-1 ,W-1) * de2  % mod 
    de2 = de2 * de_factorial[2] % mod

# print(p)
# print(q)
for i in range(1, N+1):
    tmp = 0
    tmp = ( q[i-1] + 1-p[i-1] ) * de_factorial[2] % mod
    

    print(tmp % mod)

### FIXED CODE ###

B,W = map(int, input().split())
N = B+W
mod = 10**9+7

factorial = [1]
for i in range(N+1):
    factorial.append( factorial[-1] * (i+1) % mod)
# print(factorial)



de_factorial = [0] * (N+1)
de_factorial[N] = pow(  factorial[N] , mod-2, mod  )

for i in range( N, 0, -1):
    de_factorial[i-1] = de_factorial[i] * i % mod
    
def comb(n,r):
    if n < r: return 0
    if n == r: return 1
    return (factorial[n] * de_factorial[r] * de_factorial[n-r]) % mod


p = [0] * (N+1) # Bを食べきった確率
q = [0] * (N+1) # Wを食べきった確率

de2 = de_factorial[2]
for i in range(1, N+1):
    p[i] = p[i-1] + comb(i-1 ,B-1) * de2 % mod 
    q[i] = q[i-1] + comb(i-1 ,W-1) * de2  % mod 
    de2 = de2 * de_factorial[2] % mod

    tmp = ( q[i-1] + 1-p[i-1] ) * de_factorial[2] % mod
    
    print(tmp)
### BUGGY CODE ###

import numpy as np
N, W = map(int, input().split())
#dp[v] vとなる最小のＷ
dp = np.full(10**5+1, 10**9+1, dtype=np.int64)
for _ in range(N):
    w,v = map(int, input().split())
    for val in range(10**5, 1, -1):
        if val - v < 1:
            break
        dp[val] = min(dp[val], dp[val - v] + w)
    if dp[v] > w:
        dp[v] = w
print(max(np.where(dp <= W)[0]))

### FIXED CODE ###

def main():
    N, W = map(int, input().split())
    #dp[v] vとなる最小のＷ
    dp = [10**9+1 for _ in range(10**5+1)]
    for _ in range(N):
        w,v = map(int, input().split())
        for val in range(10**5, 1, -1):
            if val - v < 1:
                break
            dp[val] = min(dp[val], dp[val - v] + w)
        if dp[v] > w:
            dp[v] = w
    ans = 0
    for v, w in enumerate(dp):
        if w <= W:
            ans = max(ans, v)
    print(ans)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

n, m = map(int, input().split())
l = [[-1 for j in range(m)] for i in range(n)]
for i in range(n):
    for j in range(m):
        l[i][j] *= -1
        if (j-1) >= 0: l[i][j-1] *= -1
        if (j+1) < m: l[i][j+1] *= -1
        if (i-1) >= 0:
            l[i-1][j] *= -1
            if (j-1) >= 0: l[i-1][j-1] *= -1
            if (j+1) < m: l[i-1][j+1] *= -1
        if (i+1) < n:
            l[i+1][j] *= -1
            if (j-1) >= 0: l[i+1][j-1] *= -1
            if (j+1) < m: l[i+1][j+1] *= -1
ans = 0
for i in range(n):
    ans += l[i].count(1)
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
print(abs((n-2)*(m-2)))
### BUGGY CODE ###

n, k = map(int, input().split())
xy = []
for _ in range(n):
  xy.append(tuple(map(int, input().split())))

mins = None
for i, _xl in enumerate(xy):
  for _xr in xy[i:]:
    for j, _yu in enumerate(xy):
      for _yd in xy[j:]:
        c = 0
        for _xy in xy:
          if min(_xl[0], _xr[0]) <= _xy[0] <= max(_xl[0], _xr[0]) and min(_yd[1], _yu[1]) <= _xy[1] <= max(_yd[1], _yu[1]):
            c += 1
        if c >= k:
          if mins is None:
            mins = abs(_xl[0] - _xr[0]) * abs(_yu[1] - _yd[1])
          elif mins > abs(_xl[0] - _xr[0]) * abs(_yu[1] - _yd[1]):
            mins = abs(_xl[0] - _xr[0]) * abs(_yu[1] - _yd[1])
print(mins)


### FIXED CODE ###

from itertools import combinations

n, k = map(int, input().split())
xlist, ylist, xy = [], [], []
for _ in range(n):
  x, y = map(int, input().split())
  xlist.append(x)
  ylist.append(y)
  xy.append((x, y))

xlist.sort()
ylist.sort()
ans = (xlist[-1] - xlist[0]) * (ylist[-1] - ylist[0])
for x1, x2 in combinations(xlist, r=2):
  for y1, y2 in combinations(ylist, r=2):
    tmpk = 0
    for i in range(n):
      if x1 <= xy[i][0] <= x2 and y1 <= xy[i][1] <= y2:
        tmpk += 1

      if tmpk >= k:
        tmp_ans = (x2 - x1) * (y2 - y1)
        if ans > tmp_ans:
          ans = tmp_ans

print(ans)
### BUGGY CODE ###

# E
import fractions

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

value = 1
for a in A:
    value = value * a // fractions.gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value * pow(i, mod-2,mod)
    ans = ans % mod

print(ans)


### FIXED CODE ###

# E
from fractions import gcd

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

value = 1
for a in A:
    value = value * a // gcd(value, a)

mod = 10**9+7

ans = 0
for i in A:
    ans += value // i

print(ans%mod)
### BUGGY CODE ###

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

ok = [1 for i in range(len(A))]

for i in range(len(A)-1):
  for j in range(i+1, len(A)):
    if ok[j] == 0:
      continue
    if A[i] == A[j]:
      ok[i] = ok[j] = 0
      continue
    if A[j] % A[i] == 0:
      ok[j] = 0

print(sum(ok))

### FIXED CODE ###

N = int(input())
*A,=map(int,input().split())
A = sorted(A)

if N == 1:
  print(1)
  exit()

flag = [0]*(10**6+5)
for i in range(N):
  flag[A[i]] = 1

for i in range(N):
  if flag[A[i]] == 0:
    continue
  if i>0 and A[i]==A[i-1]:
    flag[A[i]] = 0
    continue
  for num in range(A[i]*2,A[-1]+1,A[i]):
    flag[num] = 0
  
print(sum(flag))