Harryxun/stf_run huggingface dataset:
from collections import deque

def isCLKWISE(ph):
    a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
    b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
    crs = a[0]*b[1] - a[1]*b[0]
    if crs < 0 :
        return False
    else :
        return True
    
def ConvexHullScan(P):
    P = sorted(P)
    phU = deque(P[0],P[1])
    print(phU)
    for p in P[2:]:
        phU.append(p)
        while(True):
            if isCLKWISE(phU) :
                break
            else :
                del phU[-2]
                if len(phU) == 2 :
                    break
    phL = deque(P[-1],P[-2])
    for p in P[-3::-1]:
        print(phL)
        phL.append(p)
        while(True):
            if isCLKWISE(phL) :
                break
            else :
                del phL[-2]
                if len(phL) == 2 :
                    break
    ph = phU + phL[1:-1]
    return ph

n = int(input())
P = deque([])
for i in range(n):
    P.append([int(x) for x in input().split()])
    
Q = ConvexHullScan(P)
Q.reverse()
print(len(Q))
for q in Q:
    idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(Q)])[2]
    R = Q[idx:] + Q[:idx]
for r in R:
    print(r[0],r[1])

### FIXED CODE ###

def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        while(True):
            try :
                if isCLKWISE(phU) : break
                else : del phU[-2]
            except IndexError : break
    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            try :
                if isCLKWISE(phL) : break
                else : del phL[-2]
            except IndexError : break
    ph = phU + phL[1:-1]
    return ph
  
P = [[int(x) for x in input().split()] for _ in range(int(input()))]
P = ConvexHullScan(P)
P.reverse()
print(len(P))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(P)])[2]
for p in P[idx:] + P[:idx] : print(p[0],p[1])
sd=list(input())
t=list(input())

#sts="?tc????"
#ts="coder"

#sts="??p??d??"
#ts="abc"
#sd=list(sts)
#t=list(ts)

for i in range(len(sd)-len(t)+1):
    ii=len(sd)-len(t)-i
    yn=""
    for j in range(len(t)):
        if sd[ii+j]!=t[j] and sd[ii+j]!="?":
            yn="NG"
            break
    if yn=="NG":
        continue
    else:
        yn="yes"
        break
    
if yn=="NG": 
    print("UNRESTORABLE")
elif yn=="": 
    print("UNRESTORABLE")
elif yn=="yes":
    s=sd.copy()
    for j in range(len(t)):
        s[ii+j]=t[j]
    for j in range(len(s)):
        if s[j]=="?":
           s[j]="a"
    strt="".join(s)
    print(strt)

### FIXED CODE ###

sd=list(input())
t=list(input())

yn=""
for i in range(len(sd)-len(t)+1):
    ii=len(sd)-len(t)-i
    yn=""
    for j in range(len(t)):
        if sd[ii+j]!=t[j] and sd[ii+j]!="?":
            yn="NG"
            break
    if yn=="NG":
        continue
    else:
        yn="yes"
        break
    
if yn=="NG" or yn=="": 
    print("UNRESTORABLE")
else:
    for j in range(len(t)):
        sd[ii+j]=t[j]
    for j in range(len(sd)):
        if sd[j]=="?":
           sd[j]="a"
    strt="".join(sd)
    print(strt)
s = input()
k = int(input())

print(s[1])

### FIXED CODE ###

s = input()
k = int(input())

ans_idx = 0

s = list(s)
for i in range(min(k, len(s))):
  if (s[i] != "1"):
    break
print(s[i])
x = int(input())
for i in range(2,x+1):
  if x%i==0:
    a = 0
    b = a-i
    break
while a**5 -b**5 != x:
  a+= 1
  b+= 1
print(a,b)

### FIXED CODE ###

x = int(input())

cands = [(i**5,i) for i in range(-500,500)]

for a,i in cands:
  for b,j in cands:
    if a-b == x:
      print(i,j)
      exit()
N = input()
if N % 2 == 0:
    A = (N/2)/N
    print(float(A))
else:
    B = ((N+1)/2)/N
    print(float(B))

