peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
s=sum(a)
cn=0
buf=s
for i in range(n):
  cn+=a[i]
  buf=min(buf,abs(s-2*cn))
print(buf)
# Judge status: Wrong Answer
a,b=list(map(int, input().split()))
ct=(a*(a-1))//2
ct+=b
print(ct)
# Judge status: Accepted
n = int(input())
s = {}
ans = 0
for _ in range(n):
    sn = sorted(input())
    sn = ''.join(sn)

    if sn in s:
        ans += s[sn]
        s[sn] += 1
    else:
        s[sn] = 1

print(ans)
# Judge status: Accepted
#-*-coding:utf-8-*-
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    x,y=map(int,readline().split())
    ans=0
    while x<=y:
        x*=2
        ans+=1
    print(ans)

if __name__=="__main__":
    main()
# Judge status: Accepted
N = int(input())
import math as m
print(m.factorial(N) % (10**9+7))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = []
i = 0
while i < N - 1:
    if A[i] != A[i+1]:
        B.append(A[i])
    i += 1
B.append(A[-1])

ans = 1
i = 0
while i < len(B) - 2:
    if (B[i + 1] - B[i]) * (B[i + 2] - B[i + 1]) < 0:
        ans += 1
        i += 2
    else:
        i += 1
print(ans)
# Judge status: Wrong Answer
N,K=map(int, input().split())
A = list(map(int, input().split()))

A = [0] + A

visited = [1]
now = 1
while True:
  next = A[now]
  if next in visited:
    break
  visited.append(next)
  now = next

initial = visited.index(next)
cycle = len(visited[initial:])

residual = (K - initial) % cycle
print(visited[initial+residual])
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = set()
c = [0]*n

for i in range(n, 0, -1):
  x = 0
  for j in range(2*i, n+1, i):
    x+=c[j-1]
  if a[i-1] != x%2:
    c[i-1] += 1
    b.add(i)
print(len(b))
print(*b)
# Judge status: Accepted
h, n = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) >= h: print('Yes')
else: print('No')
# Judge status: Wrong Answer
import math

n = int(input())
c = 10
ans = 0
while c <= n:
    ans += math.floor(n / c)
    c *= 5
print(ans)
# Judge status: Accepted
N=int(input())
i=1
buf=0
while True:
 if (buf<N) and (N<=buf+i):
  print(i)
  break
 else:
  buf=buf+i
  i=i+1
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
dp = [0]*n
dp[1] = abs(h[0] -h[1])
for i in range(2,n):
    dp[i] = min(dp[i-1]+abs(h[i] - h[i-1]),dp[i-2]+abs(h[i] - h[i-2]))
print(dp[n-1])
# Judge status: Accepted
a=int(input())
b=a//15
c=a*800-b*200
print(c)
#through this we can find how much he has to pay
# Judge status: Wrong Answer
x,y = map(int,input().split())
t = 0
while x <= y:
  x *= 2
  t = 0

print(t)
# Judge status: Accepted
import math
N = int(input())

CSF = []

for n in range(N-1):
    CSF.append(list(map(int, input().split())))

ans = []

for i in range(N-1):
    t = 0
    for j in range(i, N-1):
        t = max(math.ceil(t / CSF[j][2]) * CSF[j][2], CSF[j][1]) + CSF[j][0]
    ans.append(t)
ans.append(0)

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

print((r^2)%1)
# Judge status: Wrong Answer
S,W= input().split()
if S <= W*2:
    print("unsafe")
else:
    print("safe")
# Judge status: Accepted
n = int(input())
list01 = input().split()
list02 = sorted([int(s) for s in list01])
a = sum(list02) - list02[-1]
if list02[-1] < a:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=max(a,b)
print(c+max(a-1,b-1,c))
# Judge status: Accepted
a,b,t=map(int,input().split())

