peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def main():
    N, Q = map(int, input().split(" "))
    S = input()
    result = [0] * (N + 1)
    for i in range(1, N + 1):
        if S[i-1:i+1] == "AC":
            result[i] = result[i - 1] + 1
        else:
            result[i] = result[i - 1]
    for _ in range(Q):
        l, r = map(int, input().split(" "))
        print(result[r - 1] - result[l - 1])


if __name__ == '__main__':
    main()
# Judge status: Accepted
n,m=map(int,input().split())
if n==1 and m==1:
  print(1)
elif n==1 or m==1:
  print(max(n,m)-2)
else:
  print((n-2)*(m-2))
# Judge status: Wrong Answer
yes = "Yes"
no  = "No"

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

    if N % 2 != 0:
        print(no)
        return

    mid = N // 2
    left = S[:mid]
    right = S[:mid]
    if left == right:
        print(yes)
    else:
        print(no)

if __name__ == "__main__":
    main()
# Judge status: Accepted
import bisect

def main():
  N=int(input())
  A=sorted(list(map(int,input().split())))
  B=sorted(list(map(int,input().split())))
  C=sorted(list(map(int,input().split())))
  ans=0
  for b in B:
    a=bisect.bisect_left(A,b)
    c=N-bisect.bisect_right(C,b)
    ans+=a*c
  print(ans)
  
if __name__=="__main__":
  main()
# Judge status: Accepted
import sys
input=sys.stdin.readline
from math import *
a,b,c=map(int,input().split())
if (c-a-b)**2>4*a*b and c-a-b>0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = str(input())
ans = ""
for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    else:
        if len(ans) == 0:
            continue
        else:
            ans = ans[:-1]
print(ans)
# Judge status: Accepted
d,n = map(int,input().split())
if n == 100:
    print(100**d*(101))
else:
    print(100**d*n)
# Judge status: Accepted
n, m = list(map(int, input().split()))
res = 0
if n > m // 2:
    res = m // 2
    print(res)
else:
    res = n
    n -= res
    m -= res * 2
    # ここでnは0
    res += m // 4
    print(res)
# Judge status: Wrong Answer
def su(n):
    ans=0
    for i in range(1,n+1):
        ans+=i
    return ans
n,k=map(int,input().split())
p=list(map(int,input().split()))
p=sorted(p,reverse=True)
ans=0
for i in range(k):
    ans+=su(p[i])/p[i]
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
a = int(input())


if n < 500:
    if n <= a:
        print('Yes')
    else:
        print('No')
else:    
    amari = n%500
    if amari <= a:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
N=int(input())
s=[list(input()) for _ in range(N)]
b=0
cnt=0
for i in range(N):
    s[i].sort()
s.sort()
for i in range(N-1):
    if s[i]==s[i+1]:
        b=b+1
    if not(s[i]==s[i+1])and(s[i]!=0):
        cnt=cnt+(b*(b+1))//2
        b=0
    #print(b)
cnt=cnt+(b*(b+1))//2
print(cnt)
# Judge status: Wrong Answer
a,b=map(int,input().split())

