peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,a,b=map(int,input().split())

if (a-b)%2==0:
    print(abs(a-b)//2)
else:
    a,b=min(a,b),max(a,b)
    can1=(a)+((b-a)-1)//2
    a,b=n-b+1,n-a+1
    can2=(a)+((b-a)-1)//2
    print(min(can1,can2))
# Judge status: Wrong Answer
import fractions

n = int(input())
a = [int(i) for i in input().split()]
mn1 = min(a)
a.remove(mn1)
mn2 = min(a)
ko = fractions.gcd(mn2,mn1)
print(ko)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
p = 0
ans = 0
for i in range(1,n):
    if p == 0 and a[i-1] < a[i]:
        p = 1
    elif p == 0 and a[i-1] > a[i]:
        p = 2
    elif p == 1 and a[i-1] > a[i]:
        p = 0
        ans += 1
    elif p == 2 and a[i-1] < a[i]:
        p = 0
        ans += 1
print(ans+1)
# Judge status: Accepted
k, x = (int(i) for i in input().split())
list_ans = []
for i in range(0, 2 * k - 1):
    list_ans.append(str((x + i) - (k - 1)))
print(" ".join(list_ans))
# Judge status: Accepted
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(list(map(int, input().split())))
b = [0, float("INF")]
for i in range(M):
    b[0] = max(a[i][0], b[0])
    b[1] = min(a[i][1], b[1])
if b[0] <= b[1]:
    print(b[1] - b[0] + 1)
else:
    print(0)
# Judge status: Accepted
N = int(input())
print(sum(divmod(N, 2)))
# Judge status: Wrong Answer
# https://atcoder.jp/contests/abc150/tasks/abc150_a

def read_int_n(): return list(map(int, input().split()))

K, X = read_int_n()

if K*500 > X:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
S = str(input())
T = str(input())

max_len = 0
for left in range(len(T)):
    for right in range(left, len(T)):
        tmp = T[left:right]
        tmpS = S[left:-(len(T) - right)]
        # print(tmp, tmpS)
        if tmp in tmpS:
            max_len = max(len(tmp), max_len)

print(len(T) - max_len)
# Judge status: Accepted
import numpy as np
N=int(input())
P=list(map(int,input().split()))

ct=0
min_p=P[0]
for i in range(N):
	if P[i]<=min_p:
		min_p=P[i]
		ct+=1


print(ct)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 0
cur_max=0

for x in a:
  if cur_max > x:
    ans += cur_max - x
  cur_max = max(cur_max, x)
print(ans)
# Judge status: Accepted
n = int(input())

dp = [False] * (n + 1)
dp[0] = True
for i in range(n-3):
    if dp[i]:
        dp[i+4] = True
for i in range(n-6):
    if dp[i]:
        dp[i+7] = True

if dp[n]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import deque
import sys
input = sys.stdin.readline
n,m = map(int,input().split())
l = [[] for i in range(n)]
for i in range(m):
  a,b = map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)
visited = [-1]*n
deq = deque([0])
c = 0
visited[0] = 0
while deq:
  cur = deq.popleft()
  c += 1
  for i in l[cur]:
    if visited[i] == -1:
      deq.append(i)
      visited[i] = cur
if c == n:
  print('Yes')
  for i in visited[1:]:
    print(i+1)
else:
  print('No')
# Judge status: Accepted
n, m = [int(x) for x in input().split()]
ans = [0] * n
for _ in range(m):
    a, b = [int(x) - 1 for x in input().split()]
    ans[a] += 1
    ans[b] += 1
print(*ans)
# Judge status: Accepted
#!/usr/bin/env python3

