peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n,k = map(int, input().split())
H = list(map(int, input().split()))
l = n-k
sorted(H)
if k >= n : print(0)
else:
    print(sum(H[:l]))
# Judge status: Accepted
n,a,b,c,d = map(int, input().split())
s = input()

if '##' in s[a-1:c] or '##' in s[b-1:d]:
    print('No')
else:
    if c<d:
        print('Yes')
    else:
        if '...' in s[b-2:d+1]:
            print('Yes')
        else:
            print('No')
# Judge status: Wrong Answer
import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

A.sort()
B.sort()
C.sort(reverse=True)

#2分探索を用いる
ans = 0
for i in B:
    a = bisect.bisect_left(A,i)
    b = bisect.bisect_left(C,i)
    ans += a*b
print(ans)
# Judge status: Wrong Answer
N = int(input())
a = [int(input()) for _ in range(N)]
a = [s-1 for s in a]
index = 0
count = 1
flag = False
while(count <= N):
  index = a[index]
  count += 1
  if a[index] == 1:
    flag = True
    break
if (flag):
  print(count)
else:
  print(-1)
# Judge status: Accepted
N, T = map(int, input().split())
min_cost = 10**9
for i in range(N):
    c, t = map(int, input().split())
    if t > T:
        continue
    else:
        min_cost = min(min_cost, c)
if min_cost != 10**9:
    print(min_cost)
else:
    print("TLE")
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
now = n
for i in range(1,n+1):
  if now == i:
    key = -1
    top = i
    break
  elif now - i < 0:
    key = i - now
    top = i
    break
  else:
    now -= i
for i in range(1,top+1):
  if i != key:print(i)
# Judge status: Accepted
s = input()
if int(s[:4]) <= 2019:
  if int(s[5:7]) == 4 and int(s[8:]) <= 30:
    print("Heisei")
  elif int(s[5:7]) < 4:
    print("Heisei")
  else:
    print("TBD")
else:
  print("TBD")
# Judge status: Wrong Answer
alphabet = [chr(ord('a') + i) for i in range(26)]
s = list(input())
s = sorted(list(set(s)))
if len(s) == 26:
    print("None")
    exit()
for i in range(len(s)):
    if i == len(s) - 1:
        print(alphabet[i + 1])
        exit()
    elif s[i] == alphabet[i]:
        pass
    else:
        print(alphabet[i])
        exit()
# Judge status: Accepted
n = int(input())

l = []
for i in range(n):
  x,y = map(str,input().split())
  l.append((x,y, i))


L = []

for i in range(n):
  L.append((l[i][0], int(l[i][1]), l[i][2]))

L.sort(key = lambda L:(L[0],-L[1]))


for i in range(n):
  print(L[i][2] + 1)
# Judge status: Accepted
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    N, K = iim()
    *A, = iim()

    ans = []
    for i in range(N-K):
        ans.append("Yes" if A[i] < A[i+K] else "No")

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

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
a=[]
for i in range(5):
    a+=input()
n=int(input())
count=0
for c in range(5):
    for i in range(c,5):
        z=abs(int(a[c])-int(a[i]))
        if z>n:
            count+=1
if count==0:
    print('Yay!')
else:
    print(':(')
# Judge status: Wrong Answer
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
ans=0
n = int(input())
for i in range(1,n+1):
    d=make_divisors(i)
    ans+=-((-len(d))//2)
print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())

if a > b:
    print(0)
elif n == 1 and a != b:
    print(0)
else:
    minimum = a * (n-1) + b
    maximum = a + (n-1) * b
    print(maximum - minimum + 1)
