Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import numpy as np
N = int(input())
a_s = input().split()
for i in range(N):
    a_s[i] = int(a_s[i])
a_s = np.array(a_s)

a_unique = np.unique(a_s)
a_counts = []
for i,a in enumerate(a_unique):
  a_counts.append(sum(a_s==a))

ans = 0
for i in range(len(a_unique)):
    val = a_counts[i]
    if i>0:
        if a_unique[i-1]+1==a_unique[i]:
            val += a_counts[i-1]
            
    if i<len(a_unique)-1:
        if a_unique[i+1]-1==a_unique[i]:
            val += a_counts[i+1]
            
    if val > ans:
        ans = val
        
print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
a_s = input().split()
a_s = [int(a_s[i]) for i in range(N)]

c = Counter(a_s)
c = sorted(c.items(), key=lambda x:x[0])
a_unique, a_counts = zip(*c)

ans = 0
for i,a in enumerate(a_unique):
    val = a_counts[i]
    if (i>0):
        if (a_unique[i-1]+1==a):
            val += a_counts[i-1]
            
    if (i<len(a_unique)-1):
        if (a_unique[i+1]-1==a):
            val += a_counts[i+1]
    
    if val > ans:
        ans = val
        
print(ans)
### BUGGY CODE ###

from collections import deque
import sys
input = sys.stdin.readline
n,x,y = map(int,input().split())
to = [[] for _ in range(n)]
for i in range(n-1):
    to[i].append(i+1)
    to[i+1].append(i)
x -= 1
y -= 1
to[x].append(y)
to[y].append(x)

ans = [0]*(n-1)
d = {}
for i in range(n-1):
    Q = deque()
    Q.append((i,-1,0))
    flag = [False]*n
    flag[i] = True
    while Q:
        cur,prev,dist = Q.popleft()
        for nxt in to[cur]:
            if nxt == prev: continue
            if flag[nxt]: continue
            flag[nxt] = True
            if (i,nxt) not in d: ans[dist] += 1
            Q.append((nxt,cur,dist+1))
            d[(i,nxt)] = 1
            d[(nxt,i)] = 1

print("\n".join(map(str,ans)))

### FIXED CODE ###

n,x,y = map(int,input().split())
ans = [0]*(n-1)
x -= 1
y -= 1
for i in range(n-1):
    for j in range(i+1,n):
        dist = min(j-i,abs(x-i)+1+abs(j-y),abs(y-i)+1+abs(j-x))
        ans[dist-1] += 1
print("\n".join(map(str,ans)))
### BUGGY CODE ###

#12:40
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
dp = [0]
for i in range(1,n+1):
  tmp = [dp[-1]+1]
  for k in range(3):
    if i - a[k] >= 0:
      tmp.append(dp[i-a[k]]+b[k])
  #print(dp,tmp)
  dp.append(max(tmp))
m = dp[-1]
#print(dp)
#print(m)
dp = [0]
for j in range(1,m+1):
  tmp = [dp[-1]+1]
  for k in range(3):
    if j - b[k] >= 0:
      #print(j,b[k],dp)
      tmp.append(dp[j-b[k]]+a[k])
  dp.append(max(tmp))
print(dp[-1])

### FIXED CODE ###

#12:40
n = int(input())
a1,a2,a3 = map(int,input().split())
b1,b2,b3 = map(int,input().split())
dp = [0] * (n+1)
for i in range(1,n+1):
  tmp = dp[i-1]+1
  if i-a1 >= 0:
    if dp[i-a1]+b1 > tmp:
      tmp = dp[i-a1]+b1
  if i-a2 >= 0:
    if dp[i-a2]+b2 > tmp:
      tmp = dp[i-a2]+b2
  if i-a3 >= 0:
    if dp[i-a3]+b3 > tmp:
      tmp = dp[i-a3]+b3
  dp[i] = tmp
m = dp[-1]
#print(dp)
#print(m)
dp = [0] * (m+1)
for j in range(1,m+1):
  tmp = dp[j-1]+1
  if j-b1 >= 0:
    if dp[j-b1]+a1 > tmp:
      tmp = dp[j-b1]+a1
  if j-b2 >= 0:
    if dp[j-b2]+a2 > tmp:
      tmp = dp[j-b2]+a2
  if j-b3 >= 0:
    if dp[j-b3]+a3 > tmp:
      tmp = dp[j-b3]+a3
  dp[j] = tmp
