Harryxun/stf_run huggingface dataset:
H, W = map(int, input().split())
MAX_VAL = 10**9
cost = [[MAX_VAL]*(W+1) for _ in range(H+1)]
field = ["#" * (H+1)]
for i in range(H):
    line = input()
    field.append("#" + line)

if field[1][1] == "#":
    cost[1][1] = 1
else:
    cost[1][1] = 0

for i in range(1, H+1):
    for j in range(1, W+1):
        if i * j == 1:
            continue

        if field[i][j] == ".":
            cost[i][j] = min(cost[i-1][j], cost[i][j-1])
        else:
            top_cost = cost[i-1][j]
            left_cost = cost[i][j-1]
            
            if field[i-1][j] == ".":
                top_cost += 1
            if field[i][j-1] == ".":
                left_cost += 1
            
            cost[i][j] = min(top_cost, left_cost)

print(cost[H][W])

### FIXED CODE ###

H, W = map(int, input().split())
MAX_VAL = 10**9
cost = [[MAX_VAL]*(W+1) for _ in range(H+1)]

field = ["#" * (W+1)]
for i in range(H):
    line = input()
    field.append("#" + line)

if field[1][1] == "#":
    cost[1][1] = 1
else:
    cost[1][1] = 0

for i in range(1, H+1):
    for j in range(1, W+1):
        if i * j == 1:
            continue

        if field[i][j] == ".":
            cost[i][j] = min(cost[i-1][j], cost[i][j-1])
        else:
            top_cost = cost[i-1][j]
            left_cost = cost[i][j-1]
            
            if field[i-1][j] == ".":
                top_cost += 1
            if field[i][j-1] == ".":
                left_cost += 1
            
            cost[i][j] = min(top_cost, left_cost)

print(cost[H][W])
def common():
   X = raw_input()
   Y = raw_input()
            
   for i in range(0. len(Y)+1):
      s[i] = 0
            
   for j in range(0, len(X)):
      t = s + []
      for k in range(0, len(Y)):
         if s[j] == j[k]:
            s[k+1] = t[k] + 1
         elif s[k+1] < s[k]:
            s[k+1] = s[k]
         
   return s[-1]
   
q = input()     
for l in range(0, q):
   common()

### FIXED CODE ###

def common():
   X = raw_input()
   Y = raw_input()
  
   s = [0 for i in range(len(Y)+1)]
 
   for j in range(0, len(X)):
      t = s + []
      for k in range(0, len(Y)):
         if X[j] == Y[k]:
            s[k+1] = t[k] + 1
         elif s[k+1] < s[k]:
            s[k+1] = s[k]
  
   print s[-1]
 
q = input()
for l in range(0, q):
   common()
import fraction
import copy
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n1 = int(input())
nl1 = [int(i1) for i1 in input().split()]

r1 = 0
for  i2 in range(n1):
    nl2 = copy.copy(nl1)
    if i2 == 0:
        nl2[i2] = nl1[1]
    else:
        nl2[i2] = nl1[i2 - 1]
    r1 = max(r1,gcd_list(nl2))

print(r1)

### FIXED CODE ###

import fractions
import sys

n1 = int(input())
nl1 = [int(i1) for i1 in input().split()]

if n1 == 2:
    print(max(nl1))
    sys.exit()

r1 = 0

nl1.sort()

if n1 >= 3:
    n2 = fractions.gcd(nl1[0], nl1[1]) 
    n2 = max(n2, fractions.gcd(nl1[1], nl1[2]))
    n2 = max(n2, fractions.gcd(nl1[0], nl1[2]))

c1 = 0
for i2 in range(n1):
    if nl1[i2] % n2 != 0:
        c1 += 1
    if c1 >= 2:
        break
    if i2 == (n1 - 1):
        r1 = n2

i3 = n2

while r1 == 0:
    c1 = 0
    for i4 in range(n1):
        if nl1[i4] % i3 != 0:
            c1 += 1
        if c1 >= 2:
            break
        if i4 == (n1 - 1):
            r1 = i3
    i3 -= 1

print(str(r1))
import sys  
import numpy as np

input = sys.stdin.readline

S_ = input()
T = input()

S_ = list(S_)[:-1]
T = list(T)[:-1]

for i in range(len(S_)-len(T)+1):
    if i==0:
        part = S_[-len(T):]
    else :
        part = S_[-len(T)-i:-i]
    j = False
    for k in range(len(part)-1,-1,-1):
        if part[k] == "?":
            if k==0:
                j = True
            continue
        elif part[k] == T[k]:
            if k==0:
                j = True
        else:
            break
    if j:
        break