### FIXED CODE ###

N = int(input())

if N % 2 == 0:	
    print((N/2)/N)
else:
    print(((N+1)/2)/N)
a, b = list(map(int,input().split()))
if a * b % 2 == 0:
  print("Even")
else:
  pritn("Odd")
      

### FIXED CODE ###

a, b = list(map(int,input().split()))
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")
n, k = list(map(int, input().split()))
sushi = []
for i in range(n):
    sushi.append(list(map(int, input().split())))
point = 0
sushi_kind = set()
duplication = []
sushi.sort(key=lambda x: x[1],reverse = True)
for i in range(k):
    point += sushi[i][1]
    if sushi[i][0] in sushi_kind:
        duplication.append(sushi[i])
    else:
        sushi_kind.add(sushi[i][0])
ans = point + pow(len(sushi_kind),2)
dup_index = len(duplication) - 1
for i in range(k,n):
    if sushi[i][0] in sushi_kind:
        continue
    else:
        point += sushi[i][1]
        sushi_kind.add(sushi[i][0])
        point -= duplication[dup_index][1]
    ans = max(ans, point + pow(len(sushi_kind),2))
print(ans)



### FIXED CODE ###


n, k = list(map(int, input().split()))
sushi = []
for i in range(n):
    sushi.append(list(map(int, input().split())))
point = 0
sushi_kind = set()
duplication = []
sushi.sort(key=lambda x: x[1],reverse = True)
for i in range(k):
    point += sushi[i][1]
    if sushi[i][0] in sushi_kind:
        duplication.append(sushi[i])
    else:
        sushi_kind.add(sushi[i][0])
ans = point + pow(len(sushi_kind),2)
dup_index = len(duplication) - 1
for i in range(k,n):
    if sushi[i][0] in sushi_kind:
        continue
    else:
        if dup_index >= 0:
            point -= duplication[dup_index][1]
            dup_index -= 1
            point += sushi[i][1]
            sushi_kind.add(sushi[i][0])
    ans = max(ans, point + pow(len(sushi_kind),2))
print(ans)
from itertools import accumulate

N,K=list(map(int,input().split(" ")))
S=input()

def solve():
    cnt=0
    l=[]
    prev = "1"
    for i in S:
        if prev ==i:
            cnt += 1
        else:
            l.append(cnt)
            cnt = 1
        prev =i
    l.append(cnt)
    if prev=="0":
        l.append("0")
    
    w = 2 * K + 1
    
    if len(l) <=w:
        return N
    
    acc=[0]+list(accumulate(l))
    ans = 0
    for i in range(0,len(l) - w+ 1,2):
        ans = max(ans, acc[w+i] - acc[i])

    return ans
print(solve())

### FIXED CODE ###

A,B=list(map(int,input().split(" ")))
coin=[A+(A-1),B+(B-1),A+B]
print(max(coin))
count = 1

