peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
res = INF
for i in range(1,10**6+10):
    if n%i == 0:
        tmp = i + n//i - 2
        res = min(res, tmp)
print(res)
# Judge status: Accepted
A1,A2,A3 = map(int,input().split())

if A1+A2+A3 >21:
    print("bust")
else:
    print("win")
# Judge status: Accepted
import math
from functools import reduce

def lcm_base(x,y):
    return (x*y)//math.gcd(x,y)

def lcm_list(numbers):
    return reduce(lcm_base,numbers,1)

n=int(input())
nums=[int(input()) for i in range(n)]

print(lcm_list(nums))
# Judge status: Accepted
s=input()
n=len(s)
s=s[::-1]
cnt_mod=[0]
m=0
d=1
for i in range(n):
  m+=int(s[i])*d
  m%=2019
  d*=10
  d%=2019
  cnt_mod.append(m)

from collections import Counter
c=Counter(cnt_mod)
ans=0
for v in c.values():
  ans+=v*(v-1)//2
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
S = input()

x = sum(S[i] == "R" and S[i + 1] == "L" for i in range(N - 1))
y = int(S[0] == "L") + int(S[-1] == "R")
res = N - 2 * x - y

ans = res + 2 * min(K, x)
if K - x > 0 and y > 0:
    ans += 1
print(ans)
# Judge status: Wrong Answer
N,M=map(int,input().split())
interval=[[0,0] for i in range(M)]
for i in range(M):
  interval[i][0],interval[i][1]=map(int,input().split())
L=[interval[i][0] for i in range(M)]
R=[interval[i][1] for i in range(M)]
L_max=max(L)
R_min=min(R)
print(R_min-L_max+1)
# Judge status: Accepted
a,v,b,w,t=map(int,open(0).read().split())
print('YNEOS'[v-w<abs(a-b)/t::2])
# Judge status: Wrong Answer
array = list(map(int, input().split()))
miniDis = []
for i in range(1,array[0]):
  for j in range(i+1,array[0]+1):
    miniDis.append(min(j-i,abs(array[1]-i)+1+abs(array[2]-j)))
                     
for i in range(1,array[0]-1):
  print(miniDis.count(i))
# Judge status: Wrong Answer
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
# print(p)
sum = 0
cnt = 0
for i in p:
    sum += i
    cnt += 1
    if cnt == 3:
        break
print(sum)
# Judge status: Accepted
s = input()
l = []
for i in range(len(s)):
	l.append(s.count(s[i]))
r = []
for x in l:
	if(x%2!=0):
		r.append(False)
	else:
		r.append(True)

if(all(r)):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
N = int(input())
M = N // 1000
if N % 1000 != 0:
    M += 1