# Judge status: Accepted
K=str(input())
if (int(K[0])%7==0 and int(K[0])!=0 )or (int(K[1])%7==0 and int(K[1])!=0 ) or (int(K[2])%7==0 and int(K[2])!=0 ):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
    n = int(input())
    s = input()

    if n % 2 == 0:
        if s[:n // 2] == s[n // 2:]:
            ans = "Yes"
        else:
            ans = "No"
    else:
        ans = "No"

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
cnt = 0
for i in range(n):
    if a[i]%2==1 and (i+1)%2==1:
        cnt +=1
print(cnt)
# Judge status: Accepted
N,M=map(int, input().split())
d=set()
a,b=1,N
for _ in range(M):
    print(a,b)
    d.add(b-a)
    d.add(N-b+a)
    a+=1
    b-=1
    while b-a in d or N-b+a in d or b-a == N-b+a: b-=1
# Judge status: Wrong Answer
n = int(input())
a = [0] * n; b = [0] * n
for i in range(n):
    a[i],b[i] = map(int,input().split()) 

if n%2 != 0 :
    print(b[n//2] - a[n//2] + 1)
    exit(0)

def m_r(c):
    return (c[n//2] + c[n//2 - 1])

z = m_r(b) - m_r(a) + 1
print(z)
# Judge status: Accepted
n = input()

if '7' in n:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
Y = []
for s in inputs[1:]:
    x, l = map(int, s.split())
    Y.append((x-l+1, x+l-1))
Y.sort(key=lambda x: x[0])

cnt = 0
l0, r0 = Y[0]
for i in range(1, n):
    l, r = Y[i]
    if r0 >= l:
        cnt += 1
        if r0 > r:
            l0, r0 = l, r
print(n-cnt)
# Judge status: Accepted
N = int(input())
L = [111*i for i in range(1,10)]
ans = 0
for l in L:
    if N <= l:
        ans = l
        break
print(l)
# Judge status: Wrong Answer
n, m = map(int, input().split())

a_lst = []
case = [0] * n
for j in range(m):
  a = int(input())
  a_lst.append(a)

for k in range(n):
  if (k + 1) in a_lst:
    pass
  elif k == 0:
    case[k] = 1
  elif k == 1:
    case[k] = case[k-1] + 1
  else:
    case[k] = case[k-1] + case[k-2]
print(case[-1])
# Judge status: Accepted

url = "https://atcoder.jp//contests/abc115/tasks/abc115_a"

def main():
    c = 25
    today = int(input())

    print('Christmas' + ' Eve' * (c - today))

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,s=[(input()) for i in range(2)]
if int(a)>=3200:
    print(s)
else:
    print('red')
# Judge status: Accepted
l = [list(map(int,input().split())) for i in range(3)]
ans = 0
for i in l:
  ans += sum(i)
print("Yes" if ans/3==(l[0][0]+l[1][1]+l[2][2]) else "No")
# Judge status: Wrong Answer
a, b, c = list(map(int, input().split()))

if b - a == c - a:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
print(max(a) - min(a))
# Judge status: Accepted
n,m,x,y=map(int,input().split())
for i in [i for i in range(max(list(map(int,input().split())))+1,min(list(map(int,input().split())))+1)]:
  if x<i<=y: print('No War');break
else:
  print('War')
# Judge status: Accepted
n = int(input())
d = [list(map(int, input().split())) for _ in range(n)]

cnt = 0
ans = 0
for d1, d2 in d:
    if d1 == d2:
        cnt += 1
        if cnt >= 3:
            print('Yes')
            exit()
    else:
        cnt = 0

print('No')
# Judge status: Accepted
N, M = map(int, input().split())

res = 0

if N*M==1:
    res = 1
elif N==1:
    res = (M-2)
elif M==1:
    res = (N-2)
else:
    res = (N-2)*(M-2)
print(res)
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
print(N - sum(A) if N - sum(A) >= 0 else -1)
# Judge status: Wrong Answer
N, K =map(int, input().split())
A = [int(a) - 1 for a in input().split()]
idx = 0
if K<=N:
    for i in range(K):
        idx = A[idx]
    print(A[idx] + 1)
    exit() #全ての実行をここで終了

t = [-1] * N
t[0] = 0
for i in range(1, N):
    idx = A[idx]
    last = i
    if t[idx] != -1:
        break
    t[idx] = i

d = i - t[idx]
K = K - i
amari = K%d

for i in range(amari):
    idx = A[idx]
print(idx + 1)
# Judge status: Accepted
H, W = map(int, input().split())
if H==1 or W ==1:
    print(1)
else:
    print(-(-(H*W)//2))
# Judge status: Accepted
def gcd(x,y):
    if y==0:
        return x
    if x<y:
        x,y=y,x
    x,y=y,x%y
    return gcd(x,y)
a,b=map(int,input().split())
print(a*b//gcd(a,b))
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))
dp=[10**9]*n
dp[0]=0
dp[1]=abs(h[1]-h[0])
for i in range(n-1):
    dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]))
    if i+2<n:
        dp[i+2]=min(dp[i+2],dp[i]+abs(h[i+2]-h[i]))
print(dp[-1])
# Judge status: Accepted
n = int (input ())
cnt = [[0 for i in range (10)] for i in range (10)]
for i in range (1, n + 1) :
    p = int (str (i)[0])
    q = i % 10
    cnt[p][q] += 1
    ans = 0
for i in range (1, 10) :
    for j in range (1, 10) :
        ans += cnt[i][j] * cnt[j][i]
print (ans)
# Judge status: Wrong Answer
N,A,B,C,D=list(map(int,input().split()))
l=list(input())
if "##" in "".join(l[A-1:max(C,D)]):
   print("No")
   exit()
if C>D:
   pass
else:
   print("Yes")
   exit()
if "..." in "".join(l[B-2:D+2]):
   print("Yes")
else:
   print("No")
# Judge status: Wrong Answer
X, Y, Z = map(int, input().split())
print(Z, Y, X)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int , input().split()))

if n == k:
    print(1)
    exit()

print((n + (n // k)) // (k-1))
# Judge status: Wrong Answer
import math
import itertools

def distance(c1,c2):
    x1,y1 = c1
    x2,y2 = c2
    return math.sqrt((x1-x2)**2+(y1-y2)**2)

N = int(input())
Cord = []
ls = list(itertools.permutations(range(N)))
for _ in range(N):
    Cord.append(tuple(map(int,input().split())))
ans = 0
print(ls)
for l in ls:
    for i in range(N-1):
        ans+=distance(Cord[l[i]],Cord[l[i+1]])
print(ans/len(ls))
# Judge status: Accepted
N=int(input())
D=[map(int, input().split()) for i in range(N)]
x, y = [list(i) for i in zip(*D)]

s=0
l=[]
for i in range(N):
  if x[i]==y[i]:
    s+=1
    if i==N-1:
      l.append(s)
  elif x[i]!=y[i]:
    l.append(s)
    s=0

if max(l)>=3:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
num = [int(i) for i in input().split()]
sorted_num = sorted(num)

if sorted_num[0] % 2 == sorted_num[1] % 2:
    count = sorted_num[2] - (sorted_num[0] + sorted_num[1])/2
elif sorted_num[0] % 2 != sorted_num[1] % 2:
    count = ((sorted_num[2] + 1) - (sorted_num[0] + sorted_num[1] + 1)/2) + 1

print(int(count))
# Judge status: Wrong Answer
from math import factorial

def combinations_count(n, r):
  return factorial(n) // (factorial(n - r) * factorial(r))

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

eve = 0
odd = 0

for i in range(n):
	if a[i]%2==0:
		eve += 1
	else:
		odd += 1
		
eve_cb = 2**eve
odd_cb = 0

for i in range(1,odd+1)[::2]:
	odd_cb += combinations_count(odd,i)

print(eve_cb*odd_cb)
# Judge status: Accepted
from collections import Counter

N, C, K = map(int, input().split())
T = [int(input()) for _ in range(N)]
T.sort()

ans = 1
cnt = 0
# 最後にバスが出た時間
st = T[0]
for t in T:
    cnt += 1
    # バスが出てからK時間以上たつ or count が　C を越した場合
    if t - st > K or cnt > C:
        ans += 1
        st = t
        cnt = 1

print(ans)
# Judge status: Accepted
import math;a,b=map(int,input().split());print(math.ceil((a+b)/2))
# Judge status: Accepted
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    X = input()
    ans = 0
    now = 0
    for x in X:
        if x == 'S':
            now -= 1
        else:
            now += 1
        ans = max(ans,now)
    print(ans*2)

if __name__ == "__main__":
    main()
# Judge status: Accepted
x, y = map(int, input().split())

if x %  y == 0:
	print(-1)
else:
	print(x)
# Judge status: Wrong Answer
A,B,C,D = map(int, input().split())

def calc(a,x):
    return int(a/x)

print(B - A + 1 - (calc(B, C) - calc(A-1, C) + calc(B, D) - calc(A-1, D) - (calc(B, C*D) - calc(A-1, C*D))))
# Judge status: Accepted
import math
def gooddistance(l1, l2):
    calc = []
    for i in range(len(l1)):
        calc.append((l1[i] - l2[i])**2)

    if math.sqrt(sum(calc)).is_integer():
        return 1
    else:
        return 0

N, D = map(int, input().split())
lis = [list(map(int, input().split())) for _ in range(N)]
cnt = 0

for i in range(N):
    for j in range(i+1,N):
       cnt += gooddistance(lis[i],lis[j])

print(cnt)
# Judge status: Accepted
import sys

def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

S = LS2()
T = LS2()

ans = 0
for i in range(len(S)):
    if S[i] != T[i]:
        ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
word_list = []
flag = True
for i in range(n):
    word = input()
    if word_list == []:
        word_list.append(word)
    else:
        if (word_list[-1][-1] == word[0]) and (word not in word_list):
            word_list.append(word)
        else:
            flag = False
            break
            
if flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
x=int(input())
 
a=x%11
b=x//11
 
if a==0:
    ans=2*b
elif a<=6:
    ans=2*b+1
elif 5<a<11:
    ans=2*b+2
print(ans)
# Judge status: Accepted
n=int(input())
d=list(map(int,input().split()))
num=[0]*n
num[0]=1
if d[0]!=0 or d.count(0)!=1:
    print(0)
else:
    ans=1
    for i in range(1,n):
        num[d[i]]+=1
    for i in range(1,max(d)+1):
        ans*=num[i-1]**num[i]
        ans%=998244353
    print(ans)
# Judge status: Accepted
N,W = map(int,input().split())
Value = []
weight = []
inf=float("inf")
dp=[[-inf for i in range(W+1)] for j in range(N+1)]
for i in range(W+1): dp[0][i]=0

for i in range(N):
    w,v = map(int,input().split())
    Value.append(v)
    weight.append(w)


for i in range(N):
  for w in range(W+1):
    if w>=weight[i]:
      dp[i+1][w] = max(dp[i][w-weight[i]]+Value[i],dp[i][w])
    else:
      dp[i+1][w] = dp[i][w]

print(dp[N][W])
# Judge status: Accepted
S = list(input())

if len(set(S)) == 1:
    print ('No')
else:
    print ('Yes')
# Judge status: Wrong Answer
def compress(arr):
    *XS, = set(arr)
    XS.sort()
    return {e: i for i, e in enumerate(XS)} 
n,m=map(int,input().split())
s=[[] for i in range(n+1)]
p=[0]*m
y=[0]*m
for i in range(m):
    p[i],y[i]=map(int,input().split())
    s[p[i]].append(y[i])
for i in range(1,n+1):
    s[i]=compress(s[i])
for i in range(m):
    print("0"*(6-len(str(p[i]))),p[i],"0"*(6-len(str(s[p[i]][y[i]]))),s[p[i]][y[i]]+1,sep="")
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))

res = 0
if a[0] > x:
    res += a[0] - x
    a[0] = x
for i in range(n-1):
    if a[i] + a[i+1] > x:
        val = a[i] + a[i+1] - x
        res += val
        a[i+1] -= val

print(res)
# Judge status: Wrong Answer
n,m = map(int,input().split())
dp = [1]*(n+2) 

mod = 10**9 + 7
for i in range(m):
    a = int(input())
    dp[a-1] = 0

    
for i in range(2,n+2):
    if dp[i] == 0:
        continue
    else:
        dp[i] = (dp[i-1] + dp[i-2])%mod

print(dp[n-1])
# Judge status: Accepted
a, b = input().split()

if len(a) == 1 and len(b) == 1:
    a = int(a)
    b = int(b)
    print(a * b) 
else:
    print(-1)
# Judge status: Wrong Answer
N = int(input())
print(1000-N%1000)
# Judge status: Accepted
N = int(input())
P = [int(p) for p in input().split()]
cur = float('inf')
res = 0
for p in P:
    if p <= cur:
        res += 1
    cur = min(cur, p)
print(res)
# Judge status: Accepted
S = input()
A = [0]*(len(S)+1)

for i in range(len(S)):
    if S[i] == "<":
        A[i+1] = A[i]+1

for i in range(len(S)-1, -1, -1):
    if S[i] == ">":
        A[i] = max(A[i], A[i+1]+1)

print(sum(A))
# Judge status: Wrong Answer
N = int(input())
S = str(input())

WtoE=0
EtoW=S[1:N+1].count('E')
min_ans = WtoE + EtoW

for i in range(1, N):

    if S[i-1] == 'W':
        WtoE += 1
    if S[i-1] == 'E':
        EtoW -= 1
    ans = WtoE + EtoW

    if min_ans > ans:
        min_ans = ans

print(min_ans)
# Judge status: Accepted
X=int(input())

if X>=30:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
    n = int(input())
    p = n * 25 // 27
    a, b = int(p * 1.08), int((p + 1) * 1.08)
    if a == n:
        print(p)
    elif b == n:
        print(p + 1)
    else:
        print(":(")

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
s = input()

tmp = []
ans = ""

for i in s:
    if i == "(":
        tmp.append("(")
    else:
        if len(tmp) == 0:
            ans = "(" + ans + ")"
        else:
            ans += tmp.pop() + ")"
print(ans + "".join(tmp) + ")" * len(tmp))
# Judge status: Wrong Answer
import fractions
from functools import reduce
n,m = map(int,input().split())
a = list(map(int,input().split()))
a = list(set(a))
l = 1
s = 0
h = []
ans = 0
for i in a:
  h.append(i//2)
for j in range(m):
  for k in range(len(a)):
    if j-h[k]<0:
      break
    if (j-h[k])%a[k]:
      break
  if not (j-h[k])%a[k]:
    s = j
    break
for x in a:
  l*=x
r = l//reduce(fractions.gcd, a)
ans = (m-s)//r
if ans:
  ans+=1
print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

from functools import lru_cache

def F(N):
    if N < 10:
        return N
    q, r = divmod(N, 10)
    x1 = F(q) + r
    x2 = F(q-1) + 9
    return max(x1, x2)
ans = F(int(input()))
print(ans)
# Judge status: Wrong Answer
c = input()
ord_s = ord(c)
chr_s = chr(ord_s)
print(chr_s)
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    S = input().rstrip()

    if N % 2 == 1:
        ans = "No"
    else:
        if S[:N // 2] == S[N // 2:]:
            ans = "Yes"
        else:
            ans = "No"

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
#D
n, m = list(map(int, input().split()))

room = [[0 for _ in range(n)] for _ in range(n)]

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

for i, j in l:
    room[i-1][j-1] = 1
    room[j-1][i-1] = 1

result = [0 for _ in range(n-1)]

for i in range(n):
    for j in range(n):
        if result[j-1] == 0:
            if room[i][j] == 1:
                result[j-1] = i+1
                room[j][i] = 0


    
print('Yes')
[print(i) for i in result]
# Judge status: Wrong Answer
import numpy as np

N, K = map(int, input().split())
A = np.array([int(x) for x in input().split()])
B = np.zeros(N)
C = np.zeros(N)
pos = 0
for i in range(N*2):
    B[pos] += 1
    if C[pos] == 0:
        C[pos] = i+1
    pos = A[pos] - 1
ans = K - len(B[B <= 1])
ans %= len(B[B > 1])
D = sorted(C[B > 1])
tmp = D[ans]
index = A[C == tmp]
print(*index)
# Judge status: Wrong Answer
import math
x,y=map(int, input().split())
print(int(math.log(y/x,2))+1)
# Judge status: Accepted
#!/usr/bin/env python3
import sys
import math

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

c = math.ceil(b / 0.1)

for i in range(c, c + 10):
    if math.floor(i * 0.1) == b:
        if math.floor(i * 0.08) == a:
            print(i)
            sys.exit()

print(-1)
# Judge status: Accepted
from collections import Counter
s = input()

a,b,c = s.count('a'),s.count('b'),s.count('c')
if max(a,b,c)-min(a,b,c)<=1:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import math
K = int(input())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += math.gcd(a,math.gcd(b,c))
print(ans)
# Judge status: Wrong Answer
import copy

n = int(input())
a = [int(item) for item in input().split()]

a.sort()

b = copy.deepcopy(a)
flag = []
num = []

for i in range(n):
    if i in flag:
        continue
    for j in range(i+1, n):
        if j in flag:
            continue
        if a[j] % a[i] == 0 and a[j] in b:
            flag.append(j)
            continue
        num.append(a[j])

print(len(num))
# Judge status: Accepted
import fractions

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

left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    left[i+1] = fractions.gcd(left[i], a[i])
    right[n-i-1] = fractions.gcd(right[n-i], a[n-1-i]) 

ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(left[i], right[i+1]))
print(ans)
# Judge status: Accepted
n,m,q=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(q):
	ai,bi,ci,di=map(int,input().split())
	a.append(ai)
	b.append(bi)
	c.append(ci)
	d.append(di)
from itertools import combinations_with_replacement as cmb
A=list(cmb(range(1,m+1),n))
#print(A)
ans=0
for lst in A:
	sum=0
	for i in range(q):
		if lst[b[i]-1]-lst[a[i]-1]==c[i]:
			sum+=d[i]
	ans=max(sum,ans)
print(ans)
# Judge status: Accepted
from collections import Counter
n=int(input())
s=[]
for i in range(n):
    s.append(input())
c = Counter(s)
print(len(c))
# Judge status: Accepted
# Problem B - Maximum Sum

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

# initialization
max_cost = 0

# max index search
if a>=b and a>=c:
    for i in range(k):
        a = a * 2
elif b>=a and b>=c:
    for i in range(k):
        b = b * 2
elif c>=a and c>=b:
    for i in range(k):
        c = c * 2

ans = a + b + c
print(ans)
# Judge status: Accepted
num = int(input())

flag = False
while True:
    if num == 2:
        print(2)
        exit()
    for i in range(2, int(num**0.5)+1):
        if num % i ==0:
            flag = False
            break
        else:
            flag = True
    if flag:
        print(num)
        exit()
    else:
        num+=1
# Judge status: Wrong Answer
n=input()
result=''
for s in n:
    if s=='7':
        result+='Yes'
    else:
        continue
if result=='Yes':
    print(result)
else:
    print('No')
# Judge status: Wrong Answer
##B
S = str(input())
N = int(len(S))
##print(N)
S1 = S[0:(N-1)//2]
N1 = len(S1)
S2 = S[(N+3)//2-1:N]
N2 = len(S2)

if S1 == S2:
    if S1[0:(N1-1)//2] == S1[(N1+3)//2-1:N1]:
        if S2[0:(N2-1)//2] == S2[(N2+3)//2-1:N2]:
            print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M = map(int, input().split())
boxes = [1] * N
ans = {1}
for i in range(M):
    x, y = map(int, input().split())
    boxes[x - 1] -= 1
    boxes[y - 1] += 1
    if x in ans:
        if boxes[x - 1] == 0:
            ans.remove(x)
        ans.add(y)
print(len(ans))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print('Yes' if c == a or c== b or c ==a+b else 'No')
# Judge status: Accepted
n, h = map(int, input().split())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

a = sorted(a, reverse=True)
b = sorted(b, reverse=True)

ans = 0
i = 0
while i < n and a[0] < b[i]:
    h -= b[i]
    i += 1
    ans += 1
    if h <= 0:
        break
if h <= 0:
    print(ans)
else:
    print(ans + (h + a[0] - 1) // a[0])
# Judge status: Accepted
a=input()
b=input()

good=0
for i in range(len(a)):
    if(a[i]!=b[i]):
        good+=1
print(good)
# Judge status: Accepted
L, R = map(int, input().split())

if L == 0 or R-L >= 2019:
    ans = 0
else:
    ans = 10**18
    for i in range(L, R):
        for j in range(i+1, R+1):
            tmp = (i*j)%2019
            ans = min(ans, tmp)
            if not ans:
                break
print(ans)
# Judge status: Accepted
import numpy as np
import bisect
N,M,K= map(int, input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
if A[0]>K and B[0]>K:print(0);exit()

Asum=[0]
for i in range(N):
  if Asum[-1]+A[i]<=K:
    Asum.append(Asum[-1]+A[i])  
  else:break
Bsum=[0]
for j in range(M):
  if Bsum[-1]+B[j]<=K:
    Bsum.append(Bsum[-1]+B[j])
  else:break

C=[]
for i in range(len(Asum)):
  C.append(bisect.bisect(Bsum,K-Asum[i])+i-1)
print(max(C))
# Judge status: Accepted
import math
K = int(input())
if K == 7 or K == 1:
  print(1)
elif math.gcd(K,10) != 1:
  print(-1)
else:
  if K % 7 == 0:
    K //= 7
  cnt = 1
  res = 10
  while True:
    cnt += 1
    res *= 10
    res %= (9 * K)
    if res == 1:
      break
  print(cnt)
# Judge status: Accepted
n = int(input())
s = set(input().split())
print('YES' if n == len(s) else 'NO')
# Judge status: Wrong Answer
from math import log2

X, Y = map(int, input().split())

ans = log2(Y / X) + 1
print(ans)
# Judge status: Accepted
a,b = list(map(int,input().split()))
x = list(range(int(a//0.08+1), int((a+1)//0.08+1)))
y = list(range(int(b//0.1+1), int((b+1)//0.1+1)))
z = list(set(x) & set(y))
if not z:
  print(-1)
else:
    print(min(z))