Harryxun/stf_run huggingface dataset:
def main():

    n,m = map(int,input().split())
    ary = []
    for i in range(m):
        aa, bb = map(int,input().split())
        l = min(aa,bb)
        r = max(aa,bb)
        ary.append((l,r))
    ary_s = list(set(ary))
    a = []
    # b = []
    for i in range(len(ary_s)):
        a.append(ary_s[i][0])
        a.append(ary_s[i][1])

    import collections
    c_a = collections.Counter(a).most_common()[0][1]
    print(c_a+1)
if __name__=='__main__':
    main()


### FIXED CODE ###

def main():

    n,m = map(int,input().split())
    ary = []
    for i in range(m):
        aa, bb = map(int,input().split())

        ary.append((aa-1,bb-1))
    ary_s = list(set(ary))
    a = []
    # b = []
    # Union-Find作る
    uf = UnionFind(n)

    for i in range(len(ary_s)):
        a.append(ary_s[i][0])
        a.append(ary_s[i][1])
        uf.union(ary_s[i][0], ary_s[i][1])
    ans = 1
    for i in a:
        ans = max(ans, uf.size(i))
    print(ans)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

if __name__=='__main__':
    main()
N = int(input())
s = N-1
a = N
b = 1
for i in range(int(N**0.5)+1, 1, -1):
        if N%i == 0:
            a = i
            b = N//i
            s = a + b -2
            break

print(s)

### FIXED CODE ###

A, B = map(int, input().split())
if (1 <= A <= 9) & (1 <= B <= 9):
    s = A*B
    print(s)

else:
    print(-1)
a=list(map(inti,input().split()));print(sum(a)-max(a))

### FIXED CODE ###

a=list(map(int,input().split()));print(sum(a)-max(a))
n = int(raw_input())
u = raw_input()
q = int(raw_input())

def cmd_set(q,u):
    x = int(q[0])
    y = int(q[1])
    z = q[2]

    h = u[:x-1]
    t = u[y:]
    zz= z*(y-x+1)

    return h+zz+t

def cmd_comp(q, u):
    a = int(q[0])
    b = int(q[1])
    c = int(q[2])
    d = int(q[3])

    s = u[a-1:b]
    t = u[c-1:d]
    if s < t:
        print "s"
    elif s > t:
        print "t"
    else:
        print "e"

for i in range(q):
    q = raw_input().split()
    cmd = q[0]
    q.pop(0)

    if cmd == 'comp':
        cmd_comp(q, u)
    elif cmd == 'set':
        u = cmd_set(q, u)

### FIXED CODE ###

n = int(raw_input())
u = raw_input()
q = int(raw_input())

def cmd_set(q,u):
    x = int(q[0])
    y = int(q[1])
    z = q[2]

    h = u[:x-1]
    t = u[y:]
    zz= z*(y-x+1)

    return h+zz+t

def cmd_comp(q, u):
    a = int(q[0])
    b = int(q[1])
    c = int(q[2])
    d = int(q[3])

    s = u[a-1:b]
    t = u[c-1:d]
    if s < t:
        print "s"
    elif s > t:
        print "t"
    else:
        print "e"

for i in range(q):
    q = raw_input().split()
    cmd = q[0]
    q.pop(0)

    if cmd == 'comp':
        cmd_comp(q, u)
    elif cmd == 'set':
        u = cmd_set(q, u)
import sys
n, m = map(int, input().split())
image = []
temp = []
match = False
for i in range(n):
  image.append(input())
for i in range(m):
  temp.append(input())
for i in range(n):
  for j in range(n - m + 1):
    if (temp[0] == image[i][j : j + m]):
      match = True
      for k in range(1, m):
        if ((temp[k] != image[i + k][j : j + m]) | (i + k >= n)):
          match = False
          break
      if (match == True):
        print('Yes')
        sys.exit()
print('No')

### FIXED CODE ###

import sys
n, m = map(int, input().split())
image = []
temp = []
match = False
for i in range(n):
  image.append(input())
