Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
import math


def factorize(a):
    ret = set()
    i = 2
    while i * i < a:
        if a % i != 0:
            i += 1
        else:
            while a % i == 0:
                a //= i
                ret.add(i)
            i += 1
    if a != 1:
        ret.add(a)
    return ret

def main():
    A, B = map(int,input().split())
    ABgcd = math.gcd(A, B)
    ABfactor = factorize(ABgcd)
    Ans = len(ABfactor) + 1
    print(Ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

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

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def factorize(a):
    ret = set()
    i = 2
    while i * i < a:
        if a % i != 0:
            i += 1
        else:
            while a % i == 0:
                a //= i
                ret.add(i)
            i += 1
    if a != 1:
        ret.add(a)
    return ret

def main():
    A, B = map(int,input().split())
    ABgcd = gcd(A, B)
    ABfactor = factorize(ABgcd)
    Ans = len(ABfactor) + 1
    print(Ans)

if __name__ == "__main__":
    main()
N = int(input())
L = [int(input()) for i in range(N)]
if max(L) < sum(L) - max(L):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
L = list(map(int,input().split()))
if max(L) < (sum(L) - max(L)):
    print('Yes')
else:
    print('No')
H,W,A,B = map(int,input().split())
temp = ""
for l in range(0,W):
    temp = temp + "0"


Alist = list()
for k in range(0,H):
    Alist.append(list(temp))


for i in range(0,H):
    for j in range(0,W):
        if i < B and j < A :
            Alist[i][j] = 1
        elif j >= A and i<B:
            Alist[i][j] = 0
        elif i >= B and j < A :
            Alist[i][j] = 0
        else:
            Alist[i][j] = 1

for a in Alist:
    print(''.join(a))


### FIXED CODE ###

H,W,A,B = map(int,input().split())
temp = ""
for l in range(0,W):
    temp = temp + "0"


Alist = list()
for k in range(0,H):
    Alist.append(list(temp))


for i in range(0,H):
    for j in range(0,W):
        if i < B and j < A :
            Alist[i][j] = "1"
        elif j >= A and i<B:
            Alist[i][j] = "0"
        elif i >= B and j < A :
            Alist[i][j] = "0"
        else:
            Alist[i][j] = "1"

for a in Alist:
    print(''.join(a))
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

x = input()
X = int(x)

div = make_divisors(X)

for item in div:
    for A in range(-1000,1000):
        B = A - item

        if A^5 - B^5 == X:
            print(A + " " + B)

### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

x = input()
X = int(x)

div = make_divisors(X)

for item in div:
    for A in range(-1000,1000):
        B = A - item

        if A**5 - B**5 == X:
            print(str(A) + " " + str(B))
            break
        else:
            continue
        break
def calc_dist(N, K, x):
    dists = [2 * min(K - x_i, x_i) for x_i in x]
    return sum(dists)

if __name__ == "__main__":
    run_test(calc_dist, test_pair)
    N = int(raw_input())
    K = int(raw_input())
    x = map(int, raw_input().split())
    print(calc_dist(N, K, x))

### FIXED CODE ###

def calc_dist(N, K, x):
    dists = [2 * min(K - x_i, x_i) for x_i in x]
    return sum(dists)

if __name__ == "__main__":
    N = int(raw_input())
    K = int(raw_input())
    x = map(int, raw_input().split())
    print(calc_dist(N, K, x))
# coding: utf8

n = int(input())
w = []
flag = True
for _ in range(n):
    a = input()
    last = w[len(w)-1]
    if a[0] != last[len(last)-1] and a in w:
        flag = False
        print("No")
        break
    w.append(a)
if flag == True:
    print("Yes")



### FIXED CODE ###

# coding: utf8

if __name__ == "__main__":
    n = int(input())
    w = []
    flag = True
    for _ in range(n):
        a = input()
        if len(w) == 0:
            w.append(a)
            continue
        last = w[len(w)-1]
        if a[0] != last[len(last)-1] or a in w:
            flag = False
            break
        w.append(a)
    if flag == True:
        print("Yes")
    else:
        print("No")
k=[0]*(10**9+1)
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
	k[a[i]]+=1
	if k[a[i]]>a[i]:
		ans+=1
print(ans)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
cnt=1
for i in range(n-1):
	if a[i]==a[i+1]:
		cnt+=1
	else:
		if cnt>=a[i]:
			x=cnt-a[i]
		else:
			x=10**10
		ans+=min(cnt,x)
		cnt=1
if cnt>=a[-1]:
	x=cnt-a[-1]
else:
	x=10**10
ans+=min(cnt,x)
print(ans)
from collections import deque
n,m = list(map(int,input().split()))
e = [[] for _ in range(m+1)]
for i in range(m):
    a,b = list(map(int,input().split()))
    e[a].append(b)
    e[b].append(a)
q = deque()
q.append(1)
s = [float('inf') for _ in range(n+1)]
t = [-1 for _ in range(n+1)]
s[1] = 0
while len(q):
    node = q.pop()
    step = s[node]+1
    for i in range(len(e[node])):
        nex = e[node][i]
        if s[nex] > step:
            q.append(nex)
            s[nex] = step
            t[nex] = node
# print(s,t,e)
print("Yes")
for i in range(2,n+1):
    print(t[i])

### FIXED CODE ###

from collections import deque

n,m = list(map(int,input().split()))
e = [[] for _ in range(n+1)]

for i in range(m):
    a,b = list(map(int,input().split()))
    e[a].append(b)
    e[b].append(a)
q = deque()
q.append(1)
t = [-1 for _ in range(n+1)]

while len(q):
    node = q.popleft()

    for i in range(len(e[node])):
        nex = e[node][i]
        if t[nex] == -1:
            q.append(nex)
            t[nex] = node
print("Yes")
for i in range(2,n+1):
    print(t[i])
# coding: utf-8
# Your code here!
N, K = map(int, input().split())


mylist =  [0] + list(map(int,input().split()))
#print(mylist)

myflag = [0 for n in range(N+1)]
#print(myflag)

myorigine = []
mypos = 1
for n in range(1,N+1):
    if myflag[n] == 0:
        myflag[n] == 1
        myorigine.append(mypos)
        mypos = mylist[mypos]
    elif myflag[n] == 1:
        break
#print(myorigine)
    
mypos = 0
while myorigine[mypos] != myorigine[-1]:
    mypos += 1
#print(mypos)
origin1 = myorigine[:mypos]
origin2 = myorigine[mypos:]
#print(origin1, origin2[:-1])


mymod = K%N
mymod = len(origin1) -1
print(origin2[mymod-1])



### FIXED CODE ###

N, K = map(int, input().split())
mylist =   [0] + list(map(int,input().split()))
#print(mylist)
flag_list = [float('INF') for n in range(N+1)]
#print(flag_list)
myseries = []

myflag = 0
mypos = 1
mycnt = 0 
while myflag == 0:
    if flag_list[mypos] == float('INF'):
        flag_list[mypos] = mycnt
        #print(mypos)
        myseries.append(mypos)
        mypos = mylist[mypos]
        mycnt += 1
    else:
        myflag = 1
        mystart = flag_list[mypos]
        mylen = mycnt-mystart
#print(flag_list)
#print(myseries)
#print(mystart, mylen)

if K < mystart:
    print(myseries[K])
else:
    print(myseries[(K-mystart)%mylen + mystart])
# -*- coding: utf-8 -*-

s = str(input())
n = len(s)

dic = dict()
for c in s:
	dic[c] = dic.get(c, 0) + 1

ans = (dic['g'] - dic['p']) // 2

print(ans)



### FIXED CODE ###

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

s = str(input())
n = len(s)

G = s.count('g')
P = s.count('p')

ans = (G - P) // 2

print(ans)
hon = '24579'
pon = '0168'
bon = '3'
N = str(input())
if N[-1] in hon:
  print("hon")
elif N[-1] in pon:
  print("pon")
elid N[-1] in bon:
  print("bon")

### FIXED CODE ###

hon = '24579'
pon = '0168'
bon = '3'
N = str(input())
if N[-1] in hon:
  print("hon")
elif N[-1] in pon:
  print("pon")
elif N[-1] in bon:
  print("bon")
results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count=0
    for i in range(0,int(len(a)/2)):
        for k,l in zip(a[2*i+1],b[2*i+1]):
            if(k!=l):
                count+=1
    if count==0:
        results.append(0)
    elif count==1:
        results.append(1)
    else:
        results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")
    



### FIXED CODE ###

results=[]
while True:
    a=input().split("\"")
    if a[0]==".":
        break
    b=input().split("\"")
    count1=0
    count2=0
    if len(a) != len(b):
        results.append(2)
    else:
        for i in range(len(a)):
            if(i%2==1):
                if len(a[i]) != len(b[i]):
                    count1+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count1+=1
            else:
                if len(a[i]) != len(b[i]):
                    count2+=1
                else:
                    for k,l in zip(a[i],b[i]):
                        if(k!=l):
                            count2+=1           
        if count1==0 and count2==0:
            results.append(0)
        elif count1==1 and count2==0:
            results.append(1)
        else:
            results.append(2)
for i in results:
    if i==0:
        print("IDENTICAL")
    if i==1:
        print("CLOSE")
    if i==2:
        print("DIFFERENT")
S = input()
L = S.split()

a = L[0]
b = L[1]
c = L[2]

a = int(a)
b = int(b)
c = int(c)
l = [a,b,c]
    
min_1 = min(a,b,c)
# print l.remove(min_1)
l.remove(min_1)

min_2 = min(l)

l.remove(min_2)

min_3 = l[0]
print min_1 , min_2, min_3

### FIXED CODE ###

S =raw_input()
L = S.split()

a = L[0]
b = L[1]
c = L[2]

a = int(a)
b = int(b)
c = int(c)
l = [a,b,c]
    
min_1 = min(a,b,c)
# print l.remove(min_1)
l.remove(min_1)

min_2 = min(l)

l.remove(min_2)

min_3 = l[0]

min_1 = str(min_1)
min_2 = str(min_2)
min_3 = str(min_3)

print min_1+' '+min_2+' '+min_3
N = int(input())
A = list()
for _ in range(N):
    A.append(int(input()))

one, two = sorted(list(set(A)), reverse=True)[:2]

for i in A:
    print(two if one == i else one)

### FIXED CODE ###

N = int(input())
A = list()
for _ in range(N):
    A.append(int(input()))

one, two = sorted(A, reverse=True)[:2]

for i in A:
    print(two if one == i else one)
n=int(input())
ans=[0 for _ in range(10050)]
for i in range(105):
  for j in range(1,105):
    v=i*i+j*j+k*k+i*j+j*k+k*i;
    if(v<10050):
      ans[v]+=1
for i in range(n):
  print(ans[i+1])

### FIXED CODE ###

import math
from queue import PriorityQueue
from sys import stdin,stdout
from collections import defaultdict

def solve():
    n=int(input())
    ans=[0 for _ in range(200050)]
    for i in range(1,101):
        for j in range(1,101):
            for k in range(1,101):
                v=i*i+j*j+k*k+i*j+k*j+k*i
                ans[v]+=1
    for i in range(n):
        print(ans[i+1])
    

    
    
    
def main():
    solve()
main()
import fractions
from functools import reduce

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N,M = map(int,input().split())
A = list(map(int,input().split()))
LCM = lcm_list(A)
print(int(((2*M)/LCM+1)/2))

### FIXED CODE ###

from fractions import gcd
from functools import reduce

N, M = map(int,input().split())
a = list(map(int,input().split()))
a = [x // 2 for x in a]

def solve(p, q):
    g = gcd(p, q)
    p //= g
    q //= g
    if (p - q) % 2 == 1:
        return 0
    return p * q * g

k = reduce(solve, a)
if k == 0:
    print(0)
else:
    print(M // k - M // (k * 2))
import sys
input = sys.stdin.readline
import numpy as np

MOD = 10 ** 9 + 7

N,C = map(int,input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

# (i,j) に j^i を入れる
kth_pow = np.ones((1024, 401), dtype=np.int64)
rng = np.arange(401, dtype=np.int64)
for i in range(1,C+1):
    kth_pow[i] = kth_pow[i-1] * rng % MOD
kth_pow_cum = kth_pow.cumsum(axis = 1) % MOD
kth_pow_cum[C+1:] = 0

def convolve(A,B,n=32):
    if n == 8:
        return np.rint(np.fft.irfft(np.fft.rfft(A) * np.fft.rfft(B))).astype(np.int64)
    n //= 2
    M = 1 << n
    A1,A2 = np.divmod(A,M)
    B1,B2 = np.divmod(B,M)
    X = convolve(A1,B1,n)
    Y = convolve(A1-A2,B1-B2,n)
    Z = convolve(A2,B2,n)
    return (X * (M * M % MOD) + (X + Z - Y) * M + Z) % MOD

dp = np.zeros(1024, dtype=np.int64) # これまで配った個数、合計点
dp[0] = 1
for a,b in zip(A,B):
    arr = kth_pow_cum[:,b] - kth_pow_cum[:,a-1]
    dp = convolve(dp,arr)
    dp[C+1:] = 0

answer = dp[C]
print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np

MOD = 10 ** 9 + 7

N,C = map(int,input().split())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

# (i,j) に j^i を入れる
kth_pow = np.ones((C+1, 401), dtype=np.int64)
rng = np.arange(401, dtype=np.int64)
for i in range(1,C+1):
    kth_pow[i] = kth_pow[i-1] * rng % MOD
kth_pow_cum = kth_pow.cumsum(axis = 1) % MOD

dp = np.zeros((C+1), dtype=np.int64) # これまで配った個数、合計点
dp[0] = 1
for a,b in zip(A,B):
    arr = kth_pow_cum[:,b] - kth_pow_cum[:,a-1]
    prev = dp
    dp = np.zeros(C+1, dtype=np.int64)
    for n in range(C+1):
        dp[n:] += arr[n] * prev[:C+1-n] % MOD
    dp %= MOD

answer = dp[C]
print(answer)
N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>=K:
    print(p[K])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    if count>=K:
        print(loop[0])
    else:
        num=(K-count)%len(loop)
        print(loop[num])

### FIXED CODE ###

N,K = map(int, input().split())
A =[0]
B=list(map(int, input().split()))
for m in range(N):
    A.append(B[m])
place=set([])
p=[]
i=1
count=0
while i not in place:
    place.add(i)
    p.append(i)
    i=A[i]
    count+=1
if count>K:
    print(p[K])
else:
    loop=[i]
    start=i
    j=A[i]
    count+=1
    while j!=start:
        loop.append(j)
        j=A[j]
        count+=1
    if count>K:
        print(loop[K-len(p)])
    else:
        num=(K-count)%len(loop)
        print(loop[num])
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]


mod = 998244353
inf = 1e10

#solve
def solve():
    n, s = LI()
    a = LI()
    dp = [[0] * (s + 1) for i in range(n + 1)]
    dp[0][0] = 1
    ans = 0
    for i in range(1, n + 1):
        dpi = dp[i]
        dpi1 = dp[i - 1]
        for j in range(s - a[i-1] + 1):
            # print(j)
            dpi[j + a[i-1]] = (dpi1[j] + dpi1[j + a[i-1]]) % mod
        for j in range(a[i-1]):
            dpi[j] = dpi1[j]
        ans += dpi[-1]
        ans %= mod
    print(ans)
            
    return


#main
if __name__ == '__main__':
    solve()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]


mod = 998244353
inf = 1e10

#solve
def solve():
    n, s = LI()
    a = LI()
    dp1 = [0] * (3000 + 1)
    dp2 = [0] * (3000 + 1)
    ans = 0

    for i in range(n):
        for j in range(s+1):
            dp2[j] = dp1[j]
        
        for j in range(a[i], s + 1):
            dp2[j] += dp1[j - a[i]]
            dp2[j] %= mod
        dp2[a[i]] += i + 1 
        ans += dp2[s]
        ans %= mod
        dp1 = dp2[::1]
        # print(dp2)
    print(ans)
            
    return


#main
if __name__ == '__main__':
    solve()
import numpy as np
n=int(input())
a=list(map(int,input().split()))
# dp[i][j]:i番目の数字の中からj個数字を取った時の最大。(i//2)-1<=j<=(i+1)//2
# 求めるのはdp[n][n//2]
dp=np.full((n+1,n+1),-1e+9)
dp[1,1]=a[0]
for i in range(2,n+1): #i番目の数字はa[i-1]
      for j in range(i//2-1,(i+1)//2+1):
            dp[i,j]=max(dp[i-2,j-1]+a[i-1],dp[i-1,j])
print(int(dp[n,n//2]))

### FIXED CODE ###

from collections import defaultdict

n=int(input())
a=list(map(int,input().split()))
#n=2*pow(10,5)
#a=range(1,pow(10,5)+1)
# dp[i][j]:i番目の数字の中からj個数字を取った時の最大。(i//2)-1<=j<=(i+1)//2
# 求めるのはdp[n][n//2]
dp=defaultdict(lambda:-pow(10,18))
dp[(1,1)]=a[0]
for i in range(2,n+1): #i番目の数字はa[i-1]
      for j in range(i//2-1,(i+1)//2+1):
            if j==1:
                  dp[(i,j)]=max(dp[(i-1,1)],a[i-1])
            elif j==0:
                  dp[(i,j)]=0
            else:
                  dp[(i,j)]=max(dp[(i-2,j-1)]+a[i-1],dp[(i-1,j)])
print(dp[(n,n//2)])
import math
 
def main():
  N = int(input())
  
  print(search(N))
 
def search(x):
  
  ints = list(range(2,x))
  
  # 順に確認する
  for i in ints:
    if x%i==0:
      return seartch(x+1)
  	elif x < i**2:
      break
    
  return x

### FIXED CODE ###

def main():
  N = int(input())
  
  print(search(N))
 
def search(x):
  
  ints = list(range(2,x))
  
  # 順に確認する
  for i in ints:
    if x%i==0:
      return search(x+1)
    elif x < i**2:
      break
    
  return x

main()
import numpy as np
import numba
@numba.jit

def frog(N,K):

    h = np.array(list(map(int,input().split())))
    dp=np.array([0 for i in range(N)])
    dp[0]= 0
    dp[1]=abs(h[1]-h[0])
    if N<=K:
        dp[N-1]=abs(h[0]-h[N-1])
    else:  
        for i in range(2,N):
            dp[i]=min(dp[j]+abs(h[i]-h[j]) for j in range(max(0,i-K),i))
            
            #dp[i]=np.min(list1)
             
    print(dp[N-1])

line = np.array(list(map(int,input().split())))
a,b = line[0],line[1]
frog(a,b)

### FIXED CODE ###

import numpy as np
N,K = map(int,input().split())
h = np.array(list(map(int,input().split())))
dp=np.array([0 for i in range(N)])
dp[0]= 0
dp[1]=abs(h[1]-h[0])
if N<=K:
    dp[N-1]=abs(h[0]-h[N-1])
else:  
    for i in range(2,N):
      j=max(0,i-K)
      dp[i]=np.min(dp[j:i]+np.abs(h[i]-h[j:i]))
      #dp[i]=min([dp[i-j]+abs(h[i]-h[i-j]) for j in range(1,min(k+1,i+1))])
print(int(dp[-1]))
import math

#入力
a,b,x = map(int, input().split())

if a*b*a/2 < x:
    c = 2*x/(a*a) - b
    d = a*b/(b-c)
    print(90-math.degrees(math.atan(d/b)))
else:
    c = (2*x)/(a*b)
    print(90 - math.degrees(math.atan(c/b)))

### FIXED CODE ###

import math

#入力
a,b,x = map(int, input().split())

if a*b*a/2 < x:
    c = 2*x/(a*a) - b
    if b == c:
        print(0)
    else:
        d = a*b/(b-c)
        print(90-math.degrees(math.atan(d/b)))
else:
    c = (2*x)/(a*b)
    print(90 - math.degrees(math.atan(c/b)))
n = int(input())
dic = {"JPY": 1, "BTC": 380000}
ans = 0
for i in range(n):
  x,u = input().split()
  ans += int(x) * dic[u]
print(ans)  

### FIXED CODE ###

n = int(input())
dic = {"JPY": 1, "BTC": 380000}
ans = 0
for i in range(n):
  x,u = input().split()
  ans += float(x) * dic[u]
print(ans)
s,t=input().split()
c=0
for i in range(3):
  if s[i]==t[i]:c+=1
print(c)

### FIXED CODE ###

s=input()
t=input()
c=0
for i in range(3):
  if s[i]==t[i]:c+=1
print(c)
K = int(input())

ans=0

if K%2 = 0:
	ans=(K/2)*(K/2)
else:
	ans=(K*K-1)/4

print(ans)

### FIXED CODE ###

k = int(input())

if k % 2 == 0:
    print((k//2)**2)
else:
    print((k//2)*((k//2)+1))
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
from numpy.linalg import solve
def nasu(a, b, c):
  A = a[0] ** 2 - b[0] ** 2 + a[1] ** 2 - b[1] ** 2
  B = b[0] ** 2 - c[0] ** 2 + b[1] ** 2 - c[1] ** 2
  x = [2 * (b[0] - a[0]), 2 * (c[0] - b[0])]
  y = [2 * (b[1] - a[1]), 2 * (c[1] - b[1])]
  if x[0] * y[1] == x[1] * y[0]:
    return 10 ** 10
  left = [[x[0], y[0]],
          [x[1], y[1]]]
  right = [-A, -B]
  Cx, Cy = solve(left, right)
  r = ((a[0] - Cx) ** 2 + (a[1] - Cy) ** 2) ** (1 / 2)
  for i in range(N):
    if honya(xy[i], Cx, Cy) > r:
      return 10 ** 10
  return r

def honya(a, Cx, Cy):
  return ((a[0] - Cx) ** 2 + (a[1] - Cy) ** 2) ** (1 / 2)
ans = 10 ** 10
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    for k in range(j + 1, N):
      ans = min(ans, nasu(xy[i], xy[j], xy[k]))

print(ans)

### FIXED CODE ###

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
def nasu(a, b, c):
  A = a[0] ** 2 - b[0] ** 2 + a[1] ** 2 - b[1] ** 2
  B = b[0] ** 2 - c[0] ** 2 + b[1] ** 2 - c[1] ** 2
  x = [2 * (b[0] - a[0]), 2 * (c[0] - b[0])]
  y = [2 * (b[1] - a[1]), 2 * (c[1] - b[1])]
  k = x[1] * y[0] - x[0] * y[1]
  if k == 0:
    return 10 ** 10
  Cx = -(y[0] * B - y[1] * A) / k
  Cy = (x[0] * B - x[1] * A) / k
  return honyamorake(Cx, Cy)

def honya(x, y, Cx, Cy):
  return ((x - Cx) ** 2 + (y - Cy) ** 2) ** (1 / 2)

def honyaraka(a, b):
  Cx = (a[0] + b[0]) / 2
  Cy = (a[1] + b[1]) / 2
  return honyamorake(Cx, Cy)

def honyamorake(Cx, Cy):
  r = honya(xy[0][0], xy[0][1], Cx, Cy)
  for i in range(1, N):
    r = max(r, honya(xy[i][0], xy[i][1], Cx, Cy))
  return r

ans = 10 ** 10
for i in range(N - 2):
  for j in range(i + 1, N - 1):
    for k in range(j + 1, N):
      ans = min(ans, nasu(xy[i], xy[j], xy[k]))
for i in range(N - 1):
  for j in range(i + 1, N):
    ans = min(ans, honyaraka(xy[i], xy[j]))

print(ans)
S,W = map(int, input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")


### FIXED CODE ###

S,W = map(int, input().split())
if W>=S:
    print("unsafe")
else:
    print("safe")
import sys
N,M = list(map(int,sys.stdin.readline().split()))
S = list(map(int,sys.stdin.readline()split()))
S = [0] + S
T = list(map(int,sys.stdin.readline()split()))
T = [0] + T
DP = [[0] * (N+1)  for _ in range(M+1)]
for n in range(N+1):
    DP[0][n] = 1
for m in range(M+1):
    DP[m][0] = 1
# s = 0
# for i in range(N+1):
#     for j in range(M+1):
#         if S[i] == T[j]:
#             for i2 in range(i):
#                 for j2 in range(j):
#                     dp[i][j] += dp[i2][j2]
#             s += dp[i][j]
# print(s)
mod = 10**9 + 7
for n in range(1,N+1):
    for m in range(1,M+1):
        num = DP[m-1][n-1] if S[n] == T[m] else 0
        DP[m][n] = (DP[m-1][n] + DP[m][n-1] + num - DP[m-1][n-1]) % mod
print(DP[M][N])

### FIXED CODE ###

N,M = list(map(int,input().split()))
S = list(map(int,input().split()))
S = [0] + S
T = list(map(int,input().split()))
T = [0] + T
dp = [[0] * (N+1)  for _ in range(M+1)]
DP = [[0] * (N+1)  for _ in range(M+1)]
dp[0][0] = 1
for n in range(N+1):
    DP[0][n] = 1
for m in range(M+1):
    DP[m][0] = 1
# s = 0
# for i in range(N+1):
#     for j in range(M+1):
#         if S[i] == T[j]:
#             for i2 in range(i):
#                 for j2 in range(j):
#                     dp[i][j] += dp[i2][j2]
#             s += dp[i][j]
# print(s)
for n in range(1,N+1):
    for m in range(1,M+1):
        if S[n] == T[m]:
            dp[m][n] = DP[m-1][n-1]
        DP[m][n] = (DP[m-1][n] + DP[m][n-1] + dp[m][n] - DP[m-1][n-1]) % (10**9+7)
print(DP[M][N])