if "9" in input():
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
s = input()
if s[:len(s)//2+1] == s[len(s)//2+1:]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A, B, C = map(int, input().split())

first_amari = A%B
next_amari=0
i=2
while(first_amari!=next_amari):
    next_amari = (A*i) % B
    if next_amari == C:
        print("YES")
        exit()
    i+=1

print("NO")
# Judge status: Accepted
a,b,c,d = map(int,input().split())
ans=[]
for X in [a,b]:
  for Y in [c,d]:
    ans.append(X*Y)
print(max(ans))
# Judge status: Wrong Answer
import math

k = int(input())

memo = [[[None]*k for i in range(k)] for j in range(k)]

ans = 0
for p in range(k):
  for q in range(k):
    for r in range(k):
      a = sorted([p,q,r])
      if memo[a[0]][a[1]][a[2]] == None:
        memo[a[0]][a[1]][a[2]] = math.gcd(p,math.gcd(q,r))
      ans += memo[a[0]][a[1]][a[2]]
      
print(ans)
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

INF = float('inf')

def solve():
    x = II()

    t = x // 500
    x = x - 500 * t

    t2 = x % 5
    # print(t, t2)
    print(1000*t + 5 * t2)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
cnt = int(input())
chain = 0
first = 0
second = 0

for i in range(cnt):
    nList = list(map(int, input().split()))
    first = nList.pop()
    second = nList.pop()
    if first == second:
        chain = chain + 1
    else:
        chain = 0

if chain >= 3:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
S = input() 
Q = int(input())
for i in range(Q):
    lists = input().split()
    if lists[0] == "1":
        pass
    else:
        S = S + lists[2]
print(S)
# Judge status: Wrong Answer
A, B = map(int, input().split())
print((A+B)/2 if (A+B) % 2 == 0 else "IMPOSSIBLE")
# Judge status: Accepted
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]

if a < c < b or b < c < a:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
A = map(int, input().split())
total = 0
for a in A:
  total ^= a
result = []
for a in A:
  result.append(total ^ a)
print(result)
# Judge status: Accepted
s = input()
print(s.replace('2017','2018'))
# Judge status: Accepted
X, Y = map(int, input().split())
a = X
cnt = 0
while a <= Y:
    a *= 2
    cnt += 1
print(cnt)
# Judge status: Accepted
s, t = input(), input()
for i in range(len(s)):
    u = s[i:] + s[:i]
    if u == t:
        print("Yes")
        exit(0)
print("No")
# Judge status: Accepted
K = int(input())
if K%2==0 or K%5==0:
  print(-1)
elif K == (1 or 7):
  print(1)
else:
  mod = 7 % K
  mod_plus = mod
  i = 0
  while mod != 0:
    i += 1
    mod_plus = (mod_plus*10) % K
    mod = (mod + mod_plus) % K
  print(i+1)
# Judge status: Accepted
n=int(input())
flag=True
for i in range(n):
    t,x,y=map(int,input().split())
    if x+y>t or t%2!=(x+y)%2:
        flag=False
        break
print("Yes" if flag else "No")
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    p = [0] + list(map(int, readline().split()))

    cnt = 0
    for i in range(N + 1):
        if p[i] != i:
            cnt += 1

    if cnt <= 2:
        print("YES")
    else:
        print("NO")


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

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

ans = 1
for i in range(n):
  g = gcd(left[i],right[i])
  ans = max(ans,g)
print(ans)
# Judge status: Accepted
from sys import exit
from collections import Counter
mod = 998244353
n = int(input())
D = list(map(int, input().split()))
m = max(D)
C = Counter(D)
ans = 1
if C.get(0):
    if C[0] != 1 or D[0] != 0:
        print(0)
        exit()
else:
    print(0)
    exit()
for i in range(0, m):
    if C.get(i + 1):
        ans *= (C[i] ** C[i + 1]) % mod
        ans %= mod
    else:
        print(0)
        exit()

print(ans)
# Judge status: Accepted
voin=["a","i","u","e","o"]
s=input()
if s in voin:
    print("vowel")
else:
    print("consonant")
# Judge status: Wrong Answer
a = int(input())
s = input
if a >= 3200:
  print(s)
else:
  print("red")
# Judge status: Accepted
n = int(raw_input())

mat = []
for i in range(n):
    mat.append(map(int,raw_input().split()))
    
dp = [0,0,0]

for day in range(n):
    ndp = [0,0,0]
    data = mat[day]
    
    for i in range(3):
        for j in range(3):
            if i != j:
                ndp[j] = max(ndp[j], dp[i]+data[j])
    dp = ndp