print(int(((t+0.5)//a)*b))
# Judge status: Wrong Answer
a=input()
b=input()
ans='123'
print(ans.strip(a).strip(b))
# Judge status: Accepted
#A
import math
n = int(input())
print((math.ceil(n / 2)) / n)
# Judge status: Accepted
n, k = map(int, input().split())

ret = 0

for i in range(n):
    me = i + 1
    prob = 1
    while me < k:
        prob /= 2
        me *= 2
    ret += (prob / n)

print(ret)
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=input()
x=s.count('RL')-1
y=0
cnt=0
for i in range(n-1):
  if s[i]==s[i+1]:
    cnt+=1
if s[0]=='L' or s[n-1]=='R':
  y+=1
while k>0:
  if x>0:
    x-=1
    cnt+=2
    k-=1
  else:
    if y>0:
      cnt+=1
      y-=1
      k-=1
    else:
      break
print(cnt)
# Judge status: Wrong Answer
a=int(input())
b=a**a
print(int(a+b+a*b))
# Judge status: Accepted
N, K, S=map(int, input().split())
if S==10**9:
  ans=[10**9]*K+[10**9-1]*(N-K)
  print(*ans)
else:
  ans=[S]*K+[S+1]*(N-K)
  print(*ans)
# Judge status: Accepted
import sys

s = input()

for c in s[::2]:
    if(c == 'L'):
        print("No")
        sys.exit()

for c in s[1::2]:
    if(c == 'R'):
        print("No")
        sys.exit()

print("Yes")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


A,B,C = MI()
print('Yes' if A+B >= C else 'No')
# Judge status: Accepted
n=int(input())
ans=int(0)
s=int(0)
for i in range(n):
    now=int(input())
    if now==0:
        ans+=int(s/2)
        s=int(0)
    else:
        s+=now
ans+=int(s/2)
print(ans)
# Judge status: Accepted
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


K = I()
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[:K] + '...')
# Judge status: Accepted
S = input()

ps = ''
for s in S:
    if s != ps and ps != '':
        print('Yes')
        break
    ps = s
else:
    print('No')
# Judge status: Accepted
g1=[1,3,5,7,8,10,12]
g2=[4,6,9,11]
a,b = map(int,input().split())
if (a in g1 and b in g1) or (a in g2 and b in g2):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x,k,d=map(int,raw_input().split())

def solve(x,k,d):
    x=abs(x)
    if (x>0 and x/d>=k):
        x=x-k*d
        return x
    y=x//d
    x-=y*d
    k-=y
    if k%2==0:
        return abs(x)
    return min(abs(x+d),abs(x-d))
print(solve(x,k,d))
# Judge status: Wrong Answer
A,B,C = list(map(int,input().split()))
if abs(A-B) - abs(B-C) == 0:
	print("YES")
else:
	print("NO")
# Judge status: Accepted
import sys
s=input()
cnt=1
for i in range(0, len(s)-1):
  if(s[i]==s[i+1]):
    cnt+=1
  else:
    cnt=1
  if(cnt==3):
    print("Yes")
    sys.exit()
print("No")
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
def iroha(a,b,c):
    if (a==5 or a==7) and (b==5 or b==7) and (c==5 or c==7) and a+b+c==17:
        if [a,b,c]==[5,7,5]:
            return "NO"
        else:
            return "YES"
    else:
        return "NO"
print(iroha(a,b,c))
# Judge status: Accepted
n, x, y = map(int, input().split())
c = [0 for _ in range(1, n)]
for i in range(1, n+1):
  for j in range(1, n+1):
    if i <= j:
      continue
    a = i - j
    b = abs(j - x)+1+abs(i - y)
    if a < b:
      c[a-1] += 1
    else:
      c[b-1] += 1
for e in c:
  print(e)
# Judge status: Wrong Answer
N, K = map(int, input().split())
a = []
for i in range(K):
  di = int(input())
  a.append(map(int, input()))
  
    

a = set(a)
print(N - len(a))
# Judge status: Accepted
from fractions import gcd
N = int(input())
A = list(map(int,input().split()))
MOD = 10**9+7
 
def lcm(a,b):
  g = gcd(a, b)
  return a*b // g
 
l = 1
for a in A:
  l = lcm(l, a)
 
# print(l)
 
ans = 0
for a in A:
  ans += l//a
  # ans %= MOD
 
print(ans%MOD)
# Judge status: Accepted
a = input()
count = 0
if a[0] == '1':
    count += 1
if a[1] == '1':
    count += 1
if a[2] == '1':
    count += 1
    
print(count)
# Judge status: Accepted
x,y,a,b,c = map(int,input().split())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))
R = list(map(int,input().split()))
p = sorted(P,reverse=True)
q = sorted(Q,reverse=True)
r = sorted(R,reverse=True)
V = p[0:x] + q[0:y] + r
v = sorted(V,reverse=True)
print(sum(v[0:x+y]))
# Judge status: Accepted
total = 0
for ch in input().strip():
	total = (total + int(ch)) % 9
