Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
"""
C - Pyramid
https://atcoder.jp/contests/abc112/tasks/abc112_c

"""
import sys


def solve(N, positions):
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[0]
            ph = h + abs(cy-y) + abs(cx-x)
            for x, y, h in positions[1:]:
                hh = h + abs(cy-y) + abs(cx-x)
                if hh != ph:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)


def main(args):
    N = int(input())
    positions = [[int(i) for i in input().split()] for _ in range(N)]
    ans = solve(N, positions)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
C - Pyramid
https://atcoder.jp/contests/abc112/tasks/abc112_c

"""
import sys


def solve(N, positions):
    if N == 1:
        return positions[0]
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[0]
            ph = h + abs(cy-y) + abs(cx-x)
            for x, y, h in positions[1:]:
                hh = max(ph - abs(cy-y) - abs(cx-x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)
    for cy in range(101):
        for cx in range(101):
            is_valid = True
            x, y, h = positions[-1]
            ph = h + abs(cy-y) + abs(cx-x)
            for x, y, h in positions[:-1]:
                hh = max(ph - abs(cy-y) - abs(cx-x), 0)
                if hh != h:
                    is_valid = False
                    break
            if is_valid:
                return (cx, cy, ph)


def main(args):
    N = int(input())
    positions = [[int(i) for i in input().split()] for _ in range(N)]
    ans = solve(N, positions)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])
N,X = map(int,input().split())
li = list(map(int,input().split()))

point=0
count=1
for i in li:
  point += i
  if point<=X:
    count+=1
print(count)

### FIXED CODE ###

x,A = map(int,input().split())
if x<A:
  print(0)
else:
  print(10)
import sys


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


def get_sum(x1, x2, y1, y2):
    return acc[x2][y2] - acc[x1][y2] - acc[x2][y1] + acc[x1][y1]


h, w, k = map(int, input().split())
s = [[int(c) for c in input()] for i in range(h)]

acc = [[0 for j in range(w + 1)] for i in range(h + 1)]
for i in range(h):
    for j in range(w):
        acc[i + 1][j + 1] = acc[i][j + 1] + acc[i + 1][j] - acc[i][j] + s[i][j]

min_div_cnt = 10 ** 18

for h_div in range(1 << (h - 1)):
    h_ranges = []
    cur_begin = 0
    for i in range(h - 1):
        if (h_div >> i) & 1:
            h_ranges.append([cur_begin, i + 1])
            cur_begin = i + 1
    h_ranges.append([cur_begin, h])
    h_div_cnt = len(h_ranges) - 1

    max_hchoco_cnt = 0
    tgt_h_range = []
    for h_range in h_ranges:
        hchoco_cnt = get_sum(h_range[1], h_range[0], w, 0)
        if hchoco_cnt > max_hchoco_cnt:
            max_hchoco_cnt = hchoco_cnt
            tgt_h_range = h_range

    cur_begin = 0
    v_div_cnt = 0
    is_valid = True
    for i in range(0, w):
        cur_cnt = get_sum(tgt_h_range[1], tgt_h_range[0], i, cur_begin)
        next_cnt = get_sum(tgt_h_range[1], tgt_h_range[0], i + 1, cur_begin)
        if next_cnt - cur_cnt > k:
            is_valid = False
            break
        if cur_cnt <= k and next_cnt > k:
            cur_begin = i
            v_div_cnt += 1

    if is_valid:
        min_div_cnt = min(min_div_cnt, h_div_cnt + v_div_cnt)

print(min_div_cnt)


### FIXED CODE ###

import sys


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


def get_sum(x1, x2, y1, y2):
    return acc[x2][y2] - acc[x1][y2] - acc[x2][y1] + acc[x1][y1]


h, w, k = map(int, input().split())
s = [[int(c) for c in input()] for i in range(h)]

acc = [[0 for j in range(w + 1)] for i in range(h + 1)]
for i in range(h):
    for j in range(w):
        acc[i + 1][j + 1] = acc[i][j + 1] + acc[i + 1][j] - acc[i][j] + s[i][j]

ans = h + w

for h_div in range(1 << (h - 1)):
    h_ranges = []
    h_begin = 0
    for i in range(h - 1):
        if h_div >> i & 1:
            h_ranges.append([h_begin, i + 1])
            h_begin = i + 1
    h_ranges.append([h_begin, h])
    div_cnt = len(h_ranges) - 1

    def is_addable():
        for h_range in h_ranges:
            if get_sum(h_range[1], h_range[0], j + 1, w_begin) > k:
                return False
        return True

    w_begin = 0
    for j in range(w):
        if not is_addable():
            w_begin = j
            div_cnt += 1
            if not is_addable():
                div_cnt = h + w
                break
    ans = min(ans, div_cnt)

print(ans)
N = int(input())
H = list(map(int, input().split()))
ans,i = 0
for n in range(N):
    if H[n] >= H[n+1]:
        i += 1
    else:
        if ans < i:
            ans = i
        i=0
print(max(ans,i))


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
ans = 0
i = 0
for n in range(N-1):
    if H[n] >= H[n+1]:
        i += 1
    else:
        if ans < i:
            ans = i
        i=0
print(max(ans,i))
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, k, s = MAP()

# A = [i for i in range(1, s+1)]
# print(A)
# add = []
# A = [i for i in range(1, 10**9+1)]
# for i in range(1, n+1):
#   for j in range(i, n+1):
# のびしろ，これからこれだけのばすよ

L = [ s ] * k
# print(c)

one = []
see = 0
while n-len(L)-len(one) != 0:
  # for i in range(c):  
  while L[see] == 1:
    see +=1
  #   L.insert(0, 1)
  L[see] = L[see] - 1
  one.append(1)
# print(one)

a = one + L
#ans = [1, 2, 3, 4]
print(*a)

### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, k, s = MAP()
 
if s == 10 ** 9:
  a = 1
else:
  a = 10 ** 9

ans = [s] * k + [a] * (n - k)
 
print(*ans)
N = int(input())
info = [list(map(int,input().split())) for _ in range(N)]

def judge(Cx,Cy):
    x0,y0,h0 = info[0]
    pH = abs(x0-Cx) + abs(y0-Cy) + h0
    for x, y, h in info:
        H = abs(x-Cx) + abs(y-Cy) + h
        if h == 0:
            if not H <= 0:
                return
        elif H != pH:
            return
        pH = H
    global ans
    ans = [Cx,Cy,H]
    
for Cx in range(101):
    for Cy in range(101):
        judge(Cx,Cy)

print(*ans)

### FIXED CODE ###

N = int(input())
info = []
for i in range(N):
    x,y,h = map(int,input().split())
    if h == 0:
        N -= 1
        continue
    info.append([x,y,h])
for i in range(101):
    for j in range(101):
        H_0 = info[0][2] + abs(info[0][0] - i) + abs(info[0][1] - j)
        for k in range(1,N):
            H = info[k][2] + abs(info[k][0] - i) + abs(info[k][1] - j)
            if H_0 != H:
                break
            elif k == N-1:
                print(i,j,H_0)
                exit()
print(info[0][0],info[0][1],info[0][2])
import math
a,b,c=map(int,input().split())
d=b-c/(a**2)
d=d*2
if d==0:
  print(0)
if d>a:
  e=c*2/(a*b)
  print(90-math.degrees(math.atan(e/b)))
else:
  print(90-math.degrees(math.atan(a/d)))

### FIXED CODE ###

import math
a,b,c=map(int,input().split())
d=b-c/(a**2)
d=d*2
if d==0:
  print(0)
elif d>b:
  e=(c*2)/(a*b)
  print(math.degrees(math.atan(b/e)))
else:
  print(math.degrees(math.atan(d/a)))
def BubbleSort(A,n):
    count = 0
    for i in range(n):
        for j in range(n-1,i,-1):
            if A[j] < A[j-1]:
                A[j], A[j-1] = A[j-1], A[j]
                print (A[j], A[j-1])
                count += 1
    return A, count


n = int(input())
A = [int(input().strip()) for i in range(n)]
count = 0
ans = 0
ans, count =  (BubbleSort(A,n))
ans = list(map(str,ans))

print (" ".join(ans))
print (count)

### FIXED CODE ###

n = int(input())
 
numbers = list(map(int, input().split(" ")))
 
cnt = 0
 
for i in range(n):
    for j in range(n - 1, i, -1):
        if numbers[j] < numbers[j - 1]:
            numbers[j],numbers[j - 1] = numbers[j - 1], numbers[j]
            cnt += 1
 
numbers = map(str, numbers)
print(" ".join(numbers))
 
print(cnt)
import math
n = int(input())
a = list(map(int,input().split()))
g_c = sum([1 for i in a if i%2==0]) 
ans = 0
for i in a:
  if i%2==0:
    while(i%2==0):
      i = i//2
      ans += 1
print(c)

### FIXED CODE ###

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

ans = 0
for i in a:
  if i%2==0:
    while(i%2==0):
      i = i//2
      ans += 1
print(ans)
fac=[0]*505050
inv=[0]*505050
finv=[0]*505050
mod=1000000007
fac[0]=finv[0]=inv[1]=1;
for i in range(1,500010):
  fac[i]=fac[i-1]*i%mod
  inv[i]=inv[mod%i]*(mod//i)%mod
  finv[i]=finv[i-1]*inv[i]%mod

def C(n,r):
  if n<0 or r<0 or n<r: return 0
  return fac[n]*inv[n-r]*inv[r]%mod

n,m=map(int,input().split())
ans=0
for i in range(N+1):
  ans+=C(n,i)*fac[M]*finv[M-i]*(C(M-i,N-i)**2)*(1 if i%2==0 else -1) % mod
print(ans%mod)


### FIXED CODE ###

fac=[1]*505050
inv=[1]*505050
finv=[1]*505050
mod=1000000007
for i in range(2,500010):
  fac[i]=fac[i-1]*i%mod
  inv[i]=-inv[mod%i]*(mod//i)%mod
  finv[i]=finv[i-1]*inv[i]%mod

def C(n,r):
  if n<0 or r<0 or n<r: return 0
  return fac[n]*finv[n-r]*finv[r]%mod

N,M=map(int,input().split())
ans=0
for i in range(N+1):
  ans+=C(N,i)*fac[M]*finv[M-i]*((fac[M-i]*finv[M-N])**2)*(1 if i%2==0 else -1) % mod
print(ans%mod)
A=list(map(int,input().split()))

p=0
for i in A:
  if p==0:
    while i%2==1:
      p=p+1    
  else:
    ans=p
    while i%2==1:
      p=p+1
    if p>ans:
      ans=p
print(ans)

### FIXED CODE ###

print(input().count("1"))
#標準入力からソートまで
import numpy as np
N, M = map(int, input().split())
A = list(map(lambda x : int(x) * (-1), input().split()))
#Aの中で一番でかいのをdiscountしてまた並び替え
#優先度付きqueuemを使う
import heapq
heapq.heapify(A)
for i in range(M):
    tmp = (-1) * heapq.heapop(A) // 2
    heapq.heappush(A, tmp * (-1))
print(-sum(A))

### FIXED CODE ###

#標準入力からソートまで
N, M = map(int, input().split())
A = list(map(lambda x : int(x) * (-1), input().split()))
#Aの中で一番でかいのをdiscountしてまた並び替え
#優先度付きqueuemを使う
import heapq
heapq.heapify(A)
for i in range(M):
    tmp = (-1) * heapq.heappop(A) // 2
    heapq.heappush(A, tmp * (-1))
print(-sum(A))
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i:i+2]=='AC' else 0)
for i in range(N):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()

acl = [0]*(N+1)

for i in range(N):
    acl[i+1] = acl[i] + (1 if S[i:i+2] == "AC" else 0)

for _ in range(Q):
    l, r = map(int, input().split())
    print(acl[r-1] - acl[l-1])
import re

def revPolish(f):
    f = re.sub(r'(\-?\d+\.?\d*?)\s(\-?\d+\.?\d*?)\s([\+\-\*/])',
        lambda m: str(eval(m.group(1) + m.group(3) + m.group(2))),
        f)
    if f[-1] in ('+','-','*','/'):
        return revPolish(f)
    else:
        return f

print(revPlish(input()))


### FIXED CODE ###

import re
pat = re.compile(r'(\-?\d+\.?\d*)\s(\-?\d+\.?\d*)\s([\+\-\*/])(?!\d)')

def revPolish(f):
    global pat
    f = pat.sub(lambda m: str(eval(m.group(1) + m.group(3) + m.group(2))),f)
    if f[-1] in '+-*/':
        return revPolish(f)
    else:
        return f

print(revPolish(input()))
N=int(input())
T_N=int(input().split())
list_time=[]
for i in range(N)
    list_time.append(T_N[i])
sum=sum(list_time)
M=int(input())
for i in range(M):
    p,x=map(int,input.split())
    ans=sum+(x-list_time[p-1])
    print(ans)

### FIXED CODE ###

n = int(input())
t_N = input().split()
list_Time = []
for id in range(n):
    list_Time.append(int(t_N[id]))
sum = sum(list_Time)
m = int(input())
for id in range(m):
    p, x = map(int, input().split())
    answer = sum + x - list_Time[p - 1]
    print(answer)
n=int(input())
L=list(map(int,input().split()))
L.sort()
ans=sum(L)-L[n-1]
if ans>L[n-1]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b=map(int,input().split())
print(a/b)
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break

for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.asciilowercase:
    print("{0} : {1}".format(key, count[key]))

### FIXED CODE ###

import string
   
count = {x: 0 for x in string.ascii_lowercase}
lines = ""
   
while True:
    try:
        lines += input().lower()
    except EOFError:
        break
           
for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1
           
for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
import math
x=int(input())
mon = 100
cnt = 0
while mon < X:
    mon = math.floor(mon*1.01)
    cnt += 1
print(cnt)


### FIXED CODE ###

#import math
x=int(input())
mon = 100
cnt = 0
while mon < x:
    mon += mon//100
    cnt += 1
print(cnt)
import heapq,math,sys
input=sys.stdin.readline
INF=math.inf
heappush=heapq.heappush
heappop=heapq.heappop

n,m=map(int,input().split())
graph=[[] for _ in range(n)]
minway=[]
bridges=[]
ans=0
for _ in range(m):
    a,b,c=map(int,input().split())
    graph[a-1].append((b-1,c))
    graph[b-1].append((a-1,c))
    bridges.append((a-1,b-1))

def dijkstra(graph,n,start):
    Q=[]
    distance=[]
    dappend=distance.append
    for i in range(n):
        dappend([INF,i])
    distance[start][0]=0
    for j in distance:
        heappush(Q,j)
    while Q!=[]:
        q=heappop(Q)
        for v,vl in graph[q[1]]:
            alt=vl+q[0]
            if alt<distance[v][0]:
                distance[v][0]=alt
                heappush(Q,[alt,v])
    return distance

for k in range(n):
    minway.append(dijkstra(graph,n,k))

for l in bridges:
    flag=0
    x,y=l[0],l[1]
    for p in graph[x]:
        if p!=y:
            if minway[x][p[0]][0]+minway[x][y][0]==minway[p[0]][y][0]:
                flag=1
    for q in graph[y]:
        if q!=x:
            if minway[x][y][0]+minway[y][q[0]][0]==minway[x][q[0]][0]:
                flag=1
    if flag==0:
        ans+=1
print(ans)

### FIXED CODE ###

import heapq,sys
input=sys.stdin.readline
INF=float('inf')
heappush=heapq.heappush
heappop=heapq.heappop

n,m=map(int,input().split())
graph=[[] for _ in range(n)]
minway=[]
bridges=[]
ans=0
for _ in range(m):
    a,b,c=map(int,input().split())
    graph[a-1].append((b-1,c))
    graph[b-1].append((a-1,c))
    bridges.append((a-1,b-1,c))

def dijkstra(graph,n,start):
    Q=[]
    distance=[]
    dappend=distance.append
    for i in range(n):
        dappend([INF,i])
    distance[start][0]=0
    for j in distance:
        heappush(Q,j)
    while Q!=[]:
        q=heappop(Q)
        for v,vl in graph[q[1]]:
            alt=vl+q[0]
            if alt<distance[v][0]:
                distance[v][0]=alt
                heappush(Q,[alt,v])
    return distance

for k in range(n):
    minway.append(dijkstra(graph,n,k))

for l in bridges:
    x,y,z=l[0],l[1],l[2]
    flag=True
    for p in range(n):
        if minway[x][p][0]+z==minway[y][p][0] or minway[y][p][0]+z==minway[x][p][0]:
            flag=False
            break
    if flag:
        ans+=1

print(ans)
s=input()
n=int(s)
c=0
for i in range(len(s)+1):
  for j in range(i,len(s)+1):
    m=int(int(n/(10**i))%(10**j))
    if m%2019==0:
      c+=1
print(c)

### FIXED CODE ###

S = input()
N = len(S)
A = [int(S[i]) for i in range(N)]
A = A[::-1]

MOD = 2019

p10 = [1] * N
for i in range(1, N):
	p10[i] = (p10[i - 1] * 10) % MOD

for i in range(N):
	A[i] = (A[i] * p10[i]) % MOD

cumsum = [A[0]] * N
for i in range(1, N):
	cumsum[i] = (cumsum[i - 1] + A[i]) % MOD

cnt = [0] * MOD
cnt[0] = 1
for i in range(N):
	cnt[cumsum[i]] += 1

ans = 0
for i in range(MOD):
	ans += cnt[i] * (cnt[i] - 1) // 2

print(ans)
# 二項係数を"やるだけ"にしてくれるライブラリ
MAX = 10005
MOD = 1000000007
factrial = [0]*MAX
inverse = [0]*MAX
factrial_inverse = [0]*MAX


# テーブルを作る前処理
def COMinit():
    global factrial, inverse, factrial_inverse
    factrial[0] = 1
    factrial[1] = 1
    inverse[1] = 1
    factrial_inverse[0] = 1
    factrial_inverse[1] = 1
    for i in range(2, MAX):
        factrial[i] = factrial[i-1] * i % MOD
        inverse[i] = MOD - inverse[MOD % i] * (MOD//i) % MOD
        factrial_inverse[i] = factrial_inverse[i-1] * inverse[i] % MOD


# 二項係数計算
def COM(n, k):
    global factrial, inverse, factrial_inverse
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return factrial[n] * (factrial_inverse[k] * factrial_inverse[n-k] % MOD) % MOD


# 前処理完了
COMinit()

N = int(input())
X = list(map(int, input().split()))

ans = 0
prepro = [1]
for i in range(2, N+1):
    prepro.append((prepro[-1]+inverse[i]) % MOD)

for i in range(N-1):
    ans += (X[i+1]-X[i]) * prepro[i] % MOD
    
ans *= factrial[N-1]  # 期待値の総和に(N-1)!をかける

print(ans % MOD)


### FIXED CODE ###

# 二項係数を"やるだけ"にしてくれるライブラリ
MAX = 510000
MOD = 1000000007
factrial = [0]*MAX
inverse = [0]*MAX
factrial_inverse = [0]*MAX


# テーブルを作る前処理
def COMinit():
    global factrial, inverse, factrial_inverse
    factrial[0] = 1
    factrial[1] = 1
    inverse[1] = 1
    factrial_inverse[0] = 1
    factrial_inverse[1] = 1
    for i in range(2, MAX):
        factrial[i] = factrial[i-1] * i % MOD
        inverse[i] = MOD - inverse[MOD % i] * (MOD//i) % MOD
        factrial_inverse[i] = factrial_inverse[i-1] * inverse[i] % MOD


# 二項係数計算
def COM(n, k):
    global factrial, inverse, factrial_inverse
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return factrial[n] * (factrial_inverse[k] * factrial_inverse[n-k] % MOD) % MOD


# 前処理完了
COMinit()

N = int(input())
X = list(map(int, input().split()))
# expected_value = [1]
# for i in range(2, N):
#     expected_value.append(expected_value[-1]+(1/i))
ans = 0
f = factrial[N-1]
c = 0
for i in range(1, N):
    c += f * inverse[i]
    c %= MOD
    ans += c * (X[i] - X[i-1])
    ans %= MOD

print(ans % MOD)
import collections

N = int(input())
H_list = list(map(int, input().split()))

import collections
point = 0
step_candidates = collections.Counter()
for n in range(N-1):
    if(H_list[n] < H_list[n+1]):
        step_candidates[point] = n - point
        point = n+1
if(point != N - 1):
    step_candidates[point] = N - 1 - point

print(step_candidates.most_common()[0][1])

### FIXED CODE ###

import collections

N = int(input())
H_list = list(map(int, input().split()))

if(N == 1):
    print(0)
else:
    point = 0
    step_candidates = collections.Counter()
    for n in range(N-1):
        if(H_list[n] < H_list[n+1]):
            step_candidates[point] = n - point
            point = n+1
    if(point != N - 1):
        step_candidates[point] = N - 1 - point

    print(step_candidates.most_common()[0][1])
from sys import stdin

X = stdin.readline().strip().split(" ")

n = 0
for i in range(len(X)):
  if X[i] == 0:
    n = i+1
    break
print n

### FIXED CODE ###

from sys import stdin
 
X = stdin.readline().strip().split(" ")
 
n = 0
for i in range(len(X)):
  if X[i] == "0":
    n = i+1
    break
print(n)
a = int(input())
for i in range(1,a+3):
    if i % 3 == 0 or i % 10 == 3 or (int(i/10) % 3 == 0 and int(i/10) != 0:
        print(" {}".format(i), end = "")
    elif i % 10 == 3:
        print(" {}".format(i), end = "")
print()




### FIXED CODE ###

a = int(input())
for i in range(1,a+1):
    x = i
    if i % 3 == 0 or i % 10 == 3:
        print(" {}".format(i), end = "")
    else:
        while int(x) > 0:
            x /= 10
            if int(x) % 10 == 3:
                print(" {}".format(i), end = "")
                break
print()
import sys
n,m = map(int,input().split())
s = [0] * m
c = [0] * m
for i in range(m):
    s[i],c[i] = map(int,input().split())
ans = [10] * max(s)
for i in range(m):
    if s[i] == 1 and c[i] == 0:
        print(-1)
        sys.exit()
    if ans[s[i] - 1] == 10:
        ans[s[i] - 1] = c[i]
    else:
        if c[i] != ans[s[i] - 1]:
            print(-1)
            sys.exit()
    
for i in range(len(ans)):
    if i == 0 and ans[i] == 10:
        ans[i] = 1
    elif ans[i] == 10:
        ans[i] = 0
print(''.join([str(i) for i in ans]))

### FIXED CODE ###

n,m = map(int,input().split())
s = [0] * m
c = [0] * m
for i in range(m):
    s[i],c[i] = map(int, input().split())

if n>1:
    ans=[1]+[0]*(n-1)
else:
    ans=[0]
flag = False


for i in range(m):
    if n>2 and s[i]==1 and c[i]==0:
        flag = True
    ans[s[i]-1]=c[i]
    for j in range(i+1,m):
        if s[i]==s[j]:
            if c[i]!=c[j]:
                flag=True

if flag:
    print(-1)
else:
    print("".join(map(str,ans)))
from bisect import *
from heapq import *
import math
mod = 10**9+7
N, K = map(int, input().split())
A = list(map(lambda x: (-int(x), int(x), 1), input().split()))
heapify(A)
k = 0
while K > 0:
    x, _x, c1 = A[0]
    heappop(A)
    y, _y, c2 = A[0]
    c3 = math.ceil(_x/(-y))
    print(c3)
    if c3-c1 > K:
        c3 = c1+K
        K = 0
    else:
        K -= c3-c1
    heappush(A, (-(_x/c3), _x, c3))
print(math.ceil(-A[0][0]))
print(A)

### FIXED CODE ###

from bisect import *
from heapq import *
import math
mod = 10**9+7
N, K = map(int, input().split())
A = list(map(int, input().split()))
l = 0
r = 10**9+1
while l+1 < r:
    x = (l+r)//2
    k = 0
    for a in A:
        k += math.ceil(a/x)-1
        if k > K:
            break
    if K < k:
        l = x
    else:
        r = x
print(r)
import sys
import math

N, M = map(int, input().split())

s, c = [0] * N, [0] * N
for i in range(M):
	s[i], c[i] = map(int, input().split())

for i in range(0 if N == 1 else 10 ** (N - 1), 10 ** N):
	x = str(i)
	for j in range(M):
		if x[s[j] - 1] != str(c[j]):
			break
		elif j == M - 1:
			print(i)
			sys.exit(0)

print(-1)

### FIXED CODE ###

import sys
import math

N, M = map(int, input().split())

s, c = [0] * M, [0] * M
for i in range(M):
	s[i], c[i] = map(int, input().split())

for i in range(0 if N == 1 else 10 ** (N - 1), 10 ** N):
	x = str(i)
	if M == 0:
		print(i)
		sys.exit(0)
	for j in range(M):
		if x[s[j] - 1] != str(c[j]):
			break
		elif j == M - 1:
			print(i)
			sys.exit(0)

print(-1)
a, b, c, d = list(map(int, input().split()))
# minus minus
if b <= 0 and d <= 0:
    ans = a*c
# minus plus
if b <= 0 and c >= 0:
    ans = b*c
# plus minus
elif 0 <= a and d <= 0:
    ans = a*d
# plus plus
if a >= 0 and c >= 0:
    ans = b*d
print(ans)



### FIXED CODE ###

a, b, c, d = list(map(int, input().split()))
# minus minus
if b <= 0 and d <= 0:
    print(a*c)
else:
    ans = max(a*c, a*d, b*c, b*d)
    print(ans)
def cal(A, B):
    if A >= 13 and A <= 100:
        return B
    elif 6 <= A and A <= 12:
        return B/2
    elif 0 <= A and A <= 5:
        return 0

if __name__ == "__main__":
    print(cal(int(input()), int(input())))

### FIXED CODE ###

def main():
    i = list(map(int, input().split()))
    a = i[0]
    b = i[1]

    #if isinstance(a, int) == False or isinstance(b, int) == False or a < 0 or 100 < a or b < 2 or 1000 < b or b % 2 != 0:
    #    return

    if 13 <= a and a <= 100:
        print(b)
    elif 6 <= a and a <= 12:
        print(b//2)
    elif 0 <= a and a <= 5:
        print(0)

if __name__ == "__main__":
    main()