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

import numpy as np

n,m,q = list(map(int, input().split()))

lrs = [list(map(int, input().split())) for _ in range(m)]
pqs = [list(map(int, input().split())) for _ in range(q)]

train_array = np.zeros((n+1,n+1),dtype=int)

for lr in lrs:
    train_array[lr[0]][lr[1]] +=1


#print(train_array)

train_array_ruisekiwa = np.zeros((n+1,n+1), dtype = int)

for index, train_vector in enumerate(train_array):
    train_array_ruisekiwa[index][0] = train_vector[0]

    for i in range(1, n+1):
        train_array_ruisekiwa[index][i] = train_array_ruisekiwa[index][i-1] + train_vector[i]

#print(train_array_ruisekiwa)

for pq in pqs:
    ans = 0
    for i in range(pq[0],pq[1]+1):
        ans += train_array_ruisekiwa[i][pq[1]] - train_array_ruisekiwa[i][pq[0] - 1]

    print(ans)

### FIXED CODE ###

import numpy as np
import sys

input=sys.stdin.readline

n,m,q = list(map(int, input().split()))

lrs = [list(map(int, input().split())) for _ in range(m)]
pqs = [list(map(int, input().split())) for _ in range(q)]

train_array = np.zeros((n+1,n+1),dtype=int)

for lr in lrs:
    train_array[lr[0]][lr[1]] +=1


#print(train_array)

train_array_ruisekiwa = np.zeros((n+1,n+1), dtype = int)

for i in range(1, n+1):
    for j in range(1, n+1):
        train_array_ruisekiwa[i][j] = train_array[i][j] + train_array_ruisekiwa[i][j-1] + train_array_ruisekiwa[i-1][j] - train_array_ruisekiwa[i-1][j-1]

#print(train_array_ruisekiwa)

for pq in pqs:
    print(train_array_ruisekiwa[pq[1]][pq[1]] - train_array_ruisekiwa[pq[1]][pq[0]-1] - train_array_ruisekiwa[pq[0]-1][pq[1]] + train_array_ruisekiwa[pq[0]-1][pq[0]-1])
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
b = []
for i in a:
  if i > 10**5:
    break
  else:
    b.append(i)
ans = len(a)-len(b)
for i in range(1,10**5+1):
  if b.count(i) == i or 0:
    continue
  elif b.count(i) < i:
    ans += b.count(i)
  elif b.count(i) > i:
    ans += b.count(i)-i
print(ans)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
b = [i for i in a if i <= 10**5]
ans = len(a)-len(b)
import collections
c = collections.Counter(b)
for i in range(0,10**5+1):
  if c[i] < i:
    ans += c[i]
  if c[i] > i:
    ans += c[i]-i
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
F - LCS
https://atcoder.jp/contests/dp/tasks/dp_f

"""
import sys


def solve(s, t):
    n, m = len(s), len(t)
    dp = [[0] * (m + 1) for _ in range(n + 1)]
    for i in range(n):
        for j in range(m):
            if s[i] == t[j]:
                dp[i+1][j+1] = dp[i][j] + 1
            else:
                dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])
    ans = []
    y, x = n, m
    lcs = dp[y][x]
    while x > 0 or y > 0:
        if y-1 >= 0 and dp[y-1][x] == lcs:
            y -= 1
        elif x-1 >= 0 and dp[y][x-1] == lcs:
            x -= 1
        else:
            y -= 1
            x -= 1
            ans.append(s[y])
            lcs -= 1
    return ''.join(ans[::-1])


def main(args):
    s = input()
    t = input()
    ans = solve(s, t)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
F - LCS
https://atcoder.jp/contests/dp/tasks/dp_f

"""
import sys