print(dp[-1])
### BUGGY CODE ###

import fractions
n = int(input())
lis = list(map(int,input().split()))
lis.sort()
if n == 2:
  print(max(lis))
  exit()
li = [lis[0]]
lii = [lis[-1]]
for i in range(1,n):
  li.append(fractions.gcd(li[i-1],lis[i]))
  lii.insert(0,fractions.gcd(lii[-i],lis[-(i+1)]))
ans = max(lii[1],li[-2])
for i in range(n-2):
  ans = max(ans,fractions.gcd(li[i],lii[i+2]))
print(ans)

### FIXED CODE ###

from fractions import gcd
n = int(input())
a = list(map(int, (input().split())))

if n == 2:
    print(max(a[0], a[1]))
    exit()

noskip = gcd(a[0], a[1])
skipped = max(gcd(a[0], a[2]), gcd(a[1], a[2]))

for i in range(2, n):
    skipped = max(gcd(skipped, a[i]), noskip)
    noskip = gcd(noskip, a[i])

print(max(noskip, skipped))
### BUGGY CODE ###

def comb(n, k, MOD = 10 ** 9 + 7):
    if n < k:
        return 0
    if n - k < k:
        k = n - k
    comb = 1
    for x in range(n - k + 1, n + 1):
        comb = (comb * x) % MOD
    d = 1
    for x in range(1, k + 1):
        d = (d * x) % MOD
    comb *= pow(d, MOD - 2, MOD)
    return comb % MOD

