peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, M, X = map(int, input().split())
books = []
min_cost = float("inf")

for _ in range(N):
    books.append(list(map(int, input().split())))

for i in range(1, 2**N):
    i = format(i, '0{}b'.format(N))
    books_bought = [books[j] for j in range(N) if int(i[j])]
    cost = sum(book[0] for book in books_bought)
    experience = [sum(book[k] for book in books_bought) for k in range(1, len(books_bought[0]))]
    if sum(exp >= X for exp in experience) == M:
        min_cost = min(min_cost, cost)


if min_cost < float("inf"):
    print(min_cost)
else:
    print(-1)
# Judge status: Accepted
from itertools import groupby
n, a, b, c, d = map(int, input().split())
s = input()

g = groupby(s[a:c])
h = groupby(s[b:d])

for i, j in g:
    if i == "#" and len(list(j)) > 1:
        print("No")
        exit()

for i, j in h:
    if i == "#" and len(list(j)) > 1:
        print("No")
        exit()

if c < d:
    print("Yes")
    exit()

e = groupby(s[b-2:d+1])
for i, j in e:
    if i == "." and len(list(j)) > 2:
        print("Yes")
        exit()

print("No")
# Judge status: Accepted
N = int(input())
n, p, score = N, 2, 0
while p ** 2 <= N:
  e = 1
  while n % (p ** e) == 0:
    n //= (p ** e)
    score += 1
    e += 1
  else:
    while n % p == 0:
      n //= p
    p = p + 1 if p == 2 else p + 2
else:
  if n != 1:
    score += 1
print(score)
# Judge status: Accepted
N = int(input())
print(sum(sorted(list(map(int,input().split())))[::-1][1:2*N:2]))
# Judge status: Accepted
def main():
    A,B = map(int,input().split())
    if A >= 13:
        return B
    elif 6 <= A <= 12:
        return int(B/2)
    else:
        return 0

print(main())
# Judge status: Accepted
n,t = map(int,input().split())
ans = 10000
for i in range(n):
    cost,time = map(int,input().split())
    if time <= t and cost < ans:
        ans = cost
if ans == 10000:
    ans = "TLE"
print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())
print(max(1+(b-a)*(n-2),0))
# Judge status: Accepted
n, m = map(int,input().split())
sc = []
for i in range(m):
    s,c = map(int,input().split())
    sc.append([s,c])
for i in range(1000):
    if len(str(i)) == n:
        flag = True
        for j in range(m):
            if int(str(i)[sc[j][0] - 1]) != sc[j][1]:
                flag = False
        if flag:
            print(i)
            exit()
        else:
            continue
print(-1)
# Judge status: Wrong Answer
n, m = map(int, input().split())
N = [list(map(int, input().split())) for _ in range(n)]
M = [list(map(int, input().split())) for _ in range(m)]


for i in range(n):
    ans = 0
    d = 99999999
    for j in range(m):
        tmp = abs(N[i][0]-M[j][0]) + abs(N[i][1]-M[j][1])
        if tmp < d:
            d = tmp
            ans = j
    print(ans+1)
# Judge status: Wrong Answer
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq
#x = int(input())
n, m = map(int, sys.stdin.readline().split())
#s = input()
#a = list(map(int, sys.stdin.readline().split()))

for i in range(m):
    print(i+1, n-i)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
for i in range(N):
    if A[i] <= B[i]:
        ans += A[i]
        B[i] -= A[i]
        if A[i+1] >= B[i]:
            ans += B[i]
            A[i+1] -= B[i]
        else:
            ans += A[i+1]
            A[i+1] = 0
    else:
        ans += B[i]

print(ans)
# Judge status: Wrong Answer
import math
A, B = map(float, input().split())
from decimal import Decimal
from decimal import *  


A = Decimal(A)
B = Decimal(B)
# print(A, B)
C = A*B
# print(C)
print(math.floor(C))

exit()
# Judge status: Accepted
from fractions import gcd

n = int(input())
t = [int(input()) for _ in range(n)]
result = 1


for i in range(n):
    num = t[i]
    result = result * num // gcd(result, num)

print(result)
# Judge status: Accepted
a, b = map(int, input().split())

if a*b%2==0:
  print('Even')
else:
  print('Odd')
# Judge status: Wrong Answer
N = int(input())
T,A=map(int,input().split())
List = list(map(int, input().split()))
t = 0
mid = 0
MID = 100000000000
res = 100000000000
for i in range(N):
  t = T - 0.006*List[i]
  mid = abs(A-t)
  if mid < MID:
    MID = mid
    res = i+1