print(1000 * M - N)
# Judge status: Wrong Answer
a,b=map(int,input().split())
x=(a+b)/2
if x*10%10==5:
    print(x*10//10+1)
else:
    print(x)
# Judge status: Wrong Answer
import math
import decimal
a,b,h,m = map(float,input().split())


if h==0:
    hh = 360
else:
    hh = 360*(h/12)+(30*m/60)
if m==0:
    mm = 360
else:
    mm = 360*(m/60)
    
x = float(abs(mm-hh))

a2 = a**2
b2 = b**2

ans = math.sqrt((a2+b2)-(2*a*b*math.cos(math.radians(x))))
print(format(ans,'.15f') )
# Judge status: Accepted
from fractions import gcd


def solve(n, m, aaa):
    lcm = 1
    for a in aaa:
        a //= 2
        lcm *= a // gcd(lcm, a)
        if lcm > m:
            return 0
    for a in aaa:
        if int(lcm / a) == lcm / a:
            return 0
    return (m // lcm + 1) // 2


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

print(solve(n, m, aaa))
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = "Yes"
 
a.sort(reverse=True)
 
for i in range(m):
    if a[i] < sum(a)*(1/(4*m)):
        ans = "No"
        break
 
print(ans)
# Judge status: Wrong Answer
number = int(input())

r = number / 1

print(r)
# Judge status: Accepted
s = input()
s_r = s[::-1]
ans = "No"
if s == s_r:
    ss = s[:int((len(s) - 1) / 2)]
    ss_r = ss[::-1]
    if ss == ss_r:
        sss = s[int((len(s) + 3) / 2) - 1:]
        sss_r = sss[::-1]
        if sss == sss_r:
            ans = "Yes"
print(ans)
# Judge status: Accepted
s = input()
ans = ""
for i in s:
    if i == "B":
        ans = ans[:-1]
    else:
        ans += i
print(ans)
# Judge status: Accepted
w, h, x, y = map(int, input().split())
a = 1 if x*2 == w and y*2 == h else 0
print(w*h/2, a)
# Judge status: Accepted
N = int(input())
l = []
for i in range(N-1):
  s = [int(x) for x in input().split()]
  l.append(s)
for i in range(N-1):
  t = 0
  for j in range(i,N-1):
      t = max(t,l[j][1]) 
      if t % l[j][2] == 0:
        t += l[j][0]
      else:
        t += l[j][2]- t % l[j][2] +l[j][0]
  print(t)
print(0)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
if a%500 <b:
  print("NO")
else:
  print("YES")
# Judge status: Accepted
n,k = map(int,input().split())
#print(n,k)
S=list(input())
#print(S)
s=S.pop(k-1)
#print(s)
s=s.lower()
#print(s)
S.insert(k-1, s)

print(''.join(S))
# Judge status: Accepted
n = input()
total = sum(list(map(int, n)))
while True:
    if int(n) == 0:
        print('Yes')
        break
    if len(str(total)) != 1:
        total = sum(list(map(int, str(total))))
    elif total == 9:
        print('Yes')
        break
    else:
        print('No')
        break
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

S=input()
C=collections.Counter(S)
C["a"]=C["a"] 
C["b"]=C["b"] 
C["c"]=C["c"] 
print("YES" if max(C.values())-min(C.values()) <= 1 else "NO")
# print(C)
# Judge status: Accepted
N, K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse = True)

if K <= N:
  for i in range(K):
    H[i] = 0
else:
  for i in range(N):
    H[i] = 0
print(sum(H))
# Judge status: Accepted
money = int(input())
thousand = money//500
money = money - thousand*500
five = money//5
print(thousand*1000+five*5)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
t = s.split('-')
print('Yes' if s[a] == '-' and len(t) == 2 else 'No')
# Judge status: Accepted
S = input()
print('Yes' if len(set(S))==2 else 'No')
# Judge status: Accepted
from collections import Counter


def main():
    n = int(input())
    A = [int(e) for e in input().split()]

    D = Counter(A)
    for i in range(1, n + 1):
        print(D[i])


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
# coding: utf-8

MOD = 10^9+7
N = int(input())
A = [int(a) for a in input().split()]
ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        ans = (ans + (A[i] ^ A[j])) % MOD
        
print(ans)
# Judge status: Accepted
S = str(input())
S1 = ["a", "b", "c"]
if S.count(S1[0]) == 1 and S.count(S1[1]) == 1 and S.count(S1[2]) == 1:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
[n,k] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

"""
初期条件
dp[0] = 0
dp[1] = h[1] - h[0]
"""

dp = [10 ** 9 + 7] * n
dp[0] = 0
dp[1] = abs(h[1] - h[0])
if n > 2:
    for i in range(2,n):
        for j in range(1,min(i - 0,k)+1):
            dp[i] =min(dp[i - j] + abs(h[i]-h[i - j]),dp[i])
    print(dp[n-1])
else:
    print(dp[1])
# Judge status: Accepted
N = int(input())

for i in range(25):
    for j in range(15):
        if N == 4*i + 7*j:
            print('Yes')
            exit()

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

ans=R+(100*(10-N))

if N>=10:
    print(R)
else:
    print(ans)
# Judge status: Wrong Answer
n=int(input())
list=input().split()
for f in list:
    f=float(f)
def sec(a, b, c):
    l=[a, b, c]
    xxx=min(l)
    xx=max(l)
    l.remove(xx)
    l.remove(xxx)
    return l[0]
count=1
c=0
for i in range(n-2):
    if sec(list[count], list[count+1], list[count-1])==list[count]:
        c=c+1
    count=count+1
print(c)
# Judge status: Accepted
from collections import defaultdict
from bisect import bisect_left

n, m = map(int, input().split())
years = defaultdict(list)
sorted_years = defaultdict(list)
PY = []
for i in range(m):
    prefecture, year = map(int, input().split())
    years[prefecture].append(year)
    PY.append((prefecture, year))

for prefecture, year_list in years.items():
    temp = year_list
    temp.sort()
    sorted_years[prefecture] = temp

for pair in PY:
    p, y = pair
    years[p]
    num = 1 + bisect_left(sorted_years[p], y)
    print(str(p).zfill(6) + str(num).zfill(6))
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))
a.insert(0,0)