print max(dp)
# Judge status: Accepted
n = int(input())
a = n //2 
b = n % 2
print(a + b)
# Judge status: Accepted
s=sorted(list(map(int,input().split())))
print('Yes' if s[0]+s[1]==s[2] else 'No')
# Judge status: Wrong Answer
def main():
  X, Y, A, B, C  = map(int, input().split())
  aka_list = sorted([int(t) for t in input().split()],reverse=True)[:X]
  midori_list = sorted([int(t) for t in input().split()],reverse=True)[:Y]
  mu_list = sorted([int(t) for t in input().split()],reverse=True)
  
  j = 0
  sum_list = sorted(aka_list + midori_list)
  for i in range(len(sum_list)):
    if sum_list[i] < mu_list[j]:
      sum_list[i] = mu_list[j]
      if j < C-1: 
        j += 1
  print(sum(sum_list))
  
main()
# Judge status: Wrong Answer
l = sorted(list(map(int, input().split())))
print(l[0] * l[1] / 2)
# Judge status: Accepted
s = input()

if s[0] != s[1] or s[1] != s[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = [i for i in input().split()]

n = set(n)

if len(n) == 2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int,input().split()))

c = sorted(collections.Counter(a).items(),reverse = True)

tmp = 0
ans=[]

for k in c:
  if k[1]>=4:
    tmp = max(tmp,k[0]*k[0])
  if k[1]>=2:
    ans.append(k[0])
  else:
    continue

if len(ans)>=2:
  print(max(ans[0]*ans[1],tmp))
else:
  print(tmp)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
S = 0
n = A[0]
for i in A[1:]:
    if n < i:
        S += i - n
        n = i
    elif n == i:
        continue
    else:
        n = i
print(S)
# Judge status: Wrong Answer
import numpy as np
from sys import stdin

def main():
  n = map(int,input().split())
  a = list(map(int, input().split()))
  print(a[0])
  b = np.argsort(a)+1
  str_ = ""
  for i in b:
    str_ = str_ + "{:d} ".format(i)
  print(str_)
  
  
if __name__ == "__main__":
    main()
# Judge status: Accepted
x,a,b=map(int,input().split())
if(abs(a-x)>abs(b-x)):
    print('B')
else:
    print('A')
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 0
if x == sum(a):
    ans = n
elif x > sum(a):
    ans = n-1
else:
    for i in range(n):
        if x - a[i] >= 0:
            x -= a[i]
            ans += 1
        else:
            break
print(ans)
# Judge status: Wrong Answer
S  = str(input())

cnt =0
flg = True

for i in range(len(S)-1):
    
    if S[i] in S[cnt+1]:
        flg =False
    
    cnt+=1
    
if flg ==True:
    print("yes")
else:
    print("no")
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
dp=[0]*(n+1)
dp[0]=1
for i,x in enumerate(a):
	if dp[i]<x:
		print(-1)
		exit()
	if i<n:
		dp[i+1]=(dp[i]-x)*2
dp[-1]=a[-1]
for i in range(n,0,-1):
	if dp[i-1]>a[i-1]+dp[i]:
		dp[i-1]=a[i-1]+dp[i]
print(sum(dp))
# Judge status: Wrong Answer
A,B,C = map(int,input().split())