def main():
    N = int(input())
    A = [int(v) for v in input().split()]
    C = [0] * (N + 1)

    for i in A:
        C[i] += 1


    for i in range(N):
        C[A[i]] -= 1
        ans = 0
        for cnt in C:
            ans += comb(cnt, 2)
        C[A[i]] += 1
        print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N = int(input())
    A = [int(v) for v in input().split()]
    C = [0] * (N + 1)

    for i in A:
        C[i] += 1

    b = 0
    
    for cnt in C:
        b += ((cnt * (cnt - 1)) // 2)

    for i in range(N):
        p = ((C[A[i]] - 1) * (C[A[i]] - 2)) >> 1
        m = (C[A[i]] * (C[A[i]] - 1)) >> 1
        print(b - m + p)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import numpy as np

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

for k in range(0, min(100, K)):
    work = np.zeros_like(A)
    for i in range(0, N):
        l = max(0, i - A[i])
        r = min(N - 1, i + A[i])
        work[l] += 1
        if (r + 1 < N):
            work[r + 1] -= 1
    work = np.cumsum(work)
    A = work

print(" ".join([str(item) for item in work]))

### FIXED CODE ###

import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@njit('(i8[::1],)', cache=True)
def update(A):
    N = len(A)
    B = np.zeros_like(A)
    for i, x in enumerate(A):
        l = max(0, i - x)
        r = min(N - 1, i + x)
        B[l] += 1
        if r + 1 < N:
            B[r + 1] -= 1
    B = np.cumsum(B)
    return B

N, K = map(int, readline().split())
A = np.array(read().split(), np.int64)

K = min(K, 100)
for _ in range(K):
    A = update(A)
print(' '.join(A.astype(str)))
### BUGGY CODE ###

import itertools
n = int(input())
*s, = input()

ans = []
for i in itertools.combinations(s, 3):
    ans.append(i)

print(len(set(ans)))


### FIXED CODE ###

n = int(input())
s = input()

ans = 0
for i in range(10):
    a = s.find(str(i))
    if a == -1:
        continue

    for j in range(10):
        b = s.find(str(j), a+1)
        if b == -1:
            continue

        for k in range(10):
            if s.find(str(k), b+1) != -1:
                ans += 1

print(ans)
### BUGGY CODE ###

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

x, y, z, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

yam = []
for l in range(x):
    for m in range(y):
        for n in range(z):
            yam.append(a[l]+b[m]+c[n])
yam.sort(reverse=True)
#print(yam)

for l in range(k):
        print(yam[l])

### FIXED CODE ###

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

import heapq

x, y, z, k = map(int, input().split())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

yam = []
for l in range(x):
    for m in range(y):
        for n in range(z):
            if k < len(yam) and a[l]+b[m]+c[n] <= yam[0]:
                break
            elif k < len(yam):
                heapq.heappushpop(yam, a[l]+b[m]+c[n])
            else:
                heapq.heappush(yam, a[l]+b[m]+c[n])
yam.sort(reverse=True)
#print(yam)

for l in range(k):
        print(yam[l])
### BUGGY CODE ###

X, Y, Z, K = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

ablst = [m + n for n in b for m in a]
ablst.sort(reverse=True)

abclst = []
abclst = [m + n for n in c for m in ablst[:K]]
abclst.sort(reverse=True)

print(*abclst[:K], sep='\n')


### FIXED CODE ###

import sys
input = sys.stdin.readline

X, Y, Z, K = map(int, input().split())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

a.sort(reverse=True)
b.sort(reverse=True)

ablst = [m + n for n in b for m in a]

ablst.sort(reverse=True)

c.sort(reverse=True)

abclst = [m + n for n in c[:K] for m in ablst[:K]]

abclst.sort(reverse=True)

print(*abclst[:K], sep='\n')
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
from collections import deque
from math import inf


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


def bfs(maze, Ch, Cw, Dh, Dw, H, W):
    visited = [[inf] * W for i in range(H)]
    queue = deque([[Ch, Cw]])
    visited[Ch][Cw] = 0

    dy_dx0 = [[0, 1], [1, 0], [0, -1], [-1, 0]]
    dy_dx1 = [[2, 2], [2, 1], [2, 0], [2, -1], [2, -2], [1, 2], [1, 1], [1, -1], [1, -2], [0, 2],
              [0, -2], [-1, 2], [-1, 1], [-1, -1], [-1, -2], [-2, 2], [-2, 1], [-2, 0], [-2, -1], [-2, -2]]

    while queue:
        y, x = queue.popleft()
        if [y, x] == [Dh, Dw]:
            break
        for j, k in dy_dx0:
            new_y, new_x = y + j, x + k
            if 0 <= new_y < H and 0 <= new_x < W:
                if maze[new_y][new_x] == "." and visited[y][x] < visited[new_y][new_x]:
                    visited[new_y][new_x] = visited[y][x]
                    queue.appendleft([new_y, new_x])
        for j, k in dy_dx1:
            new_y, new_x = y + j, x + k
            if 0 <= new_y < H and 0 <= new_x < W:
                if maze[new_y][new_x] == "." and visited[new_y][new_x] == inf:
                    visited[new_y][new_x] = visited[y][x] + 1
                    queue.append([new_y, new_x])
    return visited[Dh][Dw]


def main():
    H, W = map(int, input().split())
    Ch, Cw = map(int, input().split())
    Dh, Dw = map(int, input().split())
    maze = [input() for i in range(H)]

    dist = bfs(maze, Ch - 1, Cw - 1, Dh - 1, Dw - 1, H, W)
    print(dist if dist != inf else -1)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import deque
from math import inf


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


def bfs(maze, Ch, Cw, Dh, Dw, H, W):
    visited = [[inf] * W for i in range(H)]
    queue = deque([[Ch, Cw]])
    visited[Ch][Cw] = 0

    dy_dx0 = [[0, 1], [1, 0], [0, -1], [-1, 0]]
    dy_dx1 = [[2, 2], [2, 1], [2, 0], [2, -1], [2, -2], [1, 2], [1, 1], [1, -1], [1, -2], [0, 2],
              [0, -2], [-1, 2], [-1, 1], [-1, -1], [-1, -2], [-2, 2], [-2, 1], [-2, 0], [-2, -1], [-2, -2]]

    while queue:
        y, x = queue.popleft()
        if [y, x] == [Dh, Dw]:
            break
        for j, k in dy_dx0:
            new_y, new_x = y + j, x + k
            if 0 <= new_y < H and 0 <= new_x < W and maze[new_y][new_x] == "." and visited[y][x] < visited[new_y][new_x]:
                visited[new_y][new_x] = visited[y][x]
                queue.appendleft([new_y, new_x])
        for j, k in dy_dx1:
            new_y, new_x = y + j, x + k
            if 0 <= new_y < H and 0 <= new_x < W and maze[new_y][new_x] == "." and visited[new_y][new_x] == inf:
                visited[new_y][new_x] = visited[y][x] + 1
                queue.append([new_y, new_x])
    return visited[Dh][Dw]


def main():
    H, W = map(int, input().split())
    Ch, Cw = map(int, input().split())
    Dh, Dw = map(int, input().split())
    maze = [input() for i in range(H)]

    dist = bfs(maze, Ch - 1, Cw - 1, Dh - 1, Dw - 1, H, W)

    print(dist if dist != inf else -1)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

def calc():
  n=int(input())
  arr=[list(input()) for _ in range(n)]
  ans=0
  for k in range(n):
    flag=True
    for i in range(1,n//2+1):
      for j in range(n):
        if arr[(j)%n][(k+j+i)%n]!=arr[(j+i)%n][(k+j+n)%n]:
          flag=False
          break
      if flag==False:
        break
    else:
      ans+=n
  print(ans)
calc()

### FIXED CODE ###

n=int(input())
arr=[list(input()) for _ in range(n)]
ans=0
for k in range(n):
  flag=True
  for i in range(1,n//2+1):
    for j in range(n):
      if arr[(j)%n][(k+j+i)%n]!=arr[(j+i)%n][(k+j+n)%n]:
        flag=False
        break
    if flag==False:
      break
  else:
    ans+=n
print(ans)
### BUGGY CODE ###

d, n = map(int,input().split())

result = 0
for i in range(1,n+1):
  if (i*100**d) // (100**d) // 100 == 0:
    result = i*(100**d)
  else:
    j = 0
    while not(((i+j)*(100**d) // (100**d) //100 == 0)):
      j += 1

    result = (i+j)*(100**d)

print(result)


### FIXED CODE ###

d, n = map(int,input().split())

result = 0
for i in range(1,n+1):
  if i // 100 == 0:
    result = i*(100**d)
  else:  
    j = 1
    result = (i+j)*(100**d)

print(result)
### BUGGY CODE ###

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

k=0
t=1
for i in range(1,N):
    print(A.count(i))
print(0)


### FIXED CODE ###

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

k=0
t=1
a=collections.Counter(A)
for i in range(1,N+1):
    print(a[i])
### BUGGY CODE ###

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

b = [None] * (n + 1)
b[P[0]] = 1

for p, pprev in zip(P[1:], P):
    bp = b[pprev] + (pprev - p) * 20000 + 1
    while bp in b:
        bp += 1
    b[p] = bp

offset = 1 - min(b[1:])
b = [i + offset for i in b[1:]]

print(' '.join([str(20000 * i) for i in range(1, n + 1)]))
print(' '.join([str(i) for i in b]))


### FIXED CODE ###

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

b = [None] * (n + 1)
b[P[0]] = 1
bs = {1}

for p, pprev in zip(P[1:], P):
    bp = b[pprev] + (pprev - p) * 20000 + 1
    while bp in bs:
        bp += 1
    b[p] = bp
    bs.add(bp)

offset = 1 - min(b[1:])
b = [i + offset for i in b[1:]]

print(' '.join([str(20000 * i) for i in range(1, n + 1)]))
print(' '.join([str(i) for i in b]))
### BUGGY CODE ###

n, k, q = map(int,input().split())
winner = [int(input()) -1 for i in range(q)]
winnerpoint = [winner.count(i) for i in range(n)]

point = [k - (q - winnerpoint[i]) for i in range(n)]

for i in range(n):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

from collections import Counter

n, k, q = map(int,input().split())
winner = [int(input()) -1 for i in range(q)]
mycount = Counter(winner)
point = [k - (q - mycount[i])for i in range(n)]

for i in range(n):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

def main():
    from fractions import gcd
    import sys
    input=sys.stdin.readline
    N=int(input())
    A=list(map(int,input().split()))
    lcm=A[0]
    for a in A:
        lcm=lcm*a//(gcd(lcm,a))

    ans=0
    for a in A:
        ans=(ans+(lcm//a)%(10**9+7))%(10**9+7)
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    from fractions import gcd
    import sys
    input=sys.stdin.readline
    N=int(input())
    A=list(map(int,input().split()))
    lcm=A[0]
    for a in A:
        lcm=lcm*a//(gcd(lcm,a))

    ans=0
    for a in A:
        ans=ans+(lcm//a)
    print(ans%(10**9+7))

if __name__ == '__main__':
    main()
### BUGGY CODE ###


import sys
sys.setrecursionlimit(10**7)
N, Q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N-1)]
px = [list(map(int, input().split())) for _ in range(Q)]

branch = [[] for _ in range(N)]
for i in range(N-1):
    branch[ab[i][0]-1].append(ab[i][1]-1)
    branch[ab[i][1]-1].append(ab[i][0]-1)

counters = [0 for _ in range(N)]
for i in range(Q):
    counters[px[i][0]-1] += px[i][1]
results = [0 for _ in range(N)]

seen = [False for _ in range(N)]
from collections import deque
seen[0] = True
todo = deque([0])
results[0] = counters[0]

while len(todo)>0:
    checking = todo.pop()
    candidates = branch[checking]
    for candidate in candidates:
        if seen[candidate] == False:
            todo.append(candidate)
            seen[candidate] = True
            results[candidate] = results[checking]+counters[candidate]


print((" ").join([str(i) for i in results]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
N, Q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N-1)]
px = [list(map(int, input().split())) for _ in range(Q)]

branch = [[] for _ in range(N)]
for i in range(N-1):
    branch[ab[i][0]-1].append(ab[i][1]-1)
    branch[ab[i][1]-1].append(ab[i][0]-1)

counters = [0 for _ in range(N)]
for i in range(Q):
    counters[px[i][0]-1] += px[i][1]
results = [0 for _ in range(N)]

seen = [False for _ in range(N)]
from collections import deque
seen[0] = True
todo = deque([0])
results[0] = counters[0]

while len(todo)>0:
    checking = todo.pop()
    candidates = branch[checking]
    for candidate in candidates:
        if seen[candidate] == False:
            todo.append(candidate)
            seen[candidate] = True
            results[candidate] = results[checking]+counters[candidate]


print((" ").join([str(i) for i in results]))
### BUGGY CODE ###

n = int(input())
s = input()

cnt = 0
for i in range(0, n-2):
    for j in range(i+1, n-1):
        if s[i] != s[j]:
            for k in range(j+1, n):
                if (j - i) != (k - j):
                    if s[i] != s[k] and s[j] != s[k]:
                        cnt += 1
                    else:
                        pass
                else:
                    pass
print(cnt)

### FIXED CODE ###

def main():
    n=int(input())
    s=input()
    r=[]
    g=[]
    b=[]
    rdict={}
    gdict={}
    bdict={}
    ans=0
    for i in range(n):
        if s[i]=='R':
            r.append(i)
            rdict[2*i]=2*i
        if s[i]=='G':
            g.append(i)
            gdict[2*i]=2*i
        if s[i]=='B':
            b.append(i)
            bdict[2*i]=2*i
    ans=len(r)*len(g)*len(b)
    for i in r:
        for j in g:
            if i+j in bdict:
                ans-=1
    for i in g:
        for j in b:
            if i+j in rdict:
                ans-=1
    for i in b:
        for j in r:
            if i+j in gdict:
                ans-=1
    print(ans)
    
if __name__ == '__main__':
    main()
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
x = 0
m = A[0]
for x in range(1, N):
    m *= A[x]

if m > 10**18:
    print(-1)
else:
    print(m)

### FIXED CODE ###

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

    if 0 in A:
        print(0)
        return

    m = 1
    for x in A:
        m *= x
        if m > 10**18:
            print(-1)
            return
    print(m)
main()
### BUGGY CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
import numpy as np

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, K = LI()
A = LI()

"""
明るさが一定値を超えると計算しなくて良い
一定？d > math.floort(N/2)
"""

lamps = [[0] * N] * (K + 1)
lamps[0] = A

lamps = np.array(lamps)

if K > 40:
    b = [str(N)] * N
    print(" ".join(b))
    sys.exit()

for i in range(K):
    if lamps[i][-1] == N:
        if np.all(lamps[i] == np.ones(N) * N):
            ans = [str(N)] * N
            print(" ".join(ans))
            sys.exit()
    for j in range(N):
        tmp = lamps[i][j]
        if tmp == 0:
            lamps[i+1][j] += 1
        else:
            lamps[i + 1][max(0, j - tmp):min(N + 1, j + tmp) + 1] += 1

ans = lamps[-1].tolist()
ans = map(str, ans)
print(" ".join(ans))


### FIXED CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, K = LI()
A = LI()

"""
明るさが一定値を超えると計算しなくて良い
一定？d > math.floort(N/2)
"""
if K > 50:
    b = [str(N)] * N
    print(" ".join(b))
    sys.exit()

lamps = [[0 for i in range(N)] for j in range(K + 1)]
lamps[0] = A

"""
累積和〜
"""
for i in range(K):
    if lamps[i] == [N for i in range(N)]:
        ans = [str(N) for i in range(N)]
        print(" ".join(ans))
    tmps = [0 for i in range(N)]
    for j in range(N):
        w = lamps[i][j]
        tmps[max(0, j - w)] += 1
        r = min(N-1, j + w)
        if r + 1 < N:
            tmps[r + 1] -= 1
    hoge = 0
    for j in range(N):
        hoge += tmps[j]
        lamps[i + 1][j] = hoge
ans = lamps[-1]
ans = map(str, ans)
print(" ".join(ans))
### BUGGY CODE ###

N,M = list(map(int,input().strip().split()))
ans = 1
i = 0

while M//2 >= N+i:
    if M%(N+i) == 0:
        ans = M//(N+i)
        break
    else:
        i += 1

print(ans)

### FIXED CODE ###

import math

N,M = list(map(int,input().strip().split()))
ans = 1
i = 0

def is_prime(num):
    if num < 2:
        return False
    if num == 2 or num == 3 or num == 5:
        return True
    if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
        return False

    prime = 7
    step = 4
    num_sqrt = math.sqrt(num)
    while prime <= num_sqrt:
        if num % prime == 0:
            return False
        prime += step
        step = 6 - step

    return True

if is_prime(M) == False:
    while M//2 >= N+i:
        if M%(N+i) == 0:
            ans = M//(N+i)
            break
        else:
            i += 1

print(ans)
### BUGGY CODE ###

input = raw_input

n = int(input())
As = map(int, input().split(" "))

out = 0
d = 1
while True:
    if d >= n:
        break
    i0 = 0
    i1 = d
    while True:
        if As[i0] + As[i1] == d:
            out += 1

        i0 += 1 
        i1 += 1 
        if i1 >= n:
            break
    
    d += 1

print(out)

### FIXED CODE ###

input = raw_input

from collections import Counter
n = int(input())
As = map(int, input().split(" "))

Bs = [i-A for i, A in enumerate(As)]

c = Counter(Bs)
out = 0
for i in range(n):
    key = As[i] + i 
    cur_out = c[key]
    out += cur_out

print(out)
### BUGGY CODE ###

a,b,k=map(int, input().split())
for _ in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
    if a==0 and b==0:
        break
print(a,b)

### FIXED CODE ###

import sys
a,b,k=map(int, input().split())
l=k-a
if l<0:
    print(a-k,b)
    sys.exit()
m=l-b
if m<0:
    print(0,b-l)
    sys.exit()
else:
    print(0,0)
    sys.exit()
### BUGGY CODE ###

X = int(input())

B = 1
while True:
    B_5 = B**5

    diff = X - B_5
    A = diff**(1 / 5)
    if A % 1 == 0:
        B = -B
        A = int(A)
        break

    diff = X + B_5
    A = diff**(1 / 5)
    if A % 1 == 0:
        A = int(A)
        break

print(A, B)


### FIXED CODE ###

import sys

X = int(input())

# X = 33

for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == X:
            print(a, b)
            sys.exit(0)
### BUGGY CODE ###

uL = []
oL = []

things = int(input())

for i in range(things):
    p = input()
    uL.append(p)

x = [oL.append(x) for x in uL if x not in oL]

print(len(x))

### FIXED CODE ###

s = set([])
things = int(input())

for i in range(things):
    p = input()
    s.add(p)

print(len(s))
### BUGGY CODE ###

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))

    xmin = min(a)
    xmax = max(a)

    ans = count = 0
    for x in range(xmin, xmax+1):
        for i in a:
            if i - 1 <= x <= i + 1:
                count += 1

        ans = max(ans, count)
        count = 0

    print(ans)




### FIXED CODE ###

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))

    x = [0]*10**5

    for i in a:
        x[i] += 1

    ans = 0
    for i in range(len(x)):
        count = 0
        if i == 0:
            ans = max(x[0] + x[1], ans)
        elif i == len(x)-1:
            ans = max(x[len(x)-2] + x[len(x)-1], ans)
        else:
            ans = max(x[i-1] + x[i] + x[i+1], ans)

    print(ans)
### BUGGY CODE ###

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

for x in range(N+1):
  a=math.floor((A*x)/B)
  b=math.floor(x/B)
  ans=a-A*b
  l.append(ans)
  
print(max(l))

### FIXED CODE ###

import math
A,B,N=map(int,input().split())
if N<B-1:
  x=N
else:
  x=B-1
  
a=(A*x)/B
aa=math.floor(a)
print(aa)