counter = 0

for i in range(0,N,2):
    if a[i] % 2 == 1:
        counter += 1

print(counter)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
x = a*c
if b*d > x:
  x = b*d
if a*d > x:
    x = a*d
if b*c > x:
    x = b*c
print(x)
# Judge status: Wrong Answer
A,B,M = map(int, input().split())

la = list(map(int, input().split()))
lb = list(map(int, input().split()))

d = []
for i in range(M):
  d.append(list(map(int, input().split())))
           
for i in range(M):
  d[i] = la[(d[i][0]-1)] + lb[(d[i][1]-1)] - d[i][2]

print(min(d))
# Judge status: Wrong Answer
N, M = map(int, input().strip().split())
A = [None for _ in range(N)]
for _ in range(M):
  s, c = map(int, input().strip().split())
  if A[s-1] is None:
    A[s-1] = c
  else:
    if A[s-1] != c:
      A[s-1] = min(c, A[s-1])

if A[0] is None or (len(A) >= 2 and A[0] == 0):
  print(-1)
  exit()
A = [str(e) if e else '0' for e in A]
print(''.join(A))
# Judge status: Accepted
import numpy as np
n = int(input())
a = np.array([int(input()) for _ in range(n)])
a1n = a.argmax()
a_s = sorted(a)
a1 = a_s[-1]
a2 = a_s[-2]
for i in range(n):
    if i == a1n:
        print(a2)
    else:
        print(a1)
# Judge status: Wrong Answer
from sys import stdin

h1, m1, h2, m2, k = [int(x) for x in stdin.readline().rstrip().split()]

allMin1 = h1 * 60

allMin2 = h2 * 60

diff = (allMin2 + m2 - allMin1 + m1)
# if diff < 0 :
	# diff += 24 * 60

ans = diff - k

if ans >= 0 :
	print(ans)
else :
	print(0)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
left_max = [0]
right_max = [0]

for a in A:
    left_max.append(max(left_max[-1], a))

for a in reversed(A):
    right_max.append(max(right_max[-1], a))

for i in range(N):
    print(max(left_max[i], right_max[N - i - 1]))
# Judge status: Accepted
k, n = map(int, input().split())
a = list(map(int, input().split()))

diff = []

for i in range(n - 1):
    diff.append(a[i + 1] - a[i])
diff.append(k - a[-1] + a[0])

print(k - max(diff))
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
if (N-K) % (K-1) == 0:
  ans = 1 + (N-K) // (K-1)
else:
  ans = 2 + (N-K) // (K-1)
print(ans)
# Judge status: Accepted
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
print(N*X if K>N else (X*K)+(Y*(N-K)))
# Judge status: Accepted
a, b, c, d = map(int, input().split())
while True:
    c -= b
    if c <= 0:
        print("Yes")
        break
    a -= d
    if a <= 0:
        print("No")
        break
# Judge status: Wrong Answer
s = input()