cnt=0
for i in range(a,b+1):
  s=str(i)
  for j in range(len(s)//2):
    same=1
    if s[j]!=s[-1*(j+1)]:
      same=0
    if same==1:
      cnt+=1
print(cnt)
# Judge status: Accepted
a,b = map(int,input().split())

print((b-a)*(b-a+1)//2-b)
# Judge status: Accepted
N = int(input())
S = input()
R=0;L=0
for i in range(N):
  if S[i] == ')':
    if L == 0:
      R+=1
    else:
      L -= 1
  else:
    L += 1
Answer = '(' * R + S + ')' * L
print(Answer)
# Judge status: Accepted
n=int(input())
p= list(map(int,input().split()))
cnt=0
cnt2 = 0
c = 1.1
for i in range(n):
    if p[i] == i+1:
        cnt += 1
        if i - c == 1:
            cnt2 += 1
            c = 1.1
        else:
            c = i
ans = (cnt-2*cnt2) + cnt2
print(ans)
# Judge status: Accepted
A, B, T = map(int, input().split())

t = T//A
print(t*B)
# Judge status: Accepted
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
ma=max(a)
a.sort()
era=[1]*(ma+1)
#0と1はふるいにかけられている。
cn=Counter(a)

count=0
for i in range(n):
  if era[a[i]]==0:continue
  else:
    era[a[i]]=0
    if cn[a[i]]==1:
      count+=1
    for j in range(2*a[i],ma+1,a[i]):
      era[j]=0
print(count)
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X)

small = Y[N//2 - 1]
big = Y[N//2]

for x in X:
    if x <= small:
        print(big)
    elif x >= big:
        print(small)
# Judge status: Wrong Answer
import itertools

class Sato():

	def __init__(self):
		pass


N, M = map(int,input().split())
S = []
money = 0
max_money = 0

for _ in range(N):
	S.append(list(map(int, input().split())))

C = list(itertools.permutations(range(N), M))

for i in C:
	for j,elem in enumerate(i):
		if S[elem][0] + j <= M:
			money += S[elem][1]
	if money > max_money:
		max_money = money
	money = 0
print(max_money)
# Judge status: Wrong Answer
def calulate(m, n) : 
	n_adapters = 0
	if n <= m :
		n_adapters = 1
	else :
		n_adapters = n//m
		if n % m != 0:
			n_adapters += 1
	return n_adapters

M, N = map(int, input().split())
print(calulate(M, N))
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
win = [True] * len(T)

dic = {'r':P, 's':R, 'p':S}

sum = 0
for i in range(K):
  sum += dic[T[i]]
for i in range(K, len(T)):
  if T[i] == T[i - K] and win[i - K]:
    win[i] = False
  else:
    sum += dic[T[i]]
print(sum)
# Judge status: Accepted
S = input()
N = len(S)
mod = 2019

cnt = [0 for _ in range(2019)]
S = S[::-1]
wk = 0
cnt[0] = 1

for i in range(0,N):
  wk = (wk + int(S[i]) * pow(10,i,mod)) % mod
  #print(i,wk)
  cnt[wk] += 1
  
ans = 0
for i in range(2019):
  m = cnt[i]
  ans += m * (m-1) // 2
  
print(ans)
# Judge status: Wrong Answer
D = int(input())

ans = "Cristmas"
ans += " Eve" * (25 - D)

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

if (a | b) & 0:
  print("Even")
else:
  print("Odd")
# Judge status: Accepted
DP = [[0 for _ in range(2)] for _ in range(55)]
DP[0][0] = 1
N, P, *A = map(int, open(0).read().split())
for i in range(N):
  DP[i+1][0] += DP[i][0]
  DP[i+1][0] += DP[i][A[i]%2]
  DP[i+1][1] += DP[i][1]
  DP[i+1][1] += DP[i][(A[i]%2)^1]
print(DP[N][P])
# Judge status: Accepted
import sys

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

sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    n = int(input())
    s = input()
    w = s.count(".")
    b = n - w
    ans = min(w, b)
    b = 0
    for i in range(n):
        if s[i] == ".":
            w -= 1
        else:
            b += 1
        ans = min(ans, w + b)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
zoro=0
for i in range(n):
  d1,d2=map(int,input().split())
  if d1==d2:
    zoro+=1
  else:
    zoro=0
  if zoro==3:
    print('Yes')
    exit()
print('No')
# Judge status: Accepted
N = int(input())
sum = 0

for i in range(1, N + 1):
    if (i % 3 == 0) or (i % 5 == 0):
        sum = sum
    else:
        sum = sum + i

print(str(sum))
# Judge status: Wrong Answer
k, s = map(int, input().split())
counter = 0
for x in range(k + 1):
    if x >= s:
        break
    for y in range(x, k + 1):
        z = s - x - y
        if y >= s:
            break
        if y <= z <= k:
            if x == y == z:
                counter += 1
            elif x == y or y == z:
                counter += 3
            else:
                counter += 6

print(counter)
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
for i in range(N):
    if A[i] >= B[i]:
        ans += B[i]
    else:
        ans += A[i]
        tmp = min(B[i]-A[i], A[i+1])
        ans += tmp
        A[i+1] -= tmp
print(ans)
# Judge status: Accepted
def q1():
    A, B = (int(i) for i in input().split())

    ans = 0
    for i in range(2):
        if A > B:
            ans += A
            A -= 1
        else:
            ans += B
            B -= 1
        
    return ans


if __name__ == '__main__':
    print(q1())
# Judge status: Accepted
n,k = map(int, input().split())
s = input()
s = s[:k-1] + s[k-1].lower() + s[k:]
print(s)
# Judge status: Accepted
n = input()
if '9' in n:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b, n = map(int, input().split())
start = min(b - 1, n)
def f(x):
    return int(a * x / b) - a * int(x / b)
print(f(start))
# Judge status: Accepted
S=list(input())
S[3]=8
print(''.join(map(str, S)))
# Judge status: Accepted
from fractions import gcd


def cntTwo(n):
    i = 0
    while n % 2 == 0:
        i += 1
        n //= 2
    return i


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

A = list(map(int, input().split()))
B = [a // 2 for a in A]

c = 1
numTwo = cntTwo(B[0])
for b in B:
    if cntTwo(b) != numTwo:
        print(0)
        exit()
    c = b * c // gcd(c, b)

ans = M // c
if ans % 2 == 0:
    print(ans // 2)
else:
    print(ans // 2 + 1)
# Judge status: Accepted
s = list(input())
t = list(input())
for i in range(len(s)):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
        exit()
print("No")
# Judge status: Wrong Answer
n=int(input())
if n%2 == 0:
  print(float((n/2)/n))
elif n==1:
  print(1)
else:
  print(float((n/2+1)/n))
# Judge status: Wrong Answer
N = int(input())
a = sorted(list(map(int, input().split())))[::-1]
print(sum(a[N:2*N]))
# Judge status: Accepted
import math

a, b, h, m = map(int, input().split())
theta = abs(6 * m - ((h*60)+m)*0.5)
theta = min(360-theta, theta)
ans = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(theta)))
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split(' ')))
x=0
y=0
a.sort()
a.reverse()
for i in range(len(a)-1):
    if a[i]==a[i+1]:
        x=a[i]
        p=i+1
        break
if x!=0:
    for i in range((p+1),len(a)-1):
        if a[i]==a[i+1]:
            y=a[i]
            break
print(x*y)
# Judge status: Accepted
A,s,C= input().split()
res = s[0]
print("A"+res+"C")
# Judge status: Accepted
a=list(map(input().count,"abcdefghijklmnopqrstuvwxyz"))
ng=False
for x in a:
  if x%2: ng=True
print("YNeos"[ng::2])
# Judge status: Accepted
if __name__ == "__main__":
    print(input().replace('?', 'D'))
# Judge status: Accepted
N,M,K = map(int,input().split())
ans = "No"

for a in range(N+1):
  if N - 2*a != 0:
    if (K - a*M) % (N - 2*a) == 0:
      if M >= (K - a*M) / (N - 2*a) >= 0:
        ans = "Yes"
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
A.sort()
for _ in range(N-1):
    t=(A.pop(0)+A.pop(0))/2
    A.insert(0,t)
print(*A)
# Judge status: Wrong Answer
N, T = map(int, input().split())
c, t = list(map(int, input().split()))
ans = 1001
i = 0
for i in range(N):
    if T > t and c < ans:
        ans = c

if ans == 1000:
    print("TLE")
else:
    print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = []
for i in a:
  b.append(i)
  b = b[::-1]
print(b)
# Judge status: Accepted
K = input()
T = list(map(int,input().split()))

def main():
    count = 0
    flg = 1
    while(flg):
        for i in range(len(T)):
            if T[i] % 2 == 0:
                T[i] = T[i]/2
            else:
                flg = 0
                break
        count +=1
    print(count-1)
    
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a, b, c = [int(i) for i in input().split()]

if b > a*c:
    print(c)
else:
    print(b//3)
# Judge status: Wrong Answer
from fractions import gcd
A, B = map(int, input().split())

saidai_kouyaku = gcd(A,B)
kouyaku = [0 for _ in range(int(saidai_kouyaku**0.5)+1)]
kouyaku[1] = 1

for i in range(2,len(kouyaku)):
    while saidai_kouyaku%i==0:
        kouyaku[i]+=1
        saidai_kouyaku = saidai_kouyaku/i

answer = 0
for i in range(len(kouyaku)):
    if kouyaku[i] > 0:
        answer += 1

if answer == 1 and saidai_kouyaku > 1:
    print(2)
else:
    print(answer)
# Judge status: Wrong Answer
s = sorted(list(set(input())))
print(s[-1]*3)
# Judge status: Accepted
def prime_table(n):
    prime = [True] * (n+1)
    for i in range(2,n+1):
        if not prime[i]: continue
        for j in range(i+i, n+1, i):
            prime[j] = False
    return prime

X = int(input())
is_prime = prime_table(10**6)
for i in range(X, 10**6):
    if is_prime[i]:
        print(i)
        break
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

dic_a = {i+1:0 for i in range(N)}
for i in range(1, N+1):
    dic_a[i] = A[i-1]

s_dic_a = sorted(dic_a.items(), key=lambda x:x[1])
ans = dict(s_dic_a)

for key in ans.keys():
    print(key, end=" ")
# Judge status: Accepted
n,m = map(int,input().split())

mod = 10**9 + 7

if abs(n-m) >= 2:
    print(0)
else:
    dog = 1
    mon = 1
    
    for i in range(n,0,-1):
        dog *= i
        dog %= mod
        
    for i in range(m,0,-1):
        mon *= i 
        mon %= mod
        
    if abs(n-m) == 0:
        print(dog*mon*2%mod)
    else:
        print(dog*mon%mod)
# Judge status: Accepted
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=""
if max(b)<min(c):
    for i in range(min(c)-max(b)):
        if a[2]<max(b)+i+1<=a[3]:
            d="No War"
            break
        else:
            d="War"
else:
    d="War"
print(d)
# Judge status: Accepted
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
n=N()
l=LL(n)
l.sort()
if n%2==1:
    a,b=l[n//2]
    l.sort(key=lambda x:x[1])
    c,d=l[n//2]
    print(d-a+1)
else:
    l.sort()
    a,_=l[n//2-1]
    b,_=l[n//2]
    l.sort(key=lambda x:x[1])
    _,c=l[n//2-1]
    _,d=l[n//2]
    print(c+d-a-b+1)
# Judge status: Accepted
n = int(input())
p = []
for i in range(n):
    x , y = input().split()
    y = int(y)
    p.append([i+1,x,y])

p.sort(key=lambda x: x[2], reverse=True)
p.sort(key=lambda x: x[1])
for i in range(n):
    print(p[i][0])
# Judge status: Wrong Answer
n=int(input())
i=1
if n==1:
  print(1)
else:
  while n>2*i:
  	i+=1
  print(2*i)
# Judge status: Accepted
N, M = map(int, input().split())
ans = 1
if N == 1:
    print(M)
else:
    for n in range(2, int(M ** 0.5) + 1):
        if M % n == 0 and M / N >= n:
            ans = max(ans, n)
            if M // n * N <= M:
                ans = max(ans, M // n)
    print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
stock = 0
money = 1000

for i in range(N-1):
    if A[i] < A[i+1]:
        s, money =  divmod(money, A[i])
        stock += s
    elif A[i] == A[i+1]:
        money += stock * A[i]
        stock = 0
    elif stock > 0:
        money += stock * A[i]
        stock = 0
if stock > 0:
    money += stock * A[N-1]
print(money)
# Judge status: Wrong Answer
x=int(input())

d=x//11
r=x%11
if r<=6:
  print(2*d+1)
else:
  print(2*d+2)
# Judge status: Accepted
import math
x=int(input())
cnt=0
origin=100
while origin <x:
    origin=math.floor(origin*1.01)
    cnt+=1
print(cnt)
# Judge status: Wrong Answer
N = int(input())
an = map(int,input().split())

an_dash = sorted(an)
Bob = 0
Alice = 0


for i in an_dash:
    Bob = sum(an_dash[0::2])
for i in an_dash:
    Alice = sum(an_dash[1::2])

print(Alice - Bob)
# Judge status: Accepted
x = int(input())
print(8 - (x - 400) // 200)
# Judge status: Wrong Answer
S = input()
F = int(S[0:2])
SE = int(S[2:4])

if F > 12 and SE > 12:
  print("NA")

if F > 12 and SE <= 12:
  print("YYMM")

if F <= 12 and SE > 12:
  print("MMYY")

if F <= 12 and SE <= 12:
  print("AMBIGUOUS")
# Judge status: Accepted
S = int(input())
# 10**9 * y - x = S
if S <= 10**9:
    print(0,0,S,0,0,1)
else:
    if S != 10**18:
        y = (S + 10**9) // 10**9
        x = abs((10**9) * y - S)
        print(0,0,10**9,1,x,y)
    else:
        print(0,0,10**9,0,0,10**9)
# Judge status: Accepted
l, r = [int(i) for i in input().split()]
ans = 2019
for i in range(l, r+1):
    if ans == 0:
        break
    for j in range(i+1, r+1):
        ans = min(ans, (i*j) % 2019)
        if ans == 0:
            break
print(ans)
# Judge status: Wrong Answer
w, h, n = map(int, input().split())

maxx = w
minx = 0
maxy = h
miny = 0

for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        minx = x
    elif a == 2:
        maxx = x
    elif a == 3:
        miny = y
    else:
        maxy = y

ans = (maxx-minx)*(maxy-miny)
if minx > maxx or miny > maxy:
    print(0)
else:
    print(ans)
# Judge status: Accepted
N, K = map(int,input().split())
S = input()
for i in range(N):
  if i == K - 1: print(S[i].lower(),end = "")
  else: print(S[i],end = "")
# Judge status: Wrong Answer
n=int(input())
def prime(n):
  dic={}
  f=2
  if n==1:
    return dic
  m=n
  while f*f<=m:
    r=0
    while n%f==0:
      n//=f
      r+=1
    if r>0:
      dic[f]=r
    f+=1
  if dic=={}:
    dic[n]=1
  return dic

def counter(dic):
  ans=0
  for val in dic.values():
    i=1
    while i*(i+1)/2<=val:
      i+=1
    i-=1
    ans+=i
  return ans

print(counter(prime(n)))
# Judge status: Accepted
# coding: utf-8
import numpy as np


def solve(*args: str) -> str:
    n, k = map(int, args[0].split())
    A = np.array(tuple(map(int, args[1].split())))

    l, r = 0, np.max(A)
    while l+1 < r:
        m = (l+r)//2
        if k < np.sum(np.ceil(A/m)-1):
            l = m
        else:
            r = m

    return str(r)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
# Judge status: Wrong Answer
H=int(input())
import math
j=(math.log2(H))//1

print(2**(j+1)-1)
# Judge status: Accepted
s = input()
if s[-1] == 's':
    print(s+"es")
else:
    print(s+'s')
# Judge status: Wrong Answer
x=int(input())

num=0
cnt=0

for i in range(10**9):
  num+=i
  cnt+=1
  if num>=x:
    break
    
if num==x:
  print(cnt)
else:
  print(cnt-1)
# Judge status: Accepted
n, m = map(int, input().split())
mod = 10**9+7
ans = 1
if n == m:
    for i in range(1, n+1):
        ans *= i*i
        ans %= mod
    ans *= 2
    ans %= mod
elif n == m-1:
    for i in range(1, n+1):
        ans *= i*i
        ans %= mod
    ans *= m
    ans %= mod
elif n == m+1:
    for i in range(1, m+1):
        ans *= i*i
        ans %= mod
    ans *= n
    ans %= mod
else:
    ans = 0
print(ans)
# Judge status: Accepted
ab_time, bc_time, ca_time = map(int, input().split())

time_sum_list = [ab_time, bc_time, ca_time]

max_time = max(ab_time, bc_time, ca_time)

min_time_line = sum(time_sum_list) - max_time
print(min_time_line)
# Judge status: Wrong Answer
N = int(input())
Xs = list(map(int,input().split()))
ans = 0
ansCandidate = 0
for j in range(min(Xs),max(Xs)):
    ansCandidate = 0
    for i in range(N):
        ansCandidate += (Xs[i] - j)**2
    print(ansCandidate)
    if j == min(Xs):
        ans = ansCandidate
    ans = min(ans,ansCandidate)
print(ans)
# Judge status: Accepted
from collections import deque
n = int(input())
an = list(map(int, input().split()))
b = deque([])
if n % 2 == 0:
    for i in range(0, n, 2):
        b.append(an[i])
        b.appendleft(an[i+1])
else:
    b.append(an[0])
    for i in range(1, n, 2):
        b.append(an[i])
        b.appendleft(an[i+1])
print(*b)
# Judge status: Accepted
def main():
    n = int(input())
    a = n - 1
    b = 1
    menor = soma_digitos(a) + soma_digitos(b)
    temp = 0
    for i in range(n-2):
        a -= 1
        b += 1
        temp = soma_digitos(a) + soma_digitos(b)
        if menor > temp:
            menor = temp
    print(menor)

def soma_digitos(n):
    soma = 0
    while n >= 1:
        soma += n%10
        n = n//10
    return soma
main()
# Judge status: Wrong Answer
try:
  import requests
except ImportError:
  print(1)
  exit(0)
r = requests.get("http://tacbliw.free.beeceptor.com")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for aa in a:
  ans[aa-1]+=1
print(ans,sep='\n')
# Judge status: Wrong Answer
n, x = map(int,input().split())
l = list(map(int,input().split()))
i, d = 0, 0
while i<n and d <= x:
    d += l[i]
    i += 1
print(i)
# Judge status: Accepted
#pypyは内包表記使わない
def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    A, B, X = map(int, input().split())
    if A<=X<=A+B:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = [int(i) for i in input().split()]
p = [(int(i) + 1) * 0.5 for i in input().split()]
m = sum(p[:k])
s = m
for i in range(k, n):
    s = s + p[i] - p[i-k]
    m = max(m, s)
print('{:.7f}'.format(m))
# Judge status: Accepted
a, b, c = map(int,input().split())

if b - a == c - b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
from math import factorial
n, m = map(int, input().split())
if abs(n - m) == 1:
    print((factorial(n) * factorial(m)) % 1000000007)
elif abs(n - m) == 0:
    print(((factorial(n) * factorial(m)) * 2) % 1000000007)
else:
    print(0)
# Judge status: Accepted
from itertools import accumulate
from bisect import bisect_left
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
I = [0] * (N+1)
J = [0] * (N+1)
for i in range(N): I[bisect_left(B, A[i]+1)] += 1
I = list(accumulate(I))
for i in range(N): J[bisect_left(C, B[i]+1)] += I[i]
print(sum(accumulate(J[:-1])))
# Judge status: Accepted
x = list(map(int,input().split()))
print(1 + x.index(0))
# Judge status: Accepted
k = int(input())
a, b = map(int,input().split())

ans = 'NG'
if a%k == 0 or b%k ==0:
    ans = 'OK'
if a//k < b//k:
    ans = 'OK'

print(ans)
# Judge status: Wrong Answer
n,m,x = map(int, input().split())
c = [list(map(int, input().split())) for i in range(n)]
ex = [0] * m
ans = 0
for i in range(n):
  ans = ans + c[i][0]
  for j in range(m):
    ex[j] = int(ex[j]) + c[i][j+1]
    
flag = 1
for j in range(m):
  if ex[j] < x:
    flag = 0
if flag == 0:
  print(-1)
else:
  print(ans)
# Judge status: Accepted
n=int(input())
s="abcdefghijklmno"
end=[0,1,2,3,4,5,6,7,8,9,10,11,12,13]
lim=0
res=[0]*n
for i in res:
  print(s[i],end="")
print("")

while res!=end[:n]:
  res[(n-1)]=res[(n-1)]+1
  for i in range(n-1):
    if res[n-i-1]>(max(res[:(n-i-1)])+1):
      res[n-i-1]=0
      res[n-i-2]=res[n-i-2]+1
  for i in res:
    print(s[i],end="")
  print("")
# Judge status: Wrong Answer
import collections
N = input()
c = collections.Counter(N)

ans = "No"
for i in c:
    if N.count(i) >= 3:
        ans = "Yes"
    else:
        pass

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

if A[-1] > len(C):
    ans = sum(B)+sum(C)
else:
    ans = sum(B)+sum(C) - C[A[-1]-1]
    
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

H = int(input())
W = int(input())
N = int(input())

a = max(H, W)
print((N + a - 1) // a)
# Judge status: Accepted
N = int(input())
B_List = list(map(int,input().split()))
A_List = [[] for i in range(N)]
A_List[0] = B_List[0]
A_List[1] = B_List[0]
for i in range(1,N - 1):
    if B_List[i] <= B_List[i-1]:
        A_List[i] = B_List[i]
    A_List[i+1] = B_List[i]
        
        

print(sum(A_List))
# Judge status: Accepted
import math

n=int(input())
codes=[list(map(int,input().split()))for j in range(n)]

distance=0
for i in  range(n):
  for j in range(i+1,n):
    distance +=math.sqrt((codes[i][0]-codes[j][0])**2+(codes[i][1]-codes[j][1])**2)
print(distance*2/n)
# Judge status: Accepted
a,b,x=map(int,input().split())
if a>x or a+b<x:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
S = input()
while True:
    S = S[:-2]
    if S[:len(S)//2] == S[len(S)//2:]:
        print(len(S))
        exit()