for i in range(m):
  temp.append(input())
for i in range(n):
  for j in range(n - m + 1):
    if (temp[0] == image[i][j : j + m]):
      match = True
      for k in range(1, m):
        if (i + k >= n):
          match = False
          break
        elif (temp[k] != image[i + k][j : j + m]):
          match = False
          break
      if (match == True):
        print('Yes')
        sys.exit()
print('No')
K=int(input())
inp=input().split(' ')
A=int(inp[0])
B=int(inp[1])
for i in range(A,B+1):
    if i%K==0:
        return "Yes"
    return "No"

### FIXED CODE ###

K=int(input())
A,B = map(int, input().split())
count=0
for i in range(A,B+1):
    if i%K==0:
        print("OK")
        count+=1
        break
if count==0:
    print("NG")
import math
def main():

    N = int(input())

    d = [2 for _ in range(N+1)]
    d[1] = 1

    # for i in range(2, N//2+1):
    #     for j in range(i+i, N+1, i):
    #         d[j] += 1

    v = int(math.sqrt(N))
    for i in range(2, v+1):
        for j in range(i+i, N+1, i):
            d[j] += 1
            if j//i > v: d[j] += 1

    ans = 0
    for i in range(1, N+1):
        ans += i * d[i]
    return ans

if __name__ == '__main__':
    print(main())


### FIXED CODE ###

import math
import collections
def main():

    N = int(input())
    d = dict()
    for i in range(1, N+1):
        d[i] = 0

    ans = 0
    for i in range(1, N+1):
        p = N//i
        ans += p * (p+1)//2 * i
    return ans

if __name__ == '__main__':
    print(main())
k = int(input())
lunluns = list(map(str, range(1,10)))
new = list(map(str, range(1,10)))
new_fueta = 9
end = False
while len(lunluns) < k:
  new_new_fueta = 0
  for x in lunluns[-new_fueta:]:
    str_x = str(x)
    if str_x[-1] == '0':
      lunluns += [int(str_x+'0'),int(str_x+'1')]
      new_new_fueta += 2
    elif str_x[-1] == '9':
      lunluns += [int(str_x+'8'),int(str_x+'9')]
      new_new_fueta += 2
    else:
      l = int(str_x[-1])
      lunluns += [int(str_x+str(l-1)), int(str_x+str(l)), int(str_x+str(l+1))]
      new_new_fueta += 3
  if end:
    break
  new_fueta = new_new_fueta
print(lunluns[k-1])

### FIXED CODE ###

n, k, c = map(int, input().split())
s = input()

def solve_dp(s):
  dp = [0]*(n+2)
  for i in range(n):
    if i <= c and s[i] == 'o':
      dp[i+1] = 1
    else:
      if s[i] == 'o':
        dp[i+1] = max(dp[i], dp[i-c]+1)
      else:
        dp[i+1] = dp[i]
  return dp

mae = solve_dp(s)
ushiro = solve_dp(s[::-1])[::-1]

for i in range(1,n+1):
  if mae[i-1] + ushiro[i+1] < k:
    print(i)
N, K = map(int, input().split())
A = [0] + list(map(int, input().split()))

now = 1
path = [1]

for i in range(N + 2):
    now = A[now]
    i += 1
    if now in path: break
    path.append(now)

if i >= K:
    print(path[K])
    quit()

lo_start = path.index(now)
lo_len = i - lo_start
loop = path[lo_start:]

ans = loop[(K - lo_start) % lo_len]

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
A = [0] + list(map(int, input().split()))

now = 1
path = [1]

for i in range(N + 2):
    now = A[now]
    path.append(now)

if i >= K:
    print(path[K])
    quit()

now = path.pop()
lo_start = i - 1
while path[lo_start] != now:
    lo_start -= 1

loop = path[lo_start:]

ans = loop[(K - path.index(now)) % len(loop)]

print(ans)
N = int(input())
M = int(input())

