peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def main():
    s, t = input(), input()

    for _ in range(len(s) - 1):
        if s == t:
            print("Yes")
            break
        s = s[-1] + s[:-1]
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n,p = map(int,input().split())
a = list(map(int,input().split()))
odd = 0
even = 0
for ai in a:
    if(ai%2==0):
        even += 1
    else:
        odd += 1

if(p==1)&(odd==0):
    print(0)
elif(p==1)&(even==0):
    print(2**n)
else:
    print(2**(n-1))
# Judge status: Wrong Answer
N=int(input())
s=str(input())
t=str(input())
c=0
tmp=0
S=list(s)
T=list(t)
for i in range(N):
    if s[N-i-1:N-1]==t[0:i]:
        c=i+1
print(2*N-c)
# Judge status: Accepted
N,K = map(int,input().split())
p = [int(x) for x in input().split()]

cnt = 0

for i in range(K):
    cnt += p[i]
ans = cnt
for i in range(1,N-K+1):
    cnt -= p[i-1]
    cnt += p[K+i-1]
    ans = max(cnt,ans)


print((ans+K)/2)
# Judge status: Accepted
a, b, c, d = map(int,input().split())

if abs(a-c) <= d:
  print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
x = min([int(input()) for _ in range(5)])

a, b = divmod(n, x)
if b == 0:
    print(5+(a-1))
else:
    print(5+a)
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = list(map(int, input()))
ans = sum(n)
s = 0
for i,num in enumerate(n):
    if num>=1:
        ans = max(ans, s + (num-1) + 9*(len(n)-i-1))
    s += num
print(ans)
# Judge status: Wrong Answer
import math
n,m = map(int,input().split())
ans = 1
for i in range(2,math.ceil(math.sqrt(m))):
    if m % i == 0:
        if m // i >= n:
            ans = i
print(ans)
# Judge status: Wrong Answer
# N回ループで、ABCのうち最大を選択、記録して翌日はABCのうち前日と異なる最大値
N = int(input())
H = [0]*N
abc = list(map(int, input().split()))
H[0] = max(abc)
k = abc.index(H[0])
for i in range(1, N):
    abc = list(map(int, input().split()))
    # kは前日に選択した0,1,2のいずれかとして
    H[i] = max(abc[k-1],abc[(k+1)%3])
    k = abc.index(H[i])