while True:
       x = int(input())
       if x != 0:
           print("Case {0}: {1}".format(count, x)
           count += 1
       else:
           break

### FIXED CODE ###

count = 1

while True:
       x = int(input())
       if x != 0:
           print("Case {0}: {1}".format(count, x))
           count += 1
       else:
           break
K = int(input())
if(K % 2 == 0 | K % 5 == 0):
    print(-1)
N = 7
for i in range(K):
    if　N % 7 == 0:
        print(i + 1)
        break
    else:
        N = ((N * 10) + 7) % K

### FIXED CODE ###

K = int(input())

t = 7
for i in range(K):
    if t % K == 0:
        print(i + 1)
        break
    t = (t * 10 + 7) % K
else:
    print(-1)
N = int(input())

a = []
for i in range(1,N + 1):
  count = 0
  while True:
    if i % 2 == 0:
      i /= 2
    count += 1
    else:
      break
  a.append(count)
print(a.index(max(X) + 1))

### FIXED CODE ###

N = int(input())

a = []
for i in range(1,N + 1):
  count = 0
  while True:
    if i % 2 == 1:
      break
    else:
      i /= 2
      count += 1
  a.append(count)
print(a.index(max(a)) + 1)
N = int(input())
a = list(map(int,input().split()))
cc = []
res = s[0]
for i in range(1,N):
    res^ = s[i]
if res == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
cc = []
res = a[0]
for i in range(1,N):
    res ^= a[i]
if res == 0:
    print('Yes')
else:
    print('No')
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 21 23:25:47 2019

@author: Yamazaki Kenichi
"""
import bisect

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

T = [[] for _ in range(2*10**5+1)]

for i in range(N):
    T[A[i]].append(i)

s = A[0]
pointa = 0
counta, res = 0, [-1]
while True:
    tmp = bisect.bisect_right(T[s], pointa) % len(T[s])
    p_pointa = pointa
    pointa = T[s][tmp] + 1
    if pointa == p_pointa + 1 or pointa < p_pointa:
        counta += 1
        res.append(p_pointa)
    elif pointa == N:
        counta += 1
        res.append(p_pointa)
        break
    s = A[pointa]

ans = []
if K % counta != 0:
    pointa = res[K % counta]
#    ans.append(A[pointa])
    while pointa < N:
        if pointa < T[A[pointa]][-1]:
            tmp = bisect.bisect_right(T[A[pointa]],pointa)
            pointa = T[A[pointa]][tmp] + 1
        else:
            ans.append(A[pointa])
            pointa += 1
#        print(ans)
print(' '.join(map(str,ans)))


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Jul 21 23:25:47 2019

@author: Yamazaki Kenichi
"""
import bisect

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

T = [[] for _ in range(2*10**5+1)]

for i in range(N):
    T[A[i]].append(i)

s = A[0]
pointa = 0
counta, res = 0, [-1]
while True:
    tmp = bisect.bisect_right(T[s], pointa) % len(T[s])
    p_pointa = pointa
    pointa = T[s][tmp] + 1
    if pointa == p_pointa + 1 or pointa < p_pointa:
        counta += 1
        res.append(p_pointa)
    if pointa == N:
        counta += 1
        res.append(p_pointa)
        break
    s = A[pointa]

ans = []
if K % counta != 0:
    pointa = res[K % counta]
#    ans.append(A[pointa])
    while pointa < N:
        if pointa < T[A[pointa]][-1]:
            tmp = bisect.bisect_right(T[A[pointa]],pointa)
            pointa = T[A[pointa]][tmp] + 1
        else:
            ans.append(A[pointa])
            pointa += 1
#        print(ans)
print(' '.join(map(str,ans)))
str = input()
a,b,c = str.split()
if a == b:
  if b == c:
    print ('No')
  else print ('Yes')
else print ('Yes')

### FIXED CODE ###

txt = input()
a,b,c = list(txt)
if a == b:
  if b == c:
    print('No')
  else:
    print('Yes')
else :
  print('Yes')
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def search(values,hp,vp,item):
	if not (0<=hp<len(values)): return
	if not (0<=vp<len(values[hp])): return
	if item!=values[hp][vp]: return
	values[hp][vp]=True
	search(values,hp-1,vp,item)
	search(values,hp+1,vp,item)
	search(values,hp,vp-1,item)
	search(values,hp,vp+1,item)

def solve(values):
	count=0
	for i in range(len(values)):
		for j in range(len(values[i])):
			if values[i][j] in ['@','#','*']:
				search(values,i,j,values[i][j])
				count+=1
	return count

def main():
	line,values=input().strip(),list()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		value = list()
		for _ in range(H):
			value.append(list(x for x in input().strip()))
		values.append(value)
		line = input().strip()
	for value in values:
		print(solve(value))

if __name__=='__main__':
	main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

if __name__=='__main__':
	main()
N,x = map(int,input().split())

if x <= 2 or 2*N-x <= 2:
    print ("No")
else:
    print ("Yes")
    notend = [True] * (2*N-1)
    lis = [0] * (2*N-1)

    lis[N-1] = x
    notend[x] = False

    lis[N] = x+1
    notend[x+1] = False

    lis[N-2] = x-2
    notend[x-2] = False

    lis[N+1] = x-1
    notend[x-1] = False

    lis[N-3] = x+2
    notend[x+2] = False

    ind = 0

    for i in range(2*N-1):

        if lis[i] == 0:
            
            while not notend[ind]:
                ind += 1

            lis[i] = ind + 1
            ind += 1

    print (" ".join(map(str,lis)))

        


### FIXED CODE ###


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

if x <= 2 or 2*N-x <= 2:

    if N == 2 and x == 2:
        print ("Yes")
        print ("1")
        print ("2")
        print ("3")

    elif N >= 3 and (x == 2):

        print ("Yes")
        notend = [True] * (2*N-1)
        lis = [0] * (2*N-1)

        lis[N-1] = x
        notend[x-1] = False
    
        lis[N] = x-1
        notend[x-1-1] = False

        ind = 0

        for i in range(2*N-1):

            if lis[i] == 0:
            
                while not notend[ind]:
                    ind += 1
    
                lis[i] = ind + 1
                notend[ind] = False
            

        for i in lis:
            print (i)

    elif N >= 3 and (x == 2*N-2):

        print ("Yes")
        notend = [True] * (2*N-1)
        lis = [0] * (2*N-1)

        lis[N-1] = x
        notend[x-1] = False
    
        lis[N] = x+1
        notend[x+1-1] = False

        ind = 0

        for i in range(2*N-1):

            if lis[i] == 0:
            
                while not notend[ind]:
                    ind += 1
    
                lis[i] = ind + 1
                notend[ind] = False
            

        for i in lis:
            print (i)  
        

    else:
        print ("No")
    
else:
    print ("Yes")
    notend = [True] * (2*N-1)
    lis = [0] * (2*N-1)

    lis[N-1] = x
    notend[x-1] = False

    lis[N] = x+1
    notend[x+1-1] = False

    lis[N-2] = x-2
    notend[x-2-1] = False

    lis[N+1] = x-1
    notend[x-1-1] = False

    lis[N-3] = x+2
    notend[x+2-1] = False

    ind = 0

    for i in range(2*N-1):

        if lis[i] == 0:
            
            while not notend[ind]:
                ind += 1

            lis[i] = ind + 1
            notend[ind] = False
            

    for i in lis:
        print (i)
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
k = 0
for i in range(N - 1) :
    for j in range(i + 1, N) :
        if s[i] == s[k] :
            k += 1
print(k)


### FIXED CODE ###

N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

s_dict ={}
ans = 0
for i in range(N) :
    if s[i] in s_dict.keys() :
        ans += s_dict[s[i]]
        s_dict[s[i]] += 1
    else :
        s_dict[s[i]] = 1
print(ans)
r = int((input))
print(r**2)

### FIXED CODE ###

r = int(input())
print(r**2)
sd=list(input())
t=list(input())

for i in range(len(sd)-len(t)+1):
    ii=len(sd)-len(t)-i
    yn=""
    for j in range(len(t)):
        if sd[ii+j]!=t[j] and sd[ii+j]!="?":
            yn="NG"
            break
    if yn=="NG":
        continue
    else:
        yn="yes"
        break
    
if yn=="NG": 
    print("UNRESTORABLE")
else:
#    s=sd.copy()
    for j in range(len(t)):
        sd[ii+j]=t[j]
    for j in range(len(sd)):
        if sd[j]=="?":
           sd[j]="a"
    strt="".join(sd)
    print(strt)
        
        

### FIXED CODE ###

sd=list(input())
t=list(input())

yn=""
for i in range(len(sd)-len(t)+1):
    ii=len(sd)-len(t)-i
    yn=""
    for j in range(len(t)):
        if sd[ii+j]!=t[j] and sd[ii+j]!="?":
            yn="NG"
            break
    if yn=="NG":
        continue
    else:
        yn="yes"
        break
    
if yn=="NG" or yn=="": 
    print("UNRESTORABLE")
else:
    for j in range(len(t)):
        sd[ii+j]=t[j]
    for j in range(len(sd)):
        if sd[j]=="?":
           sd[j]="a"
    strt="".join(sd)
    print(strt)
n = int(input())
s = input()

ans = n
cnt_w = s.count('.')
cnt_k = 0
if cnt == n or cnt == 0:
    ans = 0
    print(ans)
else:
    for i in range(n):
        if s[i] == '.':
            cnt_w -= 1
        else:
            cnt_k += 1
        if ans > cnt_w + cnt_k:
            ans = cnt_w + cnt_k:
    print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

n = int(input())
s = list(input())
res = 10**9

cta = 0
ctb = 0
a = [0]*n
b = [0]*n
for i in range(n):
    if s[i] == '.':
        cta += 1
    else:
        ctb += 1
    a[i] = cta
    b[i] = ctb
for i in range(n):
    res = min(res,b[i]+a[-1]-a[i])
res = min(res,a[-1],b[-1])
print(res)
input_num = input()
input_num = int(input_num)
for i in range(1,100,1):
  flag = False
  for j in range(1,100,1):
    if input_num == i * J:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

### FIXED CODE ###

input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * j:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return(a)

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

#x_list.append(X)
#x_list_new=sorted(x_list)
x_list_new_dif=[abs(x_list_new[i]-X) for i in range(len(x_list_new))]

for i in range(len(x_list_new_dif)):
    if i==0:
        skip=x_list_new_dif[0]
    else:
        skip=gcd(skip,x_list_new_dif[i])
print(skip)

### FIXED CODE ###

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return(a)

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

#x_list.append(X)
x_list_new=sorted(x_list)
x_list_new_dif=[abs(x_list_new[i]-X) for i in range(len(x_list_new))]

for i in range(len(x_list_new_dif)):
    if i==0:
        skip=x_list_new_dif[0]
    else:
        skip=gcd(skip,x_list_new_dif[i])
print(skip)
S=input()
N=len(S)

import sys
sys.setrecursionlimit(200000)

from functools import lru_cache

@lru_cache(maxsize=None)
def dp(cur,i):
	if cur==N:
		if i==3:
			return 1
		else:
			return 0
	else:
		if S[cur]=='ABCD'[i]:
			return dp(cur+1,i+1)+dp(cur+1,i)
		elif S[cur]=='?':
			return dp(cur+1,i+1)+3*dp(cur+1,i)
		else:
			return dp(cur+1,i)

print(dp(0,0))

### FIXED CODE ###

S=input()
lens=len(S)
mod=10**9+7
cnt=[0,0,0,1]
for s in S:
    if s=="A":
        cnt[0]=(cnt[0]+cnt[3])%mod
    elif s=="B":
        cnt[1]=(cnt[0]+cnt[1])%mod
    elif s=="C":
        cnt[2]=(cnt[1]+cnt[2])%mod
    else:
        cnt[2]=(cnt[1]+3*cnt[2])%mod
        cnt[1]=(cnt[0]+3*cnt[1])%mod
        cnt[0]=(3*cnt[0]+cnt[3])%mod
        cnt[3]=cnt[3]*3%mod
print(cnt[2]%mod)
K=int(input())
nums=[i for i in range(1,10)]
for i in range(K):
    a=nums.pop(0)
    if a%10!=0:
        nums.append(a*10 + %10 - 1)
    
    nums.append(a*10 + a%10)
    
    if a%10!=9:
        nums.append(a*10 + a%10 + 1)

print(a)


### FIXED CODE ###

K=int(input())
nums=[i for i in range(1,10)]
for i in range(K):
    a=nums.pop(0)
    if a%10!=0:
        nums.append(a*10 + a%10 - 1)
    
    nums.append(a*10 + a%10)
    
    if a%10!=9:
        nums.append(a*10 + a%10 + 1)

print(a)
def input_from_console():
    n, m = map(int, input().split())
    a_list = map(int, input().split())

    bc_list = []
    for i in range(m):
        b, c = map(int, input().split())
        bc_list.append((b, c))
    return n, m, a_list, bc_list


def solve(n, m, a_list, bc_list):
    bc_list.sort(key=lambda x: x[1], reverse=True)
    a_list = sorted(a_list, reverse=True)

    result_sum = 0
    position = 0
    a_length = len(a_list)
    for item in bc_list:
        b, c = item
        if a_length <= position:
            return result_sum + sum(a_list)
        while True:
            if a_length <= position:
                return result_sum + sum(a_list)
            if a_list[position] >= c:
                position += 1
                if a_length < position:
                    return result_sum + sum(a_list)
            else:
                result_sum += sum(a_list[:position])
                a_list = sorted(a_list[position:])
                a_length = len(a_list)
                position = 0
                break
        for i in range(b):
            if position > a_length:
                return result_sum + sum(a_list)
            if a_list[position] < c:
                a_list[position] = c
                position += 1
            else:
                break
    return result_sum + sum(a_list)


def main():
    n, m, a_list, bc_list = input_from_console()
    print(solve(n, m, a_list, bc_list))


if __name__ == "__main__":
    main()

### FIXED CODE ###

def input_from_console():
    n, m = map(int, input().split())
    a_list = map(int, input().split())

    bc_list = []
    for i in range(m):
        b, c = map(int, input().split())
        bc_list.append((b, c))
    return n, m, a_list, bc_list


def solve(n, m, a_list, bc_list):
    bc_list.sort(key=lambda x: x[1], reverse=True)
    a_list = sorted(a_list)

    position = 0
    a_length = len(a_list)

    for item in bc_list:
        b, c = item
        for i in range(b):
            if position >= a_length or a_list[position] >= c:
                return sum(a_list)
            else:
                a_list[position] = c
                position += 1
    return sum(a_list)


def main():
    n, m, a_list, bc_list = input_from_console()
    print(solve(n, m, a_list, bc_list))


if __name__ == "__main__":
    main()
import numpy as np
ls = np.array([[ 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
         0,  0,  0,  0],
       [ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
        16, 17, 18, 19],
       [ 0,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7,  8,
         8,  9,  9, 10],
       [ 0,  1,  1,  1,  2,  2,  2,  3,  3,  3,  4,  4,  4,  5,  5,  5,
         6,  6,  6,  7],
       [ 0,  1,  1,  1,  1,  2,  2,  2,  2,  3,  3,  3,  3,  4,  4,  4,
         4,  5,  5,  5],
       [ 0,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,
         4,  4,  4,  4],
       [ 0,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  3,  3,  3,
         3,  3,  3,  4],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,  3,
         3,  3,  3,  3],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,
         2,  3,  3,  3],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,
         2,  2,  2,  3],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,
         2,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,
         2,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,
         2,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,
         2,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,
         2,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
         2,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
         1,  2,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
         1,  1,  2,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
         1,  1,  1,  2],
       [ 0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
         1,  1,  1,  1]])
A, B = map(int, inupt().split())
print(ls[A][B])

### FIXED CODE ###

A, B = map(int, input().split())
i = 1
socket = 0
while i < B:
    i += A - 1
    socket += 1
print(socket)
n=int(input())
w=list(map(int,input().split()))
s=w.sum()
p=0
bestsub=100000000

for i in range n:
  p=p+w[i]
  sub=abs(s-p)
  if(bestsub>sub):
    bestsub=sub

print(bestsub)

### FIXED CODE ###

n=int(input())
w=list(map(int,input().split()))
s=sum(w)
p=0
bestsub=100000000

for i in range(n):
  p=p+w[i]
  sub=abs(p-(s-p))
  if(bestsub>sub):
    bestsub=sub

print(bestsub)
x,y,z= map(int, input().split())

print(z+""+x+""+y)

### FIXED CODE ###

x,y,z=map(int,input().split())
print(z,x,y)
S = list(input())
flag = True


for i in range(0, len(S), 2):
  if S[i] == 'h' and S[i + 1] == 'i':
    pass
  else:
    flag = not flag
    break

if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = list(input())
flag = True

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
    if S[i] == 'h' and S[i + 1] == 'i':
      pass
    else:
      flag = not flag
      break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")