peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    y = list()

    for i in range(n):
        xi, li = map(int, input().split())
        y.append((xi - li + 1, xi + li - 1))

    count = 1
    sorted_y = sorted(y, key=lambda x: x[1])
    end_point = sorted_y[0][1]

    for left, right in sorted_y[1:]:
        if left > end_point:
            end_point = right
            count += 1

    print(count)


if __name__ == '__main__':
    main()
# Judge status: Accepted
l, r, d = map(int, input().split())
ans = 0
for i in range(l, r+1):
  if i%d == 0:
    ans += 1
    
print(ans)
# Judge status: Accepted
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  
  if 0 in A:
    print(0)
    return
  
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod)
main ()
# Judge status: Accepted
k = int(input())
if k % 2 == 0:
  print(k//2 * k//2)
else:
  print(k//2 * (k//2 + 1))
# Judge status: Wrong Answer
from collections import deque

K = int(input()) 
a = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])


for i in range(K-1):
    j = a.popleft()
    if j%10 != 0:
        a.append((10*j) + ((j%10) -1))
        
    a.append((10*j)+j%10)
    
    if j%10 != 9:
        a.append((10*j) +((j%10)+1))
    
a.popleft()
# Judge status: Wrong Answer
import math
n,k=map(int,input().split())
log=list(map(int,input().split()))
a=1
b=max(log)
c=(a+b)//2
while True:
  div=0
  for i in range(n):
    div+=math.ceil(log[i]/c)-1
  if div<=k:
    b=c
    c=(a+b)//2
  else:
    a=c
    c=(a+b)//2
    
  if c==a or c==b:
    break
print(b)
# Judge status: Wrong Answer
list1 = []
for i in range(5):
  a = input()
  b = int(a[-1])
  c = int(a)
  list1.append((b,c))
aaa = sorted(list1)

mini = []
total = 0
for i in range(5):
  if aaa[i][0] != 0:
    mini = aaa[i]
    
    a = aaa.pop(i)
    break

for i in aaa:
  if i[0] != 0:
    d = 10 - i[0]
    ans = i[1] + d
  else:
    ans = i[1]
  total += ans
try:
  total += mini[1]
except:
  total = 0
print(total)
# Judge status: Accepted
n,x,y = map(int, input().split())

ret = [0] * (n-1)
for i in range(1, n):
    for j in range(i+1, n+1):
        p1 = j-i
        p2 = abs(i - x) + 1 + abs(j - y)
        p3 = abs(i - y) + 1 + abs(j - x)
        if p1 > p2:
            p1 = p2
        if p1 > p3:
            p1 = p3
        ret[p1-1] += 1

for data in ret:
    print(data)
# Judge status: Wrong Answer
S = input()
w = ["Sunny","Cloudy", "Rainy"]

for i in range (len(w)):
  if S == w[0] or S == w[1]:
    print(w[i+1])
    exit()
  else:
    print(w[0])
    exit()
# Judge status: Wrong Answer
a, b, k = [int(x) for x  in input().split()]

divisors = []
for x in range(1, max(a, b)+1):
  if a % x == 0 and b % x == 0:
    divisors.append(x)

print(divisors[k-1])
# Judge status: Accepted
n, d = map(int, input().split())
res = 0
for i in range(n):
    x, y = map(int, input().split())
    if pow(pow(x,2) + pow(y,2),1/2) <= d:
        res += 1
print(res)
# Judge status: Accepted
n = int(input())

CSF = [tuple(map(int, input().split())) for _ in range(n-1)]

for i in range(n-1):
    t = 0
    for j in range(i, n-1):
        if t <= CSF[j][1]:
            t = CSF[j][1]
        elif t % CSF[j][2] == 0:
            pass
        else:
            t += CSF[j][2] - t % CSF[j][2]
        t += CSF[j][0]
    print(t)