def solve(s, t):
    n, m = len(s), len(t)
    dp = [[0] * (m + 1) for _ in range(n + 1)]
    for i in range(n):
        for j in range(m):
            if s[i] == t[j]:
                dp[i+1][j+1] = dp[i][j] + 1
            else:
                dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])
    ans = []
    y, x = n, m
    lcs = dp[y][x]
    while x > 0 or y > 0:
        if y-1 >= 0 and dp[y-1][x] == lcs:
            y -= 1
        elif x-1 >= 0 and dp[y][x-1] == lcs:
            x -= 1
        else:
            y -= 1
            x -= 1
            ans.append(s[y])
            lcs -= 1
    return ''.join(ans[::-1])


def main(args):
    s = input()
    t = input()
    ans = solve(s, t)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
### BUGGY CODE ###

h, w, d = map(int, input().split())

p = [[] for _ in range(h * w)]

for i in range(h):
    temp = list(map(int, input().split()))
    for j in range(w):
        p[temp[j] - 1] = [i, j]

q = int(input())
a = [[int(x) - 1 for x in input().split()] for _ in range(q)]

s = [0 for _ in range(h * w)]
for i in range(d, h * w):
    s[i] = abs(p[i][0] - p[i - d][0]) + abs(p[i][1] - p[i - d][1])

for i in range(q):
    temp = 0
    j = a[i][1]
    while j > a[i][0]:
        temp += s[j]
        j -= d
    print(temp)


### FIXED CODE ###

h, w, d = map(int, input().split())

p = [[] for _ in range(h * w)]

for i in range(h):
    temp = list(map(int, input().split()))
    for j in range(w):
        p[temp[j] - 1] = [i, j]

q = int(input())
a = [[int(x) - 1 for x in input().split()] for _ in range(q)]

s = [0 for _ in range(h * w)]
for i in range(d, h * w):
    s[i] = s[i - d] + abs(p[i][0] - p[i - d][0]) + abs(p[i][1] - p[i - d][1])

for i in range(q):
    print(s[a[i][1]] - s[a[i][0]])
### BUGGY CODE ###

import random
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
ans = 0
a = []
last = [0]*26
for i in range(1,d+1):
    res = -float("inf")
    index = 0
    for k in range(26):
        x = k
        tnplast = last
        tnplast[x] = i
        tnp = 0
        tnp += s[i-1][x]
        for j in range(26):
            tnp -= c[j]*(i-last[j])
        if (tnp > res):
            res = tnp
            index = k+1
    ans += res
    a.append(index)

def rec(t):
    r = 0
    l = [0]*26
    for i in range(1,d+1):
        x = t[i-1]-1
        l[x] = i
        r += s[i-1][x]
        for j in range(26):
            r -= c[j]*(i-l[j])
    return r
    
for i in range(10000):
    x = random.randrange(1,d+1)
    y = random.randrange(1,27)
    t = a
    t[x-1] = y
    A = rec(t)
    if (ans < A):
        a = t
        ans = A

print(*a ,sep="\n")
    
    

### FIXED CODE ###

import random
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
ans = 0
last = [0]*26
for i in range(1,d+1):
    x = random.randrange(26)
    print(x+1)
### BUGGY CODE ###

N, Q = map(int, input().split())
S = list(input())
TD = [tuple(input().split()) for _ in range(Q)]
G = [1 for _ in range(N)]

TD_ALPHA = dict()
for i, s in enumerate(S):
	if s in TD_ALPHA:
		TD_ALPHA[s] += [i]
	else:
		TD_ALPHA[s] = [i]

for td in TD:
	if td[0] in TD_ALPHA:
		for i in TD_ALPHA[td[0]]:
			if "L" == td[1]:
				if 0 == i:
					G[i] = 0
				else:
					G[i-1] += G[i]
					G[i] = 0
			else:
				if N-1 == i:
					G[i] = 0
				else:
					G[i+1] += G[i]
					G[i] = 0
print(sum(G))


### FIXED CODE ###

N, Q = map(int, input().split())
S = list(input())
TD = [tuple(input().split()) for _ in range(Q)]

