peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def intSqrt(n):
    x = 1
    while True:
        x2 = (x + n // x) // 2
        if abs(x - x2) <= 1:
            break
        x = x2
    return x2

n = int(input())
print(intSqrt(n)**2)
# Judge status: Wrong Answer
from collections import deque
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(M)]

graph = [[] for i in range(N+1)]
for i,j in AB:
    graph[i].append(j)
    graph[j].append(i)
    
r = [-1 for i in range(N+1)] 
Q = deque([1])

while Q:
    x = Q.pop()
    for to in graph[x]:
        if r[to] == -1:
            r[to] = x 
            Q.append(to)

print("Yes")
for i in r[2:]:
    print(i)
# Judge status: Accepted
#!python3

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

def resolve():
    D, T, S = iim()

    print("Yes" if D/S <= T else "No")

if __name__ == "__main__":
    resolve()
# Judge status: Accepted
N,Q = map(int,input().split())
S = input()
left=[]
right=[]
for _ in range(Q):
  l,r = map(int,input().split())
  left.append(l)
  right.append(r)

a = [0]*N
for i in range(1,N):
  if S[i] == "C" and S[i-1] == "A":
    a[i] = a[i-1] + 1
  else:
    a[i] = a[i-1]

#print(a)
ans = []
for j in range(Q):
  ans.append(a[right[j]-1] - a[left[j]-1])

for k in ans:
  print(k)
# Judge status: Accepted
a, b, c = map(int, input().split())

if c-(a-b) < 0 :
  print(0)
else:
  print(c-(a-b))
# Judge status: Accepted
import sys

