peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
# abc073_c.py
N = int(input())
A = [int(input()) for i in range(N)]
ans = set()
for i in A:
    if i in ans:
        ans.discard(i)
    else:
        ans.add(i)
print(len(ans))
# Judge status: Accepted
def main():
    n = int(input())
    s = set([input() for _ in range(n)])
    print(len(s))


if __name__=="__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
a = list(list(map(int, input().split())) for _ in range(n))
a.sort(key=lambda x: x[1])
ans = 0
for i in range(0, n - 1):
    ans += a[i][0]
    if ans > a[i][1]:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
S, T = input().split();print(T + S)
# Judge status: Accepted
H,W = [int(n) for n in input().split()]
if H < 2:
  W = 1
if W < 2:
  H = 1
print((H*W//2) if H*W%2==0 else ((H*W+1)//2))
# Judge status: Accepted
N = int(input())
S = {}
for i in range(N):
    s = input()
    if s not in S:
        S[s] = 1
        continue
    S[s] +=1
    

M = int(input())
T = {}
for i in range(M):
    t = input()
    if t not in T:
        T[t] = 1
        continue
    T[t] += 1

ans = 0
for key in S.keys():
    if key not in T:
        ans = max(ans, S[key])
        continue
    ans = max(ans, S[key] - T[key])
print(ans)
# Judge status: Accepted
x, n = map(int, input().split())
p = list(map(int, input().split()))

ans = 0
res = 10**9
for i in range(x-100, x+101):
    if i in p:
        continue
    diff = abs(x-i)
    if diff < res:
        ans = i
        res = diff
print(ans)
# Judge status: Accepted
x,y=map(int,input().split())
print(x+(y//2))
# Judge status: Accepted
n, l = map(int, input().split())
taste = [l+i for i in range(n)]

tmp = float('inf')
sum = sum(taste)
for i in range(n):
    if abs(taste[i]) < tmp:
        tmp = abs(taste[i])
        ans = sum - taste[i]

print(ans)
# Judge status: Wrong Answer
n = int(input())
lst_4 = [x for x in range(4, 101, 4)]
lst_7 = [x for x in range(7, 101, 7)]
lst = []
for i in lst_4:
    for j in lst_7:
        lst.append(i + j) 

ans = [x for x in lst if x <= 100]
print('Yes' if n in ans else 'No')
# Judge status: Accepted
def num_to_str(n):
    return chr(97 + n)

def str_to_num(s):
    return ord(s) - 97

def dfs(s,m,n,N,ans):
    if n == N:
        ans.append(s)
        return
    for i in range(m+2):
        dfs(s+num_to_str(i),max(m,i),n+1,N,ans)

def main():
    N = int(input())
    ans = []
    dfs('a',0,1,N,ans)
    ans.sort()
    for a in ans:
        print(a)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    count += 1
print(count)
# Judge status: Accepted
A,B=map(int,input().split())
print(A if A<=B else A-1)
# Judge status: Accepted
n = int(input())
m = n
if n in [2,3]:
  print(n)
  exit()
while True:
  for i in range(2,int(m**0.5)+1):
    if m %i == 0:
      break
    elif i > int(m**0.5)-1:
      print(m)
      exit()
  m += 1
# Judge status: Accepted
P,Q,R = map(int,input().split())
print(min(P+Q,min(Q+R,R+P)))
# Judge status: Accepted
# input
X, Y = map(int, input().split())
print(X + (Y // 2))
# Judge status: Accepted
input();s=t=input()
while'()'in t:t=t.replace('()','')
c=t.count;print('('*c(')')+s+')'*c('('))
# Judge status: Accepted
N, K = map(int, input().split())
*A, = map(int, input().split())
d = [0]*(N+1)
for a in A:
    d[a] += 1
d.sort()
d.reverse()
print(sum(d[K:]))
# Judge status: Accepted
w,h,n =map(int,input().split())
s =[list(map(int,input().split())) for _ in range(n)]
x =0;y =0;
for i in range(n):
  if s[i][2] ==1:
    if x < s[i][0]: x = s[i][0] 
  elif s[i][2] ==2:
    if w > s[i][0]: w = s[i][0]
  elif s[i][2] ==3:
    if y < s[i][1]: y = s[i][1]
  else:
    if h > s[i][1]: h = s[i][1]
print((w-x)*(h-y) if (w-x)>0 and (h-y)>0 else 0)
# Judge status: Wrong Answer
mod = 998244353
from collections import Counter
n = int(input())
d = list(map(int, input().split()))
cnt = Counter(d)
if 0 not in cnt or cnt[0] != 1:
    print(0)
    exit()
cnt = sorted(cnt.items(), key=lambda x: x[0])
ans = 1
pre_k = 0
for i in range(1, len(cnt)):
    if cnt[i][0] - pre_k != 1:
        print(0)
        exit()
    pre_k = cnt[i][0]
    ans *= (cnt[i-1][1]**cnt[i][1])
    ans %= mod
print(int(ans))
# Judge status: Accepted
A, B, M= [int(i) for i in input().split(' ')]
AA = [int(i) for i in input().split(' ')]
BB = [int(i) for i in input().split(' ')]

XYC = []
for _ in range(M):
    XYC.append([int(i) for i in input().split(' ')])

min_a , min_b = min(AA),min(BB)
min_ab = min_a + min_b

for x,y,c in XYC:
    cost = AA[x-1] + BB[y-1] - c
    min_ab = min(cost,min_ab)

print(min_ab)
# Judge status: Accepted
N=int(input())
print(min(sum(map(int,str(i)))+sum(map(int,str(N-i))) for i in range(1, N//2+1)))
# Judge status: Accepted
def solve():
  from itertools import groupby as gb 
  n=int(input())
  l=[(s,len(list(i))) for s,i in gb(sorted([input() for i in range(n)]))]
  sl,vl=[list(a) for a in zip(*l)]
  m=int(input())
  lm=[(s,-len(list(i))) for s,i in gb(sorted([input() for i in range(m)]))]
  slm,vlm=[list(a) for a in zip(*lm)]
  for i in set(sl)&set(slm):
    vl[sl.index(i)]+=vlm[slm.index(i)]
  print(max(0,max(vl)))
  
if __name__=="__main__":
  solve()
# Judge status: Accepted
a,b,x=map(int,input().split())
bb=b//x
aa=a//x
ans=bb-aa
if a%x==0:
    ans+=1
print(ans)
# Judge status: Wrong Answer
s=input()
t=input()
a=[0]*26
for i in range(len(s)):
    a[ord(s[i])-97]+=1
for i in range(len(t)):
    a[ord(t[i])-97]-=1
ans=0
for i in range(26):
    ans+=abs(a[i])

print(ans//2)
# Judge status: Accepted
from sys import stdin
import math

a, b, x = (int(i) for i in stdin.readline().rstrip().split())

if a*a*b < 2*x:
    c = math.atan(2 * b/a - 2 * x/a ** 3)
    print(math.degrees(c))
else:
    c = math.atan(a * b * b/(2 * x))
    print(math.degrees(c))
# Judge status: Wrong Answer
N,M = [int(i) for i in input().split()]
if N==M:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
a,b,c = map(int,readline().split())
if a < c < b or a > c > b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
x=int(input())
while True:
    flg=False
    for i in range(2,x):
        if x%i==0:
            
            flg=True
    if flg==False:
        print(x)
        sys.exit()
    else:
        x+=1
# Judge status: Accepted
N,K = map(int, input().split())
p_list = sorted(list(map(int, input().split())))

res = 0
for i in range(K):
    res += p_list[i]

print(res)
# Judge status: Accepted
#!/usr/bin/env python3
x = int(input())
print(x // 11 * 2 - (-(x % 11) // 6))
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys

N, *A = map(int, sys.stdin.buffer.read().split())

def tree(A,N):
  m = [A[i] for i in range(N+1)]
  M = [A[i] for i in range(N+1)]
  for i in range(N-1,-1,-1):
    m[i] += m[i+1]//2+m[i+1]%2
    M[i] += M[i+1]
  if m[0]>1 or M[0]==0:
    return -1
  count = 1
  vertex = 1
  for i in range(1,N+1):
    vertex = min(2*(vertex-A[i-1]), M[i])
    count += vertex
  return count
      
print(tree(A,N))
# Judge status: Accepted
s = input()
n = len(s) + 1
t = [0]*n
for i in range(n-1):
  if s[i] == '<':
    t[i+1] = t[i] + 1
for i in range(n-2,-1,-1):
  if s[i] == '>':
    t[i] = max(t[i],t[i+1]+1)
print(sum(t))
# Judge status: Accepted
import itertools
N, M, Q = map(int,input().split())
L = []
for _ in range(Q):
    L.append(list(map(int,input().split())))


nums = [k+1 for k in range(M)]
ans = 0
for e in itertools.combinations_with_replacement(nums, N):
    temp = 0
    for f in L:
        a, b, c, d = f[0], f[1], f[2], f[3]
        if e[b-1]-e[a-1] == c:
            temp += d
    ans = max(ans,temp)
print(ans)
# Judge status: Accepted
import math

A, B, H, M = map(int, input().split())
a = 30*H+0.5*M
b = 6*M
kaku = abs(a-b)
if kaku > 180:
    kaku = 360-kaku
#print(kaku)
#print(math.cos(math.radians(kaku)))
ans = A*A+B*B-2*A*B*math.cos(math.radians(kaku))
print(math.sqrt(ans))
# Judge status: Wrong Answer
def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    c = [0] + [abs(h[1] - h[0])]
    for i in range(2, n):
        min_step = 10 ** 4
        num = i if i <= k else k + 1
        for j in range(1, num):
            step = abs(h[i] - h[i-j]) + c[i-j]
            if step < min_step:
                min_step = step
        c.append(min_step)
    print(c.pop())


if __name__ == "__main__":
    main()
# Judge status: Accepted
X=int(input())
N=X//100
if N<0:
    print(0)
elif 100*N<=X<=105*N:
    print(1)
else:
    print(0)
# Judge status: Accepted
field=[]
result="Yes"
for i in range(3):
  field.append(list(map(int,input().split())))
for i in range(3):
  for j in range(3):
    if not (field[i][j]>=0 and field[i][j]<=100*2):
      result="No"
    if j ==0:
      pos_i0=field[i][j]
    field[i][j]-=pos_i0
for j in range(3):
  if not (field[0][j]==field[1][j] and field[0][j]==field[2][j]):
    result="No"
print(result)
# Judge status: Wrong Answer
N = int(input("enter the number:"))
ldigit = N%10
bon = [3]
pon = [0,1,6,8]
if ldigit in bon:
  print('bon')
elif ldigit in pon:
  print('pon')
else:
  print('hon')
# Judge status: Wrong Answer
user_input = input().upper()
store = []
for i in user_input:
    store.append(i)
st_nd = store[0:2]
# print(st_nd)
nd_rd = store[1:3]
# print(nd_rd)
if len(set(store)) == 1:
    for i in set(store):
        if i == "S":
            print(0)
        else:
            print(3)
elif len(set(st_nd)) == 1:
    print(2)
elif len(set(nd_rd)) == 1:
    print(2)
else:
    print(1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
from collections import Counter
a = Counter(a)
lis = []

for i,j in a.items():
    lis += [i]*(j//2)

#print(lis)

lis.sort(reverse=True)
if len(lis) <= 1:
    ans = 0
else:
    ans = lis[0]*lis[1]

print(ans)
# Judge status: Accepted
x = int(input())
print((1999-x)//200+1)
# Judge status: Wrong Answer
n,m,q=map(int,input().split())
e=[list(map(int,input().split())) for _ in range(q)]
ans=0
for i in range(1<<(2*n-1)):
  a=[1]
  for j in range(2*n-1):
    if (i>>j)&1:a[-1]+=1
    else:a+=[a[-1]]
    if a[-1]>m:
      flag=0
      break
    if len(a)>n:
      flag=1
      break
  else:flag=1
  if flag==0 or len(a)<n:continue
  cnt=0
  for s,t,u,v in e:
    if a[t-1]-a[s-1]==u:cnt+=v
  ans=max(ans,cnt)
print(ans)
# Judge status: Accepted
S = input()
l = len(list(S)) // 2
form = list(S[:l])
las = list(reversed(list(S[l:])))

count = 0
for i, e in enumerate(form):
    if las[i] != e:
        count += 1

print(count)
# Judge status: Wrong Answer
n = int(input())
v = list(map(int, input().split()))

v_s = sorted(v)

for i in range(len(v_s)-1):
    v_s[i+1] = (v_s[i] + v_s[i+1]) / 2
    v_s[i] = 0

sum(v_s)
# Judge status: Accepted
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B = MAP()

if A%3== 0 or B%3==0 or (A+B)%3 == 0:
	print("Possible")
else:
	print("Impossible")
# Judge status: Accepted
s=input()
n=len(s)
d=[s[0]]
t=0
res=''
for i in range(1,n):
  res+=s[i]
  if res==d[t]:
    continue
  else:
    d.append(res)
    res=''
    t+=1
print(len(d))
# Judge status: Accepted
N = int(input())
c = 0
for i in range(N):
  a, b = map(int, input().split())
  if a == b:
    c += 1
  else:
    c =0
  if c == 3:
    break
if c == 3:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
input()
s = input()
m = 0

for i in range(1,len(s)):
    f = s[:i]
    g = s[i:]
    
    x = set(f)
    count = 0
    
    for j in x:
        if j in g:
            count = count+1
    m = max(count,m)

print(m)
# Judge status: Accepted
A,B=map(int,input().split())
if A<=8 and B<=8 :
	print("Yay!")
else :
	print(":(")
# Judge status: Wrong Answer
n = int(input())
ans  = 0
if n == 100000 :
    ans = 101009
elif 10000 <= n <= 99999 :
    ans = n - 10000 + 1 + 1000 + 9
elif 1000 <= n <= 9999 :
    ans = 1009
elif 100 <= n <= 999 :
    ans = n - 100 + 1 + 9
elif 10 <= n < 99 :
    ans = 9
elif 1 <= n <= 9 :
    ans = n

print(ans)
# Judge status: Accepted
n = int(input())
x = n/3
print(x**3)
# Judge status: Accepted
w, h, x, y = map(int, input().split())

c_x = w / 2
c_y = h / 2

if c_x == x and c_y == y:
    print(w * h / 2, 1)
else:
    print(w * h / 2, 0)
# Judge status: Accepted
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    a = LI()
    dic = collections.defaultdict(int)
    for i in a:
        for x in range(i-1,i+2):
            dic[x] += 1
    diclst = sorted(dic.items(), key=lambda x: x[1], reverse=True)
    ans = diclst[0][1]
    print(ans)
main()
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

count = 0
minimun = 2 * (10**5)+1

for i in range(n):
    if(minimun >= p[i]):
        count += 1
        minimun = p[i]

print(count)
# Judge status: Wrong Answer
n,a,b=map(int,input().split())

def combination(n, a, mod):
    bunshi = 1
    bunbo = 1
    for i in range(a):
        bunshi *= n-i
        bunshi = bunshi%mod
        bunbo *= a-i
        bunbo = bunbo%mod
    return bunshi*pow(bunbo, mod-2, mod)%mod
mod = 100000007
answer = pow(2, n, mod)
answer -= 1
answer -= combination(n, a, mod)
answer -= combination(n, b, mod)
print(answer%mod)
# Judge status: Accepted
W,A,B=map(int,input().split())
if A+W>=B and A<=B+W:
  print(0)
else:
  if B-(A+W)>=0:
    print(B-(A+W))
  else:
    print(A-(B+W))
# Judge status: Wrong Answer
#スペース区切りの整数入力
N, M = map(int, input().split(' ')) 
#N,Mの比較
if N==M:
    print('yes')
else:
    print('No')
# Judge status: Accepted
n,m=map(int,input().split())
a=0
if m!=0:
    a=int(input())
    
b=1
s=[1]*(n+1)
for i in range(1,n+1):
    if i!=a:
        if i-2>=0:
            s[i]=(s[i-1]+s[i-2])%1000000007
        else:
            s[i]=s[i-1]%1000000007
    elif b!=m:
        s[i]=0
        a=int(input())
        b+=1
    else:
        s[i]=0
print(s[n])
# Judge status: Accepted
n = int(input())
a = []
b = []
for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)
a = a[::-1]
b = b[::-1]

ans = 0
for i in range(n):
    t = (a[i] + ans) % b[i]
    if t != 0:
        ans += b[i]-t

print(ans)
# Judge status: Accepted
s, t = [input() for i in range(2)]
ns = ''.join(sorted(s))
nt = ''.join(sorted(t, reverse=True))
print('Yes') if ns < nt else print('No')
# Judge status: Wrong Answer
# your code goes here
x = int(input())
i = 1
n= 0
if x % 2 == 0 or x % 5 == 0:
    print(-1)
else:
    for i in range(1, 1000000):

        l =( 7 %x*pow(9,-1)%x* (pow(10,i,x) - 1%x)%x )%x
        #l=math.ceil(l)
        
        n+=1
        
        if l % x == 0:
            break
    print(n)
# Judge status: Wrong Answer
S=input()
tmp=S[0]
i=1
ans=1
while i<len(S):
    print(S[i],tmp)
    if S[i]!=tmp:
        ans+=1
        tmp=S[i]
        i+=1
    else:
        ans+=1
        tmp=S[i:i+2]
        i+=2
if len(S)!=1:
    if S[-2]==S[-1] and tmp!=S[-2:]:
        ans-=1
print(ans)
# Judge status: Accepted
S,T=input().split()
a,b=[int(s) for s in input().split()]
U=input()
if S==U:
  a-=1
else:
  b-=1
print(*[a,b])
# Judge status: Wrong Answer
num = input()
numlist = map(int, input().split())
numlistmax = max(numlist)
totalnum = sum(numlist)
if totalnum - numlistmax > numlistmax:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
for i in range(n//4 +1):
  if (n - 4 * i) % 7 == 0:
    print('Yes')
    exit()
print('No')
# Judge status: Accepted
from sys import stdin

li = list(map(int,stdin.readline().rstrip().split()))
li.sort()

count = 0

if all(li)%2 == 1:
    wake = li[2]//2
    nokori = li[2]-li[2]//2
    print(li[0]*li[1]*(nokori-wake))
else:
    print(0)
# Judge status: Accepted
def gcm(a,b):
    if a==0:
        return b
    elif b==0:
        return a
    else: 
        return gcm(a%b,b) if a>=b else gcm(a,b%a)

def lcn(a,b):
    return a*b//gcm(a,b)

a,b=map(int,input().split())
print(lcn(a,b))
# Judge status: Wrong Answer
ABC = [int(x) for x in input().split()]
S = sorted(ABC)
print(S)
if S[0] == 5 and  S[1] == 5 and  S[2] == 7:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split())) 
B = list(map(int, input().split())) + [0]

ans = min(A[0], B[0])
rest = B[0] - ans
  
for i in range(N):
  #rest+B[i+1]でとA[i+1]をどれだけ倒せるか
  curr = min(A[i+1], rest + B[i+1])
  rest = max(0, rest + B[i+1] - curr)
  ans += curr
print(ans)
# Judge status: Wrong Answer
a,b = map(int, input().split())
def answer(a:int, b:int):
    if (a * b) % 2 == 0:
        return 'Even'
    else:
        return 'Odd'
# Judge status: Accepted
x = input()
cnt = 0
for s in range(3):
   if x[s] == "1":
      cnt +=1
print(cnt)
# Judge status: Accepted
N, K = map(int, input().split())
S = list(input())

S[K-1] = S[K-1].lower()
print(''.join(S))
# Judge status: Accepted
n=input()
k=int(input())

for i in range(len(n)):
    if n[i]=="1" :
        k-=1
        if k==0 :
            print(1)
            break
    else :
        print(n[i])
        break
# Judge status: Wrong Answer
n = int(input())

line = list(map(int, input().strip().split(" ")))

ans = [0 for s in range(n)]

for i in line:
    ans[i] += 1

for i in range(1, n):
    print(ans[i])
# Judge status: Accepted
N, A, B = map(int, input().split())
print(N // (A + B) * A + min(A, N % (A + B)))
# Judge status: Accepted
n = int(input())
s = list(input())

x = 0
mx = 0

for a in s:
  if a == "I":
    x +=1
  else:
    x -=1
  if x > mx:
    mx = x
    
print(mx)
# Judge status: Accepted
n,l=map(int,input().split())
f=1
as_=[]
m=float('inf')
for i in range(n):
    a=l+i
    as_.append(a)
    m=min(m,abs(a))
    if a<0:
        f=-1
    else:
        f=1
print(sum(as_)-f*m)
# Judge status: Accepted
N = int(input())
p = list(map(int,input().rstrip().split(" ")))
ans = 0
swap = 0
for i in range(N):
    if p[i] == i + 1:
        if i != N - 1:
            swap = p[i]
            p[i] = p[i + 1]
            p[i + 1] = swap
            ans += 1
        else:
            swap = p[i]
            p[i] = p[i - 1]
            p[i - 1] = swap
            ans += 1
print(ans)
# Judge status: Accepted
S,C = map(int,input().split())

p = min(S,C//2)
C -= p*2
ans = p + C//4
print(ans)
# Judge status: Wrong Answer
num_children, num_snacks = list(map(int, input().split(' ')))
children = list(map(int, input().split(' ')))
children.sort()

count = 0
for i in range(num_children):
  if num_snacks >= sum(children[:i+1]):
    count += 1
print(count)
# Judge status: Wrong Answer
N, X, Y = map(int, input().split())
ans = [0] + [0]*(N-1)

for i in range(1, N):
  for j in range(i+1, N+1):
    diff = min(j-i, abs(i-X)+abs(j-Y)+1)
    print("i={0}, j={1}".format(i, j))
    print("j-i={0}, abs(i-X)+abs(j-Y)+1={1}".format(j-i, abs(i-X)+abs(j-Y)+1))
    print("-----")
    ans[diff] += 1

for i in range(1, N):
  print(ans[i])
# Judge status: Wrong Answer
t = list(input())

for i in range(len(t)):
  if t[i] != "?":
    continue
  else:
    if t[i-1] == "D":
      t[i] = "P"
    if t[i-1] == "P":
      t[i] = "D"
      
if t[-1] == "?":
  t[-1] = "D"
      
print(''.join(t))
# Judge status: Wrong Answer
n = int(input())
*p, = map(int, input().split())

ma = p[0]
ans = 0
for i in range(n):
    if p[i] <= ma:
        ans += 1

    ma = p[i]
print(ans)
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())
ans = 10**18
for z in range(0, max(X, Y) * 2 + 1, 2):
    x, y = max(0, X - z // 2), max(0, Y - z // 2)
    tmp = A * x + B * y + C * z
    ans = min(ans, tmp)
print(ans)
# Judge status: Accepted
# N = int(input())


N, K = [int(i) for i in input().split()]
h = [0] + [int(i) for i in input().split()]
INF = 10 ** 9
dp = [INF for i in range(N+1)]
dp[1] = 0
for j in range(1, N+1):
    for i in range(1, K+1):
        if j > i:
            dp[j] = min(dp[j], dp[j-i] + abs(h[j] - h[j-i]))

print(dp[N])
# Judge status: Wrong Answer
a,b=map(int,input().split())

c=0
for i in range(a,b+1):
  s=str(i)
  s=list(s)
  if s==reversed(s):
    c+=1
print(c)
# Judge status: Accepted
N = int(input())
ans = (N*(N+1))//2

for i in range(2, N+1):
    n = N // i
    ans += i * ((n*(n+1))//2)

print(ans)
# Judge status: Accepted
import sys
from collections import deque

read = sys.stdin.read
readline = sys.stdin.readline

N, M, *AB = map(int, read().split())
graph = [[] for _ in range(N + 1)]
for A, B in zip(*[iter(AB)] * 2):
    graph[A].append(B)
    graph[B].append(A)

answer = [-1] * (N + 1)
queue = deque([1])
answer[1] = 0
while queue:
    room = queue.popleft()
    for i in graph[room]:
        if answer[i] != -1:
            continue
        answer[i] = room
        queue.append(i)

print('Yes')
print('\n'.join(map(str, answer[2:])))
# Judge status: Accepted
n=int(input())
flag=0
for  i in range(1,10):
    for j in range(1,10):
        if((i*j)==n):
            flag=1
            break
if(flag==1):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
import os

OK = 'APPROVED'
NG = 'DENIED'


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, C, D = list(map(int, sys.stdin.buffer.readline().split()))

    print('Yes' if abs(A - B) <= D and abs(B - C) <= D or abs(A - C) <= D else 'No')


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
s = input()

r = s.count("R")
g = s.count("G")
b = s.count("B")

count = r * g * b

for i in range(n-1):
    for j in range(i + 1, i + ((n - 1 - i) // 2) + 1):
        k = 2 * j - i
        if s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            count -= 1

print(count)
# Judge status: Accepted
a,b,k = list(map(int,input().split()))

if a >= k:
    print(a-k,b)
elif a < k:
    print(0, max(a+b-k,0))
# Judge status: Accepted
#n = int(input())
#a,b = map(int,input().split())
a_L = list(map(int,input().split()))
k = int(input())

a_L = sorted(a_L,reverse=True)
a_L[0] = a_L[0] * 2**k

#print(a_L)
print(sum(a_L))
# Judge status: Wrong Answer
n, m = map(int, input().split())

s = [0] * n
s[0] = 1
b = [1] * n
for i in range(m):
    x, y = map(int, input().split())
    
    s[y-1] = s[x-1]
    s[x-1] = int(b[x-1] == 1)

    b[x-1] -= 1
    b[y-1] += 1

ans = 0
for i in range(n):
    if s[i] and b[i]:
        ans += 1

print(ans)
# Judge status: Accepted
s = input()
print('x' * len(s))
# Judge status: Wrong Answer
a,b,c=map(int, input().split())
print(max(a,b,c)+a+b+c)
# Judge status: Accepted
n, q = map(int, input().split())
s = input()

acc = [0]
sum = 0
for i in range(n-1):
    if s[i:i+2] == "AC":
        sum += 1
        acc.append(sum)
    else:
        acc.append(sum)


for _ in range(q):
    l, r = map(int, input().split())
    print(acc[r-1] - acc[l-1])
# Judge status: Accepted
n=str(input())
n=list(n)
if n[0]==n[1] or n[1]==n[2] or n[2]==n[3]:
  print("Bad")
else:
  print("Good")
# Judge status: Wrong Answer
import sys
import bisect
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A,B,M = IL()
a = IL()
b = IL()
xyc = [IL() for i in range(M)]

a.sort()
b.sort()

ans = a[0] + b[0]
for x,y,c in xyc:
  ans = min(ans, a[x-1] + b[y-1] - c)
print(ans)
# Judge status: Wrong Answer
L,R = map(int,input().split())
l = L%2019
r = R%2019
Min_Answer = 2018


for i in range(l,r+1):
    for j in range (i+1,r+1):
        if i ==j:
            continue
        Answer = (i*j) % 2019
        Min_Answer = min(Answer,Min_Answer)

print(Min_Answer)