peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
c = [list(map(int, input().split())) for _ in range(3)]
for i in range(2):
    for j in range(1, 3):
        if (c[i][0] - c[j][0]) != (c[i][1] - c[j][1]) or (c[i][2] - c[j][2]) != (c[i][1] - c[j][1]) or (c[i][2] - c[j][2]) != (c[i][0] - c[j][0]):
            print('No')
            exit()
print('Yes')
# Judge status: Accepted
# multiple
line = input()
ln = 0
d = 1
counts=[0]*2019
for i in range(1,len(line) + 1):
    ti1 = (ln +(int(line[-1*i])*d))%2019
    counts[ti1] += 1
    ln = ti1
    d *= 10
    d %= 2019
total = 0
counts[0] +=1
for i in range(len(counts)):
    total += counts[i]*(counts[i] - 1)/2
print(int(total))
# Judge status: Accepted
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) 

n, X = map(int, input().split())
x = list(map(int, input().split()))
a = abs(x[0] - X)
for i in x[1:]:
  a = gcd(a, abs(i - X))
print(a)
# Judge status: Accepted
# 入力
a = int(input())
b = int(input())
h = int(input())

# 処理
area = (a + b) * h // 2

# 出力
print(area)
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab=[]
for _ in range(M):
    ab.append(tuple(map(int, input().split())))
#print(ab)

from_1=set([el[1] for el in ab if el[0]==1])
from_N=set([el[0] for el in ab if el[1]==N])
#print(from_1, from_N)
if from_1 & from_N:
    print('POSSIBLE')
else:
    print('IMPOSSILBE')
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

# にぶたん: 答えをx以下にできるか？
ok, ng = 10 ** 9 + 1, 0
while abs(ok - ng) > 1:
    x = (ok + ng) // 2
    cnt = 0

    for a in A:
        if a <= x:
            continue

        cnt += a // x
        if cnt > K:
            ng = x
            break
    else:
        ok = x

print(ok)
# Judge status: Accepted
#S= str(input())
#T= str(input())
N,X = map(int,input().split())
#N = int(input())
A = list(map(int,input().split()))
c=0
while X>=min(A):
    if len(A)==1:
        if X==A[0]:
            c+=1
            print(c)
            exit()
        else:
            print(c)
            exit()

    if X>=min(A):
        X-=min(A)
        A.remove(min(A))
        c+=1