if j:
    for p in range(len(T)):
        S_[len(S_)-len(T)-i+p] = T[p]
    # print("*",S_)
    for k in range(len(S_)):
        if S_[k] == "?":
            S_[k] = "a"

    print("".join(S_))
else:
    print("UNRESTORABLE")

### FIXED CODE ###


import sys  
import numpy as np

input = sys.stdin.readline

S_ = input()
T = input()

S_ = list(S_)[:-1]
T = list(T)[:-1]

j = False
for i in range(len(S_)-len(T)+1):
    if i==0:
        part = S_[-len(T):]
    else :
        part = S_[-len(T)-i:-i]
    j = False
    for k in range(len(part)-1,-1,-1):
        if part[k] == "?":
            if k==0:
                j = True
            continue
        elif part[k] == T[k]:
            if k==0:
                j = True
        else:
            break
    if j:
        break


if j:
    for p in range(len(T)):
        S_[len(S_)-len(T)-i+p] = T[p]
    # print("*",S_)
    for k in range(len(S_)):
        if S_[k] == "?":
            S_[k] = "a"

    print("".join(S_))
else:
    print("UNRESTORABLE")
n = int(input())
a = [int(i) for i in input().split()]
c = 0
i = 0
 
while a[i]%2 == 0:
  if a[i]%2 ==0:
    a[i]//=2
  if i==n-1:
    c+=1
    i = 0
  i+=1
print(c)


### FIXED CODE ###

s = input()
 
x = 0
 
 
for i in range(len(s)):
  if s[i] == "1":
    x += 1
  
print(x)
import pandas
 
n = int(input())
s = [input() for _ in range(n)]

x = pandas.Series(s)
lis = x.mode().tolist()
 
for i in range(len(lis)):
  print(lis[i])

### FIXED CODE ###

import sys 
from collections import Counter
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
l = read().decode().split()
c = Counter(l)
 
max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] >= max]
 
print('\n'.join(sorted(ans)))
import math
dishes =[0]*5
for i in range(5):
  dishes[i]=math.celi(int(input()))

print(sum(dishes))

### FIXED CODE ###

def int_ceil(x):
  last=int(str(x)[-1])
  return([x+10-last,last])

dishes =[0]*5
min=10
for i in range(5):
  x=(int(input()))
  if x % 10 != 0:
    ceiled=int_ceil(x)
    if ceiled[1] < min:
      min=ceiled[1]
    dishes[i]=ceiled[0]
  else:
    dishes[i]=x
print(sum(dishes) - 10 + min)
N,M = map(int,input().split())
L = list(map(int,input().split()))
R = list(map(int,input().split()))
ans = 0
if N >= min(R):
  ans = max(0,min(R) - min(L) + 1)
else:
  ans = max(0,N - min(L) + 1)
print(ans)


### FIXED CODE ###

N,M = map(int,input().split())
L = []
R = []
ans = 0
for _ in range(M):
  l, r = map(int, input().split())
  L.append(l)
  R.append(r)
ans = max(0,min(R) - max(L) + 1)
print(ans)
A, B =list (map (int, input().split(' ') ) )
if A > = 13 :
    print(B)
elif A < = 5 :
    print(0)
else :
    print(B/2)


### FIXED CODE ###

A, B =map(int, input().split() )
if A >= 13 :
    print(B)