if B / A >= 1:
    if C < B / A:
        print(C)
    elif B // A < C:
        print(B // A)
else:
    print(0)
# Judge status: Accepted
def count(n):
    c = 1
    while(n>=10):
        n = n//10
        c += 1
    return c
s = 0
n = int(input()) 
x = count(n)-1
for i in range(0,x,+2):
    s += 9*(10**i)
if (x+1) % 2:
    s += n-pow(10,x)+1
print(s)
# Judge status: Accepted
s = input()
length = len(s)
cnt = 0

if s[0] != 'A':
    print('WA')
    exit()

if length == 4:
    if s[2] == 'C':
        cnt = 1
else:
    for i in range(2, length-1):
        cnt += 1 if s[i] == 'C' else 0

if cnt != 1:
    print('WA')
    exit()

up_cnt = 0
for c in s:
    if c.isupper():
        up_cnt += 1

if up_cnt != 2:
    print('WA')
    exit()

print('AC')
# Judge status: Accepted
import sys

def main():
    input = sys.stdin.readline
    sx, sy, tx, ty = map(int, input().rstrip().split())

    horiz = tx - sx
    vert = ty - sy

    first_move = "U"*vert + "R"*horiz + "D"*vert + "L"*horiz
    second_move_go = "L" + "U"*(vert+1) + "R"*(horiz+1) + "D"
    second_move_back = "R" + "D"*(vert+1)+ "L"*(horiz+1) + "U" 
    print(first_move + second_move_go + second_move_back)

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

result = 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if n == i * j + k:
        result += 1

print(result)
# Judge status: Accepted
# Function for calc
def match(n, a, b):
    if (b - a)% 2 == 0:
        print((b-a)/2)
    else:
        if (n - b) >= a:
            print((a)+((b-(a+1))/2))
        else:
            x=(n-b+1)
            print(x+((n-(a+x))/2))
# Run match
in_string = raw_input()
[N, A, B] = [int(v) for v in in_string.split()]
match(N, A, B)
# Judge status: Accepted
l,r,d = map(int, input().split(" "))

multiple = 0
for i in range(l, r+1):
  if i % d == 0:
    multiple += 1
print(multiple)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

A.sort(reverse = True)

l = []
tmp = 0
for i in range(n-1):
    if A[i] == A[i+1]:
        l.append(A[i])
        tmp = i+1
        break

for i in range(tmp+1, n-1):
    if A[i] == A[i+1]:
        l.append(A[i])
        break

print(l[0] * l[1] if len(l) == 2 else 0)
# Judge status: Wrong Answer
n = int(input())
w = [input() for i in range(n)]
f = 'Yes'
for i in range(n-1):
    if w[i][-1]!=w[i+1][0] or w[i] in w[:i]:
        f = 'No'
print(f)
# Judge status: Accepted
import numpy as np
n=int(input())
x=list(map(int,input().split()))
a=[]
b=[]
for i in range(n):
    if i%2==1:
        b.append(x.pop())
    if i%2==0:
        a.append(x.pop())
b=b[::-1]
print(*(a+b))
# Judge status: Accepted
A = list(map(int, input().split()))

if A.count(7) == 1 and A.count(5) == 2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, m = map(int, input().split())
h = list(map(int, input().split()))
cnt = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] > h[b - 1]:
        cnt[b - 1] = 1
    elif h[a - 1] < h[b - 1]:
        cnt[a - 1] = 1
    else:
        cnt[b - 1] = 1
        cnt[a - 1] = 1
print(cnt.count(0))
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = input()
for ni in n:
  if ni == "7":
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
a, b = map(int,input().split())

if a >= 10 or b >= 10:
    print(-1)
else:
    print(a * b)
# Judge status: Accepted
a,b=map(int,input().split())
import math
c= math.gcd(a,b)
c2=c
l=[]
i=2
while i<=c:
  if c % i==0:
    c=c//i
   
    l.append(i)
  else:
    i+=1
  if i*i-1>c:
    l.append(c)
    break
  
print(len(set(l))+1)
# Judge status: Wrong Answer
import math
a = int(input())
for i in range(a, 0, -1):
  for j in range(2, 10):
    if i == int(math.pow(i, 1/j)) ** j:
      print(i)
      break
  else:
    continue
  break
# Judge status: Accepted
# A - Round One

A = int(input())
B = int(input())

print(6-A-B)
# Judge status: Wrong Answer
LI = lambda: list(map(int, input().split()))

X, K, D = LI()


def main():
    x = abs(X)
    a = x // D
    if K <= a:
        ans = x - K * D
        print(ans)
        return
    
    x -= a * D
    k = K - a
    print(a, k)
    if k % 2 == 0:
        ans = x - a * D
    else:
        ans = abs(x - D)
    print(ans)
    
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a = list(reversed(sorted(a)))
print(sum(a[1::2][:n]))
# Judge status: Accepted
def main():
    n = int(input())
    C = input()
    r = C.count('R')
    print(C[:r].count('W'))

if __name__ == '__main__':
    main()
# Judge status: Accepted
A,B,C=map(int,input().split())
K=int(input())
ans=A+B+C-max(A,B,C)
ans+=max(A,B,C)*(2**K)
print(ans)
# Judge status: Wrong Answer
n=int(input())
s=[]
s.append(2)
s.append(1)
for i in range(2,87):
    k = s[i-2]+s[i-1]
    s.append(k)
    if i==n:
        print(s[i])
        exit()
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))

ans = 1
sq = 0
a = A[0]
for i in range(1,n):
    print(a,A[i], sq)
    if sq == 0 and A[i] < a:
        sq = -1
    elif sq == 0 and A[i] > a:
        sq = 1
    elif (sq == 1 and A[i] < a) or (sq == -1 and A[i] > a):
        print('---')
        ans += 1
        sq = 0
    a = A[i]

