peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math

N = int(input())
A = N // 1.08
A2 = A + 1

if math.floor(A * 1.08) == N:
	ans = int(A)
	print(ans)
elif math.floor(A2 * 1.08) == N:
	ans = int(A2)
	print(ans)
else:
	print(":(")
# Judge status: Accepted
def read_int():
    return int(input())


def read_ints():
    return map(int, input().split(' '))


a, v = read_ints()
b, w = read_ints()
t = read_int()
if w >= v:
    print('NO')
elif abs(a - b) / (v - w) <= t:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
s=input()
cnt,ans=0,len(s)
for ss in s:
  if ss=="S":
    cnt+=1
  else:
    if cnt>0:
        cnt-=1
        ans-=2
print(ans)
# Judge status: Accepted
kind = int(input())

table_1 = input().split(' ')
table_2 = input().split(' ')
table_3 = input().split(' ')
total = 0
for i in range(kind):
    total += int(table_2[i])
    
for j in range(kind-1):
    if int(table_1[j]) == int(table_1[j + 1]) - 1:
        total += int(table_3[int(table_1[j]) - 1])
print(total)
# Judge status: Wrong Answer
n=int(input())
ans=0
for num in range(1,n+1):
    ans+=num
print(num)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

num = [0]*(max(A)+2)

for i in A:
    num[i] += 1
m = max(A)
ans = 0
for i in range(0,max(A)+2):
    if i == 0:
        tmp = num[i] + num[i+1]
    elif i == m+1:
        tmp = num[i-1] + num[i]
    else:
        tmp = num[i-1] + num[i] + num[i+1]
    ans = max(ans,tmp)

print(ans)
# Judge status: Accepted
n=int(input())
a_dict={}
for i in range(n):
    a=input()
    if a not in a_dict:
        a_dict[a]=0
    else:
        a_dict[a]+=1
# moji=[i for i,j in a_dict.items() if j==max(a_dict.values()) ]
moji=[]
j=max(a_dict.values())
for i,k in a_dict.items():
    if k==j:
        moji.append(i)
moji=sorted(moji)
for i in moji:
    print(i)
# Judge status: Wrong Answer
n = int(input())
ans = 800 * n - 200 * n // 15
print(ans)
# Judge status: Wrong Answer
n=float(input())
div=n/3
rem=n-2*div
print(div,rem)
print("{:.6f}".format(div*div*rem))
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n+1):
	k = n//i
	ans += i * k * (k+1) // 2
print(ans)
# Judge status: Accepted
from fractions import gcd
def lcm(a,b):
    return a*b//gcd(a,b)
