Harryxun/stf_run huggingface dataset:
m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s:
    print('No')
else:
    if c>d:
        if '...' in s[:d]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes') 

### FIXED CODE ###

n, a, b, c, d = (int(i) for i in input().split())  
s = str(input())
n = len(s)

m = max([c, d])
if n>m:
    n = m
    s = s[:n]
    
if '##' in s[a-1:]:
    print('No')
elif b>c:
    print('Yes')
else:
    if c>d:
        if '...' in s[b-2:d+1]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
a , b = map(int(input().split())

if a == b:
    print("Draw")
elif a == 1 B != 1:
            print("Alice")
elif a != 1 B == 1:
            print("Bob")
elif a < b:
            print("Alice")
else:
            print("Bob")
      

### FIXED CODE ###

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

if a == b:
    print("Draw")
elif a == 1 and b != 1:
            print("Alice")
elif a != 1 and b == 1:
            print("Bob")
elif a < b:
            print("Bob")
else:
            print("Alice")
n = int(input())
data = map(int, input().split())
up = 0
for i in range(n):
  up *= data[i]

down = 0
for j in range(n):
  down += up / data[j]

print(up / down)

### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print("red")
A,B,C = list(map(int,input().split()))
def swap(x,y):
  tmp=x
  x=y
  y=temp
  return(x,y)
A,B = swap(A,B)
A,C = swap(A,C)
print(X,Y,Z)

### FIXED CODE ###

x,y,z = list(map(int,input().split()))
 
def swap(a,b):
    tmp = a
    a = b
    b = tmp
    return (a,b)
 
x,y = swap(x,y)
x, z = swap(x, z)
print(x,y,z)
import sys
input = sys.stdin.readline
import numpy as np

N, K = [int(item) for item in input().split()]
h =np.array([int(item) for item in input().split()])

dp = np.full(N+1, 10**5)
dp[0] = 0
dp[1] = abs(h[1] - h[0])

for i in range(1,N):
    start = max(0, i-K)
    cost = np.abs(h[start:i] - h[i])
    dp[i] =min(np.minimum(dp[start:i] + cost, dp[i]))
    # print(start, i)
    # print(dp)
print(dp[N-K])


### FIXED CODE ###

import numpy as np

N, K = [int(item) for item in input().split()]
h =np.array([int(item) for item in input().split()])
# print(h.shape)
dp = np.full(N+K, 10**10+1, dtype='int64')
dp[0] = 0

for i in range(1, N):
    max1 = min(N, i+K)
    cost = abs(h[i:max1] - h[i-1])
    # print(cost.shape, dp[i:max1].shape)
    dp[i:max1] = np.minimum(dp[i:max1], dp[i-1] + cost)

    # print(dp)
print(dp[N-1])
a, b, c, b = map(int, input().split())
if a * b > c * b:
    print(a * b)
elif a * b < c * b:
    pritn(c * d)
else:
    print(a * b)

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if a * b > c * d:
    print(a * b)
elif a * b < c * d:
    print(c * d)
else:
    print(a * b)
N = int(input())
A = list(input().split())
A = [int(i) for i in A]
B = len(A)+1

for i in range(B):
    print(A.count(i+1))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math


R = int(input())
PI = math.pi

ans = 2 * R * PI
print(ans)
while True:
    a,op,b=input().split()
    if op == "?":
        break
    else:
        if op == "+":
            print(int(a)+int(b))
        elif op == "-":
            print(int(a)-int(b))
        elif op == "*":
            print(int(a)*int(b))
        elif op == "/":
            Print (int (a) //int (b))
        else:
            print("error") 

### FIXED CODE ###

while True:
    a, op, b = input().split()
    if op == '?':
        break
    if op == '/':
        op = '//'
    print(eval(a + op + b))
# -*- coding: utf-8 -*-

import sys

dic = {'A':0, 'B':0, 'AB':0, 'O':0}
for line in sys.stdin:
    id, type = map(int, line.split(','))
    dic[type] += 1
for key in dic:
    print dic[key]

### FIXED CODE ###

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

import sys

dic = {'A':0, 'B':0, 'AB':0, 'O':0}
for line in sys.stdin:
    id, type = map(str, line.split(','))
    type = type[:len(type)-1]
    dic[type] += 1
print dic['A']
print dic['B']
print dic['AB']
print dic['O']
while True:
       (H, W) = [int(x) for x in input().split()]
       if H == W == 0:
            break

    
       for hc in range(H):
             for wc in range(W):
                  print('#',end=' ')

             print()

      print()

### FIXED CODE ###

while True:
    (H, W) = [int(i) for i in input().split()]
    if H == W == 0:
        break

    for a in range(H):
        for b in range(W):
            print('#',end='')
        print()
    print()
import collections

n = int(input())
s = [input() for i in range(n)]
t = collections.Counter(s)
d = 0
i = 0
x = []
while d==0:
    x.append(t.most_common()[i][0])
    if len(t.most_common())>1:
        d=t.most_common()[i][1]-t.most_common()[i+1][1]
        i+=1
    else:
        d=1
x.sort()
for i in range(len(x)):
    print(x[i])

### FIXED CODE ###

import collections

n = int(input())
s = [input() for i in range(n)]
t = collections.Counter(s)
tm = t.most_common()
x = [tm[i][0] for i in range(len(tm)) if tm[i][1]==tm[0][1]]
x.sort()
for i in range(len(x)):
    print(x[i])
hn_kz = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
kz_hn = {}
n, m, *kzs = map(int, open(0).read().split())
# 本数から数を求める辞書を作る。同じ本数の数は大きい方を取る
for kz in kzs:
    ah = hn_kz[kz]
    if ah in kz_hn:
        kz_hn[ah] = max(kz_hn[ah], kz)
    else:
        kz_hn[ah] = kz
# 最小の本数をhmnに格納
hmn = min(kz_hn.keys())
# まず、最小の本数の数だけで桁[本数]の辞書を作る
kt_hn = {kt * hmn: kt for kt in range(n // hmn + 1)}
# 最小本数以外の数の辞書nkz_hnを作る
nkz_hn = kz_hn.copy()
del nkz_hn[hmn]

inf = 10**9

def keta(hn):
    #    print(hn,kt_hn)
    if hn in kt_hn:
        return kt_hn[hn]
    elif hn < 0:
        return -inf
    else:
        maxketa = -inf
        for hni in nkz_hn.keys():
            newkt = keta(hn - hni) + 1
            if newkt > maxketa:
                maxketa = newkt
        kt_hn[hn] = maxketa
        return maxketa

ans = ""
nokori = n
while nokori > 0:
    for kh in sorted(kz_hn.items(), key=lambda xkh: xkh[1], reverse=True):
        if keta(nokori - kh[0]) == keta(nokori) - 1 and keta(nokori)>0:
            ans += str(kh[1])
            nokori -= kh[0]
            break

print(ans)

### FIXED CODE ###

def smax(s1, s2):
    if s1=="N":
        if s2[0]=="N":
            return "N"
        else:
            return s2
    if s2[0] == "N":
        return s1
    l1 = len(s1)
    l2 = len(s2)
    if l1 == l2:
        return max(s1, s2)
    if l1 > l2:
        return s1
    return s2

hon = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
n, m = map(int, input().split())
aa = list(map(int, input().split()))
dp = ["N"] * (n + 1)
dp[0]=""
for i in range(2, n + 1):
    for a in aa:
        if i - hon[a] < 0: continue
        dp[i] = smax(dp[i], dp[i - hon[a]] + str(a))
print(dp[-1])
from collections import Counter
s=input()
a=len(s)
counter = Counter(s[2:a-2])
if s[0]!="A":
  print("WA")
  break
else:
  if counter("C")!=1:
    print("WA")
else:
  s.replace("A","a",1)
  s.replace("C","c",1)
  if s.islower()==False:
    print("WA")
  else:
    print("AC")

### FIXED CODE ###

from collections import Counter
s=input()
a=len(s)
counter = Counter(s[2:a-1])
if s[0]!="A":
  print("WA")
  
elif counter["C"]!=1:
  
    print("WA")
else:
  
  s[1:].replace("C","c",1)
  if s[1:].replace("C","c",1).islower()==False:
    print("WA")
  else:
    print("AC")
#encoding:utf-8

import math
import itertools

n = int(input())
s = []
for i in range(n):
    s.append(str(input()))

chosen_names = {"m":0,"a":0,"r":0,"c":0,"h":0}

for name in s:
    if name[0] == "M":
        chosen_names["m"] += 1
    elif name[0] == "A":
        chosen_names["a"] += 1
    elif name[0] == "R":
        chosen_names["r"] += 1
    elif name[0] == "C":
        chosen_names["c"] += 1
    elif name[0] == "H":
        chosen_names["h"] += 1

answer = 0
capitals = list("march")
capital_set = itertools.com
binations(capitals,3)
for capital in capital_set:
    answer += chosen_names[capital[0]] * chosen_names[capital[1]] * chosen_names[capital[2]]


print(answer)



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


### FIXED CODE ###

#encoding:utf-8

import math
import itertools

n = int(input())
s = []
for i in range(n):
    s.append(str(input()))

chosen_names = {"m":0,"a":0,"r":0,"c":0,"h":0}

for name in s:
    if name[0] == "M":
        chosen_names["m"] += 1
    elif name[0] == "A":
        chosen_names["a"] += 1
    elif name[0] == "R":
        chosen_names["r"] += 1
    elif name[0] == "C":
        chosen_names["c"] += 1
    elif name[0] == "H":
        chosen_names["h"] += 1

answer = 0
capitals = list("march")
capital_set = itertools.combinations(capitals,3)
for capital in capital_set:
    answer += chosen_names[capital[0]] * chosen_names[capital[1]] * chosen_names[capital[2]]


print(answer)



# def combinations_count(n,r):
#     return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
x = int(input())
print(!x)

### FIXED CODE ###

x = int(input())
print(1-x)
N, M, C = map(int, input().split())
Blis = [int(x) for x in input().split()]
Alis = []*N
k = 0
for i in range(N):
  Alis[i] = [int(x) for x in input().split()]
for i in range(N):
  total = 0
  for j in range(M):
    total = total + (Alis[i][j])*(Blis[j])
  total = total + C
  if total > 0:
    k = k + 1
print(k)

### FIXED CODE ###

N, M, C = map(int, input().split())
Blis = [int(x) for x in input().split()]
k = 0
for i in range(N):
  Alis = [int(x) for x in input().split()]
  total = 0
  for j in range(M):
    total = total + (Alis[j])*(Blis[j])
  total = total + C
  if total > 0:
    k = k + 1
print(k)
import math
phi = (1 + math.sqrt(5)) / 2

def counter(n):
    if n == 0:
        return 0
    else:
        f = round(phi**(n) / math.sqrt(5)) % (10**9+7)
        return f
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
if M == 0:
    print(counter(N+1))
    exit()
a.append(N + 1)
ans = counter(a[0])
for i in range(1,M+1):
    ans = (ans * counter(a[i]-a[i-1]-1)) % (10**9+7)
#ans = ans * round(phi**(N-a[-1]) / math.sqrt(5)) % (10**9+7)
print(ans)

### FIXED CODE ###

def fib(n):
    if n == 1 or n == 2:
        return 1
    else:
        a = 1
        b = 0
        for _ in range(n-1):
            (a, b) = (a+b, a)
        return a % (10 ** 9 + 7)


def counter(n):
    if n == 0:
        return 0
    else:
#        f = round(phi**(n) / math.sqrt(5)) % (10**9+7)
        return fib(n)


N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
if M == 0:
    print(counter(N+1))
    exit()
a.append(N+1)
ans = counter(a[0])
for i in range(1,M+1):
    ans = (ans * counter(a[i]-a[i-1]-1)) % (10**9+7)
print(ans)
def comb(a, b):
    if(a < b or b < 0):return 0
    if(b > a - b):return comb(a, a - b)
    return comb(a, b - 1) * (a - b + 1) / b

a, b, c = map(int, raw_input().split())
c -= a * b
print comb(c + a - 1, c)

### FIXED CODE ###

def fact(x):
    res = 1
    for i in xrange(1, x + 1):
        res *= i
    return res

def comb(a, b):
    if(a < b or b < 0):return 0
    if(b == 0):return 1
    return fact(a)/fact(b)/fact(a-b)

a, b, c = map(int, raw_input().split())
c -= a * b
print comb(c + a - 1, c)
a,b=map(int,input().split())
n=list([input() for i in range(b)])
for i in n:
    p=sorted(n)
    q=''.join(p)
print(q)

### FIXED CODE ###

a,b=map(int,input().split())
n=sorted([input() for i in range(a)])
print(*n,sep='')
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
import numpy as np

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, Q = MAP()

tree = defaultdict(list)

# ノードの重み

cnt = [0] * N

# tree 隣接リスト
for i in range(N-1):
    a, b = LIST()
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

for i in range(Q):
    node, point = LIST()
    cnt[node-1] += point

ans = [0] * N
q = deque([])
# 始点
q.append(0)
# 各頂点を見たかどうかのフラグ
checked = [0] * N
checked[0] = 1

while q:
    v = q.pop()
    checked[v] = 1
    for u in tree[v]:
        if checked[u] == 1:
            continue
        cnt[u] += cnt[v]
        q.append(u)
print(*cnt)


### 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
import numpy as np

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, Q = MAP()

tree = defaultdict(list)

# ノードの重み

cnt = [0] * N

# tree 隣接リスト
for i in range(N-1):
    a, b = LIST()
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

for i in range(Q):
    node, point = LIST()
    cnt[node-1] += point

ans = [0] * N
q = deque([])
# 始点
q.append(0)
# 各頂点を見たかどうかのフラグ
checked = [0] * N
checked[0] = 1

while q:
    v = q.pop()
    checked[v] = 1
    for u in tree[v]:
        if checked[u] == 1:
            continue
        cnt[u] += cnt[v]
        q.append(u)
print(*cnt)
n = int(input())
i = 1
sum = 0
for i in range(1,n){
  sum += i
}
print i


### FIXED CODE ###

n = int(input())
i = 1
sum = 0
for i in range(1,n + 1):
  sum += i
print(sum)
n = int(input())
lr = [list(map(int, input().split())) for _ in range(n)]
print(sum([i[1] -1[0] + 1 for i in lr]))

### FIXED CODE ###

n = int(input())
lr = [list(map(int, input().split())) for _ in range(n)]
print(sum([i[1] -i[0] + 1 for i in lr]))
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n, k = map(int, input().split())
  s = input().strip()
  sz, ez = [], []
  i = 0
  while i < n:
    if s[i] == '0':
      sz.append(i)
      while i < n and s[i] == '0': i += 1
      ez.append(i)
    else:
      i += 1
  
  if k >= len(sz):
    print(len(s))
    return 
  max = -1
  for i in range(k+1):
    if i==0:
      score = sz[i+k] - 0
    elif i==k:
      score = n - ez[i-1]
    else:
      score = sz[i+k] - ez[i-1]
    if max < score:
      max = score
  print(max)
      

if __name__=='__main__':
  main()


  


### FIXED CODE ###

#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  n, k = map(int, input().split())
  s = input().strip()
  sz, ez = [], []
  i = 0
  while i < n:
    if s[i] == '0':
      sz.append(i)
      while i < n and s[i] == '0': i += 1
      ez.append(i)
    else:
      i += 1
  
  if k >= len(sz):
    print(len(s))
    return 
  max = -1
  for i in range(len(sz)-k+1):
    if i==0:
      score = sz[i+k] - 0
    elif i==len(sz)-k:
      score = n - ez[i-1]
    else:
      score = sz[i+k] - ez[i-1]
    if max < score:
      max = score
  print(max)
      

if __name__=='__main__':
  main()
import bisect
import collections
n = int(input())
a = [int(i) for i in input().split()]


a_sum = [0]
for i in range(n):
    a_sum.append((a_sum[-1]+a[i]))

val = collections.deque()
cnt = collections.deque()
for i in range(n+1):
    idx = bisect.bisect_left(val, a_sum[i])
    if len(val) > idx and val[idx] == a_sum[i]:
        cnt[idx] += 1
    else:
        val.insert(idx, a_sum[i])
        cnt.insert(idx,1)

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

print(ans)

### FIXED CODE ###

from collections import Counter

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

a_sum = [0]
for i in range(n):
    a_sum.append((a_sum[-1]+a[i]))

cnt = Counter(a_sum)

ans = 0
for v in cnt.values():
    ans += v*(v-1)//2

print(ans)
num = int(input())
order = input().split()
manzoku = input().split()
additional = input().split()

prev = 0
ans = 0
for i in range(num):
  ans += manzoku[i]
  if i = prev+1:
    ans += additional[i]
  prev += 1
  
print(ans)

### FIXED CODE ###

num = int(input())
order = input().split()
order = [int(i) for i in order]
manzoku = input().split()
additional = input().split()

prev = -1
ans = 0
for i in order:
  ans += int(manzoku[i-1])
  if i == prev+1:
    ans += int(additional[i-2])
  prev = i
  
print(ans)
N = int(input())
count = [0 for i in range(N)]
n = []
for _ in range(N-1):
  a, b = map(int, input().split())
  count[a-1] += 1
  count[b-1] += 1
  n.append([a, b])

K = max(count)
All = set(range(1, K+1))
memo = [[] for i in range(N)]
print(K)
for a, b in n:
  m = list(All - set(memo[a-1] + memo[b-1]))[0]
  memo[a-1].append(m)
  memo[b-1].append(m)
  print(m)

### FIXED CODE ###

from collections import deque

N = int(input())

G = [[] for _ in range(N)]
for i in range(N-1):
  a, b = map(int, input().split())
  G[a-1].append([b-1, i])
  G[b-1].append([a-1, i])


q = deque()
q.append([0, 0, 0])

colors = [0] * (N-1)
while q:
  node, parent, edge_color = q.popleft()
  c = 1
  for child, index in G[node]:
    if child == parent:
      continue
    
    if c == edge_color:
      c += 1
    
    q.append([child, node, c])
    colors[index] = c
    c += 1

print(max(colors))
print(*colors, sep='\n')
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x*y/gcd(x,y)
# LCM --- END ---

def main():
  n=I()
  ans=I()

  for _ in range(n-1):
    ans=int(lcm(ans,I()))

  return ans

# main()
print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# GCD -- START --
def gcd(x,y):
  while y:
    x,y=y,x%y
  return x
# GCD --- END ---

# LCM -- START --
def lcm(x,y):
  return x*y//gcd(x,y)
# LCM --- END ---

def main():
  n=I()
  ans=I()

  for _ in range(n-1):
    ans=lcm(ans,I())

  return ans

# main()
print(main())
import math
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=input()
hand=[[] for _ in range(k)]
for i in range(len(t)):
    hand[i%k].append(t[i])

def janken(str):
    if str == "r":
        return p
    elif str == "s":
        return r
    else:
        return s

counter=0

for ha in hand:
    dp=[janken(ha[0])]
    if ha[0]==ha[1]:
        dp.append(dp[0])
    else:
        dp.append(janken(ha[0])+janken(ha[1]))
    
    for i in range(2,len(ha)):
        if ha[i-1] != ha[i]:
            dp.append(dp[i-1]+janken(ha[i]))
        elif ha[i] != ha[i-2]:
            dp.append(dp[i-1])
        elif dp[i-2] == dp[i-1]:
            dp.append(dp[i-1]+janken(ha[i]))
        else:
            dp.append(dp[i-1])
    counter += dp[-1]
            

print(counter)

### FIXED CODE ###

import math
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=input()
hand=[[] for _ in range(k)]
for i in range(len(t)):
    hand[i%k].append(t[i])

def janken(str):
    if str == "r":
        return p
    elif str == "s":
        return r
    else:
        return s

counter=0

for ha in hand:
    dp=[janken(ha[0])]
    if len(ha) == 1:
        counter += dp[0]
        continue

    if ha[0]==ha[1]:
        dp.append(dp[0])
    else:
        dp.append(janken(ha[0])+janken(ha[1]))
    
    for i in range(2,len(ha)):
        if ha[i-1] != ha[i]:
            dp.append(dp[i-1]+janken(ha[i]))
        elif ha[i] != ha[i-2]:
            dp.append(dp[i-1])
        elif dp[i-2] == dp[i-1]:
            dp.append(dp[i-1]+janken(ha[i]))
        else:
            dp.append(dp[i-1])
    counter += dp[-1]
            

print(counter)
min_tap = 0
if B <= A:
    min_tap = 1
else:
    min_tap =math.ceil((B-A)/(A-1))+1
print(int(min_tap))

### FIXED CODE ###

import math
A,B= list(map(int,input().split()))
#for i in range(1,22):
#    if (A-1)*(i-1)+A >=B:
#        print(i)
#        break
print(math.ceil((B-A)/(A-1))+1)
import math
t=1
for i in range(int(input())):
    s=int(input())
    t=t*s//math.gcd(s,t)
print(t)

### FIXED CODE ###

n=int(input())
t=1
for i in range(n):
    s=int(input())
    if t>s: a,b=t,s
    else: a,b=s,t
    
    while b!=0:
        a, b = b, a%b
    t=t*s//a
print(t)
n,k=int(input().split())
a=[]
def x(t,k):
  c=0
  while t<k:
    t*=2
    c+=1
  return c

for i in range(n):
  a.append(x(i+1),k)

ans=0
for i in range(k):
  ans=ans+1/n*(1/2)**k
print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
a=[]
def x(t,k):
  c=0
  while t<k:
    t*=2
    c+=1
  return c

for i in range(n):
  a.append(x(i+1,k))

ans=0
for i in range(n):
  ans=ans+1/n*(1/2)**a[i]
print(ans)
s=input()
from itertools import groupby as gb
print(len(gb(s)))

### FIXED CODE ###

s=input()
ans=0
for x,y in zip(s,s[1:]):
  if x!=y:ans+=1
print(ans)
x = int(input())
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)

### FIXED CODE ###

x = int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)
# -*- coding:utf-8 -*-
import sys

def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if 0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
sys.setrecursionlimit(1000000)
tile = [[0 for i in range(1)] for j in range(1)]
while True:
	counter+=1
	line = input()
	if ' ' in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(N)] for j in range(M)]
	if N is 0 and M is 0:
		break
	else:
		tile[counter-2] = list(line)
	if (counter-1)==M:
		solve()
		counter = 0

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0