print('No' if total else 'Yes')
# Judge status: Accepted
N=int(input())
a=[]
for i in range(N):
  a.append(0)
for x in range(1,N+1):
  if x**2>=N:
    break
  for y in range(1,N+1):
    if x**2 + y**2 >= N:
      break
    for z in range(1,N+1):
      if x**2+y**2+z**2>=N:
        break
      t=x**2+y**2+z**2+x*y+y*z+z*x
      if t<=N:
        a[t-1] += 1
for m in range(N):
  print(a[m])
# Judge status: Accepted
import math

def solve(n, k, A):
    return math.ceil((len(A) - A.count(min(A))) / (k - 1))

_n, _k = map(int, input().split())
_A = list(map(int, input().split()))
print(solve(_n, _k, _A))
# Judge status: Accepted
K,A,B = map(int,input().split())
if B-A<=2:
    print(1+K)
else:
    if K<=A-1:
        print(1+K)
    else:
        d = K-(A-1)
        if d==1:
            print(A+1)
        elif d%2==0:
            print(B+((d-2)//2)*(B-A))
        else:
            print(B+((d-3)//2)*(B-A)+1)
# Judge status: Accepted
a, b = map(int, input().split())
print(((b - a) * (b - a - 1) // 2)- a)
# Judge status: Accepted
s= input()
print("Yes" if int(s[:3])%111 == 0 or int(s[1:])%111 == 0 else "No")
# Judge status: Accepted
import sys

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

MOD = 10**9 + 7

def factorial(a):
    return 1 if a == 1 else a * factorial(a - 1) % MOD

def inverse(x):
    return pow(x, MOD - 2, MOD)

def combination(a, b):
    ans = 1
    for i in range(b):
        ans = ans * (a - i) * inverse(i + 1) % MOD
    return ans

n, a, b = map(int, input().split())
ans = pow(2, n, MOD) - 1
ans -= combination(n, a) + combination(n, b)
print(ans % MOD)
# Judge status: Accepted
s = input()
if len(set(s)) == 2 and s.count(s[0]) == 2:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys
n = int(input())
numlist = list(map(int, input().split()))
if 0 in numlist:
    print(0)
else:
    ans = 1
    for i in numlist:
        ans *= i
        if ans > 10**18:
            print("-1")
            sys.exit()
    print(ans)
# Judge status: Wrong Answer
s=input()
t=s[::2]
u=s[1::2]
a=t.count("0")
b=u.count("0")
if len(s)==1:
  print(0)
if a>=b:
  print(len(t)-a+b)
else:
  print(len(u)-b+a)
# Judge status: Wrong Answer
mycode = '''
# distutils: language=c++
# cython: language_level=3, boundscheck=False, wraparound=False
# cython: cdivision=True

ctypedef long long LL
cdef LL MOD = 10**9 + 7
cdef LL N = int(input())
cdef LL ans = 1

cdef i
for i in range(2, N + 1):
    ans *= i
    ans %= MOD
print(ans)
'''
import sys
import os
if sys.argv[-1] == 'ONLINE_JUDGE' or os.getcwd() == '/imojudge/sandbox':  # コンパイル時 or コードテスト時
    with open('mycode.pyx', 'w') as f:
        f.write(mycode)
    os.system('cythonize -i -3 -b mycode.pyx')

import mycode
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

S = sum(A)
S2 = sum(map(lambda x: x*x,A))

print((S*S - S2) / 2 % 1000000007)
# Judge status: Accepted
N, K = map(int, input().split())
st = set()
for _ in range(K):
    input()
    st |= set(map(int, input().split()))
print(len(set(range(1, N + 1)) - st))
# Judge status: Accepted
import math

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

tr = a*a*b/2

if x <= tr:
  rlt = (180/math.pi)*math.atan2(a*b**2, 2*x)
else:
  rlt = (180/math.pi)*math.atan2(2*(a**2*b - x), a**3)
  
print(rlt)
# Judge status: Wrong Answer
N,T = map(int,input().split())
CT = []
for n in range(N):
  c,t = map(int,input().split())
  CT.append([c,t])
CT = sorted(CT,key=lambda x: x[0])
for ct in CT:
  if ct[1] <= T:
    print(ct[0])
    break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(0, n, 2):
    if a[i] % 2 != 0:
        c += 1
print(c)
# Judge status: Wrong Answer
n='str(input())'
for i in range(len(n)):
  if n[i]=='7':
    print('Yes')
    exit()
print('No')
# Judge status: Accepted
s=input()
l=len(s)
def judge():
  cnt=0
  while True:
    if s[l-cnt-6:l-cnt]=='eraser':
      cnt+=6
    elif s[l-cnt-5:l-cnt]=='erase':
      cnt+=5
    elif s[l-cnt-7:l-cnt]=='dreamer':
      cnt+=7
    elif s[l-cnt-5:l-cnt]=='dream':
      cnt+=5
    else:
      print('NO')
      exit()
    if cnt==len(s):
      print('YES')
      exit()

judge()
# Judge status: Accepted
n,m = map(int,input().split())
x = [int(x) for x in input().split()]
x.sort()

if n > m:
    print(0)
else:
    ans = []
    for i in range(m-1):
        ans.append(x[i+1] - x[i])
    ans.sort()
    print(sum(ans[0:(m-n)]))
# Judge status: Accepted
p,q,r = map(int, input().split())
print(min(min(p+q,p+r),r+q))
# Judge status: Accepted
N = int(input())
s = []
now = 0
simekiri = 0
flag = 0
for i in range(N):
    a,b = map(int,input().split())
    s.append([b,a])
s.sort()
for i in range(N):
    now += s[i][1]
    simekiri = s[i][0]
    if now>simekiri:
        print("No")
        flag = 1
        break
if flag == 0:
    print("Yes")
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7
x = int(input())
cnt = 0
if x<=6:
    print(1)
elif x<=11:
    print(2)
else:
    if x%11 == 0:
        print((x//11)*2)
    else:
        print((x//11)*2 + 1)
# Judge status: Accepted
# 入力
r, g, b = map(int, input().split())

# 出力
if 1 <= r and g and b <= 9:
    if ((r * 100) + (g * 10) + b) % 4 == 0:
        print('YES')
    else:
        print('NO')
# Judge status: Accepted
a = ["R", "U", "D"]
b = ["L", "U", "D"]
s = input()
iscan = True
for i in range(len(s)):
    if i%2 == 0:
        if s[i] not in a:
            iscan = False
    else:
        if s[i] not in b:
            iscan = False
print("Yes" if iscan else "No")
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
min = 0
cnt = 0
for i,k in enumerate(b):
    min += k
j = i
for i in range(N):
    while(j > 0 and min > K):
        j -= 1
        min -= b[j]
    if(min > K):
        break
    cnt = max(cnt, i + j)
    if(i == N):
        break
    min += a[i]
print(cnt)
# Judge status: Accepted
ABN = input().split()
A = int(ABN[0])
B = int(ABN[1])
N = int(ABN[2])

answer = 0
temp = 0

if N >= B:
    answer = A*(B-1) // B - A * ((B-1)//B)

else:
    answer = A*N //B - A * (N//B)

print(answer)
# Judge status: Accepted
l = list(input())
n = len(l)

def dfs(i,f,sum):
    if i == n-1:
       if sum == 7:
           print(f+"=7")
           exit()
    
    else:
        dfs(i+1,f+"+"+l[i+1],sum+int(l[i+1]))
        dfs(i+1,f+"-"+l[i+1],sum-int(l[i+1]))

dfs(0,l[0],int(l[0]))
# Judge status: Accepted
a, b = input().split()
l = ["2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "1"]
if l.index(a) > l.index(b):
    print("Alice")
elif l.index(a) == l.index(b):
    print("Draw")
else:
    print("Bob")
# Judge status: Accepted
a = map(int, input().split())
if len(set(a)) == 2:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N, K = list(map(int, input().split()))
if N > K:
    p = (N - 1)//K
    N_p = N - p*K
    N_q  = -(N_p - K)
    ans = min(N_p, N_q)
else:
    ans = min(N, K-N)
print(ans)
# Judge status: Accepted
a,b=map(int, input().split())
s = input()
for i in range(len(s)):
  if i == a:
    if s[i] != "-":
      print("No")
      break
  else:
    if not "0" <= s[i] <= "9":
      print("No")
      break
else:
  print("Yes")
# Judge status: Wrong Answer
S=input()
count=0
max_count=-1
for i in range(len(S)):
    if S[i]!="A" and S[i]!="C" and S[i]!="G" and S[i]!="T":
        count=count+1
    else:
        if max_count<count:
            max_count=count
        count=0
print(max_count)
# Judge status: Accepted
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))
print(sum(a[:k]))
# Judge status: Accepted
A, B = map(int,input().split())
for i in range(10*B,10*(B+1)):
  if 10*B<= i <10*(B+1) and 12.5*A<= i < 12.5*(A+1):
    print(i)
    break
else:
  print(-1)
# Judge status: Wrong Answer
n=int(input())
def solve(m):
    big=m[0]
    ok=0
    for i in range(big-1,-1,-1):
        if i not in m and big-i not in m:
            m.pop(0)
            m.append(i)
            m.append(big-i)
            ok+=1
            break
    if ok>0:
        m.sort(reverse=True)
        return solve(m)
    else:
        return(m)
ans=solve([n])
for i in ans:
    print(i)
# Judge status: Wrong Answer
L = [int(input()) for i in range(5)]
k = int(input())
for i in range(4):
  if L[i+1]-L[i] > k:
    print(":(")
    quit()
print("Yay!")
# Judge status: Accepted
a,b=map(int,input().split())
v,w=map(int,input().split())
t=int(input())
if a<=v:
    d1 = a + t*b
    d2 = v + t*w
    if d1>=d2:
        print('YES')
    else:
        print('NO')
else:
    d1 = a - t*b
    d2 = v - t*w
    if d1<=d2:
        print('YES')
    else:
        print('NO')
# Judge status: Accepted
# coding: utf-8
# Your code here!

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

n,*p=map(int,open(0).read().split())

cnt=0
for a,b,c in zip(p[0:],p[1:],p[2:]):
    if a>b>c or a<b<c:
        cnt+=1
    
print(cnt)
# Judge status: Wrong Answer
k, x = list(map(int, input().split(" ")))
if 2 * k >= x:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
numero = int(input())
soma = 0
minimo = 100000
for aux in range(numero-1,1,-1):
    prim = str(aux)
    seg = str(numero - aux)
    for x in range(len(prim)):
        soma += int(prim[x])
    for x in range(len(seg)):
        soma += int(seg[x])
    if soma < minimo :
        minimo = soma
    soma = 0
if numero == 2:
    print(numero)
else:
    print(minimo)
# Judge status: Wrong Answer
import math
h=int(input())
n=math.floor(math.log2(h))
x=0
for i in range(n+1):
  x+=2**i // 2^i
print(x)
# Judge status: Wrong Answer
S = input()
N = len(S)

def is_palindrome(s):
  return s == s[::-1]

if is_palindrome(S) \
and is_palindrome(S[:int((N-1)/2)]) \
and S[:int((N-1)/2)] == S[int((N+3)/2-1):]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
import collections
n = int(input())
s = [[] for _ in range(n)]
l = [collections.defaultdict(lambda:0) for _ in range(n)]
for i in range(n):
    s[i] = list(input())
    for j in s[i]:
        l[i][j] += 1
    print(l)
mind = [float("inf")]*26
for i in range(26):
    for j in range(n):
        mind[i] = min(mind[i],l[j][chr(97+i)])
ans = ""
for i in range(26):
    ans += chr(97+i)*mind[i]
print(ans)
# Judge status: Accepted
N = int(input()) 
H = list(map(int, input().split()))
sub = []
for i in range(N-1):
    sub.append(H[i+1]-H[i])
#print(sub)
ans = 0
tmp = 0
for s in sub:
    if s <= 0:
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
ans = max(ans, tmp)


print(ans)
# Judge status: Wrong Answer
S = str(input())
    
result = False
    
if S[0] == 'A':
    
    check = S[2:len(S)-1]
    
    if check.count('C') == 1:
        
        result = check[1:]
        
        result = result.replace('C','')
        
        if result.islower():
            result = True
            
            
            
            
if result:
    print('AC')
else:
    print('WA')
# Judge status: Accepted
a=int(input())      #fjfkdajadjgkalds;fj'kaskajlsjfdka's
b=a//15
c=a*800-b*200
print(c)
# Judge status: Accepted
n,*l=map(int,open(0).read().split())
e=[1]
for i in range(n): e+=[(e[-1]-l[i])*2]
a=t=0
for i in range(n,-1,-1):
  if l[i]>e[i]: print(-1); break
  t=min(l[i]+t,e[i]); a+=t
else: print(a)
# Judge status: Accepted
import math
a,b = input().split()


s = int(a+b)

if math.sqrt(s)%1 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
ans = 0
B = 0
for i in range(N):
    A = int(input())
    C = A+B
    ans += C//2
    if B == 1 and C == 1:
        B = 0
        continue
    B = C % 2
print(ans)
# Judge status: Accepted
k = input().split()
a = int(k[0])

def b(n):
    return int(n/2)
def c(n):
    return int((3*n)+1)

Counter = 0

flag = True
IntSet = set()
IntSet.add(a)
Buffer = int(a)
for i in range(1,1000000+1):
    if Buffer%2 == 0:
        Buffer = b(Buffer)
        Counter+=1
    else:
        Buffer = c(Buffer)
        Counter+=1
    if Buffer in IntSet:
        print(Counter+1)
        break
    else:
        IntSet.add(Buffer)
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

h = int(input())
w = int(input())
n = int(input())

a = 0
c = 0

if h > w:
    m = h
else:
    m = w
    
while a < n:
    a += m
    c += 1
    
print(c)
# Judge status: Wrong Answer
L = int(input())

ans = 0
for x in range(L):
    for y in range(L):
        z = L - (x+y)
        if z > 0:
            ans = max(ans,x*y*z)
print(ans)
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))

z=sorted(x)
r=z[n//2]
l=z[n//2-1]
for i in x:
    if i<r:
        print(r)
    else:
        print(l)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, c, k = map(int, input().split())
    T = sorted(list(int(input()) for _ in range(n)))
    res = 0
    cnt = 0
    dep = T[0] + k
    for i in range(n):
        if cnt == c or T[i] > dep:
            res += 1
            cnt = 1
            dep = T[i] + k
        else:
            cnt += 1

    print(res + 1)


if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
def xor(x):
    for i in range(len(x)-1):
        x[i+1]=x[i]^x[i+1]
    return x[len(x)-1]
N=int(input())
a=list(map(int,input().split()))
num=xor(a)
for i in range(N):
    A=[num,a[i]]
    print(xor(A),end=" ")
# Judge status: Accepted

a, b, c, d = map( int, input().split() )
#print( a, b, c, d )
 
for i in range( 200 ):
    c = c - b
    if c <= 0:
        print( "Yes" )
        exit()
 
    a = a - d
    if a <= 0:
        print( "No" )
        exit()
# Judge status: Accepted
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007
INF = 122337203685477580


def solve():

    A,V = map(int, input().split())
    B,W = map(int, input().split())
    T = int(input().rstrip())
    if(B < A):
        V *= -1
        W *= -1
    if (A-B)*(A + T*V - B -T*W) <= 0:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    solve()
# Judge status: Accepted
s=input()
l=len(s)
for i in range(1,l//2):
    k=(l-i*2)
    if s[:k//2]==s[k//2:k]:
        print(k)
        break
# Judge status: Accepted
x = input()
if x == "7" or x == "5" or x == "3":
  print("YES")
else:
  print("NO")
# Judge status: Accepted
def main():
    n = int(input())
    l_list = list(map(int, input().split()))

    sum_l = sum(l_list)
    max_l = max(l_list)

    if max_l < sum_l - max_l:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
Q,H,S,D = map(int, input().split())
N = int(input())
a = N//2 * 2
k =  min(a*Q*4, a*H*2, a*S, a*D//2)
if N%2 == 1:
    k += min(Q*4, H*2, S)
print(k)
# Judge status: Accepted
r,g,b=map(int,input().split())
print("YES" if (r*100+g*10+b)%4==0 else "NO")
# Judge status: Wrong Answer
A, B, K = map(int, input().split())

# for i in range(K):
#     if A > 0:
#         A -= 1
#     elif B > 0:
#         B -= 1

if A >= K:
    A -= K
elif A+B >= K:
    A = 0
    B -= K-A

if B < 0:
    B = 0

print(A, B)
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())
if abs(a - b) > 1e18:
    print("Unfair")
elif k % 2 == 0:
    print(b - a)
else:
    print(a - b)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
c = 0
for i in range(n):
    if i%2 != 0 and a[i] %2 != 0:
        c +=1
print(c)
# Judge status: Accepted
n,m = map(int, input().split())

boxl = [1]*(n+1)
redl = [False]*(n+1)
redl[1] = True

for _ in range(m):
    x,y = map(int, input().split())
    if redl[x]:
        redl[y] = True
    if boxl[x] == 1:
        redl[x] = False
    boxl[x] -= 1
    boxl[y] += 1

ans = 0
for r in redl:
    if r: ans += 1

print(ans)