line = sys.stdin.readline().strip()
n = int(line)
print(n//2+n%2)
# Judge status: Wrong Answer
x,y = map(int,input().split())
sum = x + y/2
print(sum)
# Judge status: Accepted
def main():
    A, B = input().split()
    A = int(A)
    B1, B2 = map(int, B.split('.'))
    B = B1 * 100 + B2
    ans = A * B // 100
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def func(a, b, c):
  if (a <= c <= b):
    return "Yes"
  else:
    return "No"
  
s = input().split()
func(int(s[0]), int(s[1]), int(s[2]))
# Judge status: Accepted
N = int(input())
s = [input() for i in range(N)]
a = s.count("AC")
b = s.count("WA")
c = s.count("TLE")
d = s.count("RE")
print("AC x {}".format(a))
print("WA x {}".format(b))
print("TLE x {}".format(c))
print("RE x {}".format(d))
# Judge status: Accepted
S = input()

print("Yes" if S[2] == S[3] and S[4] == S[5] else "No")
# Judge status: Accepted
A,B=map(int,input().split())
if A%3*B%3*(A+B)%3==0:print('Possible')
else:print('Impossible')
# Judge status: Wrong Answer
nums = sorted(list(map(int, input().split())))
print(int(str(nums[0]) + str(nums[1])) + nums[2])
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
 
ans = 0
for i in range(1, n-1):
  M = max(p[i-1], p[i], p[i+1])
  m = min(p[i-1], p[i], p[i+1])
  if p[i] != M and p[i] != m: ans += 1

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
import heapq
import collections
import itertools
import bisect
mod = 10 ** 9 + 7
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A = list(np.array(A)*-1)
heap_tree = heapq.heapify(A)
for i in range(M):
    max_value = heapq.heappop(A)*-1
    max_value = (max_value//2)*-1
    heapq.heappush(A, max_value)
ans = 0
for a in A:
    ans -= a
print(ans)
# Judge status: Wrong Answer
K,A,B=map(int,input().split())
bis=1
if K==1:
  bis+=1
elif A>=B-1 or K-A+1<0:
  bis+=K
else:
  if int((K-(A-1)))%2==0:
    bis=int(A+(B-A)*(K-(A-1))/2)
  else:
    bis=A+(B-A)*int((K-(A-1))//2)+1
print(bis)
# Judge status: Wrong Answer
n,m = map(int,input().split())
drink = dict()
cost = set()
ans = 0
for i in range(n):
    ab = [int(i) for i in input().split()]
    cost.add(ab[0])
    if ab[0] in drink:
        drink[ab[0]] += ab[1]
    else:
        drink[ab[0]] = ab[1]
#ここまで入力
sorted(cost)
for i in cost:
    if m <= drink[i]:
        ans += m*i
        break
    else:
        m -= drink[i]
        ans += i * drink[i] 
    
print(ans)
# Judge status: Accepted
import itertools

n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]

c = list(itertools.combinations(range(n), 2))
ans = 0
for a, b in c:
    dist = 0
    for j in range(d):
        dist += (x[a][j]-x[b][j])**2
    if dist**(1/2) % 1 == 0:
        ans += 1
print(ans)
# Judge status: Accepted
a,b=input().split()
print(-(-int(a)//int(b)))
# Judge status: Accepted
N,S=int(input()),input()
a,b='',''
if N%2==0:
    for i in range(int(N/2)):
        a = a+S[i]
        b = S[len(S)-(i+1)]+b
    print('Yes' if a==b else 'No')
else:
    print('No')
# Judge status: Accepted
# A - ><
S = input()
N = len(S)+1
INF = 1000000
ans = [0]*N
tmp = 0
for i in range(N-1):
    if S[i]=='<':
        tmp += 1
    else:
        tmp = 0
    ans[i+1] = tmp
tmp = 0
for i in range(N-2,-1,-1):
    if S[i]=='>':
        tmp += 1
    else:
        tmp = 0
    ans[i] = max(ans[i],tmp)
print(sum(ans))
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
con=set()
wild=0

for p in a:
  if p<=399:
    con.add("灰")
  elif p<=799:
    con.add("茶")
  elif p<=1199:
    con.add("緑")
  elif p<=1599:
    con.add("水")
  elif p<=1999:
    con.add("青")
  elif p<=2399:
    con.add("黄")
  elif p<=2799:
    con.add("橙")
  elif p<=3199:
    con.add("赤")
  else:
    wild +=1
    
mini=max(1,len(con))
maxi=len(con)+wild
print(mini,maxi)
# Judge status: Wrong Answer
from sys import stdin,stdout

def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    if a>=30:
        stdout.write("YES")
    else:
        stdout.write("NO")
main()
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
dp = [0] * n
dp[1] = abs(h[0] - h[1])
for i in range(2, n):
    dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]))
print(dp[-1])
# Judge status: Accepted
from collections import deque

K = int(input())
q = deque([i for i in range(1, 10)])

cnt = 0
while cnt < K-1:
    n = q.popleft()
    d = int(str(n)[-1])
    cnt += 1
    for i in [d-1, d, d+1]:
        if i < 0 or 10 <= i:
            continue
        q.append(10*n+i)
print(q.popleft())
# Judge status: Wrong Answer
N = input()
A = input().split()

print(A[0] in A[1:])
# Judge status: Accepted
n=int(input())
s=input()
dp=[0]*(n+1)

for i in range(1,n+1):
  if s[i-1]==".":
    cnt=0
  else:
    cnt=1
  dp[i]=dp[i-1]+cnt
ans=n
for i in range(n+1):
  ans=min(ans,dp[i]+(n-i)-(dp[n]-dp[i]))
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

x = sum(B)-sum(A)

one = 0
two = 0

for i in range(N):
    if A[i] > B[i]:
        one += A[i]-B[i]
    if A[i] < B[i]:
        two += (B[i]-A[i])//2

if one<=x and two<=x:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    A=[int(_) for _ in input().split()]
    cunt=0
    for a in A:
        if a==cunt+1:cunt+=1
    if 1 in A:
        if n==1 and A[0]==1:print(0)
        else:print(n-cunt)
    else:
        print(-1)
        

if __name__=='__main__':
    main()
# Judge status: Wrong Answer
x=int(input())
for i in range(7):
  if 400+200*i <= x <= 599+200*i:
      print(8-i)
# Judge status: Accepted
import sys

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

WV = [list(map(int, sys.stdin.readline().split())) for i in range(N)]

INF = 10**11+1

dp = [[0]*(1+W) for i in range(N+1)]

for i in range(1, N+1):
    for j in range(1, W+1):
        if j-WV[i-1][0]>=0:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-WV[i-1][0]]+WV[i-1][1])
        else:
            dp[i][j] = dp[i-1][j]

print(dp[N][W])
# Judge status: Accepted

(n, k) = map(int, input().split())
(a, b) = zip(*[map(int, input().split()) for _ in range(n)])

cnt_dict = {}
for i in range(n):
    if a[i] not in cnt_dict.keys():
        cnt_dict[a[i]] = 0
    cnt_dict[a[i]] += b[i]