def bs_l(f, s, e):
	if s==e:
		return s if f(s) else s+1

	c = (s+e)//2
	if f(c):
		#左
		return bs_l(f, s, c if c == s else c-1)
	else:
		#右
		return bs_l(f, c if c == e else c+1, e)

def bs_r(f, s, e):
	if s==e:
		return s if f(s) else s-1

	c = (s+e)//2
	if not f(c):
		#左
		return bs_r(f, s, c if c == s else c-1)
	else:
		#右
		return bs_r(f, c if c == e else c+1, e)

def isAlive(c):
	for t, d in TD:
		if S[c] == t:
			c += 1 if "R" == d else -1
			if c < 0 or N <= c:
				return False
	return True

S, E = bs_l(isAlive, 0, N-1), bs_r(isAlive, 0, N-1)
print(max(E-S+1, 0))
### BUGGY CODE ###

a = set()
for i in range(int(input())):
    a = a^set([int(input())])
print(len(a))

### FIXED CODE ###

nums = int(input())
ary = list(range(nums))
check_number = [0 for i in range(nums+2)]
for i in range(nums):
    ary[i] = int(input())

ary.sort()
check = 0
count = 0
result = 0
x = 0
for i in ary :
    if check == i:
        check_number[x] += 1
    else:
        check = i
        x += 1
        check_number[x] = 1

for i in check_number:
    if i % 2 == 1:
        result += 1
print (result)
### BUGGY CODE ###

from decimal import Decimal, getcontext
getcontext().prec = 10000
a, b, c = map(Decimal, input().split())
print("Yes" if a**Decimal(0.5)+b**Decimal(0.5) < c**Decimal(0.5) else "No")


### FIXED CODE ###

from decimal import Decimal, getcontext
getcontext().prec = 1000
a, b, c = map(Decimal, input().split())
print("Yes" if a+b+Decimal(2)*((a*b)**Decimal(0.5)) < c else "No")
### BUGGY CODE ###