print(i+1)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

N, A, B = map(int, input().split())
if (A + B) % 2 == 0:
    print(((A + B) // 2) - A)
else:
    print(min(B-1, N-A))
# Judge status: Wrong Answer
def main():
    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)

main()
# Judge status: Accepted
a, b, c = map(int, input().split())
l = [a, b, c]
l.sort()
ans = l[2]-l[1]
l_ = [l[0]+ l[2]-l[1], l[2], l[2]]

if l_[0]%2 == l_[2]%2:
    ans += (l_[2]-l_[0])//2
else:
    ans += (l_[2]+1-l_[0])//2+1

print(ans)
# Judge status: Wrong Answer
n=int(input())
w=[str(input())]
ans="Yes"
for i in range(n-1):
    x=str(input())
    w.append(x)
    y=w[i]
    if x[0]!=y[-1]:
        ans="No"
        break
print(ans)
# Judge status: Accepted
# bsumitb2019_c.py
X = int(input())
head = X//100
tail = X%100
if tail >head*5:
    print(0)
else :
    print(1)
# Judge status: Accepted
n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()
ans_list = [0] * (a_list[n - 1] + 1)
ans = 0

for a in a_list:
    if ans_list[a] >= 1:
        ans_list[a] += 1
        continue
    for j in range(2 * a, a_list[n - 1] + 1, a):
        ans_list[j] += 1
    ans_list[a] = 1

for a in a_list:
    if ans_list[a] == 1:
        ans += 1
print(ans)
# Judge status: Accepted
k = int(input())
a = list(map(int,input().split()))
x = sorted(a)
m = x[k//2-1]
n = x[k//2]

if m == n:
    for i in range(k):
        print(m)
        
else:
    for i in a:
        if i <= m:
            print(n)
        else:
            print(m)
# Judge status: Accepted
N=int(input())
count=0
for i in range(105,N+1,2):
    divisor=0
    for j in range(1,i+1):
        if(i%j==0):divisor+=1
    if(divisor==8):count+=1
print(count)
# Judge status: Accepted
s = list(input())

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else :
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3

Q, H, S, D = [int(x) for x in input().split(" ")]
N = int(input())

if S > Q * 4:
    S = Q * 4
if S > H * 2:
    S = H * 2
if D > S * 2:
    D = S * 2
ans = (N // 2) * D + (N % 2) * S
print(ans)
# Judge status: Accepted
def main():
    N = int(input())
    cnt = 0
    for i in range(N - 1):
        A = i + 1
        B = 1
        while A * B < N:
            cnt += 1
            B += 1

    print(cnt)
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
B=[0]*n
cnt=0
for i in range(n):
    if A[i]<0:
        cnt+=1
    B[i]=abs(A[i])
B.sort()
if cnt%2==0:
    print(sum(B))
else:
    print(sum(B)-2*B[0])
# Judge status: Accepted
import math
import decimal

ab = input().split()
a = int(ab[0])
b = decimal.Decimal(ab[1])


print(math.floor(decimal.Decimal(a*b)))
# Judge status: Accepted
s=input()
if s=="Sunny":
  print("Cloudy")
elif s=="Cloudy":
  print("Rainy")
else:
  print("Sunny")
# Judge status: Accepted
x,y = map(int,input().split())
a = abs(abs(x)-abs(y))
if y == 0:
  if x >= 0:
    ans = a + 1
  else:
    ans = a
elif abs(x) <= abs(y):
  if x >= 0 and y >= 0:
    ans = a
  elif x < 0 and y < 0:
    ans = a + 2
  else:
    ans = a + 1
else:
  if x < 0 and y < 0:
    ans = a
  elif x >= 0 and y >= 0:
    ans = a + 2
  else:
    ans = a + 1
print(ans)
# Judge status: Accepted
N, H = map(int, input().split())
l = []
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)

B.sort(reverse=True)
ans = 0
n = max(A)
flag = True
for i in range(N):
  if B[i] > n:
    ans += 1
    H -= B[i]
    if H <= 0:
      flag = False
      break
  else:
    break
if flag:
  ans += H // n
  if H % n != 0:
    ans += 1
print(ans)
# Judge status: Accepted
n,m = map(int, input().split())
a_b = [list(map(int, input().split())) for i in range(n)]

a_b.sort()
sum_,all_ = m,0
for j in range(n):
  if sum_>=a_b[j][1]:
    sum_-=a_b[j][1]
    all_+=a_b[j][1]*a_b[j][0]
  elif sum_<a_b[j][1]:
    all_+=sum_*a_b[j][0]
    sum_-=sum_
print(all_)
# Judge status: Wrong Answer
x,y,z = map(int,input().split())
yz = y + z
print(x // yz)
# Judge status: Accepted
import sys
from string import ascii_lowercase

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


def main():
    N = int(readline())
    
    ans = []
    while N:
        N, r = divmod(N, 26)
        if r == 0:
            r = 26
            N -= 1
        ans.append(ascii_lowercase[r-1])
    
    print(''.join(reversed(ans)))
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
mi = 10**6
ans = 0
for i in range(n):
    mi = min(mi, p[i])
    if p[i]<=mi:
        ans += 1
print(ans)
# Judge status: Accepted
N = int(input())
S = input()
flag = True if N % 2==0 else False

for i in range(N//2):
    if S[i] != S[N//2 + i]:
        flag = False
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import math
import heapq
n,k=map(int,input().split())
a=list(map(int,input().split()))
SUM=sum(a)
ans=[]
y=k

for i in range(n):
    x=a[i]*k//SUM
    ans.append([-math.ceil(a[i]/(1+x)),x,i])
    y-=x

heapq.heapify(ans)
#print(y)
#print(ans)
for i in range(y):
    temp=heapq.heappop(ans)
    temp[0]=-math.ceil(a[temp[2]]/(2+temp[1]))
    temp[1]+=1
    heapq.heappush(ans,temp)

temp=heapq.heappop(ans)
print(-temp[0])
# Judge status: Wrong Answer
L,R=map(int,input().split())
ans=0
if R-L>=673:
  print(0)
  exit()
if R*(R-1)<=2018:
  print(L*(L+1))
  exit()
for i in range(R-L):
  for j in range(R-L):
    if ans>i*j%2019:
      ans=i*j%2019
print(ans)
# Judge status: Accepted
S = input()
a = S.count('0')
b = S.count('1')
print(2 * min(a, b))
# Judge status: Wrong Answer
n, m = map(int,input().split())
a = list(map(int, input().split()))
t = 0

for i in range(len(a)):
    t += a[i]
    if t > n:
        t = -1
        break

t = n - t
print(t)
# Judge status: Wrong Answer
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

res = A + V*T - (B + W*T)
if A < B and res >= 0:
    print('YES')
elif B < A and res <= 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n,a,b=list(map(int,input().split()))
s=input()
ab=a+b
total=0
foreigner=0
for i in range(n):
    if s[i]=='a':
        if total < ab:
            total+=1
            print("Yes")
        else:
            print("No")
    elif s[i]=='b':
        if total < ab and foreigner < b:
            total+=1
            foreigner+=1
            print("Yes")
        else:
            print("No")
    else:
        print("No")
# Judge status: Accepted
import sys
L=list()
N=int(input())
for i in range(N):
  a=int(input())
  L.append(a)
L=sorted(L)
c=sum(L)
if c%10!=0:
  print(c)
  sys.exit()
for i in range(N):
  if L[i]%10!=0:
    print(c-L[i])
    sys.exit()
print(0)
# Judge status: Accepted

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

ans = 1
for i in l:
    ans *= i
    if ans > 10**18:
        print(-1)
        break
else:
    print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
if c < a+b:
    print("No")
else:
    if 2*a*b < c*c + a*a + b*b -2*(a*c+b*c):
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import math
a,b,x=map(int,input().split())
A,B=a**2,b**2
print(math.degrees(math.asin((B/((2*x/(a*b))**2+B))**0.5) if 2*x<=a*a*b else math.acos((A/((2*(a*a*b-x)/A)**2+A))**0.5)))
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = [0 if i == "#" else 1 for i in input()]
if c < d:
    print("Yes")
    exit()
idx = b - 1
cnt = 0
while idx <= d:
    if s[idx] == 0:
        cnt = 0
    else:
        cnt += 1
        if cnt == 3:
            print("Yes")
            exit()
    idx += 1
print("No")
# Judge status: Accepted
n = int(input()) # 入力が1つ
# map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字
s = input()

ans = ''
for i in s:
    t = ord(i) + n
    if t > ord('Z'):
        t = ord('A') + (t - ord('Z')) - 1
    ans += chr(t)
print(ans)
# Judge status: Accepted
N, K, Q = list(map(int, input().split()))
A = [0]*N
for i in range(Q):
    num = int(input())
    A[num-1] += 1
# n番目の人の正解数がA[n-1]に入る
for i in range(N):
    if K > Q-A[i]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n,m=map(int,input().split())
p1=n
p2=m//2
if p1>p2:
    print(p2)
else:
    delta=p2-p1
    print(delta//2+p1)
# Judge status: Accepted
def resolve():
    d, n = map(int, input().split())
    if d == 0:
        if n == 100:
            print(101)
        else:
            print(n)
    elif d == 1:
        if n == 100:
            print(10100)
        else:
            print(n*100)
    else:
        if n == 100:
            print(1010000)
        else:
            print(n*10000)
resolve()
# Judge status: Accepted
x,y=list(map(int,input().split()))
def f(s):
   if s < 0:
      return 10**10
   else:
      return s
print(min(f(y-x),f(-y+x)+2,f(y+x)+1,f(-y-x)+1))
# Judge status: Accepted
S = input()
print("Yes" if len(set(S)) == 3 else "No")
# Judge status: Wrong Answer
def f(n):
	return (f(n/-2) if n/-2 != 0 else []) +[1 if n % 2 else 0] 

print ''.join(map(str,f(int(raw_input()))))
# Judge status: Wrong Answer
oo,ee = map(list, open(0).read().split())

ans = ''
while oo or ee:
    if ee:
        ans += ee.pop()
    if oo:
        ans += oo.pop()


print(ans[::-1])
# Judge status: Wrong Answer
s=str(input())

if s=='ABC':
    print("ABC")

elif s=='ARC':
    print("ARC")

else:
    pass
# Judge status: Accepted
S = list(input())
S. sort()

a = ord("a")
z = ord("z")
X = []
for i in range(len(S)):
  X.append(ord(S[i]))

for j in range(a,z+1):
  if j not in X:
    print(chr(j))
    exit()
    
print("None")
# Judge status: Accepted
N = int(input())

X = []
L = []
Y = []
for i in range(N):
  tx,tL = map(int,input().split())
  X.append(tx)
  L.append(tL)
  Y.append((tx-tL,tx+tL))

Y.sort(key=lambda x : x[1])

select = 0
for i in range(N):
  if i == 0:
    temp = Y[i][1] #今の終わり
    select += 1
  else:
    if Y[i][0] >= temp: #今の終わりより次の始まりの方が後ならおｋ
      temp = Y[i][1]
      select += 1
print(select)
# Judge status: Wrong Answer
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(d,next="A"):
  while len(d[next]) != 0:
    next =  d[next].pop()
  return next



def main():
  d = {}
  d["A"] = list(input().upper())
  d["B"] = list(input().upper())
  d["C"] = list(input().upper())
  print(solve(d))
  return

if __name__ == '__main__':
  main()
# Judge status: Accepted
n, k = map(int, input().split())

ans = 0
for i in range(n):
  s = i+1
  c = 0
  while s < k:
    s *= 2
    c += 1
  ans += 1/2**c

print(ans/n)
# Judge status: Accepted
N, M = input().split()
if N == M:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a, b, c = list(map(int, input().split()))

if (b-a) == (c-b):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
from collections import defaultdict

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

A.sort(reverse=True)

for i in A:
  D[i] += 1

cnt = 0
ans = 1

for i, x in D.items():
  if x >= 2:
    ans *= i
    cnt += 1
  if cnt == 2:
    print(ans)
    exit()

print(0)
# Judge status: Accepted
S = str(input())
if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
# Judge status: Accepted
n = int(input())

l = [0] * (n+1)

for i in range(n+1):
  if i == 0:
    l[0] = 2
  elif i == 1:
    l[1] = 1
  else:
    l[i] = l[i-2] + l[i-1]
    
print(l[n])
# Judge status: Accepted
a,b=map(int,input().split())
h=sum(i for i in range(1,(b-a+1)))
print(h-b)
# Judge status: Accepted
n,m=map(int,input().split())
data=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  if a==1:
    data[b-1]+=1
    if data[b-1]==2:
      print('POSSIBLE')
      exit()
  if b==n:
    data[a-1]+=1
    if data[a-1]==2:
      print('POSSIBLE')
      exit()
print('IMPOSSIBLE')
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
for i in range(1, max(a) + 1):
	z = int(max(a) / i)
	cnt = 0
	for j in a:
		if j % z == 0:
			cnt += 1
	if cnt >= (len(a) - 1):
		print(z)
		break
# Judge status: Accepted
S = input()
N = len(S)

res = "Yes"
for i in range(N):
  if (i+1) % 2 == 1:
    if S[i] == "L":
      res = "No"
  else:
    if S[i] == "R":
      res = "No"

print(res)
# Judge status: Accepted
N = int(input())

H = list(map(int, input().split()))

counts = []
count = 0
for i in range(N-1):
    if H[i] >= H[i+1]:
        count += 1
    else:
        counts.append(count)
        count = 0
else:
    counts.append(count)

print(max(counts))
# Judge status: Accepted
W,a,b=map(int, input().split())
if (a<=b and b<=a+W) or (a>=b and a<=b+W):
    print(0)
else:
    print(max(b-(a+W),a-(b+W)))
# Judge status: Wrong Answer
S=input()
K=int(input())
for i in S:
    if i != '1':
        print(i)
        exit()
# Judge status: Accepted
S = int(input().replace("/", ""))
print("Heisei" if S <= 20190430 else "TBD")
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
l = sorted(l, reverse = 1)


if n % 2 == 0:
    print(l[0] + sum(l[1:1+(n-2)//2])*2)
else:
    print(l[0] + sum(l[1:1+(n-2)//2])*2 + l[1+(n-2)//2])
# Judge status: Accepted
x,a,b=map(int,input().split())

if b-a<=x and b-a<=0:
    print("delicious")
elif b-a<=x and b-a>0:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
a,b,c,d,e = [int(input()) for i in range(5)]
k = int(input())
if e-a<=k:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
X=int(input())
if X==0:
  print(1)
if X==1:
  print(0)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    mat = [list(map(int, readline().split())) for _ in range(n)]

    cur = 0
    for a, b in mat[::-1]:
        a2 = a + cur
        cur += (b - (a2 % b)) % b

    print(cur)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = map(int, input().split())
print(a+b if a+b<24 else (a+b)-24)
# Judge status: Wrong Answer
a=int(input())
b=list(map(int,input().split()))
if a<sum(b)-max(b):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

import bisect
from collections import deque


def main():
	n=int(input())
	A=[int(input()) for _ in range(n)]
	
	Q=deque([A[0]])
	
	for i in range(1,n):
		if A[i]<=Q[0]:
			Q.appendleft(A[i])

		else:
			ix=bisect.bisect_left(Q,A[i])
			Q[ix-1]=A[i]
	
	print(len(Q))
	
	
	
	
	



if __name__ == "__main__":
	main()
# Judge status: Wrong Answer
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

xmax = max(x)
ymin = min(y)
if xmax < ymin:
  print('No War')
else:
  print('War')
# Judge status: Wrong Answer
def func_not(x:int) -> None:
  if x == 0:
    print(1)
  elif x == 1:
    print(0)
  else:
    print('invalid input')
# Judge status: Wrong Answer
x, y, z = map(int, input().split() )

cnt = 0
x = x - z

while( x > y+z ):
  cnt += 1
  x = x - y -z
  
print(cnt)
# Judge status: Wrong Answer
n = int(input())
boss_list = list(map(int, input().split(" ")))

boss_list = sorted(boss_list)


for i in range(1, n+1):
    if len(boss_list) > 0:
        try:
            boss_count = boss_list.index(i + 1)
        except:
            if i in boss_list:
                boss_count = boss_list.count(i)
    else:
        boss_count = 0
    del boss_list[:boss_count]
    print(boss_count)
# Judge status: Accepted
n,m = map(int,input().split())
l = list(map(int,input().split()))
if sum(l) <= n:
    print(n - sum(l))
else:print(-1)
# Judge status: Accepted
def main():
    n = input()
    if n[-1] == 's':
        ans = n + 'es'
    else:
        ans = n+'s'
    print(ans)

if __name__ == "__main__":
    main()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

b=[0]*n
for i in range(n):
    b[i]=a[i]-(i+1)
b.sort()

#中央値
med = b[n//2]

res = 0
for i in range(n):
    res+=abs(b[i]-med)
print(res)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]
Max = max(A)
x = A.count(Max)

for i in range(0 ,N) :
    if x >= 2 :
        print(Max)
    elif A[i] == Max :
        A[i] = 0
        print(max(A))
    else : print(Max)
# Judge status: Accepted
D,N=map(int,input().split())
if N==100:
  print((N+1)*(100**D))
else:
  print(N*(100**D))
# Judge status: Accepted
n = int(input())

print(n * 800 - n//15 * 200)
# Judge status: Accepted
N = int(input())
P = []
for _ in range(N):
    t,x,y = map(int, input().split())
    P.append((t,x,y))

ans = True
pre = (0,0,0)
for t,x,y in P:
    dt, dx, dy = t-pre[0], abs(x-pre[1]), abs(y-pre[2])
    if dt < dx+dy or (dt-(dx+dy))&1:
        ans = False
        break
    pre = (t,x,y)

print('Yes' if ans else 'No')
# Judge status: Accepted
import math

N = int(input())

A = math.floor(N**0.5)
B = math.ceil(N**0.5)

while True:
    if N % A == 0:
        B = N // A
        break
    elif N % B == 0:
        A = N // B
        break
    else:
        A -= 1
        B += 1

print(A + B - 2)
# Judge status: Accepted
N,M = map(int,input().split())
D = sorted([list(map(int,input().split())) for n in range(N)])
ans = 0
num = 0

for a,b in D:
  num+=b
  ans+=a*b
  if M<=num:
    ans-=a*(num-M)
    break

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

def even(a):
	if a % 2 == 0:
		return True
	else:
		return False

if A == B and B == C:
	print("-1")
	
elif not (even(A) and even(B) and even(C)):
		print("0")

else:
	cnt = 0
	while even(A) and even(B) and even(C):
		tmp1, tmp2, tmp3 = A,B,C
		A = (tmp2+tmp3) // 2
		B = (tmp3+tmp1) // 2
		C = (tmp1+tmp2) // 2
		cnt += 1
	print(cnt)
# Judge status: Wrong Answer
x = list(map(int, input().split()))

print(x.index(0))
# Judge status: Accepted
a, b, c, k = map(int, input().strip().split())


def solve():
    global k

    total = 0
    num_a = min(k, a)

    total += num_a

    k -= num_a

    if k <= 0:
        return total

    num_b = min(k, b)

    if k <= 0:
        return total

    k -= num_b

    num_c = k
    total -= num_c

    return total

print(solve())
# Judge status: Accepted
import bisect
N = int(input())
L = sorted([int(i) for i in input().split()])
ans = 0

for j in range(N-2):
    for k in range(j+1,N-1):
        S = L[j] + L[k]
        a = bisect.bisect_left(L, S)
        ans += a - 1 - k 

print(ans)
# Judge status: Accepted
N = int(input())
l = [-1 for i in range(N)]
for i in range(N):
  A = int(input())
  ok = N-1
  ng = -1
  while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    if l[mid] < A:
      ok = mid
    else:
      ng = mid  
  l[ok] = A
###
for i in range(N):
  if l[i] == -1:
    ans = i
    break
  #出会わなかったパターンを忘れ気味
  if i == N-1:
    ans = N  
print(ans)
# Judge status: Accepted
A,B,C = map(int,input().split())
print(int((C+0.5)//A*B))
# Judge status: Wrong Answer
N = int(input())
D = list(map(int, input().split()))
M = 998244353
from collections import Counter

if D[0] != 0:
    print(0)
    exit(0)

cd = Counter(D)
tmp = sorted(cd.items(), key=lambda x: x[0])

ans = 1
for kx in range(1, len(tmp)):
    __, p = tmp[kx-1]
    _, v = tmp[kx]
    while v > 0:
        ans *= p %M
        v -= 1

print(ans)
# Judge status: Wrong Answer
l=list(map(int,input().split()))
ans=0
maxt=0
for i in l:
  if i<maxt:
    ans+=maxt-1
    maxt=max(i,maxt)
print(ans)
# Judge status: Wrong Answer
N = int(input())

A = 0

for i in range(N-1):
  for j in range(i,N):
    if str(i)[0] == str(j)[-1] and str(i)[-1] == str(j)[0]:
      A += 1

print(A)
# Judge status: Wrong Answer
W,H,x,y = map(int,input().split())

ans_1 = min(W*y, W*(H-y))
ans_2 = min(x*H, (W-x)*H)

if ans_1 == ans_2:
    print(ans_1, 1)
else:
    print(max(ans_1,ans_2), 0)