length = 0
for a_i in sorted(cnt_dict.keys()):
    length += cnt_dict[a_i]
    if length >= k:
        ans = a_i
        break

print(ans)
# Judge status: Wrong Answer
def main():
    a,b = map(int, input().split())
    sum = 0
    
    for height in range(1,999):
        sum += height
        if a < sum and sum < b:
          print(sum-a)
          break;
        
if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
k = []
for i in range(1,10**6+1):
  if N%i == 0:
    k.append(i+(N//i)-2)
if len(k) == 0:
  print(N-1)
else:
  print(min(k))
# Judge status: Accepted
s = list(input())
if len(s) == len(set(s)):
  print('yes')
else:
  print('no')
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

rate=[0]*9
over=0

for i in a:
  for j in range(1,9):
    if 400*(j-1) <= i < 400*j:
      rate[j]=1
      break
    elif i >= 3200:
      over+=1
      break

ansmin = rate.count(1)
ansmax = rate.count(1)
if ansmin == 0:
  ansmin=1

if over > 0:
  ansmax += over
    
#print(rate,over)
print(ansmin, ansmax)
# Judge status: Accepted
# coding: utf-8

############################

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

if n==0:
    print(x)
    exit()

z=101
p_list = list(map(int,input().split()))
pp_list = [i for i in range(102)]

for j in p_list:
    pp_list.remove(j)

for k in pp_list:
    zettaiti = abs(x-k)

    if z > zettaiti:
        z = zettaiti
        ans = k

print(ans)
# Judge status: Wrong Answer
import math
A, B, C =map(int, input().split())
if B / A >= C:
  print(C)
else:
  print(math.ceil(B/A))
# Judge status: Accepted
s = input()

ns = 0
we = 0

if "N" in s and "S" in s:
    ns = 1
elif "N" not in s and "S" not in s:
    ns = 1
if "W" in s and "E" in s:
    we = 1
elif "W" not in s and "E" not in s:
    we = 1
    
if ns == 1 and we == 1:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
from itertools import accumulate

def main():
    N = int(input())
    people = list(input())

    wests = list(accumulate([0]+people, lambda total, x: total + (1 if x == "W" else 0)))[1:]
    easts = list(accumulate([0]+people, lambda total, x: total + (1 if x == "E" else 0)))[1:]

    def linearsearch():
        easts_total = easts[-1]
        for i in range(1, N):
            yield wests[i-1] + easts_total - easts[i]

    print(min(linearsearch()))

main()
# Judge status: Accepted
N,K = list(map(int, input().split()))

a = int(N/K)
b = N % K
c = abs(b-K)


print(min(b,c))
# Judge status: Wrong Answer
import sys

A = [[0] for _ in range(3)]
for i in range(3):
    A[i] = list(map(int, input().split()))
N = int(input())
B = []
for i in range(N):
    B.append(int(input()))

for i in range(3):
    if A[i] <= B or (A[0][i] in B and A[1][i] in B and A[2][i] in B):
        print('Yes')
        sys.exit()

if (A[0][0] in B and A[1][1] in B
        and A[2][2] in B) or (A[0][2] in B and A[1][1] in B and A[2][0] in B):
    print('Yes')

print('No')
# Judge status: Accepted
import math

x = int(input())
if 1 <= x%11 <= 6:
    print(math.ceil(x/11)*2 - 1)
else:
    print(math.ceil(x/11)*2)
# Judge status: Wrong Answer
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,HP=pin()
    weapon=[tupin() for _ in range(N)]
    weapon.sort(key=lambda x:x[0])
    a=weapon[-1][0]
    
    ans=0
    for w in weapon:
        if w[1]>a:HP-=w[1];ans+=1
    if HP>0:
        ans+=(HP-1)//a+1
    print(ans)
#%%submit!
resolve()
# Judge status: Accepted
import collections
N = int(input())
S = {}
for i in range(N):
    value = input()
    if value not in S:
        S[value] = 1
    else:
        S[value] += 1
S_largest = max(S.values())
S_sorted = sorted(S.items(), key=lambda x:x[1], reverse=True)
ans = []
for i in range(len(S_sorted)):
    if S_sorted[i][1] == S_largest:
        ans.append(S_sorted[i][0])
    else:
        break
ans_sorted = sorted(ans)
for a in ans_sorted:
    print(a)
# Judge status: Wrong Answer
N,x=map(int,input().split())
a=[int(x) for x in input().split()]
cnt=0
if a[0]>x:
    cnt += a[0] - x
    a[0]=x 
for i in range(N-1):
    if a[i]+a[i+1]:
        cnt += a[i] + a[i+1] - x
        a[i+1]=x-a[i]
    
print(cnt)
# Judge status: Accepted
from collections import Counter
print(sum([i*(i-1)//2 for i in [*Counter([''.join(sorted(input())) for _ in range(int(input()))]).values()]]))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
def inpS(): return inp().rstrip().decode()
readlines = sys.stdin.buffer.readlines 

def check(n):
  x = str(n)
  if len(x) != N:
    return False
  for s, c in SC:
    if x[s-1] != str(c):
      return False
  return True
  
N, M = map(int, inp().split())
SC = [tuple(map(int, inp().split())) for _ in range(M)]

for i in range(1001):
  if check(i):
    print(i)
    exit()
print(-1)
# Judge status: Wrong Answer
n = int(input())
aa = map(int,input().split())
x = 0
for a in aa:
  x^=a
print(" ".join(str(x^a) for a in aa ))
# Judge status: Accepted
a, b, c, d = input()
print("Bad" if a==b or b==c or c==d else "Good")
# Judge status: Wrong Answer
A,B=map(int,input().split())
a=A%13
b=B%13
if A>B:
  print("Alice")
elif B>A:
  print("Bob")
else:
  print("Draw")
# Judge status: Wrong Answer
import sys
n = int(sys.stdin.readline())
lia = list(map(int, sys.stdin.readline().split()))
lib = list(map(int, sys.stdin.readline().split()))
lic = list(map(int, sys.stdin.readline().split()))
s = sum(lib)
li = []
i = 0
while i < n-1:
  if lia[i+1] - lia[i] == 1:
    li.append(i)
  i += 1
for i in li:
  s += lic[i]
print(s)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    S = input()

    right = 0
    left = 0
    for i in range(n):
        if S[i] == "(":
            left += 1
        else:
            if left:
                left -= 1
            else:
                right += 1
    res = "(" * right + S + ")" * left
    print(res)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
n,m = map(int,input().split())
a = [tuple(map(int,input().split())) for i in range(n)]
b = [tuple(map(int,input().split())) for i in range(m)]
inf = float("inf")
for ai,bi in a:
    d,num = inf,0
    for i in range(m):
        ci,di = b[i]
        x = abs(ai-ci)+abs(bi-di)
        if d > x:
            d = x
            num = i+1
    print(num)
# Judge status: Accepted
x,y =map(int,input().split())
a = [[1,3,5,7,8,10,12],[4,6,9,11],[2]]
flag = False
for i in a:
    if x in i:
        if y in i:
            flag =True
            break
print('Yes' if flag else 'No')
# Judge status: Accepted
n,m = map(int,input().split())
acli = [0]*n
wali = [0]*n
acsi = 0
wasi = 0
for i in range(m):
    p,s = map(str,input().split())
    if acli[int(p)-1] == 0:
        if s == 'AC':
            acli[int(p)-1] = 1
            acsi += 1
        elif s == 'WA':
            wali[int(p)-1] += 1
for j in range(n):
    if acli[j] == 1 and wali[j] != 0:
        wasi += wali[j]
print(acsi,wasi)
# Judge status: Accepted
X, Y = map(int,input().split())

if (X+Y)%3 != 0 or X+Y == 0:
    print(0)
    exit()

n = int((2*Y-X)/3)
m = int((2*X-Y)/3)

if n < 0  or m < 0:
    print(0)
    exit()

mod = 10**9+7


def comb(n, r, mod):
    x=y=1
    for i in range(r):
        x *= n; y *= r
        x %= mod; y %= mod
        n -= 1; r -= 1
    return x * pow(y, mod - 2, mod) % mod

print(comb(n+m, n, mod))
# Judge status: Wrong Answer
n,m=map(int,input().split())
l=[[]]*n
for i in range(m):
  a,b=map(int,input().split())
  l[a-1].append(b)
  l[b-1].append(a)
ans=[-1]*n
x=[1]
y=[]
count=1
while count<n and len(x)>0:
  for i in x:
    for j in l[i-1]:
      if ans[j-1]==-1:
        ans[j-1]=i
        y.append(j)
        count+=1
  x=y
  y=[]
if count<n:
  print('No')
else:
  print('Yes')
  for i in range(2,n):
    print(ans[i-1])
# Judge status: Accepted
s=input()
res=""
for i in range(len(s)):
    if s[i]!="B":
        res+=s[i]
    else:
        res=res[:-1]
print(res)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
N = int(input())
A = list(map(int,input().split()))

minus = []
plus = []
for i in range(len(A)):
    minus.append(A[i]-(i+1))
    plus.append(A[i]+(i+1))

d = {}
for m in minus:
    d[m] = d.get(m,0) + 1

ans = 0
for p in plus:
    ans += d.get(-p,0)
print (ans)
# Judge status: Accepted
#B
N = int(input())

flag = True
for i in range(1,10):
    if N%i == 0:
        if N//i < 10:
            flag = False
            break
            
if flag:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
def main():
    N = int(input())
    di = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}

    for _ in range(N):
        di[input()] += 1

    for k, v in di.items():
        print(f"{k} × {v}")


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(0, n, 2):
    if a[i] % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
def solve():
  ans = 0
  N, W = map(int, input().split())
  dp = [[0]*(W+1) for _ in range(N+1)]
  for i in range(1,N+1):
    w,v = map(int, input().split())
    for j in range(W+1):
      dp[i][j] = max(dp[i-1][j],dp[i][j])
      if j+w<=W:
        dp[i][j+w] = max(dp[i-1][j+w],dp[i-1][j]+v)
  return dp[-1][-1]
print(solve())
# Judge status: Wrong Answer
n = int(input())
ans = 1
dummy1,dummy2 = divmod(n,2)
for i in range(1,dummy1+1):
  ans *= i
  ans *= n+1-i
  ans = ans % (10**9+7)
if dummy2 == 1:
  ans *= (dummy1+1)
print(ans)
# Judge status: Wrong Answer
# Nの入力
N = int(input())

# A1,A2,..Anの入力
A = list(map(int,input().split()))

flg = 0         
# A1,A2...Anの積
A_multi = 1
for a in A:
    A_multi = A_multi * a
    if A_multi > 10**18:
        flg = 1
        break

# A_len = len(str(A_multi))
# if A_len > 19:
#    flg = 1

# if A_len == 19:
#    if A_multi > 10**18:
#        flg = 1

if flg == 1:
    print("-1")
else:
    print(A_multi)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=[0]
b*=10**5+1
for i in a:
    b[i]+=1
ans=sum(a)
q=int(input())
for i in range(q):
    bi,ci=map(int,input().split())
    d=b[bi]
    b[ci]+=d
    b[bi]=0
    ans=ans+d*(ci-bi)
    print(ans)
# Judge status: Accepted
x, k, d = map(int,input().split())
max_length = k * d
xx = abs(x)
answer = 0
if xx >= max_length:
    answer = xx - max_length
else:
    if (k - xx // d) % 2 == 0:
        answer = xx - xx // d * d
    else:
        answer = xx - (xx // d + 1) * d
print(abs(answer))
# Judge status: Wrong Answer
import sys

s = input()
t = input()

for i in range(len(s)-len(t)+1):
  if i == 0:
    sub = s[-i-len(t):]
  else:
    sub = s[-i-len(t):-i]
  for j in range(len(t)):
    if sub[j]!=t[j] and sub[j]!="?":
      break
  else:
    if i == 0:
      s = s[:-i-len(t)]+t
    else:
      s = s[:-i-len(t)]+t+s[-i:]
    s = s.replace("?","a")
    print(s)
    sys.exit()
  break
    
print("UNRESTORABLE")
# Judge status: Accepted
N, M = map(int, input().split())

if N <= 5:
    print(0)
elif 6 <= N <= 12:
    print(M // 2)
else:
    print(M)
# Judge status: Accepted
a, b, c = map(int, input().split())
s, t = a + b, a * b
print("No" if c - s < 0 else "Yes" if (c - s) ** 2 - 4 * t > 0 else "No")
# Judge status: Accepted
from bisect import bisect_left
from bisect import bisect_right

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()
ans = 0
for b in B:
    a_left = min(len(A), bisect_left(A, b))
    c_right = min(len(C), bisect_right(C, b))
    ans += (a_left) * (len(C) - c_right)
print(ans)
# Judge status: Accepted
import math
import copy
N, H = map(int, input().split())
a_max = [list(map(int, input().split())) for _ in range(N)]
b_max = copy.deepcopy(a_max)
b_max.sort(key=lambda x:-x[1])
a_max.sort(key=lambda x:-x[0])
damage = 0
cnt_damage = 0
for i in range(N):
    if damage >= H:
        print(cnt_damage)
        exit()
        
    if b_max[i][1] >= a_max[0][0]:
        damage += b_max[i][1]
        cnt_damage += 1
    else:
        break

cnt_damage += math.ceil((H-damage)/a_max[0][0])

print(cnt_damage)
# Judge status: Wrong Answer
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

dicts = {}
small = 0
for i in s:
    if i not in dicts.values():
        dicts[i] = 1
    else:
        dicts[i] += 1
    
for i in t:
    if i not in dicts.values():
        dicts[i] = -1
    else:
        dicts[i] -= 1

tmp = max(dicts.values())
print(max(tmp, small))
# 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+1):
    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
N, K = map(int, input().split())
S = input()

ans = ""
for i in range(N):
    if i == K - 1:
        ans += S[i].lower()
    else:
        ans += S[i]
print(ans)
# Judge status: Accepted
L = [list(map(int, input().split())) for _ in range(3)]
T = sum([sum(i) for i in L])
print('Yes' if L[0][0] + L[1][1] + L[2][2] == (T / 3) else 'No')
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()] 

if len(set(a)) == n:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()
cnt=cnt2=0
for s in S:
    if s=='c':
        print('No')
    elif s=='a' and cnt < A+B:
        print('Yes')
        cnt+=1
    elif s=='b' and cnt < A+B and cnt2 < B:
        print('Yes')
        cnt+=1
        cnt2+=1
    else:
        print('No')
# Judge status: Accepted
N = input()
N = int(N)
S = input()

center = int(N / 2)
if S[:center] == S[center:]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
S = input()
for i in range(len(S)):
  moji = S[i]
  S = S.replace(moji, chr(ord(moji)+N))
print(S)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=list(map(int,input().split()))
import math
print(math.floor(m/max(a)-0.5)+1)
# Judge status: Accepted
# AtCoder Beginner Contest 054
# A - One Card Poker
A, B = map(int, input().split())
if A == 1:
    A = 14
if B == 1:
    B = 14
if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')
# Judge status: Wrong Answer
n = int(input())
if n%11 == 0:
    print((n//11)*2)
elif n%11 < 6:
    print((n//11)*2+1)
else:
    print((n//11)*2+2)
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
ans = [0]*201
for a in A:
  for i in range(-100,101):
    ans[i+100] += (a-i)**2
print(min(ans))
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
lr,rr=sorted(x)[n//2-1:n//2+1]
print('\n'.join([str(lr) if lr<i else str(rr) for i in x]))
# Judge status: Accepted
#python3
from collections import defaultdict
n,m = map(int, input().split())
a = []
dic = defaultdict(list)
for _ in range(m):
  x,y = map(str, input().split())
  dic[int(x)].append(y)

acc=0
for j in dic.values():
  if 'AC' in j:
    acc+=1;


cnt=0
for li in dic.values():
  if 'AC' in li:
    for j in li:
      if j == 'AC':
        break
      cnt+=1

ans = str(acc) + ' ' + str(cnt)
print(ans)
# Judge status: Wrong Answer
x, a, b = map(int, input().split())
print(['B', 'A'][abs(x - a) > abs(x - b)])
# Judge status: Accepted
n,k,q = map(int,input().split())
player = [0] * n
for i in range(q):
    player[int(input())-1] += 1
result = ['Yes' if k - q + player[i] > 0 else 'No' for i in range(n)]
for i in result:
    print(i)
# Judge status: Accepted
import math
n,m=map(int,input().split())
print( math.factorial(n+m) // (math.factorial(n+m-2) * math.factorial(2))-n*m)
# Judge status: Wrong Answer
import heapq

N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
B = sorted([list(map(int,input().split())) for i in range(M)], key = lambda x: x[1])

heapq.heapify(A)
cnt = 0
for i in range(M):
    for _ in range(B[i][0]):  heapq.heappush(A, max(heapq.heappop(A), B[i][1]))
    cnt += B[i][0]
    if cnt >= N:  break
print(sum(A))