if s[0] != s[1] and s[0] != s[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


def solve():
    a, b = inm()
    return "Even" if (a * b % 2 == 0) else "Odd"


print(solve())
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
odd = 0
mul2 = 0
mul4 = 0
for i in a:
    if i%4==0:mul4+=1
    elif i%2==0:mul2+=1
    else:odd+=1
ans = 'Yes'
if n==mul4+odd:
    if mul4+1<odd:ans='No'
else:
    if mul4<odd:ans='No'
print(ans)
# Judge status: Accepted
s= input()
ans = ''
for i in s:
    if(i=='0' or i=='1'):
        ans+=i
    else:
        if(len(ans)>=1):
            ans = ans[0:len(ans)-1]
print(ans)
# Judge status: Wrong Answer
N=int(input())
A = []

for i in range(N):
    new = int(input())
    A.append(new)

A.sort()
A.append(0)

start=A[0]
cnt=1
anscnt=0

for i in range(1,len(A)):

    if A[i]==start:
        cnt+=1
    elif A[i]!=start:
        if cnt%2==0:
            anscnt+=cnt
        cnt=1
        start=A[i]


print(N-anscnt)
# Judge status: Accepted
n, k = map(int, input().split())
d = list(map(str, input().split()))

while (1):
   c = [x for x in str(n)]

   ok = 1
   for x in c:
      if x in d:
         ok = 0
         break

   if ok == 1:
      break

   n += 1

print(n)
# Judge status: Accepted
n,x,y = map(int,input().split())

def dist(i,j):
  return min(j-i, abs(x-i) + abs(y-j) + 1, abs(x-j) + abs(y-i) + 1)

listlist = [0]*(n-1)

for i in range(1,n):
  for j in range(i+1,n+1):
    distance = dist(i,j)
    listlist[distance-1] = listlist[distance-1] + 1
    
for k in listlist:
  print(k)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a * 100 % 8 == 0:
    low = max(a * 100 // 8, b * 10)
else:
    low = max(a * 100 // 8 + 1, b * 10)
high = min(100 * (a + 1) // 8, 10 * (b+1))

if low <= high:
    print(low)
else:
    print(-1)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

l=sorted(lmp())
if l[0]+l[1]==l[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import numpy as np
import itertools
N,M,X=map(int,input().split())
a=[]
b=[]
seq=[]

for i in range(0,N):
    seq.append(i)
for _ in range(0,N):
    a.append(list(map(int,input().split())))
a=np.array(a)
ans=10**7+1
for j in range(1,N+1):
    alist=list(itertools.combinations(seq,j))
    for k in range(len(alist)):
        b=list(alist[k])
        c=sum(a[b])
        if min(c[1:])>=X:
            ans=min(ans,c[0])
if ans==10**7+1:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
import numpy as np
mod = 1000000007

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

bit = 1
ans = 0
for i in range(60):
    a_and = a & 1
    cnt_one = np.count_nonzero(a_and)
    ans += (cnt_one * (n - cnt_one) * bit) % mod
    ans %= mod
    a >>= 1
    bit *= 2
    bit % mod

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
if n >= m//2:
    print(m//2)
else:
    print(n+(m-2*n)//4)
# Judge status: Wrong Answer
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(n)]
cd=[list(map(int,input().split())) for _ in range(m)]
for i in range(n):
  mn=100000000
  ans=0
  for j in range(m):
    d=abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
    if d<mn:
      mn=d
      ans=j+1
  print(ans)
# Judge status: Wrong Answer
print(sum(map(lambda x, y: 1 if x!=y else 0,input().split(), input().split())))
# Judge status: Accepted
from itertools import permutations
a = [int(input()) for i in range(5)]
p = permutations(a,5)
ans = 10**9
for l in p:
    now = 0
    for i,item in enumerate(l):
        if i == 4:
            now += item
        else:
            now += item + int(bool(item%10))*10 - item%10
    ans = min(ans,now)
print(ans)
# Judge status: Accepted
N = int(input())
S = input()
ans = 0
x = 0
for c in S:
    if c=='I':
        x+=1
    else:
        x-=1
    if ans < x:
        ans = x
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    X = int(input())
    A = []
    for b in range(1, 1000):
        for p in range(2, 1000):
            if b**p <= X:
                A.append(b**p)
            else:
                break
    print(max(A))


main()
# Judge status: Accepted
from itertools import count
with open(0) as f:
    N, *p = map(int, f.read().split())
p.append(N+1)
ans = 0
for i in count(0):
    if i == N:
        break
    if p[i] == i+1:
        p[i] = p[i+1]
        p[i+1] = i+1
        ans += 1
print(ans)
# Judge status: Accepted
N=int(input())
move=10**12
for n in range(1,int(N**.5)+1):
    if N%n==0:
        move=min(move,N//n+n-2)
print(move)
# Judge status: Accepted
a,b = map(int,input().split())
aaa = [int(i) for i in input().split()]

aaa.append(aaa[0] + a)

result = [c1 - c0 for c0,c1 in zip(aaa,aaa[1:])]

print(a - max(result))
# Judge status: Accepted
S = input()
T = input()

lstS = list(S)
lstT = list(T)

difMin = 1000

for i in range(len(lstS)-len(lstT)+1):
  dif = 0
  
  for j in range(len(lstT)):
    if(lstT[j] != lstS[i+j]):
      dif += 1
  
  if(dif < difMin):
    difMin = dif

print(difMin)
# Judge status: Wrong Answer
import sys
f=lambda:map(int,sys.stdin.readline().split())
n,m=f()
l=sorted(f())
s=[]
t=0
for i in range(m):
  b,c=f()
  if t+b>n:
    s+=[c]*(n-t)
    t=n
    break
  s+=[c]*b
  t+=b
s.sort(reverse=1)
a=0
for i in range(n):
  if i<t: a+=max(l[i],s[i])
  else: a+=l[i]
print(a)
# Judge status: Wrong Answer
n, k = map(int, input().split())
d = list(map(int, input().split()))
digit = [str(i) for i in range(10) if not i in d]
ans = []
stack = [i for i in digit]
while stack:
  s = stack.pop()
  if int(s) >= n:
    ans.append(s)
  else:
    for i in digit:
      if len(i+s) <= len(str(n)):
        stack.append(i+s)
if len(ans) > 0:
  print(min(ans))
else:
  print(0)
# Judge status: Accepted
from collections import Counter
n,k = map(int,input().split())
a_ls = list(map(int, input().split()))
c = Counter(a_ls)
value_ls = list(c.values())
value_ls.sort(reverse=True)
ans = 0
for i in range(k, len(value_ls)):
    ans += value_ls[i]
print(ans)
# Judge status: Wrong Answer
N = int(input())

ans = 1
for i in range(1, N+1):
  ans *= i
  ans %= (10**9 + 7)

print(ans)
# Judge status: Accepted
N = int(input())
if N % 2 == 1:
    print((N//2+1)/N)
else:
    print(0.5)
# Judge status: Wrong Answer
N, M = map(int,input().split())
H = list(map(int,input().split()))

dic = {}
for i in range(M):
    A, B = map(int,input().split())
    H_max = max(H[A-1],H[B-1])
    H_min = min(H[A-1],H[B-1])
    if H_max in dic.keys():
        dic[H_max] += 1
    elif not(H[A-1] == H[B-1]):
        dic[H_max] = 1
    if H_min in dic.keys() and not(H_max == H_min):
        del dic[H_min]

print(len(dic.keys()))
# Judge status: Accepted
print(2**(len(bin(int(input())))-3))
# Judge status: Accepted
n = int(input())

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

ans = 0

for i in range(n - 2):
    if(max(p[i : i+3]) > p[i+1] and min(p[i : i+3]) < p[i+1]):
        ans += 1

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
N, M = map(int, input().split(' '))

ret = 1
for i in range(1, int(M**0.5)+1):
    if M % i == 0 and i * N <= M:
        ret = max(ret, i)

        j = M//i
        if M % j == 0 and j * N <= M:
            ret = max(ret, j)

        # exit()
print(ret)
# Judge status: Accepted
A="abcdefghijklmnopqrstuvwxyz"
S=input()
S=sorted(set(S))

for i in range(len(S)):
	if S[i]!=A[i]:
		print(A[i])
		exit()
if len(S)<len(A):
	print(A[len(S)])
	exit()
print("None")
# Judge status: Accepted
import math
N = int(input())
downer = math.ceil(N/1.08)
upper = math.floor((N+1)/1.08-0.0000000001)
A = [i for i in range(downer,upper+1)]
for i in range(len(A)):
    if math.floor(A[i]*1.08) == N:
      print(A[i])
      exit()
print(':(')
# Judge status: Accepted
n,a,b=map(int, input().split()) 
tmp=0
ans=0

for i in range(n+1):
    for j in range(len(str(i))):
        tmp+=int(str(i)[j])
    if tmp>=a and tmp<=b:
        ans+=i
    tmp=0

print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
s=input()
s1=s[:a]
s2=s[(a+1):]
if s1.isdecimal()==True and s2.isdecimal()==True and s[a]=="-":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def resolve():
    n=int(input())
    k=int(input())
    x=int(input())
    y=int(input())
    if n<k:
        print(n*x)
    else:
        print(k*x+(n-k)*y)
resolve()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
cnt_4 = 0
cnt_2 = 0
for a in A:
    if a % 4 == 0:
        cnt_4 += 1
    elif a % 2 == 0:
        cnt_2 += 1
cnt = N - 2*cnt_4 - cnt_2
if cnt_4 > 0 and N % 2 == 1:
    cnt -= 1
if cnt <= 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1, 105):
  for j in range(1, 105):
    for k in range(1, 105):
      v = i * i + j * j + k * k + i * j + j * k + k * j
      if v < 10050:
        ans[v] += 1

for i in range(n):
  print(ans[i + 1])
# Judge status: Accepted
a, b, c = list(map(int, input().split()))
print("YES") if b - a == c - b else print("NO")
# Judge status: Accepted
MOD = 10 ** 9 + 7
cnt = [1 for _ in range(26)]
n = int(input())
string = input()
for s in string:
    cnt[ord(s) - 97] += 1
ans = 1
for num in cnt:
    ans *= num
    ans %= MOD
print((ans - 1) % MOD)
# Judge status: Wrong Answer
x = int(input())
a = [100, 101, 102, 103, 104, 105]
for i in range(200, x + 1):
    for j in range(100, int(i / 2 + 1)):
        if j in a and i - j in a:
            a.append(i)
            continue
print(int(a[-1] == x))
# Judge status: Accepted
X = int(input())
i = 0

while i <= X:
  c = (i*(i+1)) / 2
  if c >= X:
    print(i)
    break
  i += 1
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
if (b-a)==(c-b):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
k = int(input())
print((k//2)**2 if k%2==0 else ((k//2)+1)*(k//2))
# Judge status: Accepted
k,x = map(int,input().split())
for i in range(x-k+1, k+x):
    print(i, end = ' ')
# Judge status: Accepted
n = int(input())
X = list(map(int, input().split()))

ans = 10 ** 9

xmin = min(X)
xmax = max(X)

for i in range(xmin, xmax + 1):
    tmp = 0
    for j in range(n):
        tmp += (X[j] - i) ** 2
    ans = min(ans, tmp)
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())

if a>b:
  print(a-1)
else:
  print(a)
# Judge status: Accepted
x = int(input())

ans_list = [1]

for i in range(2,x+1):
    cnt = 2
    while True:
        tmp = i ** cnt
        if tmp > x:
            break
        ans_list += [tmp]
        cnt += 1
        
    
ans_list.sort()

for i in ans_list[::-1]:
    if i <= x:
        print(i)
        break
# Judge status: Accepted
n=int(input())
s=input()
p=s.count('R')*s.count('G')*s.count('B')
for j in range(1,n-1):
    for i in range(1,min(j,n-j-1)+1):
        x,y,z=s[j-i],s[j],s[j+i]
        if x!=y and y!=z and z!=x:
            p-=1
print(p)
# Judge status: Wrong Answer
n = int(input())
D = tuple(map(int, input().split()))
maxd = max(D)
mod = 998244353
cd = [0] * (maxd+1)
for d in D:
    cd[d] += 1

if 0 in cd or cd[0] > 1:
    print(0)
else:
    pre_nodes = 1
    ans = 1
    for i in range(1, maxd+1):
        nodes = cd[i]
        ans *= pow(pre_nodes, nodes, mod)
        ans %= mod
        pre_nodes = nodes
    print(ans)
# Judge status: Accepted
h, n = list(map(int, input().split()))
ab = [list(map(int, input().split())) for _ in range(n)]

dp = [0] * (h+max(a for a,b in ab))
for i in range(1, len(dp)):
    dp[i] = min(dp[i-a]+b for a, b in ab)
print(min(dp[h:]))
# Judge status: Accepted
S=input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,c =map(int,input().split())

if 4*a*b < (c-a-b) ** 2 and c-a-b > 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, X, Y = map(int, input().split())


distance = [0] * (N)
for i in range(1, N + 1):
  for j in range(i + 1, N + 1):
    d = j - i
    b = abs(j - Y) + 1 + abs(X - i)
    distance[min(b, d)] += 1
for i in distance[1:]:
  print(i)
# Judge status: Accepted
a,b = map(int,input().split())
ans = abs(abs(a)-abs(b))
if a*b<0:ans+=1
if b<a<0 or 0<b<a:ans+=2
if a==0 and b<0:ans+=1
if b==0 and 0<a:ans+=1
print(ans)
# Judge status: Wrong Answer
list = []

n = int(input())

for i in range(n):
    words = str(input())
    if words in list:
        list.append(words)
    else:
        n -= 1

print(n)
# Judge status: Accepted
A, B, C, D = map(int, input().split())
ans = min(B, D)-max(A, C)
print(max(ans, 0))
# Judge status: Wrong Answer
# print('input >>')
N, X, Y = map(int,(input().split()))
ans = [0] * N

for i in range(1, N+1):
    for j in range(i, N+1):
        choku = j-i
        tanraku = abs(X-i) + abs(Y-j) + 1
        print((i,j), choku, tanraku)
        ans[min(choku, tanraku)] += 1

# print('-----output-----')
for ans_e in ans[1:]:
    print(ans_e)