elif A >=6 and A<=12 :
    print(B // 2)
else :
    print(0)
n = int(input().split())
x = [int(intpu()) for i in range(5)]
d = n // min(x)
print(d+5)

### FIXED CODE ###

n = int(input())
x = [int(input()) for i in range(5)]
d = n // min(x)
if n%min(x)==0:
  print(d+4)
else:
  print(d+5)
n, m= map(int, (input().split()))
a = list(map(int, input().split()))
count = 0
total = 0
for i in a:
  total += i
for j in a:
  if j / total => 1 / (4 * m):
    count += 1
if count >= m:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n, m= map(int, (input().split()))
a = list(map(int, input().split()))
count = 0
total = 0
for i in a:
  total += i
for j in a:
  if not (j / total < 1 / (4 * m)):
    count += 1
if count >= m:
  print("Yes")
else:
  print("No")
def sol():
    n,c=map(int,input().split())
    d=[[int(i) for i in input().split()] for i in range(c)]
    t=[[int(i) for i in input().split()] for i in range(n)]
    ans=-1
    for i in range(c):
        for j in range(c):
            for k in range(c):
                q=[i,j,k]
                if len(set(q))<3: break
                chk=0
                for p in range(n**2):
                    h,w=p//n,p%n
                    x=(h+w+2)%3
                    chk+=d[t[h][w]-1][q[x]]
                if ans==-1: ans=chk
                ans=min(ans,chk)
             
    print(ans)

if __name__="__main__":
    sol()

### FIXED CODE ###

def sol():
    n,c=map(int,input().split())
    d=[[int(i) for i in input().split()] for i in range(c)]
    t=[[int(i) for i in input().split()] for i in range(n)]
    x0,x1,x2={},{},{}
    for p in range(n**2):
        h,w=p//n,p%n
        x=(h+w)%3
        o=t[h][w]-1
        if x==0:
            if o in x0: x0[o]+=1
            else: x0[o]=1
        if x==1:
            if o in x1: x1[o]+=1
            else: x1[o]=1
        if x==2:
            if o in x2: x2[o]+=1
            else: x2[o]=1
    ans=-1
    for a in range(c**2):
        for k in range(c):
            i,j=a//c,a%c
            q=[i,j,k]
            if len(set(q))<3: continue
            chk=0
            for p in x0:
                chk+=d[p][q[0]]*x0[p]
            for p in x1:
                chk+=d[p][q[1]]*x1[p]
            for p in x2:
                chk+=d[p][q[2]]*x2[p]
            if ans==-1: ans=chk
            ans=min(ans,chk)

    print(ans)

if __name__=="__main__":
    sol()
def B(N,X,m):
    ret=0
    X-=sum(m)
    ret+=len(m)

    ret+=int(X/min(m))

    return ret

inp = sys.stdin.read().split()
inp=[int(i) for i in inp]
print(B(inp[0], inp[1], inp[2:]))

### FIXED CODE ###

def main(func):
    ret=func(input())
    print(ret)


def A(S):
    ret=700
    ret+=S.count("o")*100
    return ret

main(A)
n = int(input())
a = [int(x) for x in input().split()]

odds = [i for i in a if 2%i]
print("No" if 2%len(odds) else "Yes")

### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]

odd_list = [i for i in a if i%2]
odd_count = len(odd_list)

if (odd_count == 0 or odd_count %2 == 0):
    print("YES")
else:
    print("NO")
import functools
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

print(sum(b) % ((10**9)+7))

### FIXED CODE ###

import functools

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

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

print(sum(b) % ((10**9)+7))
s=input()
X,Y=map(int,input().split())
import copy
def solve(a,G):

    amax=0
    for i in a:
        amax+=abs(i)
    if amax==0:
        if G==0:
            return True
        else:
            return False

    dp=[[0]*2*amax for _ in range(3)]
    dp[0][a[0]]=1
    for i in range(1,len(a)):
        p=a[i]
        for j in range(-amax,amax):
            dp[i%3][j-p]+=dp[(i-1)%3][j]
            dp[i%3][j+p]+=dp[(i-1)%3][j]
            #print(dp)
        if dp[i%3][G]>=1:
            return True
    return False
    """#print(a)
    dp=set()
    dp.add(a[0])
    dp2=set()
    for i in range(1,len(a)):
        for j in dp:
            dp2.add(j-a[i])
            dp2.add(j+a[i])
        dp=copy.deepcopy(dp2)
    #print(dp)
    if G in dp:
        return True
    return False"""

x=[]
y=[0]
flg=1
cnt=0
"""if s[0]=="T":
    x.append(0)"""
for i in range(len(s)):
    if s[i]=="F":
        cnt+=1
    else:
        if flg==1:
            x.append(cnt)
            flg*= -1
            cnt=0
        else:
            y.append(cnt)
            flg*= -1
            cnt=0
if flg==1:
    x.append(cnt)
else:
    y.append(cnt)
#print(x)
#print(y)

if solve(x,X) and solve(y,Y):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

s=input()
X,Y=map(int,input().split())
from collections import defaultdict
def solve(da,dp,G):
    for i in range(len(da)):
        tmp=set()
        for j in dp:
            tmp.add(j-da[i])
            tmp.add(j+da[i])
        dp=tmp
    if G in dp:
        return True
    else:
        return False
    """amax=0
    for i in a:
        amax+=abs(i)
    if amax==0:
        if G==0:
            return True
        else:
            return False
    if a[0]==G:
        return True
    dp=[[0]*2*amax for _ in range(3)]
    dp[0][a[0]]=1
    for i in range(1,len(a)):
        p=a[i]
        for j in range(-amax,amax):
            dp[i%3][j-p]+=dp[(i-1)%3][j]
            dp[i%3][j+p]+=dp[(i-1)%3][j]
            #print(dp)
        if dp[i%3][G]>=1:
            return True
    return False"""
    """#print(a)
    dp=set()
    dp.add(a[0])
    dp2=set()
    for i in range(1,len(a)):
        for j in dp:
            dp2.add(j-a[i])
            dp2.add(j+a[i])
        dp=copy.deepcopy(dp2)
    #print(dp)
    if G in dp:
        return True
    return False"""

d=[len(x) for x in s.split("T")]

dx=d[2::2]
dy=d[1::2]

if solve(dx,{d[0]},X) and solve(dy,{0},Y):
    print("Yes")
else:
    print("No")
a = input().split()
w = int(a[0])
h = int(a[1])

b = []
c =[]

for i in range(h):
    s = input()
    b.append(s)

for i in range(h):
    c.append(b[i])
    c.append(b[i])

for i in range(len(c)):
    print(c[i])

### FIXED CODE ###

a = input().split()
h = int(a[0])
w = int(a[1])

b = []
c =[]

for i in range(h):
    s = input()
    b.append(s)

for i in range(h):
    c.append(b[i])
    c.append(b[i])

for i in range(len(c)):
    print(c[i])
n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
result = [0 for _ in range(120)]
for i in a:
    x = format(i, "060b")[::-1]
    for j in range(60):
        result[j] = result[j]+(x[j]=="1")
result = [(n-i)*i for i in result]
for i in range(70):
    result[i+1] += result[i]//2
    result[i] = result[i]%2    
print(int("".join(map(str, result[::-1])), 2)%mod)

### FIXED CODE ###

import numpy as np
mod = 10**9+7
n = int(input())
a = np.fromstring(input(), dtype = np.int64, sep = ' ')

result = 0
for i in range(60):
    count_one = int((a&1).sum())
    result += count_one*(n-count_one)*(2**i)
    a >>= 1
print(result%mod)
N = int(input())
li = list(map(int,input()))
C = 1
for i in range(N):
  C *= li[i]
if C <= 10 ** 18:
  print(C)
else: print(-1)

### FIXED CODE ###

N = int(input())
L = list(map(int,input().split()))
L.sort()
c = 1
for i in range(N):
    c *= L[i]
    if c > 10**18:
        c = -1
        break
print(c)
z =map(int, input().split())
W = z[0]
H  = z[1]
x  = z[2]
y =  z[3]
r = z[4]
if r =< x and x =< (W-r):
    if r =< y and y =< (H-r):
        print("Yes")
    else:
        print("No")
else:
    print("Yes")

### FIXED CODE ###

W, H, x, y, r = input().split()

if int(r) <= int(x) and int(x) <= int(W) - int(r):
    if int(r) <= int(y) and int(y) <= int(H) - int(r):
        print("Yes")
    else:
        print("No")

else:
    print("No")
X = int(input())
A, B, C = map(int, input().split())

price = 0
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            price = i * 500 + j * 100 + k * 50
            if price == X:
                count += 1
            price = 0

print(count)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
 
count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if i*500 + j*100 + k*50 == X:
                count += 1
 
print(count)
N, C = map(int, input().split())
T = [0 for i in range(10 ** 5)]
for i in range(N):
  s, t, c = map(int, input().split())
  for j in range(s - 1, t + 1):
    T[j] += 1
print(max(T))

### FIXED CODE ###

import functools
N, C = map(int, input().split())
T = [[0 for i in range(10 ** 5 + 1)] for j in range(C)]
for i in range(N):
  s, t, c = map(int, input().split())
  for j in range(s - 1, t):
    T[c - 1][j] = 1
ans = 0
for j in range(10 ** 5 + 1):
  r = 0
  for i in range(C):
    r += T[i][j]
  ans = max(ans, r)
print(ans)
N, A, B = list(map(int, input('').split()))
answer = 0
for x in range(1, N + 1):
  total = sum(map(int, list(str(x)))
  if A <= total <= B:
    answer += x

print(answer)


### FIXED CODE ###

N, A, B = list(map(int, input('').split()))
total = 0
for x in range(1, N + 1):
  num = str(x)
  digit_total = 0
  for y in range(len(num)):
    digit_total += int(num[y])
  if digit_total >= A and digit_total <= B:
    total += x

print(total)
n = int(input())
l = list(map(int,input().split()))
if l[-1] > l[-2]:
    l += [float('Inf')]
else:
    l += [-float('Inf')]
ans = 1
i = 1
while i <= n - 1:
    if l[i-1] <= l[i] and l[i] <= l[i+1]:
        i += 1
    elif l[i-1] >= l[i] and l[i] >= l[i+1]:
        i += 1
    else:
        #print(l[i-1],l[i],l[i+1])
        ans += 1
        i += 2
        
print(ans)

### FIXED CODE ###

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

ans = 1
status = 0
prev = a[0]

for i in a:
    diff = i - prev

    if diff == 0:
        pass
    elif diff > 0:
        if status >= 0:
            status = diff
        else:
            ans += 1
            status = 0
    else:
        if status <= 0:
            status = diff
        else:
            ans += 1
            status = 0

    prev = i

print(ans)
#E
H,N=map(int,input().split())
A,B=[0]*N,[0]*N
for i in range(N):
    A[i],B[i]=map(int,input().split())
    
memo=[0]*(H+10)
def dpinit(H):
    for i in range(H):
        memo[H]=min([dp(H-A[i])+B[i] for i in range(N)])
    
def dp(H):
    if H<=0:
        return 0
    else:
        if memo[H]==0:
            memo[H]=min([dp(H-A[i])+B[i] for i in range(N)])
        return memo[H]
    
dpinit(int(H//100))
print(dp(H))

### FIXED CODE ###

# ABC153 E Crested Ibis vs Monster
f=lambda:map(int,input().split())
H,N=f()
# dp[n][h]:=nthまでで体力をh削るときの最小魔力
INF=10**9
dp=[[INF]*(H+1) for _ in [0]*(N+1)]

for i in range(N+1):
    if i!=0:
        a,b=f()
    else:
        a,b=0,0
    for j in range(H+1):
        if i==0:
            if j==0:
                dp[i][j]=0
            else:
                dp[i][j]=INF
        else:
            dp[i][j]=min(dp[i-1][j],dp[i][max(j-a,0)]+b)

print(dp[N][H])
A = list(map(int, input().split()))
count = 0
for a in A:
  if (a % 2 == 0 and a % 3 != 0) and (a % 2 == 0 and a % 5 != 0):
    count = count + 1

if count => 1 :
  print('DENIED')
else:
  print('APPROVED')

### FIXED CODE ###

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

for i in A:
    i = int(i)
    if i % 2 == 0:
        if i % 3 !=0 and i % 5 !=0:
            print("DENIED")
            exit()
print("APPROVED")
# 拡張ユークリッド互除法
# ax + by = gcd(a,b)の最小整数解を返す
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)


# mを法とするaの乗法的逆元
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

from functools import reduce

MOD = 10**9+7

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

c = N-K+1

res = [1]*(K+1)
n = c
for i in range(1, K+1):
    res[i] *= n
    n *= c-i
    n %= MOD

n = reduce(lambda x,y: (x*y)%MOD, range(1,K+1))
n = modinv(n, MOD)

for i in reversed(range(1, K+1)):
    res[i] *= n
    res[i] %= MOD
    n *= i
    n %= MOD

n = K-1
for i in range(1, K+1):
    res[i] *= n
    n *= c-i
    n %= MOD

n = reduce(lambda x,y: (x*y)%MOD, range(1,K))
n = modinv(n, MOD)

for i in reversed(range(1, K+1)):
    res[i] *= n
    res[i] %= MOD
    n *= i-1
    n %= MOD
for a in res[1:]:
    print(a//2)

### FIXED CODE ###

# 拡張ユークリッド互除法
# ax + by = gcd(a,b)の最小整数解を返す
def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)


# mを法とするaの乗法的逆元
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m


def comb(n, max_k, mod):
    """
    (n,k) := n個からk個選ぶ組み合わせ
    k = 0~max_Kまでを計算して返す
    """
    res = [1]*(max_k+1)
    t = 1
    for i in range(max_k+1):
        res[i] *= t
        t *= n-i
        t %= mod

    n = reduce(lambda x,y: (x*y)%mod, range(1,max_k+1), 1)
    n = modinv(n, mod)

    for i in reversed(range(max_k+1)):
        res[i] *= n
        res[i] %= mod
        n *= i
        n %= mod
    return res

from functools import reduce
def solve(N,K):
    MOD = 10**9+7


    r1 = comb(N-K+1, min(K, N-K+1), MOD)
    r2 = comb(K-1, K-1, MOD)

    r1 += [0]*max(0,K+1-len(r1))
    return [(a*b)%MOD for a,b in zip(r1[1:],r2)]


if __name__ == '__main__':
    N,K = map(int,input().split())
    print(*solve(N,K), sep='\n')
a=int(input())
b=int(input())
print(a/b)


### FIXED CODE ###

import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(T,X):
    return T/X

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()
x,y,z=input().split()
a=x//(y+z)
b=x%(y+z)
if b>=z:
  print(a)
else:
  print(a-1)

### FIXED CODE ###

X,Y,Z = map(int,input().split())
ans = (X-Z)//(Y+Z)
print(ans)
n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
for i in range(1,n+1):
  D = D + l[i]
  if D <= x:
    c += 1
  elif:
    break
print(c)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
c = 1
D = 0
li = []
for i in range(1,n+1):
  D = D + l[i-1]
  if D <= x:
    c += 1
print(c)
import math
s=0
n, m=map(int, input().split())

t = {}

while s==0:
    for i in range(2,m+1):
        if m%i==0:
            m=m//i
            if m==1:
                s=1
            if i in t.keys():
                t[i]+=1
            else:
                t[i]=1
            break
out=1
for tk in t.keys():
    out *= combi(t[tk]+n-1, n-1)
print(out%(1000000007))

### FIXED CODE ###

import math

n, m=map(int, input().split())
t = {}
a = int(math.sqrt(m))

s=0

line = [2, 3] + [i%2*2 + i//2 * 6 + 5 for i in range(a)]
# line = [2] + list(range(3, m+2, 2))

for i in line:
# for i in range(2, m+2, 2):
#     print(i)
    cnt = 0
    while m%i==0:
        m=m//i
        cnt += 1

    if cnt>0:
        t[i]=cnt

    if m==1:
        break

if m!=1:
    t[m]=1

def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) 

out=1
for tk in t.keys():
    out *= combi(t[tk]+n-1, n-1)
#     out = out%(1000000007)
print(out%(1000000007))
N=int(input())
List = list(map(int, input().split()))
Row = int(input())
QList = []
for i in range (Row):
  QList.append(list(map(int, input().split())))
dictA ={}
res = 0
for i in range (N):
  dictA.setdefault(List[i],0) 
  dictA[List[i]] += 1
  res += List[i]
for i in range(Row):
  num = dictA[QList[i][0]] 
  res = res - dictA[QList[i][0]] * QList[i][0]
  dictA[QList[i][0]] = 0
  dictA[QList[i][1]] += num
  res += QList[i][1] * num
  print(res)

### FIXED CODE ###

N=int(input())
List = list(map(int, input().split()))
Row = int(input())
QList = []
for i in range (Row):
  QList.append(list(map(int, input().split())))
dictA ={}
res = 0
for i in range (N):
  dictA.setdefault(List[i],0) 
  dictA[List[i]] += 1
  res += List[i]
num = 0
for i in range(Row):
  if QList[i][0] not in dictA:
    pass
  else:
    num = dictA[QList[i][0]] 
    res = res - dictA[QList[i][0]] * QList[i][0]
    dictA[QList[i][0]] = 0
    dictA.setdefault(QList[i][1],0) 
    dictA[QList[i][1]] += num
    res += QList[i][1] * num
  print(res)
s = input()
j = 'Yes'
for i in range(len(s)):
  if (s[i] == 'U') or (s[i] == 'D'):
    continue
  if (s[i] % 2) == 0:
    if (s[i] == 'L'):
      continue
    else:
      j = 'No'
      break
  if (s[i] % 2) == 1:
    if (s[i] == 'R'):
      continue
    else:
      j = 'No'
      break
print(j)

### FIXED CODE ###

s = input()
j = 'Yes'
for i in range(len(s)):
  if (s[i] == 'U') or (s[i] == 'D'):
    continue
  if (i % 2) == 0:
    if (s[i] == 'R'):
      continue
    else:
      j = 'No'
      break
  if (i % 2) == 1:
    if (s[i] == 'L'):
      continue
    else:
      j = 'No'
      break
print(j)