def resolve():
    from fractions import gcd
    n = int(input())
    a = list(map(int, input().split()))
    mod = 10**9 + 7
    lsd = a[0]
    for i in range(1, n):
        lsd = (lsd * a[i]) // gcd(lsd, a[i])

    ans = 0
    for i in range(n):
        ans += (lsd//a[i]) % mod

    print(int(ans % mod))


if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    def lcm(X, Y):
        x = X
        y = Y
        if y > x:
            x, y = y, x
        while x % y != 0:
            x, y = y, x % y
        return X * Y // y
    n = int(input())
    a = list(map(int, input().split()))
    mod = 10**9 + 7
    lsd = a[0]
    for i in range(1, n):
        lsd = lcm(lsd, a[i])
    lsd = lsd % mod

    ans = 0
    for i in range(n):
        ans += (lsd * pow(a[i], mod-2, mod)) % mod

    print(int(ans % mod))

resolve()
### BUGGY CODE ###

h, n = map(int, input().split())
ab = [tuple(map(int, input().split())) for _ in range(n)]

dp = [10 ** 18] * 10 ** 4 * 2
dp[0] = 0
for a, b in ab:
    for i in range(h):
        dp[i + a] = min(dp[i + a], dp[i] + b)
print(min(dp[h:]))

### FIXED CODE ###

h, n = map(int, input().split())
ab = tuple(tuple(map(int, input().split())) for _ in range(n))

dp = [10 ** 20] * 10 ** 4 * 2
dp[0] = 0
for a, b in ab:
    for i in range(h):
        dp[i + a] = min(dp[i + a], dp[i] + b)
print(min(dp[h:]))
### BUGGY CODE ###

import sys
n = int(input())
ls = list(map(int,input().split()))
for i in range(len(ls)):
    if ls.count(ls[i]) > 1:
        print("NO")
        sys.exit()
    else:
        continue
print("YES")


### FIXED CODE ###

import collections
n = int(input())
ls = list(map(int,input().split()))
if len(ls) == len(collections.Counter(ls)):
    print("YES")
else:
    print("NO")
### BUGGY CODE ###

a, b = map(int, input().split())
p = 1

for i in range(a, b+1):
    p *= i
if p > 0:
    print("Positive")
elif p < 0:
    print("Negative")
else:
    print("Zero")

### FIXED CODE ###

a, b = map(int, input().split())
if 0 < a <= b:
    print("Positive")
elif a <= b < 0:
    if (b-a+1) % 2 == 0:
        print("Positive") 
    else:
        print("Negative")
else:
    print("Zero")
### BUGGY CODE ###

from collections import Counter

n = int(input())
A = list(map(int, input().split()))
counter = Counter(A)
S = [x * (x - 1) // 2 for x in counter.values()]

# (n-1)(n-2)/2 - n(n-1)/2 = 1 - n
print('\n'.join(str(sum(S) + 1 - counter[x]) for x in A))



### FIXED CODE ###

from collections import Counter

n = int(input())
A = list(map(int, input().split()))
counter = Counter(A)
s = sum(x * (x - 1) // 2 for x in counter.values())

# (n-1)(n-2)/2 - n(n-1)/2 = 1 - n
print('\n'.join(str(s + 1 - counter[x]) for x in A))
### BUGGY CODE ###

import math

N = int(input())
points = []
for _ in range(N):
  points.append(list(map(int, input().split())))

# get orientation
def orientation(p, q, r):
  v = (q[1] - p[1]) * (r[0] - q[0]) - (q[0] - p[0]) * (r[1] - q[1])
  if v == 0:
    return 0
  elif v > 0:
    return 1
  else:
    return 2

# get left most point
def left_index(points):
  minn = 0
  for i in range(1, len(points)):
    if points[i][0] < points[minn][0]:
      minn = i
    elif points[i][0] == points[minn][0]:
      if points[i][1] > points[minn][1]:
        minn = i
  return minn

# get convex hull
def convex_hull(points, n):
  if n < 3:
    return
  l = left_index(points)
  hull = []
  p = l
  q = 0
  while True:
    hull.append(p)
    q = (p + 1) % n
    for i in range(n):
      if orientation(points[p], points[i], points[q]) == 2:
        q = i
    p = q
    if p == l:
      break
  return hull

hull = convex_hull(points, len(points))

res = 0

def distance(p, q):
  return abs(p[0] - q[0]) + abs(p[1] - q[1])

if len(points) == 2:
  print(distance(points[0], points[1]))
  exit()

for i in range(len(hull)):
  for j in range(len(hull)):
    if i == j:
      continue
    res = max(res, distance(points[hull[i]], points[hull[j]]))

print(res)

### FIXED CODE ###

from math import sqrt

N = int(input())
ps = set()
for _ in range(N):
  ps.add(tuple(map(int, input().split())))
ps = list(ps)
ps.sort()

def cross3(a, b, c):
  return (b[0]-a[0])*(c[1]-a[1]) - (b[1]-a[1])*(c[0]-a[0])

def cross(a, b, c, d):
  return (b[0]-a[0])*(d[1]-c[1]) - (b[1]-a[1])*(d[0]-c[0])

# ps = [(x, y), ...]: ソートされた座標list
def convex_hull(ps):
  qs = []
  N = len(ps)
  for p in ps:
    # 一直線上で高々2点にする場合は ">=" にする
    while len(qs) > 1 and cross3(qs[-1], qs[-2], p) > 0:
      qs.pop()
    qs.append(p)
  t = len(qs)
  for i in range(N-2, -1, -1):
    p = ps[i]
    while len(qs) > t and cross3(qs[-1], qs[-2], p) > 0:
      qs.pop()
    qs.append(p)
  return qs

# キャリパー法(Rotating Calipers法)
# 凸多角形を回転しながら走査し、最遠点対を求める
def dist(a, b):
  return abs(a[0]-b[0]) + abs(a[1]-b[1])

def rotating_calipers(ps):
  qs = convex_hull(ps)
  n = len(qs)
  if n == 2:
    return dist(qs[0], qs[1])
  i = j = 0
  for k in range(n):
    if qs[k] < qs[i]: i = k
    if qs[j] < qs[k]: j = k
  res = 0
  si = i; sj = j
  while i != sj or j != si:
    res = max(res, dist(qs[i], qs[j]))
    if cross(qs[i], qs[i-n+1], qs[j], qs[j-n+1]) < 0:
      i = (i + 1) % n
    else:
      j = (j + 1) % n
  return res

if len(ps) == 1:
  print(0)
elif len(ps) == 2:
  print(dist(ps[0], ps[1]))
else:
  print(rotating_calipers(ps))
### BUGGY CODE ###

N,K=map(int, input().split())
A=list(map(int, input().split()))
import numpy as np

def f(A):
  D=[0]*(N+1)
  for j in range(N):
    d=A[j]
    mi=max(j-A[j],0)
    ma=min(j+A[j],N-1)
    D[mi]+=1
    D[ma+1]-=1   
  A=np.cumsum(D)
  return A 

for i in range(min(K,42)):
  A=list(f(A))  
  
print(*A[:-1])

### FIXED CODE ###

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

def f(A):
  D=[0]*(N+1)
  for j in range(N):
    mi=max(j-A[j],0)
    ma=min(j+A[j],N-1)
    D[mi]+=1
    D[ma+1]-=1   
  for i in range(1,N):
    D[i]+=D[i-1]
  A=D[:-1]
  return A 

for i in range(min(K,42)):
  A=f(A)
print(*A)
### BUGGY CODE ###

def fuctorial(n):
    ret = 1
    while n > 0:
        ret *= n
        n -= 1
    return ret

def combination(n, k):
    return fuctorial(n) // (fuctorial(n-k) * fuctorial(k))


N, K = map(int, input().split())
MOD = 10**9+7
for i in range(1,K+1):
    print(combination(N - K + 1, i) * combination(K - 1, i - 1) % MOD)


### FIXED CODE ###

def fuctorial(n):
    ret = 1
    while n > 0:
        ret *= n
        n -= 1
    return ret

def combination(n, k, MOD):
    return (fuctorial(n) // (fuctorial(n-k) * fuctorial(k)))%MOD


def main():
    N, K = map(int, input().split())
    MOD = 10**9+7
    for i in range(1, K + 1):
        if i > N - K + 1:
            print(0)
        else:
            print(combination(N - K + 1, i,MOD) * combination(K - 1, i - 1,MOD) % MOD)

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

from collections import deque

mod = 10**9+7

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]

cnt = [[0]*w for _ in range(h)]
cnt[0][0] = 1

D = deque()
D.append((0, 0))

dxdy = [(0, 1), (1, 0)]

appended =  [[False]*w for _ in range(h)]
appended[0][0] = True
while D:
  p = D.popleft()
  if p == (h-1, w-1):
    break
  for k in range(2):
    nx = p[0] + dxdy[k][0]
    ny = p[1] + dxdy[k][1]
    if 0<=nx<h and 0<=ny<w and maze[nx][ny]==".":
      cnt[nx][ny] += cnt[p[0]][p[1]]
      cnt[nx][ny] %= mod
      if appended[nx][ny]==False:
        D.append((nx, ny))
        appended[nx][ny] = True

print(cnt[h-1][w-1])

### FIXED CODE ###

from collections import deque

mod = 10**9+7

h, w = map(int, input().split())
maze = [list(input()) for _ in range(h)]

cnt = [[0]*w for _ in range(h)]
cnt[0][0] = 1

D = deque()
D.append((0, 0))

dxdy = [(0, 1), (1, 0)]

appended =  [[False]*w for _ in range(h)]
appended[0][0] = True
while D:
  p = D.popleft()
  if p == (h-1, w-1):
    break
  for k in range(2):
    nx = p[0] + dxdy[k][0]
    ny = p[1] + dxdy[k][1]
    if 0<=nx<h and 0<=ny<w and maze[nx][ny]==".":
      cnt[nx][ny] += cnt[p[0]][p[1]]
      cnt[nx][ny] %= mod
      if appended[nx][ny]==False:
        D.append((nx, ny))
        appended[nx][ny] = True

print(cnt[h-1][w-1])
### BUGGY CODE ###

N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
counter = 0
for i in range(0, N):
    j = A[i] - 2
    if j == 0 or j == 1:
        counter += 1
    else:
        while j > 1:
            if A[i] % j == 0:
                break
            else:
                j -= 1
        else:
            counter += 1
print(counter)

### FIXED CODE ###

def isprime(x):
    import math
    if  x == 2:
        return True
    elif x < 2 or x % 2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(x):
            if x % i == 0:
                return False
            i += 2
        return True

N = int(input())
A=[]
for i in range(N):
    A.append(int(input()))
counter = 0
for i in range(0, N):
    if isprime(A[i]):
        counter += 1
        
print(counter)
### BUGGY CODE ###

from fractions import gcd
import math

a,b=map(int,input().split())

gcd_num=gcd(a,b)
first_gcd=gcd_num

f=[]
while gcd_num!=1:
    for i in range(2,int(math.sqrt(first_gcd))+2):
        if gcd_num%i==0:
            gcd_num=gcd_num//i
            f.append(i)
            break
print(len(set(f))+1)


### FIXED CODE ###

from fractions import gcd

a,b=map(int,input().split())

gcd=gcd(a,b)
ab_gcd=gcd

f=[]
for i in range(2,int(ab_gcd**0.5)+1):
    while gcd%i==0:
        gcd=gcd//i
        f.append(i)
if gcd!=1:
    f.append(gcd)

print(len(set(f))+1)
### BUGGY CODE ###

def resolve():
    s = list(input())
    ls = len(s)
    ans = 0
    while "BW" in "".join(s):
        for i in range(ls - 1):
            if s[i] == "B" and s[i + 1] == "W":
                s[i], s[i + 1] = "W", "B"
                ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()


### FIXED CODE ###

def resolve():
    s = input()
    ans = 0
    b = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += b
        else:
            b += 1
    print(ans)


if __name__ == "__main__":
    resolve()
### BUGGY CODE ###

n = int(input())
lst = [int(i) for i in input().split()]

dic = {}
for i in range(n):
  a = lst[i]
  if a >= n - 1:
    continue
  if a not in dic:
    dic[a] = set()
  dic[a].add(i)
#print(dic)
count = 0
for a in dic.keys():
  set_ = dic[a]
  for index in set_:
    b = a + index
    if b > n:
      continue
    for c in range(n - b):
      if c in dic:
        j = b + c
        if j in dic[c]:
          count += 1
print(count)

### FIXED CODE ###

n = int(input())
lst = [int(i) for i in input().split()]

dic = {}
count = 0
for i in range(n):
  num = lst[i]
  a = i + num
  if a not in dic:
    dic[a] = 1
  else:
    dic[a] += 1
  b = i - num
  if b in dic:
    count += dic[b]
print(count)
### BUGGY CODE ###

n, m = map(int, input().split())
d = {}
ans = [0] * (n)
for _ in range(m):
    a, b = map(int, input().split())
    if not a in d.keys():
        d[a] = [b]
    elif not b in d[a]:
        d[a].append(b)
    if not b in d.keys():
        d[b] = [a]
    elif not a in d[b]:
        d[b].append(a)

q = [1]
alr = [1]
while not len(q) == 0:
    x = q.pop(0)
    for i in d[x]:
        if ans[i-1] == 0:
            ans[i-1] = x
        if i in alr:
            continue
        alr.append(i)
        q.append(i)
if 0 in ans:
    print('No')
else:
    print('Yes')
    for j in ans[1:]:
        print(j)

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
d = [[] for _ in range(n+1)]
ans = [0] * (n)
for _ in range(m):
    a, b = map(int, input().split())
    d[a].append(b)
    d[b].append(a)

q = deque([1])
while not len(q) == 0:
    x = q.popleft()
    for i in d[x]:
        if ans[i-1] == 0:
            ans[i-1] = x
            q.append(i)

if 0 in ans:
    print('No')
else:
    print('Yes')
    s  = "\n".join(map(str, ans[1:]))
    print(s)
### BUGGY CODE ###

import sys

def binary_search(li, item):
  low = 0
  high = len(li) - 1
  
  while low <= high:
    mid = (low + high) // 2
    guess = li[mid]
    if item == guess:
      return True
    if item < guess:
      high = mid-1
    else:
      low = mid+1
  return False

n = int(input())
a_li = list(map(int, input().split()))
a_li.sort()
for a in a_li:
  a_li.remove(a)
  if binary_search(a_li, a) == True:
    print("NO")
    sys.exit()
print("YES")

### FIXED CODE ###

import sys


def main():
  input = sys.stdin.readline
  n = int(input())
  a_li = list(input().split())
  a_li = [int(s) for s in a_li]

  a_li.sort()
  for i in range(n-1):
    if a_li[i] == a_li[i+1]:
      print("NO")
      sys.exit()
  print("YES")
  
if __name__ == "__main__":
  main()
### BUGGY CODE ###

a, b, c, k = map(int, input().split())

total = 0
for i in range(k):
  if a != 0:
    total+=1
    a-=1
  elif b != 0:
    b-=1
  else:
    total-=1
print(total)

### FIXED CODE ###

a, b, c, k = map(int, input().split())

total=0
total+=a

if k - a == 0:
  print(total)
elif k - a < 0:
  print(k)
else:
  k-=a
  if k - b <= 0:
    print(total)
  else:
    k-=b
    print(total-k)
### BUGGY CODE ###

def resolve():
    N, X, Y = map(int, input().split())
    X -= 1
    Y -= 1
    from collections import defaultdict, deque
    ans = [0] * N
    for i in range(N):
        queue = deque([(i, 0)])
        d = [float('inf')] * N
        while queue:
            node, dist = queue.popleft()
            if d[node] != float('inf'):
                continue
            d[node] = dist
            if node == X:
                queue.append([Y, dist+1])
            if node == Y:
                queue.append([X, dist+1])
            if node + 1 < N:
                queue.append([node+1, dist+1])
            if node - 1 >= 0:
                queue.append([node-1, dist+1])
        for j in range(N):
            ans[d[j]] += 1
    for i in range(1, N):
        print(ans[i]//2)
resolve()


### FIXED CODE ###

def resolve():
    N, X, Y = map(int, input().split())
    from collections import defaultdict
    dist = defaultdict(int)
    for i in range(1, N):
        for j in range(i+1, N+1):
            _dist = min(j-i, abs(X-i) + 1 + abs(j-Y), abs(Y-i) + 1 + abs(j-X))
            dist[_dist] += 1
    for i in range(1, N):
        print(dist[i])

resolve()
### BUGGY CODE ###

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

ans = 0
big = pow(10,9) + 7
for i in range(n-1):
  for j in range(i+1,n):
    ans += a[i] * a[j]
    ans %= big
    
print(ans)

### FIXED CODE ###

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

big = pow(10,9) + 7
sums = pow(sum(a),2)
a_2 = list(map(lambda x: x ** 2, a))

print(((sums-sum(a_2)) // 2)%big)