n,m=map(int,input().split())
a=list(map(int,input().split()))
h=list(map(lambda x:x//2,a))
l=1
for i in range(n):
    l=lcm(l,h[i])
for i in range(n):
    if (l//h[i])%2==0:
        print(0)
        exit()
print((m//l+1)//2)
# Judge status: Accepted
N,X=map(int,input().split())
L=list(map(int,input().split()))
l=[0]
s=0
for i in range(N):
   s+=L[i]
   if  s>X:
       break
   l.append(s)
print(len(l))
# Judge status: Wrong Answer
w, a, b = map(int,input().split())

if b > (w+a):
  print(b-(w+a))
else:
  print(0)
# Judge status: Accepted
A,B,C=[input() for i in range(0,3)]

turn='a'
while True:
  if turn == 'a':
    if A =="":
      print('A')
      break
    turn=A[0]
    A=A[1:]
  elif turn=='b':
    if B=="":
      print('B')
      break
    turn=B[0]
    B=B[1:]
  else:
    if C=="":
      print('C')
      break
    turn=C[0]
    C=C[1:]
# Judge status: Accepted
ans = 0
for A, B in [map(int, input().split()) for _ in range(int(input()))][::-1]:
    ans += (B - A - ans) % B
print(ans)
# Judge status: Accepted
#まずnが奇数なら値は0
#nが偶数なら素因数5の個数
#素因数10の個数を求めたい
n=int(input())
if n%2==1:
  print(0)
else:
  ans=0
  num=5
  n=n//2
  while num<=n:
    ans+=n//num
    num=num*5
  print(ans)
# Judge status: Wrong Answer
s=list(map(ord,list(input())))
k=int(input())

for i in range(len(s)):
    s[i]-=97

c=0
while k>0:
    if c==len(s)-1:
        s[c]=(s[c]+k)%26
        k=0
    elif s[c]+k>=26:
        k-=26-s[c]
        s[c]=0
        c+=1
    else:
        c+=1

seq=""
for i in range(len(s)):
    seq+=chr(s[i]+97)

print(seq)
# Judge status: Accepted
def fact(n):
    res = 1
    for i in range(2,n+1):
        res = (res*i)%1000000007
    return res

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

if abs(N-M) >= 2:
    print(0)
elif N == M:
    print(2*fact(N)*fact(M)%1000000007)
else:
    print(fact(N)*fact(M)%1000000007)
# Judge status: Wrong Answer
n = int(input())
if n % 2 == 0:
    print(1 / 2)
else:
    print((int(1 / 2 * n) + 1) / 1)
# Judge status: Accepted
A, B, K = list(map(int, input().split()))
arr = []

for i in range(1,101):
  if A%i == 0 and B%i == 0:
    arr.append(i)
print (arr[-K])
# Judge status: Accepted
a, b, c ,k = map(int, input().split())
fromA = a if k > a else k
fromB = 0
fromC = 0
k = k - fromA
if k > 0:
    fromB = b if k > b else k
    k = k - fromB
if k > 0:
    fromC = c if k > c else k
    k = k - fromC
total = (fromA * 1) + (fromB * 0) + (fromC * -1)
print(total)
# Judge status: Accepted
a = int(input())
s = input()
if a < 3200:
  print("red")
else:
  print(s)
# Judge status: Accepted
import sys

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

if N >= M:
    print(0)
    sys.exit()
diff = [0]*(M-1)
for i in range(M-1):
    diff[i] = x[i+1] - x[i]
diff.sort()
ans = sum(diff[:M-N])
print(ans)
# Judge status: Wrong Answer
n = int(input())
if n == 0:
    print(0)
    exit()

s = ""
while n != 1 and n != -1:
    if n%2 == 0 and 0 < n:
        s += "0"
    else:
        s += "1"
    n //= -2
s += "1"
print(s[::-1])
# Judge status: Accepted
A, B = map(int, input().split())
K = 0
L = 0

while A*K-L+1 < B:
    K = K+1
    L = L+1
print(K)
# Judge status: Accepted
n=int(input())
heights=list(map(int,input().split()))
step=0

for i in range(n-1) :
  if heights[i+1] < heights[i] :
    step += heights[i] - heights[i+1]
    heights[i+1] = heights[i]

print(step)
# Judge status: Accepted
X = list(input())
N = len(X)
Life = 0
out = 0
for i in range(N):
    if X[i]=="S":
        Life += 1
    elif X[i]=="T":
        if Life==0:
            out += 1
        elif Life>0:
            Life += -1
print(out+Life)
# Judge status: Accepted
a,b,c,d = map(int, input().split())
if (abs(b-a) <= d and abs(c-b) <= d) or abs(c-a) <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
S,W=map(int, input().split())
print('unsafe' if S <= W else 'safe')
# Judge status: Wrong Answer
import re
n, a, b, c, d = map(int, input().split())
s = input()
if re.match(".*?#{2,}.*?", s[:max(c, d)]):
  print("No")
  exit()
if c > d:
  if re.match(".*?[\.]{3,}.*?", s[:max(c,d)]):
    print("Yes")
  else:
    print("No")
  exit()
print("Yes")
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())
ans = a - b
max_abs = 1000000000000000000
for i in range(k):
    tmp_a = b + c
    tmp_b = a + c
    tmp_c = a + b
    a = tmp_a
    b = tmp_b
    c = tmp_c

print(ans) if abs(ans) < max_abs else print("Unfair")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
n = input()
m = len(n)-1
for i in range(2 ** m):
    ops = []
    N = [int(n[0]), int(n[1]), int(n[2]), int(n[3])]
    for j in range(m):
        if (i >> j) & 1:
            ops.append("+")
        else:
            N[j + 1] *= -1
            ops.append("-")
    if sum(N) == 7:
        print(N)
        print(n[0]+ops[0]+n[1]+ops[1]+n[2]+ops[2]+n[3]+"=7")
        break
# Judge status: Accepted
from collections import defaultdict
 
N = int(input())
A = list(map(int,input().split()))
d = defaultdict(int)
for a in A:
  d[a]+=1

q = int(input())
sum_a=sum(A)
for _ in range(q):
  b,c=list(map(int,input().split()))
  sum_a+=(c-b)*d[b]#初期配列で数えた数
  d[c]+=d[b]#変換した数を引き継ぎ
  d[b]=0#変換されたので消す
#  print(d)
  print(sum_a)
# Judge status: Accepted
n,k = map(int,input().split())
if n % k ==0:
    print(0)
else:
    l = [n]
    p = n//k
    c = n-(p*k)
    half = k//2
    while c > half:
        c = abs(c-k)
    l.append(c)
    print(min(l))
# Judge status: Accepted
a,b,c,x,y = map(int, input().split())

ans1 = c*max(x,y)*2
ans2 = a*x + b*y
if x<y:
    ans3 = c*2*x + b*(y-x)
else:
    ans3 = c*2*y + a*(x-y)

print(min(ans1,ans2,ans3))
# Judge status: Accepted
import numpy as np
def resolve():
    N = int(input())
    A = np.zeros(N + 1, dtype = int)
    for i in range(1, N + 1):
        A[i] = int(input())
    current_num = 1
    ans = 0
    Found = False
    for _ in range(N):
        next_num = A[current_num]
        ans += 1 
        if next_num == 2:
            Found = True
            break
        current_num = next_num
    if (Found):
        print(ans)
    else:
        print(-1)
resolve()
# Judge status: Accepted
S=list(input())
while len(S)>1:
    if S[0] == 'h' and S[1] == 'i':
        S.remove('h')
        S.remove('i')
    else:   
        break

if len(S) == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b,c = sorted(map(int, input().split()))
print(int(a*b/2))
# Judge status: Accepted
S = input()
T = input()

judge = [False]*len(S)

if len(T) == len(S) + 1:
    for i in range(len(S)):
        judge[i] = S[i] == T[i]

if sum(judge) == len(S):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A = input()

if A == "ABC":
    print("ARC")
else:
    print("ABC")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

n, Y = map(int,input().split())
x , y , z = '-1' , '-1' , '-1'

def check(num,total):
  for i in range(num+1):
    for j in range(num+1):
      k = num - i - j
      if (i + j + k == num) and (10000 * i + 5000 * j + 1000 * k == total):
        x , y , z = str(i) , str(j) , str(k)
        return x + ' ' + y + ' ' + z
res = check(n,Y)
if res is None:
  res = x + ' ' + y + ' ' + z
print(res)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

min_a = min(A)
max_a = max(A)

ans = float("inf")
for i in range(min_a, max_a+1):
  tmp = 0
  for j in A:
    tmp += (i - j) ** 2
  ans = min(ans, tmp)
  
print(ans)
# Judge status: Wrong Answer
Q,H,S,D = map(int,input().split())
N = int(input())
A = min(Q*4,H*2,S)
if 2*A <= D:
    print(N*A)
else:
    print(N//2*D + A)
# Judge status: Accepted
N = int(input())-1
l = len(str(N))

ans = ''

if N == 0:
    print('a')
    exit(0)

cnt = 0
while N >= 26:
    d = N % 26
    ans = chr(ord('a') + d) + ans
    N //= 26
    N -= 1
ans = chr(ord('a') + N) + ans

print(ans)
# Judge status: Accepted
x,a,b = map(int,input().split())
print("A" if abs(x-a) < abs(x-b) else "B")
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())

ans = []
if n>k:
    for i in range(k):
        ans.append(x)

    for i in range(n-k):
        ans.append(y)
else:
    for i in range(n):
        ans.append(x)
print(sum(ans))
# Judge status: Accepted
H=int(input())

i=0
ans=1
while H!=1:
    H=int(H/2)
    i+=1
    ans+=pow(2,i)
print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a+b % 2 == 0:
    print((a+b) /2)
else:
    print("IMPOSSIBLE")
# Judge status: Wrong Answer
a=int(input())
if a<3200:
    print('pink')
else:
    print('red')
# Judge status: Wrong Answer
N = int(input())
X = sorted([int(x) for x in input().split()])
min_cost = 10**12
for p in range(X[0]+1, X[-1]):
    cost_sum = 0
    for x in X:
        cost_sum += (x-p)**2
    min_cost = min(min_cost, cost_sum)

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

x = b - a
s = 0
for i in range(1,x,1):
  s += i

ans = s - a
print(ans)
# Judge status: Wrong Answer
k=int(input())
print(k//2 * (k+1)//2)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
d=[]
num = 1
for i in range(b+1):
    d.append(a**i)
    if sum(d)%b == c:
        num += 1
        break
if num == 0:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
A = list(map(int, input().split()))
B = [a%2 for a in A]
if len(set(B))==1:
    ans = (max(A)*3-sum(A))//2
elif B.count(0)==1:
    ind = B.index(0)
    if A[ind] == max(A):
        ans = (max(A)*3-2-sum(A))//2
    else:
        ans = (max(A)*3-sum(A)+1)//2
else:
    ind = B.index(1)
    if A[ind] == max(A):
        ans = (max(A)*3-2-sum(A))//2+1
    else:
        ans = (max(A)*3-sum(A)+1)//2+1
print(ans)
# Judge status: Wrong Answer
n=int(input())
for i in range(40):
    for j in range(40):
        if i**5-j**5==n:
            print(i,j)
            exit()
        if i**5+j**5==n:
            print(i,-j)
            exit()
# Judge status: Accepted
l=list(map(int,input().strip().split()))

l.sort()
x=l[2]-l[1]+(l[1]-l[0])//2
ans=x if (l[1]-l[0])%2==0 else x+2
print(ans)
# Judge status: Accepted
s = input()
t = input()
count = 0
for i in range(len(s)):
	if s[i] != t[i]:
		count += 1
print(count)
# Judge status: Accepted
# -*- coding: utf-8 -*-
print(6-int(input())-int(input()))
# Judge status: Accepted
s = input()
n = len(s)+1
ls = [0]*n
rs = [0]*n
for i in range(n-1):
    if s[i] == "<":
        ls[i+1] = ls[i]+1
for i in range(n-1):
    if s[-1-i] == ">":
        rs[-2-i] = rs[-1-i]+1
ans = 0
for i,j in zip(ls,rs):
    ans += max(i,j)
print(ans)
# Judge status: Accepted
n = int(input())
abcde = [int(input()) for i in range(5)]
minabcde = 10**16
for i in abcde:
         if minabcde > i:
                  minabcde = i
print((n+minabcde-1)//minabcde + 4)
# Judge status: Accepted
# きりみんちゃん配信からきました
# 4で割りきれる数と奇数をぶつける（4で割り切れず2で割り切れるやつはまあはい）
n = int(input())
arr = list(map(int, input().split()))
dividable4 = 0
dividable2 = 0
odds = 0
for a in arr:
  if a % 4 == 0:
    dividable4 += 1
  elif a % 2 == 1:
    odds += 1
  elif a % 2 == 0:
    dividable2 += 1
print("Yes" if odds <= dividable4 or (odds - dividable4 == 1 and dividable2 == 0)  else "No")
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
jobs = {}
for _ in range(N):
    a, b = map(int, input().split())
    if a > M:
        continue
    if a not in jobs.keys():
        jobs[a] = []
    jobs[a].append(b)

ans = 0
canditates = []
for a in range(1, M+1):
    if a in jobs.keys():
        for b in jobs[a]:
            heapq.heappush(canditates, -b)
    else:
        if not canditates:
            continue
    ans += heapq.heappop(canditates) * (-1)

print(ans)
# Judge status: Accepted
k = int(input())
if k%2 == 0:
    print((k//2)**2)
else:
    print((k//2)*((k//2)+1))
# Judge status: Wrong Answer
n, m = [int(i) for i in input().split(' ')]
for i in range(0, m):
  print(i + 1, (2*i) % n + 1 + 1)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
print(max([a*c,a*d,b*c,b*d]))
# Judge status: Accepted
d,t,s=map(int,input().split())
if d <=s*t:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N, K, S = map(int, input().split())
ret = [0] * N
for i in range(K):
    ret[i] = S

print(' '.join([str(i) for i in ret]))
# Judge status: Wrong Answer
N = int(input())
Alist = list(map(int,input().split()))
result = 1
for i in range(N):
    if Alist[i] == 0:
        result =0
        break
    else:
        result = result*Alist[i]
    if result > 10**18:
        result = -1
        break
print(result)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    # 追いつけない
    print("NO")
else:
    dx = abs(A - B)
    dv = V - W
    t = dx / dv
    if t <= T:
        print("YES")
    else:
        print("NO")
# Judge status: Wrong Answer
"""
102 C
"""

import math

def read_input():
    n = int(input())
    alist = list(map(int, input().split()))

    return n, alist


def sum_abs(alist, b):
    return sum([abs(a - b) for a in alist])


def submit():
    n, alist = read_input()

    alist = [a - (i + 1) for i, a in enumerate(alist)]
    asum = sum(alist)

    b_min = math.floor(asum // n)
    b_max = math.floor(asum // n + 1)

    print(min(sum_abs(alist, b_min), sum_abs(alist, b_max)))


if __name__ == "__main__":
    submit()
# Judge status: Accepted
import fractions
a, b, c, d = map(int, input().split())

f = c*d//fractions.gcd(c,d)

num = b//c + b//d - b//f
num -= (a-1)//c + (a-1)//d - (a-1)//f

print(b-a+1-num)
# Judge status: Wrong Answer
a,b,c=map(int, input().split())
if b-c == c-a:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
now = 0
scale = 2**32
while scale:
  cnt = 0
  tmp = now + scale
  for x in a:
    cnt += (x-1) // tmp
  if cnt > k:
    now = tmp
  #print(tmp,cnt)
  scale //= 2
print(now+1)
# Judge status: Accepted
def nextTurn(a):
  if a == "a":
    return 0
  elif a == "b":
    return 1
  else:
    return 2
    
hand = [list(input()) for i in range(3)]
turn = nextTurn(hand[0].pop(0))
while(True):
  if len(hand[turn]) == 0:
    if turn == 0:
      print("A")
    elif turn == 1:
      print("B")
    else:
      print("C")
    break
  turn = nextTurn(hand[turn].pop(0))
# Judge status: Wrong Answer
in_string = input()
out_string = ["X"]*len(in_string)
print("".join(out_string))
# Judge status: Accepted
a, b = map(int, input().split())
lst = [4, 6, 9, 11]
lst2 = [1, 3, 5, 7, 8, 10, 12]
if a==b==2:
  print('Yes')
elif a in lst and b in lst:
  print('Yes')
elif a in lst2 and b in lst2:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A, B = map(int, input().split())

if A >= 13:
    print(B)
elif 6 <= A <= 12:
    print(B//2)
else:
    print(0)
# Judge status: Accepted
n = int(input())
s = input()
l = []
for i in range(len(s)):
  l.append(chr((ord(s[i])-65+n)%26 + 65))
print("".join(l))
# Judge status: Accepted
a,b,m = map(int, input().split())
aprice = list(map(int, input().split()))
bprice = list(map(int, input().split()))
c = sorted(aprice)
d = sorted(bprice)
e = c[0]+d[0]
f  =0
for i in range(m):
  x,y,k = map(int, input().split())
  f =aprice[x-1]+bprice[y-1]-k
  if(e>f):
    e = f
print(e)
# Judge status: Wrong Answer
# 問題A
s = input()
t = input()
if s+t[-1] == t:
    print('Yes')
else:
    print('NO')
# Judge status: Wrong Answer
S = int(input())
T = input()

if S <= 3200:
  print(T)
else:
  print("red")
# Judge status: Accepted
A, B, C = map(int, input().split())

ret = 0
while True:
    if A == B and B == C:
        print(ret)
        exit()

    ret += 1
    A, B, C = sorted([A, B, C])
    if B < C:
        A += 1
        B += 1
    elif B == C:
        A += 2
# Judge status: Accepted

def q2():
    A, B, C, K =  [int(i) for i in input().split(" ")]
    if K <= A:
        print(K)
        return
    if K <= A + B:
        print(A)
        return
    print(A+(K-(A+B))*-1)
    

q2()
# Judge status: Accepted
n = int(input())
cards_list = list(map(int,input().split()))
cards_list.sort()
cards_list.reverse()
sum_alice = 0
sum_bob = 0
turn = 0

for val in cards_list:
    if turn == 0:
        sum_alice += val
        turn = 1
    else:
        sum_bob += val
        turn = 0

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

if (a+b)%2 == 0 :
    print(a*b/2)
else :
    print("IMPOSSIBLE")
# Judge status: Accepted
def resolve():
    a, b = input().split()
    a = int(a)
    b = float(b)
    b = int(b*1000)
    print(int(a*b//1000))
resolve()
# Judge status: Accepted
s = input()
s = s[::-1]
i = 0
check = True
while i < len(s):
  if s[i:i+5] == "maerd" or s[i:i+5] =="esare":
    i += 5
  elif s[i:i+6] == "resare":
    i += 6
  elif s[i:i+7] == "remaerd":
    i += 7
  else:
    check = False
    break
    
if check == True:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
A = int(input())
B = int(input())

if (A + B == 3):
    print(3)
elif (A + B == 4):
    print(2)
else:
    print(1)
# Judge status: Wrong Answer
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]
a = [i[0] for i in ab]
b = [i[1] for i in ab]
sa = sorted(a)
cnt = 0
ans = 0
for i in sa:
    if cnt + b[a.index(i)] > m:
        print(ans + i * (m - cnt))
        exit()
    else:
        cnt += b[a.index(i)]
        ans += i * b[a.index(i)]
print(ans)
# Judge status: Accepted
N,*D=map(int,open(0).read().split())
c=[0]*N
for i in D:c[i]+=1
m=max(D)
if D[0]>0 or c[0]>1:print(0);exit()
a=1
for i in range(m):a*=c[i]**c[i+1]
print(a%998244353)
# Judge status: Wrong Answer
num = int(input())
A = [int(i) for i in input().split(" ")]

A = sorted(A)
num = len(A)

res = 1
if len(A) > 1 and A[0] == A[1]:
  res = 0
i = 1
while i < num:
  divisible = False
  for j in range(i):
    if A[i] % A[j] == 0:
      divisible = True
      A.pop(i)
      num -= 1
      i -= 1
      break
  i += 1

  if not divisible:
    res += 1
print(res)
# Judge status: Accepted
N,M = map(int,input().split())

A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

ans = 0
for i in range(N-M+1):
    for h in range(N-M+1):
        cnt = 0
        for k in range(M):
            for j in range(M):
                if A[i+k][h+j] != B[k][j]:
                    cnt += 1
        if cnt == 0:
            ans += 1
if ans != 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())

v=[int(x) for x in input().split()]

v.sort()
at=v[0]
b=0
for i in range(0,n-1):
    b=(at+v[i+1])/2
    at=b
print(b)
# Judge status: Accepted
def main():
    N, K = map(int, input().split())
    *A, = map(int, input().split())

    for _ in range(K):
        B = [0] * (N + 1)
        for i, x in enumerate(A):
            B[max(0, i - x)] += 1
            B[min(N - 1, i + x) + 1] -= 1
        for i in range(N):
            B[i + 1] += B[i]
        B.pop()
        if A == B: break
        A = B
    print(*A)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
H1,M1,H2,M2,K = map(int,input().split())
 
tmp = K
if (M1 < M2):
  H = H2 - H1 - 1
  M = M1 - M2
  if M < 0:
    M = 60 - M
    
else:
  H = H2 - H1
  M = M2 - M1
 
T = H * 60 + M
 
ans = 0
while T > tmp:
  T = T - K
  ans += K
 
print(ans)
# Judge status: Wrong Answer
n=int(input())

a=[]
b=[]

for _ in range(n):
    a_i ,b_i = map(int,input().split())

    a.append(a_i)
    b.append(b_i)

cnt=0

a=list(reversed(a))
b=list(reversed(b))


for i in range(n):
    fr = a[i]+cnt
    target =b[i]

    if fr ==0 or target==1:
        continue

    num = abs(target -fr) // target

    if fr>target:
        target += target*(num+1)
    
    cnt += (target-fr)

print(int(cnt))
# Judge status: Accepted
n = int(input())
P = list(map(int, input().split()))
sorted_P = sorted(P)

cnt = 0
for i in range(n):
    if sorted_P[i] != P[i]:
        cnt += 1

if cnt <= 2:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())

def main():
  n,m=nii()

  tree=[[] for i in range(n)]
  for i in range(m):
    a,b=nii()
    a-=1
    b-=1
    tree[a].append(b)
    tree[b].append(a)

  for i in tree[0]:
    for j in tree[i]:
      if j==n-1:
        print('POSSIBLE')
        exit()
  print('IMPOSSIBLE')

if __name__=="__main__":
  main()
# Judge status: Wrong Answer
import math
n, k, *nums = map(int, open(0).read().split())
print(math.ceil((n-k)/2)+1)
# Judge status: Wrong Answer
N,D=map(int,input().split())
ans=0
for i in range(N):
    x,y=map(int,input().split())
    if x^2 + y^2<=D^2:
        ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
dp = [[0 for _ in range(3)] for _ in range(N + 1)]
a, b, c = map(int, input().split())
dp[1][0] = a
dp[1][1] = b
dp[1][2] = c
for i in range(2, N + 1):
    a, b, c = map(int, input().split())
    dp[i][0] = max(dp[i - 1][1] + a, dp[i - 1][2] + a)
    dp[i][1] = max(dp[i - 1][0] + b, dp[i - 1][2] + b)
    dp[i][2] = max(dp[i - 1][0] + c, dp[i - 1][1] + c)

print(max(dp[N]))
# Judge status: Wrong Answer
import sys
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(len(A)):
    if i % 2 == 1 and A[i] % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
n, x = map(int,input().split())
tmp = list(map(int,input().split()))
tmp.append(x)
se = list(sorted(set(tmp)))
lis = []
for si,s in enumerate(se):
    lis.append(se[si]-se[si-1])

import fractions
a = lis
ans = a[0]
for i in range(1, len(a)):
    ans = fractions.gcd(ans, a[i])
print(ans)
# Judge status: Accepted
s,t=input(),input()
slen=len(s)

j=0
count=0
for i in range(slen):
    if s[j]!=t[j]:
        count+=1
    j+=1    
    
print(count)
# Judge status: Accepted
a,b=map(int,input().split())

def is_pali(s):
    if s==s[::-1]: return True
    else: return False
  
  
cnt=0  
for i in range(a,b+1):
    if is_pali(str(i))==True: cnt+=1
print(cnt)
# Judge status: Accepted
n=int(input())
for c in input():
  print(chr(65+(ord(c)-65+n)%26),end='')
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if a == b:
    if a == c:
        print('No')
    else:
        print('Yes')
else:
    if b == c:
        print('Yes')
    else:
        print('No')