peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a, b, k = map(int, input().split())
if a >= k:
    a -= k
else:
    b = max(0,k - a)
    a = 0
print(a, b)
# Judge status: Accepted
def main():
    n = int(input())
    v = [int(val) for val in input().split()]
    v.sort()
    
    ans = (v[0] + v[1]) / 2
    for i in range(2, n):
        ans = (ans + v[i]) / 2
    print(ans)

main()
# Judge status: Wrong Answer
N,M = map(int, input().split())
an_li = list(map(int, input().split()))
an_li.remove(an_li[0])
for i in range(N-1):
    li = list(map(int, input().split()))
    li.remove(li[0])
    for t in an_li:
        if t in li:
            a = 1
        else:
            an_li.remove(t)
print(len(an_li))
# Judge status: Wrong Answer
S=input()
cnt=0
for i in range(len(S)//2-1):
  if S[i]!=S[-1*i]:
    cnt+=1
print(cnt)
# Judge status: Accepted
a,b,c = map(int,input().split())
print(max(10*a+b+c, a+10*b+c, a+b+10*c))
# Judge status: Accepted
menu = [int(input()) for _ in range(5)]

wait = []
for i in menu:
    w = i
    n = max(len(str(i)),2)
    while w % 10 != 0:
        w += 1
    wait.append([i,(w-i)%(10**(n-1))])
wait.sort(key=lambda x: x[1])
time = 0
for i in range(len(wait)):
    time += wait[i][0]
    if time % 10 != 0 and i != len(wait)-1:
        time += wait[i][1]
print(time)
# Judge status: Wrong Answer
a = input()
if a == 1:
    print(0)
else:
    print(1)
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
for _ in range(k):
	if b <= a:
		b *= 2
	else:
		c *= 2
if a < b < c:
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
n = list(input())

for k in range(0,10):
  head = int(''.join(n[:2]))-k
  
  tmp = str(head)
  tmp = list(tmp)
  
  if len(tmp) == 1:
    break
  elif int(tmp[1]) <= 8:
    continue
  else:
    break

#print(tmp)

if n[:2] == tmp:
  tmp.append(8)
  for i in range(len(n)-3):
    tmp.append(9)
else:  
  for i in range(len(n)-2):
    tmp.append(9)

#print(tmp)  
  
ans = 0  
  
for j in range(len(tmp)):
  ans += int(tmp[j])
  
print(ans)
# Judge status: Accepted
mod = 10**9+7
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(60):
    cnt = 0
    for j in range(N):
        cnt += (A[j]>>i)&1
    ans = (ans+(((N-cnt)*cnt)%mod)*2**i)%mod
print(ans)
# Judge status: Accepted
import bisect
n = int(input())
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        a = bisect.bisect(l, l[i]+l[j]-1)
        ans += (a-j-1)
print(ans)
# Judge status: Accepted
n=int(input())
P=list(map(int,input().split()))
A=sorted(P)
count=0
for i in range(n):
    if P[i]!=A[i]:
        count+=1
print("YES" if count<=2 else "NO")
# Judge status: Accepted
abc_list = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

if __name__ == '__main__':
	w = input()
	w = [s.split()[0] for s in w]

	check = 0
	
	for i in abc_list:
		if w.count(i) % 2 != 0:
			check = 1
			break

	if check == 0:
		print('Yes')
	else:
		print('No')
# Judge status: Wrong Answer
N = int(input())
Monster = list(map(int, input().split()))
Brave = list(map(int, input().split()))
cnt = 0
amari = 0

for i in range(N):
    cnt += min(Monster[i], Brave[i]+amari)
    
    if (Brave[i]+amari > Monster[i]):
        amari = Brave[i]+amari - Monster[i]    
        
cnt += min(amari, Monster[N])
print(cnt)
# Judge status: Wrong Answer
def lower(n, hli):

    hli.reverse()
    ans = 0
    count = 0

    for i in range(n-1):
        if hli[i] <= hli[i+1]:
            count += 1
        else:
            ans = max(ans, count)
            count = 0

    return ans

def main():
    n = int(input())
    hli = list(map(int, input().split()))
    print(lower(n, hli))

if __name__ == '__main__':
    main()
# Judge status: Accepted
Q, H, S, D = map(int, input().split())
N = int(input())

smin = min(4 * Q, 2 * H, S)
if D < 2 * smin:
    print((N // 2) * D + (N % 2) * smin)
else:
    print(N * smin)
# Judge status: Wrong Answer
l = list(map(int, input().split()))

N = l[0]
K = l[1]

s = list(map(int, input().split()))
number = [0,1,2,3,4,5,6,7,8,9]
not_in = []

for i in range(10):
  if i not in s:
    not_in.append(i)
    
result = ""
for i in str(N):
  for j in not_in:
    if int(i) <= j:
      result += str(j)
      break
print(result)
# Judge status: Accepted
a = input()
print("Yes" if '9' in a else "No")
# Judge status: Accepted
def right(a,n):
    sw = [0]*(n+1)
    for x,y in enumerate(a):
        x_min = max(0,x-y)
        x_max = min(n,x+y+1)
        sw[x_min] += 1
        sw[x_max] -= 1
    s = 0
    for i in range(n):
        s += sw[i]
        a[i] = s
    return a

n,k = map(int,input().split())
a = list(map(int,input().split()))
for i in range(min(k,50)):
    a = right(a,n)
a = [str(n) for n in a]
print(" ".join(a))
# Judge status: Wrong Answer
S = list(input())
N = len(S) + 1

mn = 0
a = 0
ans = 0
for s in S:
  if s == '<':
    a += 1
  elif s == '>':
    a -= 1
    mn = min(mn,a)    
  
  ans += a
  
ans -= mn * N
print(ans)
# Judge status: Accepted
import sys


def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    d = list(map(int,input().split()))
    d.sort()
    print(d[N//2]-d[N//2-1])




if __name__ == "__main__":
    main()
# Judge status: Accepted
k,a,b = map(int,input().split())
# first
cost = 0
# 2回でb-a枚ふやせる
if b-a <= 2 or k < a-1:
    print(k+1)
else:
    res = a
    k -= a-1
    if k%2 == 1:
        res += 1
        k -=1
    res += (b-a)*(k//2)
    print(res)
# Judge status: Wrong Answer
n=int(input())
li=list(map(int, input().split()))
ans="Yes"
for i in range(n):
  for j in range(i+1, n):
    if li[i]==li[j]:
      ans="No"
      break
  else:
    continue
  break
print(ans)
# Judge status: Accepted
A,B = map(int,input().split())
ans=-1
for i in range(1,1001):
  if i*0.08//1==A and i*0.1//1==B:
    ans=i
    break
print(ans)
# Judge status: Wrong Answer
mod = 7+10**9
def ncr(n,c,mod):
  x = 1
  y = 1
  for i in range(n-c+1,n+1):
    x = x*i%mod
  for j in range(1,c+1):
    y = y*j%mod
  return (x * pow(y, mod-2, mod)) % mod

n, a, b = map(int, input().split())
al = pow(2, n, mod) -1
acr = ncr(n, a, mod)
bcr = ncr(n, b, mod)
print(al-(acr+bcr)%mod)
# Judge status: Accepted
def main():
    N, K, S = list(map(int, input().split()))

    salt = -1 if S >= 10**9 else 1
    if K == 0:
        arr = [S+salt] *N
    else:
        arr = [] 
        for i in range(0, K):
            arr += [S]
        while len(arr) < N:
                arr += [S+salt]

    print(' '.join(map(str,arr)))

if __name__ == "__main__":
    main()
# Judge status: Accepted
c = input()
arr = list("a b c d e f g h i j k l m n o p q r s t u v w x y z".split())

for i in range(25):
    if c == arr[i]:
        print(arr[i+1])
# Judge status: Accepted
import math 

a,b,x=map(int,input().split())
if x>=(a**2*b)/2:
  sita=math.degrees(math.atan((b/a-x/a**3)*2))
else:
  sita=math.degrees(math.atan(b**2*a/(2*x)))
print(sita)
# Judge status: Accepted
d = int(input())
if d == 25:
    print('Christmas')
elif d == 24:
    print('Christmas Eve')
elif d == 23:
    print('Christmas Eve Eve')
else:
    print('Christmas Eve Eve Eve')
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
c = Counter(map(int, input().split()))
c = sorted(c.items())


ans = max(c[0][1], c[len(c)-1][1])
if len(c) <= 2:
    print(ans)
    exit()

for i in range(1, len(c)-1):
    cnt = c[i][1]
    if c[i+1][0] - c[i][0] == 1:
        cnt += c[i+1][1]
    if c[i][0] - c[i-1][0] == 1:
        cnt += c[i-1][1]
    ans = max(cnt, ans)

print(ans)
# Judge status: Wrong Answer
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=0
d=0
# print(d)
while cnt<len(listl):
    d = d+listl[cnt]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)
# Judge status: Wrong Answer
X = int(input())
if (1800 <= X < 2000):
  print("1級")
elif (1600 <= X < 1800):
  print("2級")
elif (1400 <= X < 1600):
  print("3級")
elif (1200 <= X < 1400):
  print("4級")
elif (1000 <= X < 1200):
  print("5級")
elif (800 <= X < 1000):
  print("6級")
elif (600 <= X < 800):
  print("7級")
elif (400 <= X < 600):
  print("8級")
# Judge status: Accepted
from collections import deque
N,M=map(int,input().split())

G=[[] for i in range(N)]
for i in range(M):
  a,b=map(int,input().split())
  G[a-1]+=[b-1]
  G[b-1]+=[a-1]
que=deque([0])
visited=[-1 for i in range(N)]
visited[0]=0
dokokara=[0 for i in range(N)]
while len(que)>0:
  v=que.popleft()
  for i in G[v]:
    if visited[i]!=-1:
      continue
    else:
      visited[i]+=1
      dokokara[i]=v
      que.append(i)


print("Yes")
for i in range(1,N):
  print(dokokara[i]+1)
# Judge status: Accepted
import sys

n = int(input())

if n == 0:
    print("0")
    sys.exit(0)

sum = 0
ans = ""

count = 0
d = 1

while n != sum:
    mod = (n - sum) % (d * 2)
    # print("count/d/mod %d/%d/%d" % (count, d, mod))

    if mod != 0:
        ans = "1" + ans
        sum += d * (1 if count % 2 == 0 else -1)
    else:
        ans = "0" + ans

    count += 1
    d *= 2

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

if A <= C and B >= C:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = input()
ans = False
for i in s[::2]:
    if i == "L":
        ans = True
for i in s[1::2]:
    if i == "R":
        ans = True
if ans:
    print("No")
else:
    print("YES")
# Judge status: Accepted
a,b,c=map(int,input().split())
x = 100*a+10*b+c
if x%4==0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
nums = list(map(int, input().split()))
nums.sort()
print(int((nums[0] * nums[1])/2))
# Judge status: Accepted
import math

N = int(input())

t1 = 1

for i in range(2, int(math.sqrt(N)) + 1):
    if N % i == 0:
        t1 = i

t2 = N // t1

print(t1 + t2 - 2)
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int, input().split()))

c = collections.Counter(a)
for k in range(1,n+1):
    print(c[k])
# Judge status: Accepted
c=sum(a:=[*map(int,[*open(s:=0)][1].split())])
b=1
for a in a:s=-(b<a)or s+b;b=min(c:=c-a,(b-a)*2)
print(s)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int,input().split()))
cnt = [0]*(n+1)
ans = []
for i in range(n,0,-1):
    a = A[i-1]
    s = 0
    for j in range(n//i):
        idx = i*j
        s+=cnt[idx]

    if s%2==0:
        cnt[i] = a
    else:
        cnt[i] = 1-a

    if cnt[i] ==1:
        ans.append(i)
m = sum(cnt)

print(m)
print(*ans)
# Judge status: Wrong Answer
n = int(input())
s = list(input())
half = int(n/2)

max1 = 0
for i in range(half):
  f = set(s[:half-i])
  b = set(s[half-i:])
  union = len(f&b)
  if max1 <= union:
    max1 = union
  else:
    break

max2 = 0
for i in range(1,half+1):
  f = set(s[:half+i])
  b = set(s[half+i:])
  union = len(f&b)
  if max2 <= union:
    max2 = union
  else:
    break
    
ans = max1 if max1>max2 else max2
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a >= 9 or b >= 9:
    print(":(")
elif a <= 8 and b <= 8:
    print("Yay")
# Judge status: Wrong Answer
N, M = map(int, input().split())
PY = [list(map(int, input().split())) for _ in range(M)]

A = [[] for _ in range(N+1)]

for i, py in enumerate(PY):
    A[py[0]].append([py[1], i])

City = []
for i in range(N+1):
    A[i] = sorted(A[i])
    for j, a in enumerate(A[i]):
        pref = i
        city = j
        City.append([a[1], str(pref).zfill(6) + str(city).zfill(6)])

City = sorted(City)
for city in City:
    print(city[1])
# Judge status: Wrong Answer
import math

n,k = map(int, input().split())
hlist = input().split()
hlist.sort()

sum = 0
for i in range(n-k):
  sum = sum + int(hlist[i])
print(sum)
# Judge status: Accepted
x=int(input())
y=[7,5,3]
print('YES' if x in y else 'NO')
# Judge status: Wrong Answer
a = int(input())

if a%2 == a:
  print(a/2)
else:
  print(a//2 + 1)
# Judge status: Wrong Answer
X=int(input())
l=[]
for y in range(1,X//2+2):
	if X%y==0:
		l.append(y)
K=len(l)
A=-1
for y in range(0,K):
	KKK=0
	A=0
	while KKK<X:
		A=A+1
		KKK=A**5-(A-l[y])**5
	if KKK==X:
		print(A,A-l[y])
		break
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=input()
ans=s[k-1]+s[k-1].lower()+s[k:]
print(ans)
# Judge status: Accepted
N, M = map(int, input().split(" "))

a = list(set(map(int, input().split(" "))))
g = a.copy()

while not any(x%2 for x in g): g = [i //2 for i in g]

if not all(x%2 for x in g): print(0); exit(0)

def gcd(a, b):

    while b:

        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)


tot = 1

for x in a: tot = lcm(tot, x//2)
print((M//tot+1)//2)
# Judge status: Wrong Answer
S = str(input())
T = str(input())
S=sorted(S)
T=sorted(T, reverse=True)
if S < T:
    print(S)
    print(T)
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# B - Papers, Please
# https://atcoder.jp/contests/abc155/tasks/abc155_b

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

even = 0
cnt = 0

for i in a:
    if i % 2 == 0:
        even += 1
        if i % 3 == 0 or i % 5 == 0:
            cnt += 1

if even == cnt:
    print('APPROVED')
else:
    print('DENIED')
# Judge status: Wrong Answer
c = input()
if c == 'a' or 'i' or 'u' or 'e' or 'o':
  print('vowel')
else:
  print('consonant')
# Judge status: Wrong Answer
from collections import deque
import bisect
x,y=map(int,input().split())
citylist=deque([deque() for x in range(x)])
inputlist=deque()
arucity=deque()
old=0
for a in range(y):
    s,t=map(int,input().split())
    citylist[s-1].append(t)
    inputlist.append(s)
    inputlist.append(t)
    if old != s:
        arucity.append(s)
        old = s

for a in arucity:
    citylist[a-1]=sorted(citylist[a-1])
for b in range(y):
    e=inputlist.popleft()
    print("{:06}{:06}".format(e,(bisect.bisect(citylist[e-1],inputlist.popleft())+1)))
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n > k:
    print(k*x+(n-k)*y)
else:
    print(n*x)
# 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

n=int(input())
P=list(map(int,input().split()))
i=0
while i<n:
    if P[i]==i+1:
        i+=1
        count+=1
    i+=1
print(count)
# Judge status: Accepted
a,b,c=sorted(map(int,input().split()))
print(["NO","YES"][a==b==5 and c==7])
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

cnt1=0
cnt2=0
cnt4=0

for i in a:
  if i%2==1:
    cnt1+=1
  elif i%4==0:
    cnt4+=1
  elif i%2==0:
    cnt2+=1

if cnt2!=0:
  if cnt4>=cnt1:
    print('Yes')
  else:
    print('No')
else:
  if cnt4+1>=cnt1:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
s = input()
t = input()

if len(s) + 1 == len(t) and s in t:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(500):
    ans=[0]*(n)
    for j in range(n):
        l=max(0,j-a[j])
        r=j+1+a[j]
        ans[l]+=1
        if r<n:
            ans[r]-=1
    for z in range(n-1):
        ans[z+1]+=ans[z]
    a=ans
print(" ".join(list(map(str,ans))))
# Judge status: Accepted
a, b, c = map(int, input().split())
if c <= (b - a + 1) // 2:
  for i in range(a, a+c):
    print(i)
  for i in range(b-c+1, b+1):
    print(i)
else:
  for i in range(a, b+1):
    print(i)
# Judge status: Accepted
def ss():
    N,Q = list(map(int,input().split()))
    s = input()
    lis=[0]*N
     
    count = 0
    for i in range(1,len(s)):
        if s[i-1] == 'A' and s[i] == 'C':
            count +=1
        lis[i]+=count
    for i in range(Q):
        l,r = list(map(int,input().split()))
        print(lis[r-1]-lis[l-1])

ss()
# Judge status: Wrong Answer
N = int(input())
S = {}
for i in range(N):
    s = input()
    if s not in S:
        S[s] = 1
        continue
    S[s] +=1
    

M = int(input())
T = {}
for i in range(M):
    t = input()
    if t not in T:
        T[t] = 1
        continue
    T[t] += 1

ans = 0
for key in S.keys():
    if key not in T:
        continue
    ans = max(ans, S[key] - T[key])
print(ans)
# Judge status: Accepted
n = int(input())
print(n // 2 / n if n % 2 == 0 else (n // 2 + 1) / n)
# Judge status: Accepted
N = int(input())
max1 = [0,[]]
max2 = 0
for i in range(N):
  a = int(input())
  if a > max1[0]:
    max2 = max1[0]
    max1[0] = a
    max1[1] = [i]
  elif a == max1[0]:
    max1[1].append(i)
  elif a > max2:
    max2 = a

if len(max1[1]) == 1:
  max1_idx = max1[1][0]
  for i in range(0,max1_idx):
    print(max1[0])
  print(max2)
  for i in range(max1_idx + 1 , N):
    print(max1[0])
else:
  for i in range(N):
    print(max1[0])
# Judge status: Wrong Answer
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
  
x=int(input())
while True:
  if is_prime(x)==True:
    break
  x+=1
print(x)
# Judge status: Wrong Answer
import sys
N = int(input())

ans = []

if N == 1:
    print(1)
    sys.exit()

for i in range(1, N):
    n = N - i
    if n != 0 and n <= i:
        continue
    N = n
    ans.append(i)
    if n == 0:
        break

print(*ans, sep='\n')
# Judge status: Accepted
n   = int(input())
p = list(map(int, input().split()))

# 初期化
cnt = 1
min = p[0]
# カウント処理
for i in range(1, n):
  if(p[i] <= min):
    cnt += 1
    min = p[i]

print(cnt)
# Judge status: Accepted
#!/usr/bin/python3
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
a_list = list(map(int, input().split()))
sum_a = sum(a_list)
count = 0

for a in a_list:
    if a < sum_a / (4 * m):
        continue
    else:
        count += 1

if count >= m:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
a=0
if n<=2:
    print(n)
elif n<4:
    print(2)
else:
    for i in range(n//2):
        if 2**a<=n:
            a+=1
        else:
            break
    print(2*(a-1))
# Judge status: Wrong Answer
X,Y=list(map(int, input().split()))
present=[X]
i=0
while present[i]<Y:
    present.append(present[i]*2)
    i=i+1

print(len(present)-1)
# Judge status: Accepted

def Sol(arr):
    
    print(len(set(arr)))
    return

    

#for t in range(int(input())):
#n,k,d,c = map(int,input().split())
n = int(input())
arr = []
for i in range(n):
    arr.append(input())
#arr = list(map(int,input().split()))
#k = input()
#n = int(input())
Sol(arr)
# Judge status: Accepted
a=list(map(int,input().split()))

if a.count(5)==2 and a.count(7)==1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
judg=True
while(judg==True):
    a-=d
    if a<=0:
        judg = False
        break
    c-=b
    if c<=0:
        judg = False
        break
if a<=0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
import fractions
def lcm(a,b):
    return a*b//fractions.gcd(a,b)

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

P=[c,d,lcm(c,d)]
A=[]
for p in P:
    if a%p==0:
        left=a//p
    else:
        left=a//p+1
    right=b//p
    if left<=right:
        A.append(right-left+1)
    else:
        A.append(0)
print(b-a+1-A[0]-A[1]+A[2])
# Judge status: Accepted
import math
a,b,h,m = map(int,input().split())

hr = h*30+m/2
mr = m*6
r = abs(hr-mr)
r = min(r, 360-r)

ans = a**2 + b**2 - 2*a*b*math.cos(math.radians(r))

print(math.sqrt(ans))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
count = 1
skip = False
for i in range(0, N-3):
    if not skip:
        before = A[i+1] - A[i]
        after = A[i+2] - A[i+1]
        if ((before > 0) - (before < 0))*((after > 0) - (after < 0)) == -1:
            count += 1
            skip = True
    else:
        skip = False
print(count)
# Judge status: Accepted
s = input()

w_l = s.split('S')
print(max([m for m in map(len, w_l)]))
# Judge status: Accepted
from sys import stdin

n = int(stdin.readline().rstrip())

mi = 10**10

for i in range(1,n):
    a = str(i)
    b = str(n-i)
    point = 0
    for i in a:
        point += int(i)
    for j in b:
        point += int(j)
    mi = min(point,mi)
print(mi)
# Judge status: Accepted
N=int(input())

X=1
while X<=N:
    X*=2
print(X//2)
# Judge status: Wrong Answer
N = int(input())
x = 111
while N < x:
    x += 111
print(x)
# Judge status: Accepted
import math
a, b = map(int, input().split())
a1 = a+1
b1 = b+1
A = a/0.08
A1=a1/0.08
B = b/0.1
B1 = b1/0.1

ans1 = set(i for i in range(math.ceil(A), math.floor(A1)))
ans2 = set(j for j in range(math.ceil(B), math.floor(B1)))

if ans1 & ans2 == set():
    print(-1)
else:
    ans = ans1&ans2
    print(min(list(ans)))
# Judge status: Wrong Answer
N = int(input())
A = [0] * (N + 1)
B = [0] * (N + 1)

count = 0

for i in range(1, N + 1):
  A[i], B[i] = map(int, input().split())

if N % 2 == 1:
  centerA = A[(N + 1) // 2]
  centerB = B[(N + 1) // 2]
else:
  centerA = (A[N // 2] + A[N // 2 + 1]) / 2
  centerB = (B[N // 2] + B[N // 2 + 1]) / 2

#print(centerA, centerB)  

if N % 2 == 1:
  count = centerB - centerA + 1
else:
  count = int(centerB * 2) - int(centerA * 2) + 1

print(int(count))
# Judge status: Wrong Answer
n,k=map(int,input().split())
h=[int(i) for i in input().split()]
h.sort
a=0
if n-k<=0:
  print(0)
else:
  for j in range(n-k):
    a+=h[j]
  print(a)
# Judge status: Accepted
N = int(input())
List = [list(map(int,input().split(" "))) for i in range(N)]
List.sort(key=lambda x: x[1])

time = 0
for i in range(N):
  time += List[i][0]
  if time > List[i][1]:
    print("No")
    break
else:
  print("Yes")
# Judge status: Wrong Answer
S,T = list(map(str,input().split()))
A,B = list(map(int,input().split()))
U = input()


if U == 'red':
    print(A-1,B)
else:
    print(A,B-1)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

sa = input()
sb = input()
sc = input()

sa = list(sa)
sb = list(sb)
sc = list(sc)

dic = {"a":sa,
       "b":sb,
       "c":sc}
#print(dic)

player_selected = "a"

while(True):
    tmp = dic[player_selected][0]
    #print("remove: ", tmp)
    dic[player_selected].remove(tmp)

    try:
        player_selected = dic[player_selected][0]
        #print("player_selected :", player_selected)
    except: #エラーが起きた場合
        break

print(player_selected.upper())
# Judge status: Accepted
# -*- coding: utf-8 -*-

#----------
s = input().strip()
#----------

s_list=s.split()
print(s_list[0][0] + s_list[1][0] + s_list[2][0])
# Judge status: Wrong Answer
tt = [int(input()) for i in range(5)]
ll = [10*i for i in range(14)]
ans = []
at = bt = ct = dt = et = 0
for t in tt:
    i = 0
    while t > ll[i]:
        print(t, ll[i])
        i+=1
    ans.append(ll[i])

max = 0
dex = 0
for i in range(5):
    if ans[i] - tt[i] > max:
        dex = i
        max = ans[i]-tt[i]
at = 0
for j in range(5):
    if j != dex:
        at += ans[j]
    if j == dex:
        at += tt[j]

print(at)
# Judge status: Accepted
s, t = raw_input(), raw_input()
def check(a,b):
	if len(a) != len(b): return False

	for u,v in zip(a,b):
		if u != v and u != '?':
			return False
	return True
cand = -1
for i in range(len(s)):
	if check(s[i:i + len(t)],t): cand = i

print (s[:cand].replace('?', 'a') + t + s[cand+len(t):].replace('?','a')) if cand != -1 else 'UNRESTORABLE'
# Judge status: Wrong Answer
h,w = map(int, input().split())
if (h*w %2 ==0):
  print(h*w/2)
else:
  print(((h*w)/2) +1)
# Judge status: Accepted
from sys import stdin, stdout

s = stdin.readline().strip('\n')
al = [True for i in range(26)]
for i in s:
  al[ord(i) - 97] = False
for i in range(97, 123):
  if al[i - 97]:
    stdout.write(str(chr(i)) + '\n')
    break
else:
  stdout.write('None\n')
# Judge status: Wrong Answer
x, y = (int(x) for x in input().split())
from numpy import log2
ans = int(log2(y/x+1)) + 1
print(ans)
# Judge status: Wrong Answer
import sys
def read_string(row):
    return row().rstrip()

def read_int(row):
    return int(row().rstrip())
  
row = sys.stdin.readline
a = read_int(row)
s = read_string(row)

print("red" if a >= 3200 else s)
# Judge status: Accepted
a,b = map(int,input().split())
if a*b%2 == 1:
    print("Odd")
else:
    print("Even")
# Judge status: Wrong Answer
w, h, x, y = map(int, input().split())
ans1 = w*h/2
if x % 2 != 0 or y % 2 != 0:
    print(ans1, 0)
elif x == w//2 and y == h//2:
    print(ans1, 1)
else:
    print(ans1, 0)