print(c)
# Judge status: Accepted
def main():
    H, W = map(int, input().split())
    if H == 1 or W == 1:
        print(1)
        return

    ans = 0
    ans += ((W + 1) // 2) * ((H + 1) // 2)
    ans += (W // 2) * (H // 2)
    print(ans)


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())
# Judge status: Accepted
import sys

input = sys.stdin.readline

n = int(input())

abc = [[int(i) for i in input().split()] for j in range(n)]

def happy(n, abc):
    da, db, dc = 0, 0, 0
    
    for a, b, c in abc:
        na = max(db, dc) + a
        nb = max(da, dc) + b
        nc = max(da, db) + c
        
        da, db, dc = na, nb, nc
    
    return max(da, db, dc)
    
print(happy(n, abc))
# Judge status: Accepted
n = int(input())
s = []
i = 1
m = (n%2)
s.append(n%2)
while 1:
    if m == n:
        break
    if n%(2**(i+1)) == m or n%(2**(i+1))-2**(i+1) == m:
        s.append(0)
    else:
        s.append(1)
        m += (-2)**i
    i += 1

print(''.join(map(str, s[::-1])))
# Judge status: Accepted
import fractions

A, B = map(int, input().split())

x = fractions.gcd(A, B)

C = []

def cal(i):
    for j in range(2, int(-(-i**0.5//1))+1):
        while True:
            if i%j == 0:
                i //= j
                C.append(j)
            else:
                break
    if i != 1:
        C.append(i)
        
    return set(C)

print(1+len(cal(x)))
# Judge status: Accepted
N = int(input())
A = int(input())

print('Yes' if N%500 <= A else 'No')
# Judge status: Accepted
import math
X = int(input())
c = 0
N = True
while N:
  for i in range(2,math.ceil((X+c)**.5)+1):
    if (X+c)%i == 0:
      c += 1
      break
  else:
    N = False 
print(X+c if X>2 else 2)
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def fanc(n):
    if n % 2 == 0:
        res = n // 2
    else:
        res = 3 * n + 1
    return res


s = int(readline())
n = fanc(s)
i = 2
while n > 4:
    n = fanc(n)
    i += 1

print(i+3)
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(a*b)
# Judge status: Accepted
N, X, T = map(int, input().split())

print((N + (X-1)) // X * T)
# Judge status: Accepted
s=str(input())
a,b=int(s[:2]),int(s[2:])
f,g= 1<=a and a<=12, 1<=b and b<=12
if f and g:
  print("AMBIGUOUS")
elif f:
  print("MMYY")
elif g:
  print("YYMM")
else:
  print("NA")
# Judge status: Accepted
A,B,K=(map(int,input().split()))
if A<=K:
    B=B-K+A
    A=0
    if B<0:
        B=0
else:
    A=A-K
print(A,B)
# Judge status: Wrong Answer
import math
x = int(input())

xx = int(x ** (1/5))
for i in range(-xx, xx + 1):
    a5 = i ** 5
    b5 = a5 - x
    if b5 > 0:
        if b5 == int(b5 ** (1/5)):
            print(i, b5)
            break

    else:
        if (-1*b5) == int((-1*b5) ** (1/5)):
            print(i, b5)
            break
# Judge status: Wrong Answer
from functools import reduce
from fractions import gcd
import numpy as np

MOD = 10**9+7

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

def main():
    N = int(input())
    a = [int(i) for i in input().split()]
    A = np.array(a)  

    lcm = reduce(lcm_base, A, 1)
    B = lcm // A

    print(np.sum(B) % MOD)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N, K = map(int, input().split())
x = [0] * (N+1)

for i in range(K):
    d = int(input())
    if d > 0:
        a = list(map(int, input().split()))
        for v in a:
            x[v] += 1

# print(a)

c = 0
for i in range(1, N+1, 1):
    if x[i] == 0:
        c += 1

print(c)
# Judge status: Wrong Answer

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

a = [0]

for i in range(n):
    a.append(a[i] + l[i])

#print(a)

for j in range(len(a)):
    if a[j] <= x:
        pass
    else:
        print(j)
        break
# Judge status: Accepted
A, B, C, K = map(int, input().split())

ans = A-B if K % 2 == 0 else B-A

print(ans)
# Judge status: Wrong Answer
in1 = int(input())
A = list(map(int, input().split()))
for i in range(1, in1):
    print(A.count(i))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

b = [-1] * (n + 2)

mid = n // 2
left = mid - 1
right = mid + 1

b[mid] = a[0]

for i in range(1, n):
  if not i % 2 == n % 2:
    b[left] = a[i]
    left -= 1
  else:
    b[right] = a[i]
    right += 1

for i in b:
  if i < 0:
    continue
  print(i, end=" ")
# Judge status: Wrong Answer
N, A, B=map(int, input().split())
ans=0
for i in range(1, N+1):
  s=str(i)
  x=0
  for j in s:
    x+=int(j)
    
  if A<=x<=B:
    ans+=1
    
print(ans)
# Judge status: Accepted
from decimal import *

a, b, c = map(int, input().split())

if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
X = str(input())

count= 0
count2 = 0
Nagasa = len(X)

for i in range (0, len(X)):
	if 2*count2 == Nagasa:
		print(2*count)
		exit()
	if X[i] == 'T':
		count+=1
		count2+=1
	if X[i] == 'S':
		count-=1

print(0)
# Judge status: Accepted
N,M=map(int,input().split())
#Sをすべて使うとき必要なCの数は2N
if M<2*N:
    print(M//2)
else:
    ans=N#現時点で作ったScc
    m=M-2*N#残りのc
    #Sccを１こ作るのにcは4つ必要
    ans+=m//4
    print(ans)
# Judge status: Accepted
N = int(input().strip())
a = [int(v) for v in input().strip().split(" ")]

num = 0
for i in range(N):
    if (i+1) % 2 != 0 and a[i] % 2 != 0:
        num += 1

print(num)
# Judge status: Wrong Answer
import numpy as np
import math
import sys

sys.setrecursionlimit(10000000)
n = input()
arr = np.array(list(map(int, input().split())))
def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x
lcm_v = lcm(arr)
div_arr = lcm_v / arr
print(int(div_arr.sum()) % (10**9 + 7))
# Judge status: Accepted
N, M, X = map(int, input().split())
BOOKS = [tuple(map(int, input().split())) for _ in range(N)]

INF = 10 ** 8
ans = INF
for selection in range(1 << N):
    price = 0
    values = [0] * M
    for i in range(N):
        if selection & (1 << i):
            x = BOOKS[i]
            price += x[0]
            for j in range(M):
                values[j] += x[j+1]
    if all(v >= X for v in values):
        ans = min(ans, price)

if ans == INF:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
N,K = map(int,input().split())

S = [0 for i in range(N)]
for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for j in range(d):
    S[j-1]+=1
ans = 0
for i in range(N):
  if S[i]==0:
    ans+=1

print(ans)
# Judge status: Wrong Answer
x,k,d = map(int,input().split())
if x>=k*d:
    print(x-k*d)
else:
    temp = x//d
    if temp%2==k%2:
        min_ = temp
        max_ = temp+2
    else:
        min_ = temp-1
        max_ = temp+1
    if max_ > k:
        max_ = min_
    #print(min_,max_)
    ans = min(abs(x-d*min_),abs(x-d*max_))
    print(ans)
# Judge status: Accepted
#071_B
s=input()
c='a'
while c<='z':
    if c not in s:
        print(c)
        exit()
    c=chr(ord(c)+1)
    
print('None')
# Judge status: Wrong Answer
A,B=(int(x) for x in input().split())
A*B
# Judge status: Wrong Answer
n = int(input())
x = list(map(int,input().split()))

count = 0
temp = 0

for i in range(len(x)):
    temp += x[i]


while temp%2==0:
    temp = 0
    for i in range(len(x)):
        x[i] = int(x[i] / 2)
        temp += x[i]
    count+=1

print(count)
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(((a-b)*(a-b)-(a+b))/2)
# Judge status: Accepted
N, M, d = map(int, input().split())
cnt = 0
for i in range(N, M + 1):
    if i % d == 0: cnt += 1
print(cnt)
# Judge status: Wrong Answer
N,C,K = map(int,input().split())

T = sorted([int(input()) for _ in range(N)])
ans = 0
count = 0
time = 0
for i in range(N):
  if T[i] > time + K:
    ans += 1
    count = 0
  if count == 0:
    time = T[i]
  count += 1
  if count == C:
    ans += 1
    count = 0
if count > 0:
  ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
x=""
while n!=0:
  x=str(n%2)+x
  n=-(n//2)
print(0 if x=="" else x)
# Judge status: Wrong Answer
N, X, Y = map(int, input().split(" "))
k = 0
while k < X:
    print(N-k)
    k += 1
nodes = [i for i in range(1, N+1)]
del nodes[(X+Y)//2-1]
k += 1
while k < N:
    print(len(nodes)-k)
    k += 1
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))
C = {}
for a in A:
    if a in C:
        C[a] += 1
    else:
        C[a] = 1

s = int(sum(c * (c - 1) / 2 for c in C.values()))
for a in A:
    print(int(s - C[a] + 1))
# Judge status: Accepted
n, k = map(int, input().strip().split())
L = list(map(int, input().strip().split()))
L = [v - 1 for v in L]

seen = set()
cur = 0
untillBackToIntersec = 0

while cur not in seen:
    seen.add(cur)
    untillBackToIntersec += 1
    cur = L[cur]

intersec = cur
cur = 0
beforeLoop = 0

while cur != intersec:
    cur = L[cur]
    beforeLoop += 1
if k<=beforeLoop:
    proceed=k
else:
    loopSize = untillBackToIntersec - beforeLoop
    proceed=(k - beforeLoop) % (loopSize) + beforeLoop
ans = 0

for _ in range(proceed):
    ans = L[ans]

print(ans + 1)
# Judge status: Accepted
from collections import Counter
import heapq
N,M = map(int,input().split())
A = Counter(list(map(int,input().split())))

cards = []
for x,y in A.items():
  heapq.heappush(cards, (-x,y))

for _ in range(M):
  b,c = map(int,input().split())
  heapq.heappush(cards, (-c,b))

cnt = N
res = 0
while cnt <= N:
  v,c = heapq.heappop(cards)
  v *= -1

  if cnt-c < 0:
    res += v*cnt
    break
  else:
    res += v*c
    cnt -= c

print(res)
# Judge status: Accepted
k, a, b = map(int, input().split())
ans = k + 1
if a < b:
    k -= a - 1
    ans = max(ans, a + (b-a)*(k//2) + k%2)
print(ans)
# Judge status: Accepted
import sys
from math import pi

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    R = int(readline())

    print(2 * R * pi)

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
N, A, B = map(int, input().split())
diff = B - A

if N == 1:
    if diff != 0:
        print(0)
    else:
        print(1)
else:
    if diff < 0:
        print(0)
    elif diff == 0:
        print(1)
    else:
        max_val = B * (N-1) + A
        min_val = A * (N-1) + B
        print(max_val - min_val + 1)
# Judge status: Accepted
from collections import defaultdict
def main():
    N = int(input())
    a = [int(i) for i in input().split()]
    dd = defaultdict(int)
    res=0

    for i in a:
        dd[i]+=1 
    for i in dd.keys():
        if dd[i]<i:
            res += dd[i]
        elif dd[i]>i:
            res += dd[i]-i 
            dd[i] = i 
    print(res)
            



if __name__ == "__main__":
    main()
# Judge status: Accepted
n,a,b=map(int,input().split())
print(a*(n//(a+b))+min(a,n%(a+b)))
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))


for i in range(n):
    if A[i]==0:
        print(0)
        exit()


ans = 1
for i in range(n):
    ans *= A[i]
    if ans > 1e18:
        print(-1)
        exit()

print(ans)
# Judge status: Accepted
s = input()
print(s.count('1'))
# 全探索
# Judge status: Wrong Answer
nk = input().split()
n = int(nk[0])
k = int(nk[1])
d = input().split()
for i in range(n,10000):
    for j in range(k):
        for l in range(len(str(n))):
            if str(n)[l] == str(d)[j]:
                break
        else:
            continue
        break
    else:
        print(i)
        break
    n += 1
# Judge status: Accepted
n=int(input())
b=list(map(int,input().split()))
ans=b[0]+b[-1]

for i in range(n-2):
  if b[i]<=b[i+1]:
    ans+=b[i]
    
  else:
    ans+=b[i+1]
  
print(ans)
# Judge status: Wrong Answer
from collections import defaultdict

s=input()
t=input()
lis=defaultdict(lambda:-1)
lis2=defaultdict(lambda:-1)
for i,val in enumerate(s):
    if lis[i]==-1:
        lis[i]=val
    else:
        if lis[i]!=val:
            print("No")
            exit()
for i,val in enumerate(t):
    if lis2[i]==-1:
        lis2[i]=val
    else:
        if lis2[i]!=val:
            print("No")
            exit()
print("Yes")
# Judge status: Accepted
def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = 0
    y = 0
    sort_a = sorted(a, reverse=True)
    for i in range(n):
        if i % 2 == 0:
            m += sort_a[i]
        else:
            y += sort_a[i]
    print(m - y)
main()
# Judge status: Accepted
from collections import deque
k = int(input())
l = [int(x) for x in range(1,10)]
lnln = deque(l)
Lnln = []
# print(lnln)
n = 10**5
for i in range(n):
    x = lnln.popleft()
    Lnln.append(x)
    a = x % 10
    
    if a!=0:
        lnln.append(x*10 + (a-1))
        
    lnln.append(x*10 + a)
        
    if a!=9:
        lnln.append(x*10 + (a+1))
        
print(Lnln[k-1])
# Judge status: Accepted
Sset=set(input())
Sset=sorted(Sset)

ans = "None"
flg = True
last = "None"
for i,c in enumerate(Sset):
	if i+97 !=ord(c):
		flg=False
		ans = chr(i+97)
		break
	last = c

if flg and last != 'z' :
	ans = chr(ord(last)+1)
print(ans)
# Judge status: Wrong Answer
w = list(input())
ans = 'Yes'
for i in range(ord('a'),ord('z')):
	if int(w.count("chr(i)"))%2 == 1:
		ans = 'No'
		break
	if int(w.count("chr(i)"))%2 == 0:
		continue
print(ans)
# Judge status: Accepted
N = int(input())

print(int(N*(N+1)*0.5))
# Judge status: Wrong Answer
a,b = map(int,input().split())

if(a <= 5):
    print(0)
elif(a < 12):
    print(b//2)
else:
    print(b)
# Judge status: Accepted
n,m=map(int,input().split())
if m<=2*n:
  print(int(m/2))
else:
  print(int((2*n+m)/4))
# Judge status: Wrong Answer
N=int(input())
s=0
A=list(map(int,input().split()))
li=[0]*(2*(10**5))
for i in range(N):
    li[A[i]]+=1
for j in range(N):
    s+=li[j]*(li[j]-1)//2
for k in range(N):
    print(s-(li[A[k]]*(li[A[k]]-1))//2+((li[A[k]]-1)*(li[A[k]]-2))//2)
# Judge status: Accepted
p, q, r = map(int, input().split())
list01 = [p, q, r]
print(p + q + r - (max(list01)))
# Judge status: Accepted
s = list(set(list(input())))

if (len(s)%2==1):
      print("No")
else:
      if ("N" in s) and ("S" in s):
            print("Yes")
      elif ("E" in s) and ("W" in s):
            print("Yes")
      else:
            print("No")
# Judge status: Accepted
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M:
    print(0)
else:
    X.sort()
    X_div = [0] * (M-1)
    for i in range(1,M):
        X_div[i-1] = X[i] - X[i-1]
    X_div.sort(reverse=True)
    m = 0
    for i in range(N-1):
        m += X_div[i]
    print(X[-1]-X[0]-m)
# Judge status: Wrong Answer
x=int(input())

if 400 <= x <= 599:print(8)
elif 700 <= x <= 799:print(7)
elif 800 <= x <= 999:print(6)
elif 1000 <= x <= 1199:print(5)
elif 1200 <= x <= 1399:print(4)
elif 1400 <= x <= 1599:print(3)
elif 1600 <= x <= 1799:print(2)
else:print(7)
# Judge status: Wrong Answer
import bisect
from collections import defaultdict
n,m = map(int,input().split())
p = [list(map(int, input().split())) for _ in range(m)]

a = defaultdict(list)
for x,y in sorted(p):
    a[x].append(y)
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("{0:06d}{0:06d}".format(x,z))
# Judge status: Accepted
N,M=map(int,input().split())
print(abs(N-2)*abs(M-2))
# Judge status: Accepted
n = int(input())
s = input()
x = 0
point = [0] * (n + 1)
for i in range(n) :
    if s[i] == "I" :
        point[i+1] = point[i] + 1
    if s[i] == "D" :
        point[i+1] = point[i] - 1
print(max(point))
# Judge status: Accepted
import math
X = int(input())
if X == 2:
    print(2)
else:
    is_find = False
    while not is_find:
        for i in range(2, X//2):
            is_find = True
            if math.gcd(X, i) != 1:
                is_find = False
                X += 1
                break
        rst = X
    print(rst)
# Judge status: Wrong Answer
s = input()
a = 'dream'
b = 'dreamer'
c = 'erase'
d = 'eraser'
for i in range(len(s)):  
  if not s[i] == a[i//4] or s[i] == b[i//5] or s[i] == c[i//4] or s[i] == d[i//5]:
    print('NO')
    exit()
print('YES')
# Judge status: Accepted
n = int(input())

x = n % 10
y = (n // 10) % 10
z = n // 100
if x == 7 or y == 7 or z == 7:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# C - Sum of gcd of Tuples (Easy)
from math import gcd


def main():
    K = int(input())
    gcd_three = lambda x, y, z: gcd(gcd(x, y), z)
    ans = sum(
        gcd_three(i, j, k)
        for i in range(1, K + 1)
        for j in range(1, K + 1)
        for k in range(1, K + 1)
    )
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
comp = input()
if comp == "ABC":
  print("ARC")

else:
  print("ABC")
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))

N=h[0]
for i in range(n):
    if N-1 > h[i]:
        print("No")
        break
    elif h[i] > N:
        N = h[i]
        
else:
    print("Yes")
# Judge status: Accepted
A, B = map(int, input().split())
if A == B:
    print('Draw')
elif A == 1:
    print('Alice')
elif B == 1:
    print('Bob')
elif A > B:
    print('Alice')
else:
    print('Bob')
# Judge status: Accepted
N, K = map(int, input().split())
cnt = [0]*100001
S = set()
for i in range(N):
  a, b = map(int, input().split())
  cnt[a-1] += b
  S.add(a)

acc = 0
for s in sorted(S):
  acc += cnt[s-1]
  if acc >= K:
    print(s)
    break
# Judge status: Accepted
N = int( input() )
V = list( map( int, input().split() ) ) 

V.sort()

ret = V[0]
for i in range( 1, len( V ) ):
  ret = ( ret + V[i] ) / 2
print( ret )
# Judge status: Accepted
N = int(input())
S = input()

C = list(S)
cA = ord('A')  # 65
n = ord('Z') - ord('A') + 1  # 26
ans = map(lambda c : chr(cA + (ord(c) + N - cA) % n), C)
print(''.join(ans))
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
i=0
ans=0
while i<n:
  if p[i]==i+1:
    i+=1
    ans+=1
  i+=1
print(ans)
# Judge status: Accepted
s=input()
a=s.count("N")
b=s.count("W")
c=s.count("S")
d=s.count("E")
ans=False
if a!=0 and c!=0:
    if (b!=0 and d!=0) or (b==0 and d==0):
        ans=True
if a==0 and c==0:
    if (b!=0 and d!=0) or (b==0 and d==0):
        ans=True
if ans==True:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
print("Yes" if a + b >= c else "No")
# Judge status: Wrong Answer
N,A,B=map(int,input().split())
S=input()
t_count=0
b_count=0
flag=None

for i in S:
  if i=="c":
    print("No")
  else:
    if i=="a":
      t_count+=1
      if t_count<=A+B:
        print("Yes")
      else:
        print("No")
    else:
      b_count+=1
      if b_count<=B:
        t_count+=1
        print("Yes")
      else:
        print("No")
# Judge status: Accepted
n = int(input())
a = 0
while n > 1:
    n = n//2
    a = a+1
print(2**a)
# Judge status: Wrong Answer
w, a, b = map(int, input().split())

if a < b < a + w:
    print(0)
elif a + w < b:
    print(b - (a + w))
elif b + w < a:
    print(a - (b + w))
# Judge status: Accepted
# C Vacation
N = int(input())
A = [list(map(int, input().split())) for i in range(N)]

#print(N,A)

dp = [[0] * 3 for _ in range(N)]
dp[0][0] = A[0][0]
dp[0][1] = A[0][1]
dp[0][2] = A[0][2]
#print(dp)

for i in range(1,N):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j],dp[i-1][k]+A[i][j])

print(max(dp[N-1]))
# Judge status: Accepted
import sys
from bisect import bisect_right as bi_r, bisect_left as bi_l
inf = float('inf')

n, *a = map(int, sys.stdin.read().split())

def main():
  res = [inf] * n
  for x in a[::-1]:
    res[bi_r(res, x)] = x
  print(bi_l(res, inf))

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

print(N - sum(A))
# Judge status: Accepted
a,b,c = list(map(int, input().split()))

"""
a ** 0.5 + b ** 0.5 < c ** 0.5
a + 2(a*b) ** 0.5 + b < c
2(a*b) ** 0.5 < (c - a -b)
#c-a-b>0のとき
4(a*b) < (c - a -b)**2
a*b < (c-a-b)**2/4
"""

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

if N >= 10:
    answer = R
else:
    answer = R + 100*(10 - N)

print(answer)
# Judge status: Accepted
N, A, B = map(int, input().split())

if (B - A) % 2 == 0:
    print((B - A) // 2)
else:
    print(min(A + (B - A - 1) // 2, N - B + 1 + (B - A - 1) // 2))
# Judge status: Accepted
s = input()[::-1]

while True:
    if len(s) == 0:
        break
    if s[:7] == "remaerd":
        s = s[7:]
    elif s[:6] == "resare":
        s = s[6:]
    elif s[:5] == "maerd" or s[:5] == "esare":
        s = s[5:]
    else:
        print("NO")
        exit()

print("YES")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
k=sum(b)-sum(a)
p=0
for i in range(n):
    if a[i]>=b[i]:
        p+=a[i]-b[i]
    else:
        p+=a[i]-b[i]//2*-1
print('Yes' if k>=p else 'No')
#print(k)
# Judge status: Accepted
import math
import statistics
a=int(input())
#b=int(input())
# c=[]
# for i in b:
#     c.append(i)
# e1,e2 = map(int,input().split())
f = list(map(int,input().split()))
#j = [input() for _ in range(3)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))
ans=0
count=0
for i in range(a):
    if ans+1 == f[i]:
        ans=f[i]
        count+=1
if count>0:   
    print(len(f)-count)
else:
    print(-1)
# Judge status: Accepted
a, b = map(int, input().split())
h = 0
hs = []
for i in range(1, 1000):
    h += i
    hs.append(h)
for i in range(998):
    if (hs[i] - a) == (hs[i + 1] - b):
        print(hs[i] - a)
        exit()
# Judge status: Accepted
K = int(input())

ans = [i + 1 for i in range(9)]

i = 0
while len(ans) <= K:
    s = str(ans[i])
    t = int(s[-1])
    d = [-1, 0, 1]
    if t == 0:
        d = [0, 1]
    elif t == 9:
        d = [-1, 0]

    for x in d:
        ans.append(s + str(t + x))
    i += 1
print(ans[K-1])
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
sm=sum(a)
x=[a[0]]
y=[sm-a[0]]
for i in range(1,n):
  x.append(x[i-1]+a[i])
  y.append(sm-x[i])
min=9999999999
for (p,q) in zip(x,y):
  sa=abs(p-q)
  if sa<min:
    min=sa

print(min)