print(ans)
# Judge status: Accepted
K,N=map(int,input().split())
a=[int(i) for i in input().split()]
a.append(a[0])

max=0
b=0
for i in range(N-1):
    b=a[i+1]-a[i]
    if(b>=max):
        max=b
    
m=K-a[i+1]+a[0]

if(m>max):
    max=m

kyori=K-max

print(kyori)
# Judge status: Accepted
import numpy as np

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

nx = np.arange(1, n+1)

ans = 0
ed = n
coin = 0

while (ed > 0):
    ct = 0
    for i in range(ed-1, -1, -1):
        if (nx[i] >= k):
            ct += 1
            ed = i
        else:
            break
    ans += ct*(1/2**(coin))

    # print(nx)
    nx *= 2
    coin += 1

print(ans/n)
# Judge status: Accepted
N = int(input())

while N >= 10:
  s = str(N)
  array = list(map(int, s))
  N = sum(array)

if N == 9 or N == 0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N=int(input())
S=str(input())
t=N*(N-1)*(N-2)//6
print (t)
for i in range(N):
    for j in range(i+1,N):
        if S[i]==S[j]:
            t=t-(N-j-1)
        else:
            for k in range(j+1,N):
                if S[j]!=S[k] and S[i]!=S[k] and (i-j)!=(j-k):
                    continue
                else:
                    t=t-1
print (t)
# Judge status: Accepted
import math
N = int(input())
if N <= 1:
    print(0)
    exit()