print(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

x,y = map(int,input().split())
if x%y == 0:print(-1)
else: print(x)
# Judge status: Wrong Answer
import math as mt
import sys
import bisect
input=sys.stdin.readline
#t=int(input())
t=1

mod=10**9+7
for _ in range(t):
    
    n=int(input())
    l=[]
    for i in range(n):
        x,y=map(int,input().split())
        l.append(x+y)
    
    #u1,d1=map(int,input().split())
    #u2,d2=map(int,input().split())
    #l=list(map(int,input().split()))
    l.sort()
    print(l[-1]-l[0])
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

whole = sum(a)

if n == 2:
    print(abs(a[0] - a[1]))
else:
    now = 0
    ans = float("inf")
    for i in a:
        now += i
        diff = abs(whole - 2 * now)
        ans = min(ans, diff)

    print(ans)
# Judge status: Accepted
n = int(input())
s = []
r = []
sr = []
for i in range(n):
    s, r = map(str, input().split())
    sr.append([i+1, s, int(r)])
# print(sr)
sr1 = sorted(sr, key=lambda x:x[2], reverse=True)

ans = sorted(sr1, key=lambda x:x[1])

for i in range(n):
    print(ans[i][0])
# Judge status: Accepted
import sys

def solve():
    input = sys.stdin.readline
    S = list(input().strip("\n"))
    if len(S) == len(set(S)): print("yes")
    else: print("no")
    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
k,a,b = map(int,input().split())
if a >= b-1 or k <= a:
  print(k+1)
else:
  print((k-a+1)//2*(b-a) + ((k-a+1)%2) + a)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ok = True
for i in a:
    if i%2 == 0 :
        if i%3 != 0 and i%5 != 0:
            ok = False
            break
            
if ok:
    print("APPROVED")
else:
    print("DENIED")
# Judge status: Accepted
n = int(input())

print((n*(n-1)//2))
# Judge status: Wrong Answer
a=input()
#str = list(a)
print(a[0:2])
# Judge status: Accepted
N, K = map(int,input().split())
ans = 0
MOD = int(1E+9 + 7)
for n in range(K,N+2):
    x = (N+1-n) * n + 1
    ans += x
    ans %= MOD
print (ans)
# Judge status: Wrong Answer
N, X, Y = list(map(int, input().split()))
path = list(range(1, N+1))
for i in range(N-1):
  i += 1
  if i == 1:
    count = 1
  else:
    count = 0
  for j in path:
    if j - i > 0:
      count += 1
  if i == (Y - X):
    count -= 1
  print(count)
# Judge status: Wrong Answer
n,m=map(int,input().split())

a=list(map(int,input().split()))
cnt=0

for i in a:
    cnt+=i
   
if cnt<0:
    print(-1)
else:
    print(n-cnt)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

m = sum(B)-sum(A)
cnt1 = 0
cnt2 = 0
for a, b in zip(A, B):
    if a > b:
        cnt1 += (a-b)
    elif a < b:
        cnt2 += (b-a+1)//2
    else:
        pass

if cnt1 <= m and cnt2 <= m:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,k=map(int, input().split())
    l=[int(input()) for i in range(n)]
    l.sort()
    ans=10*18
    for i in range(0,n-k+1):
        ans=min(ans,l[i+k-1]-l[i])
    print(ans)
resolve()
# Judge status: Accepted
a, b = map(int, input().split())

if a > 0 and b > 0:
    print('Positive')
elif a < 0 and b < 0:
    if ((a - b) + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
else:
    print('Zero')
# Judge status: Accepted
x1, x2, x3, x4, x5 = map(int,input().split())
print(15-x1-x2-x3-x4-x5)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())

print(a * h - (a - b) * h)
# Judge status: Wrong Answer
def main():
    W, H, x, y = map(int, input().split())

    S2 = W * H / 2
    if x == 0 or x == W or y == 0 or y == H:
        print(S2, 0)
        exit()

    print(W * H / 2, 1)


main()
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
x = 2*(10**5)+1
c = 0
for i in p:
	if i < x:
		x = i
		c += 1
print (c)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))
count = 0
for i in range(1,N):
    if i % 2 != 0 and a[i] % 2 != 0:
        count += 1
    else:
        pass
    
print(count)
# Judge status: Accepted
n=int(input())
a=input().split()
count=0

for t in range(n):
  a[t]=int(a[t])
  
for i in range(n-2):
  for j in range(n-2):
    if j>=i:
      for k in range(n-2):
        if k>=j:
          if a[i]!=a[j+1] and a[j+1]!=a[k+2] and a[k+2]!=a[i]:
            if a[i]+a[j+1]>a[k+2] and a[j+1]+a[k+2]>a[i] and a[k+2]+a[i]>a[j+1]:
              count+=1
print(count)
# Judge status: Accepted
def resolve():
    X,Y=map(int,input().split())
    cnt=0
    while X<=Y:
        X=X*2
        cnt+=1
    print(cnt)


resolve()
# Judge status: Accepted
a = list(input())
b = list(input())
c = list(input())

s = a.pop(0)
for i in range(400):
    if s == 'a':
        if a == []:
            break
        s = a.pop(0)
    elif s == 'b':
        if b == []:
            break
        s = b.pop(0)
    elif s == 'c':
        if c == []:
            break
        s = c.pop(0)
print(s.upper())
# Judge status: Accepted
H1, M1, H2, M2, K = map(int, input().split())

T1 = H1 * 60 + M1
T2 = H2 * 60 + M2

print(T2 - T1 - K)
# Judge status: Wrong Answer
import numpy as np

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

m = int(np.median(x))
k = int(np.std(x))
ans = max(x) ** 2 * n

# pos = m + k
# print(pos)
# cost = 0

low = max(1, m - k)
high = min(m + k, np.max(x))

for i in range(low, high, 1):
  cost = 0
  for j in range (n):
    cost += (x[j] - i) ** 2
  # print(cost)
  if cost < ans:
    ans = cost

print(ans)
# Judge status: Accepted
n=int(input())
p=[int(_) for _ in input().split()]
count=0
for i in range(n-2):
    if p[i+1]!=min(p[i:i+3]) and p[i+1]!=max(p[i:i+3]):
        count+=1
print(count)
# Judge status: Accepted
N, K = [int(i) for i in input().split()]

ab = [[int(i) for i in input().split()] for _ in range(N)]

length = 0
sorted_ab = sorted(ab, key=lambda x:x[0])

for x in sorted_ab:
    length += x[1]
    if length >= K:
        output = x[0]
        break
    
print(output)
# Judge status: Accepted
n,m=map(int,input().split())
student=[list(map(int,input().split())) for _ in range(n)]
checkpoint=[list(map(int,input().split())) for _ in range(m)]
ans=[0]*n

for i in range(n):
    distance=10**9
    index=0
    for j in range(m):
        if abs(student[i][0]-checkpoint[j][0])+abs(student[i][1]-checkpoint[j][1])<distance:
            distance=abs(student[i][0]-checkpoint[j][0])+abs(student[i][1]-checkpoint[j][1])
            index=j
    print(index+1)
# Judge status: Wrong Answer
X, Y, A, B, C = map(int, input().split())
p = sorted([int(i) for i in input().split()], reverse=True)
q = sorted([int(i) for i in input().split()], reverse=True)
r = sorted([int(i) for i in input().split()], reverse=True)
l = sorted(p[:X] + q[:Y],reverse=True)

i = 0
ans = 0
for a in l:
    if i < C and r[i] <= a:
        ans += a
    elif i < C and r[i] > a:
        ans += r[i]
        i += 1

print(ans)
# Judge status: Wrong Answer
#105_B
N=int(input())
flg=False
for i in range(0,N//7+1):
    N=N-7*i
    if N%4==0:
        flg=True
        break
print('Yes' if flg else 'No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)[::-1]
s = 0
for i in range(1, n):
    s += a[i//2]
print(s)
# Judge status: Wrong Answer
print('今日の天気を入力してね')
today_weather=input()
if today_weather=="Sunny":
    print('Cloudy')
elif today_weather=="Cloudy":
    print('Rainy')
else:
    print('Sunny')
# Judge status: Accepted
n,m = map(int,input().split())
lst1 = [list(map(int,input().split())) for i in range(m)]

lst2 = [0]*n

for i,j in lst1:
    lst2[i-1] += 1
    lst2[j-1] += 1

for i in lst2:
    print(i)
# Judge status: Wrong Answer
n=input()
n_list=list(map(int,input().split()))

counter=0
while all(i%2==0 for i in n_list):
    n_list=[i/2 for i in n_list]
    counter=+1
print(counter)
# Judge status: Wrong Answer
A, B, K = map(int, input().split())

n = [i for i in range(A, B+1)]

if len(n) < K*2:
    for j in range(len(n)):
        print(n[j])
else:
    for j in range(K):
        print(n[j])
    for j in reversed(range(len(n)-K,len(n))):
        print(n[j])
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
before = sum(A)

for i in range(n):
    if A[i] > B[i]:
        A[i] -= B[i]
    else:
        B[i] -= A[i]
        A[i] = 0
        A[i + 1] = max(0, A[i + 1] - B[i])
after = sum(A)

answer = before - after
print(answer)
# Judge status: Wrong Answer
n = int(input())
print(n//11*2+n%11//6+n%11%6)
# Judge status: Accepted
s = list(str(input()))

s_set = list(set(s))
if len(s_set) != 2:
    print('No')
else:
    count1 = 0
    for i in range(len(s)):
        if s[i] == s_set[0]:
            count1 += 1
    count2 = 0
    for i in range(len(s)):
        if s[i] == s_set[1]:
            count2 += 1
    if count1 == 2 and count2 == 2:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
a, b = map(int, input().split())

if a < 10 and b < 10:
    print(a * b)
else:
    print(-1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
m = a[-1]

c = [0] * (m + 1)
for i in range(n):
    for j in range(a[i], m + 1, a[i]):
        c[j] += 1

ans = 0
for e in list(set(a)):
    if c[e] == 1:
        ans += 1

print(ans)
# Judge status: Wrong Answer
x=int(input())
l=[]
c=0
for i in range(x):
    a,b = map(int,input().split())
    l.append(a)
    l.append(b)
for i in range(0,x*2,2):
    if l[i]==l[i+1]:
        c+=1
        print(l[i])
        if c>=3:
            print("YES")
            break

    else:
        c=0
if c<3:
    print("NO")
print(c)
# Judge status: Accepted
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    s=STR()
    print(len(s)*'x')
if __name__ == '__main__':
    do()
# Judge status: Wrong Answer
N,Q = list(map(int,input().split()))
S = input()
L = []
R = []
for i in range(Q):
  l,r=list(map(int,input().split()))
  L.append(l)
  R.append(r)
print(L)
print(R)

dp = [0]*N
for j in range(N-1):
  if S[j]=='A' and S[j+1]=='C':
    dp[j+1] = dp[j]+1
  else:
    dp[j+1] = dp[j]

print(dp)
for k in range(Q):
  print(dp[R[k]-1]-dp[L[k]-1])
# Judge status: Accepted
w, h, x, y = map(int, input().split())
ans = w*h/2
if h/2 == y and w/2 == x:
    flag = 1
else:
    flag = 0
print('{} {}'.format(ans, flag))
# Judge status: Wrong Answer
n = int(input())
s = input()
count = 0
count_list = []

for i in range(len(s)):
    if s[i] == "I":
        count += 1
        count_list.append(count)
    else:
        count -= 1
        count_list.append(count)

print(max(count_list))
# Judge status: Accepted
n,l=map(int,input().split() )
if l*(l+n-1)<=0:print(sum(range(l,l+n)))
elif l>0:print(sum(range(l+1,l+n)))
else:print(sum(range(l,-1+l+n)))
# Judge status: Wrong Answer
S = str(input())
T = str(input())
alp = "abcdefghijklmnopqrstuvwxyz"
for i in range(0,len(S)//2):
  if S[i] != T[i]:
    S = S.translate(str.maketrans({S[i]:T[i], T[i]:S[i]}))
  if S == T:
    print("Yes")
    exit()
print("No")
# Judge status: Wrong Answer
import time
import math
N=int(input())
if N==1:
    print(1)
    exit()


d=[1]*(N+1)

ans=0
for i in range(2,N+1):
    j=0
    while i+j<=N:
        d[i+j]+=1
        j+=i
    ans+=d[i]*i


print(ans)
# Judge status: Wrong Answer
import collections

n = int(input())
a = [int(i) for i in input().split()]
b = collections.Counter(a)
ans =0
for i,n in b.items():
    ans += min(abs(n - i),n)
print(ans)
# Judge status: Accepted
N = int(input())
k=1
for i in range(1,N+1):
    k=k*i%(10**9+7)
print(k)
# Judge status: Accepted
def main():
    n,a,b=map(int,input().split())
    k=n//(a+b)
    print(a*k+min(n%(a+b),a))
main()
# Judge status: Accepted
import math
n = int(input())
counter = False
#for n in range (0,100):
for i in range (math.ceil((n+1) / 4) ):
  for j in range (math.ceil((n+1) / 7) ):
    #print(n, i,j)
    if i*4 + j*7 == n:
      counter = True
if counter == True:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
s = input()
t = input()

dic = {}

for i,j in zip(s,t):
    if j in dic:
        if i not in dic[j]:
            print("No")
            exit()
    else:
        if j in dic:
            print("No")
            exit()
        else:
            dic[j] = i

print("Yes")
# Judge status: Wrong Answer
inf=(10**7)+1
import sys
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
n,k=get_ints()
h=get_array()
li=[inf]*n
li[0]=0

for i in range(1,n):
    l=max(0,i-k)
    for j in range(l,i):




            li[i]=min(li[i],li[j]+abs(h[i]-h[j]))
##print(li)
print(li[n-1])
# Judge status: Accepted
N = int(input())

print((N+1) // 2)
# Judge status: Wrong Answer
def main():
    n, W, *wv = map(int, open(0).read().split())
    dp = [[0] * (W + 1)]
    for i in range(n):
        w = wv[i * 2]
        v = wv[i * 2 + 1]
        pv = dp[i][w]
        dpj = [pv for _ in range(0, w)] + [max(dp[i][j], dp[i][j - w] + v) for j in range(w, W + 1)]
        dp.append(dpj)
    print(dp[-1][W])

main()
# Judge status: Accepted
N,Y=map(int,input().split())
ans=-1,-1,-1
for i in range(N+1):
    for j in range(N+1-i):
            if 1<=N<=2000 and 10000*i+5000*j+1000*(N-i-j)==Y:
                ans=i,j,N-i-j
print(*ans)
# Judge status: Accepted
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return len(divisors)
  
ans = 0

for i in range(1,N+1):
  a = make_divisors(i)
  if a ==8 and i%2 == 1 :
    ans += 1
    
print(int(ans))
# Judge status: Accepted
A,B,C=sorted(map(int,input().split()))
if A*B*C%2:
    print(A*B)
else:
    print(0)
# Judge status: Accepted
A, B, C = map(int,input().split())
ans = 0
while True:
  if A & 1 or B & 1 or C & 1: break 
  elif A == B and B == C:
    ans = -1
    break  
  else: 
    ans += 1
    A, B, C = (B + C) // 2, (A + C) // 2, (A + B) // 2
print(ans)
# Judge status: Wrong Answer
# coding: utf-8
 
a,b=list(map(int,input().split()))
 
mouse_tot = a
mouse_cnt = 1
wa = a-1
 
while mouse_tot <  b:
    mouse_tot += wa
    mouse_cnt += 1
 
print(mouse_cnt)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
t = s[:a] + s[a+1:]

if s[a]=='-' and '-' not in t:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
import math
from decimal import Decimal as D, getcontext

getcontext().prec = 1000

A, B = input().split()
A, B = D(A), D(B)
print(int(A * B // D(1)))
# Judge status: Accepted
import collections
import sys
import math
X=int(input())
if X<100:
    print("0")
    sys.exit()
amari=math.floor(X/100)
kake=amari*5
if amari*100<=X<=amari*100+kake:
    print("1")
else:
    print("0")
# Judge status: Accepted
A,B,C = list(map(int,input().split()))
if abs(A-B) < abs(A-C):
    print("A")
else:
    print("B")
# Judge status: Accepted
a,b,c=map(int,input().split())
print("Yes" if 4*a*b<(c-a-b)**2 and c-a-b>0 else "No")
# Judge status: Accepted
# 累積じゃね
n = int(input())
arr = list(map(int, input().split()))
ruiseki = [0] * (n + 1)
for i in range(1, n + 1):
    ruiseki[i] = ruiseki[i - 1] + arr[i - 1]
ans = 10**10
for i in range(1, n):
    takahashi = ruiseki[i]
    raskal = ruiseki[n] - takahashi
    ans = min(ans, abs(raskal - takahashi))
print(ans)
# Judge status: Accepted
n, p = map(int, input().split())
A = list(map(int, input().split()))

f = 0
for a in A:
    if a%2:
        f = 1
        break

if f:
    ans = 2**(n-1)
else:
    if p:
        ans = 0
    else:
        ans = 2**n
print(ans)
# Judge status: Wrong Answer
num = [int(i) for i in input().split()]
kou = [min(num)]
for i in range(2,min(num)):
    if min(num)%i==0:
        kou.append(i)
a = 1        
for j in kou:
    if max(num)%j==0:
        a = a * j       
print(int(num[0]*num[1]/a))
# Judge status: Wrong Answer
a,b=map(int,input().split())
import math
print(math.ceil(b/a))
# Judge status: Wrong Answer
from bisect import bisect_right
from bisect import bisect_left
def main():
    n=int(input())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    C = list(map(int,input().split()))

    A.sort()
    C.sort()
    sum=0
    for i in range(n):
        cnt=1
        cnt*= bisect_left(A,B[i])
        cnt*= n-bisect_right(A,B[i])
        sum+=cnt 

    print(sum)

if __name__ == '__main__':
    main()
# Judge status: Accepted
A,B,K=map(int,input().split())
l=[]

for i in range(1,min(A,B)+1):
    if A%i==0 and B%i==0:
        l.append(i)
print(l[-K])
# Judge status: Accepted
a,b=map(int,input().split())
count=0

for i in range(a,b+1):
	val=str(i)
	if (val[0]==val[-1]) and (val[1]==val[-2]):
		count+=1

print(count)
# Judge status: Accepted
k,x = map(int, input().split())
ans = []
for i in range(x-k+1, x+k):
    ans.append(i)
print(' '.join(map(str, ans)))
# Judge status: Accepted
a,b=map(int,input().split())

print(-(-(a+b)//2))
# Judge status: Accepted
n = int(input())
a = [ int(input()) for _ in range(n)]

b = sorted(a,reverse=True)
x = b[0]
y = b[1]

for i in a :
  if i == x:
    print(y)
  else:
    print(x)
# Judge status: Accepted
s = input()
ans = 0
num = len(s)-1
for i in range(0,(num//2)+1):
   if s[i] != s[num-i]:
       ans += 1

print(ans)
# Judge status: Accepted
A,B,C = map(int, input().split())
if A <= C <= B:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
a = [int(i) for i in input().split()]
ans = 10**9

for i in range(min(a),max(a)+1):
    cost = 0
    for j in range(n):
        cost += (a[j]-i)**2
    ans = min(cost, ans)

print(ans)
# Judge status: Accepted
x = int(input())
x-=1
a = x//11
if x%11>=6:
    print(2*a+2)
else:
    print(2*a+1)
# Judge status: Accepted
import sys
from itertools import combinations_with_replacement as combi
input = sys.stdin.readline
N, M, Q = map(int, input().split())
qs = [tuple(map(int, input().split())) for _ in range(Q)]
res = 0
for c in combi([x for x in range(1, M + 1)], N):
  t = 0
  for l, r, d, s in qs:
    if c[r - 1] - c[l - 1] == d: t += s
  res = max(res, t)
print(res)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0

for i in range(1,a+1):
  for j in range(1,b+1):
    for k in range(1,c+1):
      y = i*500 + j*100 + k*50
      if x == y:
        ans += 1

print(ans)
# Judge status: Accepted
x,a,b=map(int,input().split())
if b-a<=0:
    print("delicious")
elif b-a<=x:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
n=str(input())
if n[0]=='9' or n[1]=='9':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 01:58:33 2020

@author: liang
"""
import math

x = int(input())

ans = x // 11 *2 + math.ceil(x%11/6)

print(ans)
# Judge status: Accepted
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

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

cnt = 0
d = defaultdict(int)
for i, a in enu(A):
    l = (i+1) + a
    r = (i+1) - a
    cnt += d[r]
    d[l] += 1
print(cnt)
# Judge status: Accepted
import itertools as it
import math
def Dist (x1,y1,x2,y2):
    dis = (x2 - x1)**2 + (y2 - y1)**2
    return math.sqrt(dis)
N = int(input())
Pos = []
res = 0
for i in range(N):
    pos = list(map(int,input().split()))
    Pos.append(pos)
array = list(it.permutations(i for i in range(N)))
for i in range(math.factorial(N)):
    for j in range(N-1):
        res += Dist(Pos[array[i][j]][0],Pos[array[i][j]][1],Pos[array[i][j+1]][0],Pos[array[i][j+1]][1])
print(res / math.factorial(N))
# Judge status: Wrong Answer
n, k = map(int, input().split())
D = set(map(int, input().split()))
from itertools import count
for ans in count(n,1):
    for c in str(ans):
        if int(c) in D:
            print(ans)
            break
    else:
        print(ans)
        break