a = [input().split() for i in range(M)]

if sum(a) > N:
  print(-1)
  
else:
  print(N - sum(a))

### FIXED CODE ###

N, M = input().split()
 
a = list(map(int,input().split()))
 
if sum(a) > int(N):
  print(-1)
  
else:
  print(int(N) - sum(a))
from collections import defaultdict

def main():
    N, M = map(int, input().split())
    g = defaultdict(set)

    for _ in range(M):
        a, b = map(int, input().split())
        a -= 1
        b -= 1 
        g[a].add(b)
        g[b].add(a)

    from functools import lru_cache
    def dfs(u, visited: set):
        visited.add(u)
        for v in g[u]:
            if v not in visited:
                dfs(v, visited)

    count = dict()       
    for u in range(N):
        if u in count:
            continue
        visited = set()
        dfs(u, visited)
        # print(visited)
        count[u] = len(visited)
        for v in visited:
            count[v] = len(visited)

    print(max(count.values()))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10000)
    main()

### FIXED CODE ###

class UnionFind(object):

    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    def get_size(self, x):
        x = self.find(x)
        return self.size[x]


def main():
    N, M = map(int, input().split())

    uf = UnionFind(N)
    for _ in range(M):
        a, b = map(int, input().split())
        uf.union(a-1, b-1)

    ans = max(uf.get_size(i) for i in range(N))
    print(ans)


if __name__ == '__main__':
    main()
n = int(input())
h_lis = list(map(int,input().split()))
for i in range(n-1):
  if h_lis[i]-h_lis[i+1] == 1:
    h_lis[i] -= 1
  else:
    pass
    

for i in range(n-1):
  if h_lis[i]-h_lis[i+1] > 0:
    print('No')
    break
else:
  print('Yes')

    

### FIXED CODE ###

a,b,c = map(int ,input().split())
print(b + c -a if b + c-a >= 0 else 0)
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
s=sum(b)-sum(a)
if s<0:
    print(-1)
else:
    c=[0]*n
    for i in range(n):
        c[i]=a[i]-b[i]
    ans=0
    c=sorted(c)
    for i in range(n):
        if s>=c[i]:
            ans+=1
            s-=c[i]
print(n-ans) 
        

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
s=sum(a)-sum(b)
if s<0:
    print(-1)
else:
    c=[0]*n
    po=0
    ze=0
    ne=0
    nc=0
    for i in range(n):
        c[i]=a[i]-b[i]
        if c[i]>0:
            po+=c[i]
        elif c[i]<0:
            ne-=c[i]
            nc+=1
        else:
            ze+=1
    ans=0
    c=sorted(c)
    for i in range(n-1,-1,-1):
        if ne>0:
            ans+=1
        if c[i]>0:
            ne=ne-c[i]
        
    print(nc+ans)
import sys
while True:
    x = sys.stdin.readline().strip()
    if x == "0 0":
        break
    a = list(map(int, x.strip()))
    sharp = "#" * a[1]
    for i in range(a[0]):
        print(sharp)

### FIXED CODE ###

while True:
    a = list(map(int, input().split()))
    if a[0] == a[1] == 0:
        break
    sharp = "#" * a[1]
    for i in range(a[0]):
        print(sharp)
    print()
import math
X =input()
print(X)
if X == 1:
    output = 1
    print(output)
else:
    mylist = [1]
    biggest = int(math.sqrt(X))
    for i in range(2,biggest):
        bekijo = i
        while bekijo <= X:
            bekijo = bekijo * i
            mylist[i] = bekijo
        #print(mylist[i])
    print(max(mylist))

### FIXED CODE ###

import math

x =input()
X = int(x)

if X == 1:
    output = 1
    print(output)
else:
    mylist = []
    for i in range(2,X+1):
        bekijo = i
        count = 0
        while bekijo <= X:
            bekijo = bekijo * i
            count = count +1
        if count > 1:
            mylist.append(int(bekijo/i))
    print(max(mylist))