L = math.ceil(math.sqrt(N)) + 1
isPrime = [True] * L
isPrime[0] = isPrime[1] = False
primes = []
for n in range(2, L):
    if isPrime[n]:
        primes.append(n)
        isPrime[2*n::n] = [False] * ((L-n-1) // n)

ans = 0
for p in primes:
    d = p
    while N % d == 0:
        ans += 1
        N //= d
        d *= p
    while N % p == 0:
        N //= p

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

if A == B == C or (C+B == 2*A and A+B == 2*C and A+C == 2*B): 
  print(-1)
else:
  c = 0
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    ba = A
    bb = B
    bc = C
    A = bb//2 + bc//2
    B = ba//2 + bc//2
    C = ba//2 + bb//2
    c+=1
  print(c)
# Judge status: Accepted
s = input().split()
print('A'+ s[1][0].upper() +'C')
# Judge status: Wrong Answer
from bisect import bisect_left

N = int(input())

A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
num_a = 0
num_c = 0
res = 0

for b in B:
    num_a = bisect_left(A, b) # a < b となるAの要素数
    num_c = N - bisect_left(C, b) # c > b となるAの要素数
    if num_a != N and A[num_a] == b:
        num_a -= 1
    if num_c != N and A[num_c] == b:
        num_a -= 1
    res += num_a * num_c
print(res)
# Judge status: Accepted
import collections
N = int(input())
count = []

for _ in range(N):
    s = "".join(sorted(input()))
    count.append(s)

ans = 0
for v in collections.Counter(count).values():
    ans += v * (v - 1) // 2

print(ans)
# Judge status: Accepted
#

import sys
input=sys.stdin.readline

def main():
    A,B,C,K=map(int,input().split())
    if K%2==0:
        pm=1
    else:
        pm=-1
    print(pm*(A-B))
    
if __name__=="__main__":
    main()
# Judge status: Accepted
S=input()
temp=len(S)+1
for i in range(0,temp):
  S=S[:-1]
  if len(S)%2==0 and S[0:len(S)//2]==S[len(S)//2:]:
    print(len(S))
    exit()
# Judge status: Wrong Answer
x = input()
ls_x = x.split()

print(ls_x)

for i in range(len(ls_x)):
    ls_x[i] = int(ls_x[i])

gA = [1,3,5,7,8,10,12]
gB = [4,6,9,11]

if ls_x[0] == 2 or ls_x[1] == 2:
    print("No")

if ls_x[0] == gA[i] and ls_x[1] == gA[i]:
    print("Yes")
else:
    print("No")

if ls_x[0] == gB[i] and ls_x[1] == gB[i]:
    print("Yes")
else:
    ("No")
# Judge status: Wrong Answer
N, M = map(int, raw_input().split())

L = []
R = []

for i in range(M):
    Li, Ri = map(int, raw_input().split())
    L.append(Li)
    R.append(Ri)

ans = min(R) - max(L) + 1

print ans
# Judge status: Wrong Answer
S=input()
T=input()
for letter in S:
    pass
if letter in T:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def main():
    import collections

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

    distance_list = []
    for i in range(1, n):
        for j in range(i+1, n+1):
            distance_list.append(min(j-i, abs(i-x)+abs(j-y)+1))

    distance_count = collections.Counter(distance_list)
    for i in range(1, n):
        print(distance_count[i])


if __name__ == '__main__':
    main()
# Judge status: Accepted
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

for i in range(N-M+1):
  for j in range(N-M+1):
    
    for k in range(M):
      if A[i+k][j:j+M] != B[k]:
        break
    else:
      print('Yes')
      exit()

print('No')
# Judge status: Accepted
last = input()

if last == "ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Wrong Answer
S=input()

count = 0
maxCount = 0
for k,i in enumerate(list(S)):
  if i == "A"  and count == 0:
    count+=1

  elif i == "Z" and count > 0 and k<len(S)-1 :
    count +=1
    if S[k+1] != "Z":
      maxCount = max(maxCount, count)
      count = 0
  elif i == "Z" and count > 0:
    count +=1
    maxCount = max(maxCount, count)
    count = 0

  elif count > 0 :
    count +=1

  else :
    None

print(maxCount)
# Judge status: Accepted
W,a,b=map(int,input().split())
if b<=a<=b+W or b<=a+W<=b+W:
  print(0)
elif b>a+W:
  print(b-a-W)
else:
  print(a-b-W)
# Judge status: Accepted
n=int(input())
ab=[]
for i in range(n):
  aa,bb=map(int,input().split())
  ab.append((aa,bb))
t_sum=0
ab=ab[::-1]
for a,b in ab:
  if (a+t_sum)%b!=0:
    t=b-(a+t_sum)%b
    t_sum+=t
print(t_sum)
# Judge status: Accepted
n = int(input())
a = sorted([input().split() + [i+1] for i in range(n)], key=lambda x:(x[0], -int(x[1])))
for n, s, i in a:
  print(i)
# Judge status: Accepted
n = int(input())
d = [int(i) for i in input().split()]
d.sort()
print(d[n//2]-d[n//2-1])
# Judge status: Accepted
n = int(input())
s = input()

if n % 2 == 1:
    print("No")
else:
    if s[:int(n/2)] == s[int(n/2):]:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
a = input()
ok = True
for i in range(len(a)//2, 2):
    if a[i:i + 2] != "hi":
        ok = False
        break

if ok:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#Educational DP c vacation
n = int(input())
abc = [list(map(int, input().split())) for _ in range(n)]
dp = [[0, 0, 0] for _ in range(n+1)]
for i in range(n):
    dp[i+1][0] = abc[i][0] + max(dp[i][1], dp[i][2])
    dp[i+1][1] = abc[i][1] + max(dp[i][0], dp[i][2])
    dp[i+1][2] = abc[i][2] + max(dp[i][0], dp[i][1])
print(max(dp[n][0], max(dp[n][1], dp[n][2])))
# Judge status: Accepted
from collections import Counter as C
n,*a=map(int,open(0).read().split())
b=[]
for i in C(a).items():
  if i[1]>3:
    b+=[i[0],i[0]]
  elif i[1]>1:
    b+=[i[0]]
b=sorted(b)
print(b[-1]*b[-2] if len(b)>1 else 0)
# Judge status: Accepted
K = int(input())
from fractions import gcd
from math import ceil
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

sum_gcd = [0]*K
for i in range(1,K+1):
    c = 0
    for j in range(1,K+1):
        c += gcd(i,j)
    sum_gcd[i-1] = c
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        ans += sum_gcd[gcd(a,b)-1]

print(ans)
# Judge status: Wrong Answer
N = int(input())

from collections import OrderedDict

if N == 2:
    print(2)
    exit(0)
# ans = OrderedDict()
ans = set()
cur = N
i = 1

while cur != 0:
    tmp = cur - i
    if tmp in ans:
        pass
    else:
        ans.add(i)
        cur = tmp
    i+= 1

for a in ans:
    print(a)