print(sum(H))
# Judge status: Wrong Answer
def main():
    n = int(input())
    a = [list(input().split()) for i in range(n)]
    s = sorted(a, key=lambda x:(x[0],-int(x[1])))
    for i in a:
        print(s.index(i)+1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
N = int(input())
x = list(map(int, input().split()))
y = []
if N%2 == 0:
    for i in range(N//2):
        y.append(x[N-1-2*i])
    for i in range(N//2):
        y.append(x[2*i])
if N%2 == 1:
    for i in range(math.ceil(N/2)):
        y.append(x[N-1-2*i])
    for i in range(math.floor(N/2)):
        y.append(x[2*i+1])
print(*y)
# Judge status: Wrong Answer
a, b = map(int, input().split())


if a < 0 and b > 0:
    print("Zero")

elif a > 0:
    print("Positive")

elif b < 0 and a < 0:
    if abs(a) + abs(b) % 2 == 0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Accepted
n, m = map(int, input().split())
if n == m == 1:
    print(1)
elif n == 1 or m == 1:
    print(n*m-2)
else:
    print((n-2)*(m-2))
# Judge status: Wrong Answer
def resolve():
    N = int(input())
    v = list(map(int, input().split()))
    V = sorted(v)
    one = (V[0]+V[1])/2
    ans = [one]
    for i in range(2, N):
        ans.append((one+V[i])/2)
    print(max(ans))
resolve()
# Judge status: Wrong Answer
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

W, H, x, y = rl()

area = H*W*0.5
flag = 0
if x+x == W or y+y == H:
	flag = 1
print(area, flag)
# Judge status: Wrong Answer
import random

D = int(input())
c_list = list(map(int, input().split()))
for i in range(D):
    S_list = list(map(int, input().split()))
for i in range(1,D+1):
    print(i)
    # print(random.randint(1,26))
# Judge status: Accepted
n = int(input())
s = input()
e = s.count("E")
w = n - e
ans = 10**9
if s[0] == "W":
    cnt = e
else:
    cnt = e-1
num = cnt
for i in range(n-1):
    if s[i] == s[i+1] and s[i] == "E":
        cnt -= 1
    elif s[i] == s[i+1]:
        cnt += 1
    ans = min(ans,cnt,num)
    ans = max(ans,0)
print(max(ans,0))
# Judge status: Accepted
n, m = map(int, input().split())
res1, res2 = 0, 0
l = [0] * (n + 1)

for _ in range(m):
    p, s = input().split()
    p = int(p)
    
    if l[p] == -1:
        continue

    if s == "AC":
        res1 += 1
        res2 += l[p]
        l[p] = -1
    else:
        l[p] += 1

print(res1, res2)
# Judge status: Accepted
def resolve():
    N = int(input())
    B = list(map(int, input().split()))
    array = [0 for _ in range(N)]
    prev = B[0]
    array[0] = B[0]
    for i in range(N-1):
        if prev <= B[i]:
            array[i+1] = B[i]
        else:
            array[i] = B[i]
            array[i+1] = B[i]
        prev = B[i]
    print(sum(array))

    
if '__main__' == __name__:
    resolve()
# Judge status: Accepted
x = input().split()
y = int(x[0])*int(x[1])
if y % 2:
  print("Odd")
else:
  print("Even")
# Judge status: Accepted
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, M = map(int, input().split())
# 文字列の入力
s = input()
t = s.split(" ")
sum = 0
for u in t:
    sum += int(u)
if sum > N:
    print(-1)
else:
    print(N-sum)
# Judge status: Accepted
n, x = map(int, input().split())
city = list(map(int, input().split()))
dist = [abs(c - x) for c in city]
#print(dist)
from fractions import gcd
from functools import reduce
ans = reduce(gcd, dist)
print(ans)
# Judge status: Accepted
H,W,N=[int(input()) for i in range(3)]
print(min((N+H-1)//H,(N+W-1)//W))
# Judge status: Accepted
N = int(input())

if N in (7,5,3):
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
import sys

[N] = [int(x) for x in sys.stdin.readline().split(" ")]

As = [int(x) - 1 for x in sys.stdin.readline().split(" ")]
Bs = [int(x) for x in sys.stdin.readline().split(" ")]
Cs = [int(x) for x in sys.stdin.readline().split(" ")]

prev = -999
result = 0
for i in range(N):
    a = As[i]
    print("a", a)
    result += Bs[a]
    print("b", Bs[a], result)
    if a == prev+1:
        result += Cs[prev]
        print("c", Cs[prev], result)
    prev = a

print(result)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
sum_of_A = sum(A)
ans = []
for a in A:
    ans.append((sum_of_A-a)^a)
print(" ".join(map(str, ans)))
# Judge status: Accepted
N, M = map(int, input().split())
d = [0]*M
for _ in range(N):
    K, *A = map(int, input().split())
    for a in A:
        d[a-1] += 1
print(d.count(N))
# Judge status: Accepted
s = input()
a = s.count("a")
b = s.count("b")
c = s.count("c")
k = (a > 0) + (b > 0) + (c > 0)
if k == 1:
  if len(s) >= 2:
    print("NO")
  else:
    print("YES")
  exit()
if k == 2:
  if len(s) == 2:
    print("YES")
  else:
    print("NO")
  exit()
minabc = sorted([a, b, c])[0]
a = max(0, a - minabc)
b = max(0, b - minabc)
c = max(0, c - minabc)
# print(a, b, c, k)
if a <= 1 and b <= 1 and c <= 1:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
def answer(N: int) -> int:
    answer = len([N])
    if answer <= 2:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
A = A.reshape((int(N/2), 2))[:,0] if N % 2 == 0 else np.append(A, 2, 100).reshape((int((N+1)/2), 2))[:, 0]
print((A % 2 == 1).sum())
# Judge status: Accepted
import sys,math,copy,queue,itertools,bisect
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))
N,K = LI()
ans = 0
for i in range(K,N+2):
    ans = (ans + (N*i - (i-1) * i // 2) - i*(i-1) // 2 +1) % MOD
print (ans)
# Judge status: Wrong Answer
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)][::-1]

count = 0

for i in range(n-1):
    if li[i][0]%li[i][1] != 0:
        count += li[i][1]-li[i][0]%li[i][1]
        li[i+1][0] += count
if li[-1][0]%li[-1][1] != 0:       
    count += li[-1][1]-li[-1][0]%li[-1][1]
print(count)
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())

big = 0
temp = 0

if h >= w:
  temp = h
  big = h
else:
  temp = w
  big = w

c = 1

for i in range(1000000):
  if big >= n:
    break
  big += temp
  c += 1

print(c)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, m = map(int, readline().split())
ipy = [[i] + list(map(int, readline().split())) for i in range(m)]

ipy.sort(key=lambda x: x[2])

c = [0] * n
l = []
for i, p, y in ipy:
    c[p - 1] += 1
    x = str(format(p, '06') + format(c[p - 1], '06'))
    l.append([i, x])

l.sort()
for i, v in l:
    print(v)
# Judge status: Accepted
s = str(input())
t = str(input())
z = 'No'
for i in range(len(s)):
    w = s[i:] + s[:i]
    if w == t:
        z = 'Yes'
        break
print(z)
# Judge status: Accepted
s = input()

if(len(s) % 2 == 0):
    s = s[:-2]
else:
    s = s[:-1]

while(s != ""):
    if(s[:len(s)//2] == s[len(s)//2:]):
        print(len(s))
        break
    s = s[:-2]
# Judge status: Accepted
S = int(input())
v = 10**9

y = S//v + (S < 10**18)
x = v*y - S

print(0, 0, 10**9, 1, x, y)
# Judge status: Wrong Answer
# coding: utf-8
from math import sqrt
a, b, c = map(int, input().split())
mod = 10**9 + 7
# if c**2 - 2*(a+b)*c + (a-b)**2 > 0:
# if a**2 + b**2 + c**2 >= 2 * (a*b + b*c + c*a):
if (a+b+c) ** 2 > 4*(a*b + b*c + c*a):
# T = sqrt(a*b + b*c + c*a) * 2
# if -T <= a+b+c <= T:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,d = map(int,input().split())
a = []
for i in range(n):
    x = list(map(int,input().split()))
    a.append(x)

c = 0  #count_all

for j in range(n-1):
    for k in range(j+1,n):
        distance = 0
        for l in range(d):
            distance += (abs(a[j][l]-a[k][l]))**2
        distance = distance**0.5

        if distance.is_integer() == True:
            c += 1

print(c)
# Judge status: Accepted
import bisect

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

ans = 0
for b in B:
    point_A = bisect.bisect_left(A, b)
    possible_A = point_A
    point_C = bisect.bisect_right(C, b)
    possible_C = N - point_C
    ans += possible_A * possible_C

print(ans)
# Judge status: Wrong Answer
a = sorted(list(map( int, input().split())))

s = 0
if len(set(a)) == 1 :
  print(0)
else :
  if a[0]+1<a[1]:
    s +=(a[1]-a[0])//2
    a[0] = 2*s+a[0]
    if a[0] == a[1]:
      s+= a[2] -a[1]
    else :
      s+= a[2]-a[1] +2
  else :
      s+= a[2]-a[1] +2
  print(s)
# Judge status: Wrong Answer
from math import factorial
def cmb(n,r):
  return factorial(n) / factorial(r) / factorial(n - r)

list = input().split()
N = int(list[0])
a = int(list[1])
b = int(list[2])
S = 0
x = 10**9 + 7
for i in range(1,N+1):
  if i != a and i != b:
    S += cmb(N,i)
  if S >= x:
    S += -x
print(S)
# Judge status: Accepted
mod = 10**9 + 7
n, a, b = map(int, input().split())
ans = pow(2, n, mod)-1

# a
x = 1
for i in range(n - a + 1, n + 1):
    x = (x*i) % mod
y = 1
for i in range(1, a + 1):
    y = (y*i) % mod

a_ans = x*pow(y, mod-2, mod)

x = 1
for i in range(n - b + 1, n + 1):
    x = (x*i) % mod
y = 1
for i in range(1, b + 1):
    y = (y*i) % mod
b_ans = x*pow(y, mod-2, mod)
print((ans - a_ans - b_ans) % mod)
# Judge status: Accepted
n=int(input())
if(n%9==0):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
x,a,b = map(int,input().split())

if b < a:
    print("delicious")
elif b - a > x:
    print("dangerous")
else:
    print("safe")
# Judge status: Accepted
def count_dict(mystring):
    d = {}
# count occurances of character
    for w in mystring: 
        d[w] = mystring.count(w)
    return d
    
w = str(input())

values = count_dict(w).values()

valmod2 = [int(i%2) for i in values]

if all(val ==0 for val in valmod2):
    print('Yes')
    
else:
    print('No')
# Judge status: Accepted
def solve():
    X = int(input())
    now = 100
    year = 0
    while now < X:
        now = now + now // 100
        year += 1
    print(year)

    
if __name__ == '__main__':
    solve()
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    A,B,X=map(int,input().split())
    YESNO(A<=X<=A+B)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer

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

p.sort()
print(p[:k])
# Judge status: Wrong Answer
import math
a=list(map(int,input().split()))
a.sort()
print(a)
cnt=0
if a[0]==a[1]==a[2]:
  print(0)
  exit()
if a[0]==[1]:
  print(a[2]-a[1])
  exit()
if a[1]==a[2]:
  if (a[2]-a[0])%2==0:
    print((a[2]-a[0])//2)
    exit()
  else:
    print(a[2]-a[0]+1)
    exit()
cnt+=a[2]-a[1]
a[0]+=cnt
if (a[2]-a[0])%2==0:
  cnt+=math.ceil((a[2]-a[0])/2)
else:
  cnt+=math.ceil((a[2]-a[0])/2+1)
print(cnt)
# Judge status: Wrong Answer
a,b,c=sorted(list(map(int,input().split())))
ans=c-b
if (c-a)%2==0:
  print(ans+(b-a)//2)
else:
  print(ans+(b-a)//2+2)
# Judge status: Wrong Answer
N = int(input())
for i in range(1,N+1):
  N *= i
print(N%(10**9+7))
# Judge status: Accepted
N, K = map(int, input().split())

print(0 if N%K == 0 else 1)
# Judge status: Accepted
num_s, *D,  = [list(map(int, s.split())) for s in open(0)] 
flag = 0
x, y = D[0], D[1]

max_x, min_y = max(x), min(y)

if max_x > min_y:
    flag += 1
else:
    for i in range(max_x  + 1, min_y + 1):
        if i > num_s[2] and i <= num_s[3]:
            break 
    else:
        flag += 1
if flag:
    print("War")
else:
    print("No War")
# Judge status: Accepted
n=int(input())
x,y=[],[]
for i in range(n):
    x_,y_=map(int,input().split())
    x.append(x_)
    y.append(y_)
for i in range(n-2):
    if x[i]==y[i] and x[i+1]==y[i+1] and x[i+2]==y[i+2]:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
s = input()
t = input()
if s == t[:len(t)-1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
B=A[:]
count=0
zero=0
for i in range(N):
  if(A[i]<0):
    count+=1
  elif(A[i]==0):
    zero+=1
for i in range(N):
  B[i]=abs(A[i])
if(zero==0 and count%2==1):
  print(sum(B)-2*min(B[0],B[-1]))
else:
  print(sum(B))
# Judge status: Accepted
n = int(input())
A = [int(i) for i in input().split()]
#3 2 2 4 1
B = [int(i) for i in input().split()]
#1 2 2 2 1

ans = 0
for i in range(n):
	ans = max(sum(A[:i+1])+sum(B[i:]),ans)

print(ans)
# Judge status: Accepted
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a=sorted(a)
S=sum(a)
if S%10!=0:
  print(S)
  exit()
else:
  for i in range(n):
    if (S-a[i])%10:
      print(S-a[i])
      exit()
print(0)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
mod = 1000000007
S = 0
_sum = 0
for i in range(N):
    S += A[i]
    S %= mod
for i in range(N):
    S -= A[i]
    if S<0:
        S += mod
    _sum += A[i]*S
    _sum %= mod

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

print((N ** 2 + N) / 2)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 5)


readline =sys.stdin.readline

def process():
    k,s = map(int,readline().rstrip().split())
    cnt=0

    for i in range(0,k+1):
        for j in range(0,k+1):
            z = s-(i+j)
            if z>=0 and z<=k:
                cnt+=1
    
    return cnt


print(process())
# Judge status: Accepted
n = int(input())

ans = 0

if n % 2 == 0:
    n //= 10
    for i in range(27):
        ans += n // 5 ** i

print(ans)
# Judge status: Wrong Answer
a = int(input())
if a < 1000:
  print('ABC' + str(a))
else:
  a = a - 999
  if a >= 100:
  	print('ABD' + str(a))
  elif a >=10:
    print('ABD0' + str(a))
  else:
    print('ABD00' + str(a))
# Judge status: Accepted
import sys
input = sys.stdin.readline
S = [0] + list(map(int, list(input())[: -1]))

dp = [[float("inf")] * 2 for _ in range(len(S) + 1)]
dp[-1][0] = 0
for i in range(len(dp) - 1, 0, -1):
  for j in range(2):
    if S[i - 1] + j <= 5:
      dp[i - 1][0] = min(S[i - 1] + j + dp[i][j], dp[i - 1][0])
    if S[i - 1] + j >= 5:
      dp[i - 1][1] = min(10 - (S[i - 1] + j) + dp[i][j], dp[i - 1][1])

print(min(dp[0]))
# Judge status: Wrong Answer
a, b, c, d = map(lambda x: int(x), input().split())

if a - c <= d:
  print('Yes')
elif abs(a - b) + abs(b - c) <= d:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, a, b, c, d = map(int, input().split())
s = input()

a -= 1
b -= 1
c -= 1
d -= 1

if '##' in s[a:max(c,d)+1]:
    print('No')
    exit()

if c < d:
    print('Yes')
else:
    if '...' in s[b-1:d+2]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
input = input().split()
count = 1
for i in input:
  if i == '0':
    print(str(count))
    break
  count = count + 1
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
if M % N == 0:
    print(M // N)
else:
    print(M % N)
# Judge status: Accepted
import fractions
a,b,c,d = map(int,input().split())
def calc(n,x,y):
    cnt = n // x
    cnt += n//y
    lcm = x*y//fractions.gcd(x,y)
    cnt -= n//lcm
    return n - cnt

print(calc(b,c,d)-calc(a-1,c,d))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

s = a[0]
t = sum(a) - a[0]

i = 0
ans = abs(s - t)
for i in range(1, n-1):
    s += a[i]
    t -= a[i]
    ans = min(ans, abs(s - t))
    i += 1
print(ans)
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

cnt = 0
for val in a[:-1]:
    x -= val
    if x < 0:
        break
    cnt += 1
if x == a[-1]:
    cnt += 1
print(cnt)
# Judge status: Accepted
def JudgeStatusSummary():

    num = int(input())

    list_result = []

    for n in range(num):
        result = str(input())
    
        list_result.append(result)
    
    print('AC x ', list_result.count('AC'))
    print('WA x ', list_result.count('WA'))
    print('TLE x ', list_result.count('TLE'))
    print('RE x ', list_result.count('RE'))


if __name__ == '__main__':
    JudgeStatusSummary()
# Judge status: Accepted
N = int(input())
p = list(map(int,input().split()))
count = 0

for i in range(N):
  if p[i] != i + 1:
    count += 1
    
if count <= 2:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
n,m=map(int,input().split())
if n*2>=m:
  print(m//2)
else:
  print(n+(m-2*n)//4)
# Judge status: Accepted
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: Wrong Answer
N,K = map(int, input().split())
X = [int(i) for i in input().split()]

ans = float("inf")

for left in range(N-K+1):
    right = left + K - 1
    if X[left] <=0 and X[right] <= 0:
        cur = X[left]
    elif X[left] >= 0 and X[right] >= 0:
        cur = X[right]
    else:
        if abs(X[left]) >= abs(X[right]):
            cur = abs(X[right]) * 2 + abs(X[left])
        else:
            cur = abs(X[left]) * 2 + abs(X[right])
    ans = min(ans, cur)

print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import numpy as np

n = int(input())
s = np.empty((n), dtype='str')
for i in range(n):
    s[i] = str(input())

s = np.unique(s)

print(len(s))
# Judge status: Wrong Answer
import numpy as np

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

# print(A)
ans = 0

for i in range(N):
    ans += sum((A + A[i]) - [abs(i - j) for j in range(N)] == 0)


print(ans / 2)
# Judge status: Accepted
a = list(map(int,input().split()))
a.sort()
if (a[1]-a[0]) % 2 == 0:
    print((a[1]-a[0])//2 + (a[2]-a[1]))
else:
    print((a[2]-a[1])//2 + (a[2]-a[1])%2 + (a[2]-a[0]+1)//2 + 1)
# Judge status: Accepted
S = input()
idx = len(S)
ans = 'YES'
while idx > 0:
    if S[idx-5:idx] == 'dream':
        idx -= 5
    elif S[idx-5:idx] == 'erase':
        idx -= 5
    elif S[idx-7:idx] == 'dreamer':
        idx -= 7
    elif S[idx-6:idx] == 'eraser':
        idx -= 6
    else:
        ans = 'NO'
        break
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
total = sum(S)

ans = 0 if total % 10 == 0 else total
for s in S:
    if (total - s) % 10 != 0:
        ans = max(ans, total - s)
    
print (ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
g = [1]
for i in range(n):
    g = g + [(g[-1]-a[i])*2]
print(g)
b = 0
t = 0
for i in range(n,-1,-1):
    if a[i]>g[i]:
        print(-1)
        break
    t = min(a[i]+t, g[i])
    b+=t
else:
  print(b)
# Judge status: Accepted
import bisect,copy,heapq,itertools,string
from collections import *
from math import *
import sys
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()
a = [LIST() for i in range(n)]
a.sort(key=lambda x:x[1])
time = 0
for i in range(n):
        time += a[i][0]
        if(time>a[i][1]):
                print("No")
                exit()
print("Yes")
# Judge status: Accepted
import math
n, k = map(int,input().split())
a = list(map(int, input().split()))

ans = math.ceil((n - 1) / (k - 1))
print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
S = [Counter(input()) for _ in range(n)]
ans = {}
for i in S[0].keys():
  ans[i] = min([s[i] for s in S])
  
print("".join(sorted([i*j for i, j in ans.items()])))
# Judge status: Accepted
x, y = input().split()
x = int(x)
y = int(y)

if x % y == 0:
    print(-1)
else:
    print(x * (y + 1))
# Judge status: Accepted
s=input()
t=input()
ans=[]
for i in range(len(s)-len(t)+1):
  for j in range(len(t)):
    if s[i+j]!=t[j] and s[i+j]!='?':break
  else:
    a=''
    for k in s[0:i]+t+s[i+len(t):]:
      if k=='?':a+='a'
      else:a+=k
    ans+=[a]
ans=sorted(ans)
if ans:print(ans[0])
else:print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)

if l[0] < sum(l[1:]):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s = list(input())
n = len(s)
k = int(input())

for i in range(n):
    x = ord(s[i]) - ord('a')
    if x == 0 or 26 -x > k: continue
    k -= 26 - x
    s[i] = 'a'

if k:
    s[-1] = chr((ord(s[-1]) - ord('a') + k) % 26 + ord('a'))

print(''.join(s))
# Judge status: Accepted
def minus(n):
  if n>=0:
    return 0
  else:
    return 1
N=int(input())
L=list(map(int,input().split()))
c=sum(list(map(minus,L)))
if c%2==0:
  t=sum(list(map(abs,L)))
  print(t)
else:
  L=list(map(abs,L))
  print(sum(L)-min(L)*2)
# Judge status: Accepted
X = int(input())
s = X // 500
a = X % 500
t = a // 5
print(s*1000 + t*5)
# Judge status: Accepted
A, B = map(int, input().split())

if A + B <= 23:
    print(A + B)
else:
    print((A + B) - 24)
# Judge status: Wrong Answer
n=int(input())
t=int(input())
print(3-n-t)
# Judge status: Wrong Answer
A, B, K = list(map(lambda x: int(x), input().split(" ")))
cd = []
for i in range(min([A,B])):
  if A % (i + 1) == 0 and B % (i + 1) == 0:
    cd.append(i+1)

print(cd[K - 1])
# Judge status: Accepted
A=int(input())
B=int(input())
C=int(input())
X=int(input())
ans=0
for i in range(0,A+1):
    for j in range(0,B+1):
        for k in range(0,C+1):
            if 500*i+100*j+50*k==X:
                ans+=1

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

L = [0] * (n + 1)

L[0] = 2; L[1] = 1
for i in range(2, n + 1):
    L[i] = L[i - 1] + L[i - 2]

print(L[n])