s=input()
ind =0
len_s=len(s)
s = s+ "zzzzzzzzzz"

A = "dreamer"
B= "dream"
C= "erase"
D="eraser"

flag =True
while(1):
    if(s[ind] =="d"):
        if(s[ind + 5] =="d"):
            if(s[ind:ind+5]!=B):
                flag = False
                break
            else:
                ind+=5
        else:
            if(s[ind+5]!='e'):
                flag=False
                break
            if(s[ind+7] == "a"):
                if(s[ind:ind+5]!=B):
                    flag = False
                    break
                else:
                    ind+=5

            else:
                if(s[ind:ind+7] !=A):
                    flag = false
                    break
                else:
                    ind+=7
    elif(s[ind]=="e"):
        if(s[ind+5]=="r"):
            if(s[ind:ind+6]!=D):
                flag = False
                break
            else:
                ind+=6

        else:
            if(s[ind:ind +5] !=C):
                flag =False
                break
            else:
                ind+=5
    else:
        flag=False
        break
    if(ind == len_s):
        break
    if(ind > len_s):
        flag=False
        break
if(flag):
    print("YES")
else:
    print("NO")



### FIXED CODE ###

s=input()
ind =0
len_s=len(s)
s = s+ "AAAAAAAAA"

A = "dreamer"
B= "dream"
C= "erase"
D="eraser"

flag =True
while(1):
    if(s[ind] =="d"):
        if(s[ind + 5] =="d"):
            if(s[ind:ind+5]!=B):
                flag = False
                break
            else:
                ind+=5
        else:
            if(s[ind+5]!='e' and s[ind+5]!='A'):
                flag=False
                break
            if(s[ind+7] == "a" or ind + 7 >len_s):
                if(s[ind:ind+5]!=B):
                    flag = False
                    break
                else:
                    ind+=5

            else:
                if(s[ind:ind+7] !=A):
                    flag = False
                    break
                else:
                    ind+=7
    elif(s[ind]=="e"):
        if(s[ind+5]=="r"):
            if(s[ind:ind+6]!=D):
                flag = False
                break
            else:
                ind+=6

        else:
            if(s[ind:ind +5] !=C):
                flag =False
                break
            else:
                ind+=5
    else:
        flag=False
        break
    if(ind == len_s):
        break
    if(ind > len_s):
        flag=False
        break
if(flag):
    print("YES")
else:
    print("NO")
list1 = list(map(int,input().split()))
h = list1[0]
w = list1[1]
a = list()
i = 0
n = 0
ans = list()
while i <= h-1:
    a.append(list(map(int,input().split())))
    i += 1
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i][j+1] += 1
            n+=1
            ans.append(list(i+1,j+1,i+1,j+2))
for i in range(h-1):
    if a[i][w-1] % 2 != 0:
        a[i][w-1] -= 1
        a[i+1][w-1] += 1
        ans.append(list(i+1, w, i+2, w))
        n+=1
print(n)
for i in range(n):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3])

### FIXED CODE ###

list1 = list(map(int,input().split()))
h = list1[0]
w = list1[1]
a = list()
i = 0
n = 0
ans = list()
while i <= h-1:
    a.append(list(map(int,input().split())))
    i += 1
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i][j+1] += 1
            n+=1
            ans.append([i+1,j+1,i+1,j+2])
for i in range(h-1):
    if a[i][w-1] % 2 != 0:
        a[i][w-1] -= 1
        a[i+1][w-1] += 1
        ans.append([i+1, w, i+2, w])
        n+=1
print(n)
for i in range(n):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3])
s = input().split()
a, b = s[0], s[1]
x = [a+b, a-b, a*b]
print(max(x))

### FIXED CODE ###

s = input().split()
a, b = int(s[0]), int(s[1])
x = [a+b, a-b, a*b]
print(max(x))
n=int(input())
i=0
j=n//2
print(i)
a=input()
print(j)
b=input()
if j%2and a!=b or not j%2and a==b:
    i,j=j,n
while 1:
    if j-i<2:
        print(i)
        _=input()
        print(j)
        break
    k=i+(j-i)//2
    print(k)
    c=input()
    if(k-i)%2and a==c:
        j=k
    else:
        i=k
print('hoge')

### FIXED CODE ###

n=int(input())
i=0
j=n-1
print(i)
a=input()
print(j)
b=input()
while 1:
    if j-i<2:
        print(i)
        _=input()
        print(j)
        if input()!='Vacant':
            print('助けてくれ～～～')
    k=(j-i)//2+i
    print(k)
    c=input()
    if(k-i)%2and a==c or not(k-i)%2and a!=c:
        j=k
    else:
        a=c
        i=k
def main():
    N, Q = map(int, input().split())
    # AB = [list(map(int,input().split())) for _ in range(N-1)]
    roots = {}
    for _ in range(N-1):
        root,leaf = map(int,input().split())
        roots[leaf-1] = root-1

    ans = [0 for _ in range(N)]
    for _ in range(Q):
        p,x = map(int, input().split())
        ans[p-1] += x
    # print(ans)
    for i in range(1,N):
        ans[i] += ans[roots[i]]
    print(*ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**6)
N, Q = map(int, input().split())
tree = [[] for _ in range(N)]
ans = [0] * N

def dfs(v, p):
    for u in tree[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)

def main():

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

    for _ in range(Q):
        p,x = map(int, input().split())
        ans[p-1] += x
    # print(ans)

    dfs(0, -1)
    print(*ans)

if __name__ == "__main__":
    main()
a = [int(input()) for i in range(6)]
for i in range(0:4):
  if a[i+1]-a[i]>a[5]:
    print(":(")
else:
  print("Yay!")

### FIXED CODE ###

a = [int(input()) for i in range(6)]
for i in range(0,5):
    for j in range(0,5):
        if abs(a[i]-a[j]) > a[5]:
            print(":(")
            exit()
else:
    print("Yay!")
a,c,b=map(int,input().split())
if c=="+":
  print(a+b)
else:
  print(a-b)

### FIXED CODE ###

a,c,b=input().split()
if c=="+":
  print(int(a)+int(b))
else:
  print(int(a)-int(b))
W = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for s in line.lower().split():
        if s = W:
            count += 1

print(count)
        

### FIXED CODE ###

W = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for s in line.lower().split():
        if s == W:
            count += 1

print(count)
i=(48-i)
print(input())

### FIXED CODE ###

i=int(input())
print(48-i)
a, b = map(int, input())
print(a * b)

### FIXED CODE ###

a, b = map(int, input().split())
print(str(a * b))
a=list(map(int,input().split())
print(sum(a)-max(a))

### FIXED CODE ###

a=list(map(int,input().split()))
print(sum(a)-max(a))
N = int(input())
A = []
for i in range(N):
    A.append(int(input()) )

B=sorted(A)
#print(B[N-1]-B[0] + B[N-1]-B[0])
hN=int(N/2)
cnt=0
C=[]
if N %2 == 0:
    C.append(B[hN])
    for i in range(hN-1):
        C.append(B[N-1-i])
        C.append(B[i])
    C.append(B[hN+1])
else:
    C.append(B[hN])
    for i in range(hN):
        C.append(B[N-1-i])
        C.append(B[i])

#print(C)

for i in range(1,N):
    cnt+=abs(C[i]-C[i-1])

C=[]
cnt2=0
if N %2 == 0:
    C.append(B[hN-1])
    for i in range(hN):
        C.append(B[i])
        C.append(B[N-1-i])
    C.append(B[hN+1])
else:
    C.append(B[hN])
    for i in range(hN):
        C.append(B[i])
        C.append(B[N-1-i])

#print(C)
for i in range(1,N):
    cnt2+=abs(C[i]-C[i-1])

print(max(cnt,cnt2))

### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()) )

B=sorted(A)
#print(B[N-1]-B[0] + B[N-1]-B[0])
hN=int(N/2)
cnt=0
C=[]
if N ==2:
    print(B[1]-B[0])
    exit()

if N %2 == 0:
    C.append(B[hN])
    for i in range(hN-1):
        C.append(B[N-1-i])
        C.append(B[i])
    C.append(B[hN-1])
else:
    C.append(B[hN])
    for i in range(hN):
        C.append(B[N-1-i])
        C.append(B[i])

#print(C)

for i in range(1,N):
    cnt+=abs(C[i]-C[i-1])

C=[]
cnt2=0
if N %2 == 0:
    C.append(B[hN])
    for i in range(hN-1):
        C.append(B[i])
        C.append(B[N-1-i])
    C.append(B[hN-1])
else:
    C.append(B[hN])
    for i in range(hN):
        C.append(B[i])
        C.append(B[N-1-i])

#print(C)
for i in range(1,N):
    cnt2+=abs(C[i]-C[i-1])

print(max(cnt,cnt2))
K,N=map(int,input().split())
A=list(map(int,input().split()))
A.sort()

def distance(x):
    q=x[1:]-x[:-1]
    return q

B=distance(A)
B.append(K+A[0]-A[N-1])
print(K-max(B))

### FIXED CODE ###

import numpy as np

K,N=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
x=np.array(A[1:])
y=np.array(A[:-1])
B=x-y
C=B.tolist()
C.append(K+A[0]-A[N-1])
print(K-int(max(C)))
N,M  = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(M)]

#xの木の根を求める
def root(x,li): 
    if li[x] == x:
        return x
    else:
        li[x] = root(li[x],li)
        return li[x]

#xとyが同じ集合に属するかの判定
def find(x,y,li):
    return root(x,li) == root(y,li)

#xとｙを併合
def union(x,y,li):
    x = root(x,li)
    y = root(y,li)
    if x==y:
        return
    else:
        li[x] = y

li = [i for i in range(N)]

for i in range(len(AB)):
    AB[i][0] -= 1
    AB[i][1] -= 1
    union(AB[i][0], AB[i][1], li)

for i in range(N):
    root(i, li)

cnt = [0 for i in range(N)]
for i in range(N):
    cnt[li[i]] += 1
print(max(cnt))

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000+10)

N,M  = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(M)]

class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
            # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]

UF = UnionFind(N)
li = [i for i in range(N+20)]

for i in range(len(AB)):
    AB[i][0] -= 1
    AB[i][1] -= 1
    UF.Unite(AB[i][0], AB[i][1])

cnt = [UF.Count(i) for i in range(N)]
print(max(cnt))
a,b,h=map(int,input().split())
print((a+b)*h//2)


### FIXED CODE ###

a=int(input())
b=int(input())
h=int(input())
print((a+b)*h//2)
N=int(input())
B=list()
B.append(input())
for i in range(N-1):
	tmp=input()
	if tmp in B:
		print('No')
		exit()
	if tmp[0]!=B[i-1][-1]:
		print('No')
		exit()
print('Yes')

### FIXED CODE ###

N=int(input())
B=list()
B.append(input())
ans='Yes'
for i in range(N-1):
    tmp=input()
    if tmp in B:
        ans='No'
    if tmp[0]!=B[i][-1]:
        ans='No'
    B.append(tmp)
print(ans)
print(str(input())[::-1])

### FIXED CODE ###

print(raw_input()[::-1])
ans = 1
for i in a:
    ans *= i
    if ans > pow(10,18):
        print(-1)
        break
print(ans)


### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]
if 0 in a:
    print(0)
else:

    ans = 1
    for i in a:
        ans *= i
        if ans > pow(10,18):
            ans = -1
            break
    print(ans)
import math
A,B=map(int, input().split())
 
print(math.ceil((B-1)/(A-1))

### FIXED CODE ###

import math
A,B=map(int, input().split())

print(1+math.ceil((B-A)/(A-1)))