Harryxun/stf_run huggingface dataset:
n,k = map(int, input().split())

for i in range(1,10):
  if n <= k ** i:
    print(i +1)
    sys.exit()

### FIXED CODE ###

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

for i in range(1,50):
  if n < k ** i:
    print(i)
    break
import numpy as np

s=int(input())

R=2*s*np.pi
print(R)

### FIXED CODE ###

import numpy as np

s=int(input())

R=2*s*np.pi
print(R)
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

N,K = MI()
k = K.bit_length()
AB = []
for _ in range(N):
    a,b = MI()
    if a > K:
        continue
    else:
        AB.append(([(a >> i) & 1 for i in range(k-1,-1,-1)],b))

N = len(AB)
K = [(K >> i) & 1 for i in range(k-1,-1,-1)]

A = [[] for _ in range(k+1)]
B = [0]*(k+1)
for i in range(N):
    a,b = AB[i]
    for j in range(k):
        if a[j] == 1 and j >= 1:
            B[j] -= b
        if a[j] > K[j]:
            A[j].append(b)
            break
    else:
        A[k].append(b)


for i in range(k+1):
    A[i] = sum(A[i])

for i in range(k-1,-1,-1):
    A[i] += A[i+1]

print(max(A[i]+B[i] for i in range(1,k+1)))


### FIXED CODE ###

import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N,K = MI()
K += 1
k = K.bit_length()

AB = []

for _ in range(N):
    a,b = MI()
    if a >= K:
        continue
    else:
        AB.append(([(a >> i) & 1 for i in range(k-1,-1,-1)],b))

N = len(AB)
K_bit = [(K >> i) & 1 for i in range(k-1,-1,-1)]

ANS = [0]*k  # 

for i in range(N):
    a,b = AB[i]
    for j in range(k):
        if K_bit[j] == 1:
            if a[j] == 0:
                ANS[j] += b
        else:
            if a[j] == 1:
                break

print(max(ANS))
import numpy as np
N = int(input())

A_ls = np.array(list(map(int,input().split(" "))))
B_ls = np.array(list(map(int,input().split(" "))))

S = 0

for i,b in enumerate(B_ls):
    if b > A_ls[i]:
        b -= A_ls[i]
        S += A_ls[i]
        if A_ls[i+1] >= b:
            A_ls[i+1] -=b
            S+=b
        else:
            S+=A_ls[i+1]
            A_ls[i+1] = 0 
    else:
        S += b

print(S)


### FIXED CODE ###


import numpy as np
N = int(input())

A_ls = np.array(list(map(int,input().split(" "))))
B_ls = np.array(list(map(int,input().split(" "))))

S = 0

for i,b in enumerate(B_ls):
    if b > A_ls[i]:
        b -= A_ls[i]
        S += A_ls[i]
        if A_ls[i+1] >= b:
            A_ls[i+1] -=b
            S+=b
        else:
            S+=A_ls[i+1]
            A_ls[i+1] = 0 
    else:
        S += b

print(S)
import sys

for S in sys.stdin
  if S <= '20190430':
    print('Heisei')
  else:
    print('TBD')

### FIXED CODE ###

import sys

for S in sys.stdin:
  y,m,d = [int(x) for x in S.split('/')]
  if y<=2019 and m<=4:
    print('Heisei')
  else:
    print('TBD')
import sys
sys.setrecursionlimit(20000)

[n], *e = [[*map(int, t.split())] for t in open(0)]
viewers = set(range(1, n**2 + 1))
mem = {x: min((x - 1) % n, (n - x) % n, (x - 1)//n, n - 1 - (x - 1)//n)
       for x in range(1, n**2 + 1)}


def directions(x):
    tmp = []
    if x % n != 1:
        tmp.append(x - 1)
    if x % n > 0:
        tmp.append(x + 1)
    if (x - 1)//n > 0:
        tmp.append(x - n)
    if (x - 1)//n < n - 1:
        tmp.append(x + n)
    return tmp

ans = 0

for x in e[0]:

    def fill(x):
        z = mem[x] + (x in viewers)
        for k in directions(x):
            if mem[k] > z:
                mem[k] = z
                fill(k)

    ans += mem[x]
    viewers.remove(x)
    fill(x)
    display()

print(ans)


### FIXED CODE ###

_, *e = [[*map(int, t.split())] for t in open(0)]

for n, a, b, c, d in e:
    mem = {0: 0, 1: d}
    mult_cost = {2: a, 3: b, 5: c}

    def solve(n):
        if n not in mem:
            tmp = n*d
            for k in mult_cost:
                if n % k == 0:
                    tmp = min(tmp, solve(n//k) + mult_cost[k])
                else:
                    tmp = min(tmp, solve(
                        n//k) + mult_cost[k] + (n % k)*d, solve(n//k + 1) + mult_cost[k] + k*d - (n % k)*d)
            mem[n] = tmp
        return mem[n]

    print(solve(n))
from collections import defaultdict

N,K = map(int, input().split())
R,S,P = map(int, input().split())
T = input()

index = defaultdict(list)

for i, t in enumerate(T):
    index[t].append(i)


len_r = len(index['r'])
len_s = len(index['s'])
len_p = len(index['p'])

tmp = 0
flag = True
for i in index['r']:    
    if tmp % K == 0 and flag == True:
        len_r -= 1
        flag = False
        tmp = i
        continue
    if tmp % K == 0 and flag == False:    
        flag = True
        tmp = i
        continue
    tmp += i -tmp

tmp = 0
flag = True
for j in index['s']:    
    if tmp % K == 0 and flag == True:
        len_s -= 1
        flag = False
        tmp = js
        continue
    if tmp % K == 0 and flag == False:    
        flag = True
        tmp = j
        continue
    tmp += j - tmp

tmp = 0
flag = True
for k in index['p']:    
    if tmp % K == 0 and flag == True:
        len_p -= 1
        flag = False
        tmp = k
        continue
    if tmp % K == 0 and flag == False:    
        flag = True
        tmp = k
        continue
    tmp += k-tmp

ans = P * len_r + R * len_s + S * len_p
print(ans)

### FIXED CODE ###

N,K = map(int, input().split())
R,S,P = map(int, input().split())
T = input()

ans = ""
score = 0

for i, t in enumerate(T):
    if t == 'r':
        if i >= K and "p" == ans[-K]:
            ans += " "
        else:
            ans += 'p'
            score += P    

    elif t == 's':
        if i >= K and "r" == ans[-K]:
            ans += " "
        else:
            ans += 'r'
            score += R 
    else:
        if i >= K and 's' == ans[-K]:
            ans += " "
        else:
            ans += 's'
            score += S
print(score)
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13:
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif x=="C":
  b=12
elif x=="D":
  b=13:
elif x=="E":
  b=14
elif x=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")

### FIXED CODE ###

x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")
#b
n=int(input())
xl=[]
for i in range(n):
    xl.append( list( map(int,input().split()) ) )

xl.sort(key=lambda x:x[0])


x = [xl[i][0] for i in range(n)]
l = [xl[i][1] for i in range(n)]
left = [x[i]-l[i] for i in range(n)]
right= [x[i]+l[i] for i in range(n)]

import bisect
rinsetu=[]
for i in range(n):
    migite   = bisect.bisect_left(left, right[i])
    hidarite = bisect.bisect_right(right, left[i]) 
#    print(migite,hidarite)
    migite_catch   = list(range(i+1,migite) )
    hidarite_catch = list(range(hidarite,i) )
    rinsetu.append( hidarite_catch + migite_catch )
#    rinsetu.append( migite_catch )

# n=6
# rinsetu=[[1,2],[0,2,3],[0,1,3,4],[1,2],[2,5],[4]]

def remove_oya1(lis,c):
    neighbor = lis.copy()
    i0=c
    for i in range(n):
        if len(neighbor[i]) == 1:
            oya=neighbor[i][0]
            for r in neighbor[oya]:
                neighbor[r].remove(oya)
            neighbor[oya]=[]
            i0+=1
    return neighbor, i0

def remove_biggest(lis,c):
    neighbor = lis.copy()
    i0=c
    to_delete=0
    max_len=0
    for i in range(n):
        if len(neighbor[i]) > max_len:
            max_len=len(neighbor[i]) 
            to_delete=i
    
    oya=neighbor[to_delete]
    for r in oya:
        neighbor[r].remove(to_delete)
    neighbor[to_delete]=[]
    i0+=1
    return neighbor,i0



ans = 0
if sum(len(r) for r in rinsetu)==0:
    print(n)
else:
    rinsetu,ans = remove_oya1(rinsetu,ans)
while True:
    if sum(len(r) for r in rinsetu) > 0:
        rinsetu,ans = remove_biggest(rinsetu,ans)
    else:
        print(n-ans)
        break
    
    if sum(len(r) for r in rinsetu) > 0:
        rinsetu,ans = remove_oya1(rinsetu,ans)
    else:
        print(n-ans)
        break
        
  

### FIXED CODE ###

n=int(input())
xlr=[[] for _ in range(n)]

for i in range(n):
    xx,ll = map(int,input().split())
    xlr[i] = [xx,ll,xx-ll,xx+ll]
    
xlr.sort(key = lambda x:x[3])

ans=1
right=xlr[0][-1]
for i in range(1,n):
    if right <= xlr[i][2]:
        ans+=1
        right=xlr[i][-1]

print(ans)
nums = input().split()
a = int(nums[0])
b = float(nums[1])
print(int((a*(100*b))/100)

### FIXED CODE ###

from decimal import Decimal
a, b = map(Decimal, input().split())
print(int(a*b))
n=input()
print('ABC' if n < 1200 else 'ARC' if 1200 <= n < 2800 else 'AGC')

### FIXED CODE ###

n=int(input())
print('ABC' if n < 1200 else 'ARC' if 1200 <= n < 2800 else 'AGC')
mod = 10**9+7


def inv(a,mod):
    r = [1,0,a]
    w = [0,1,mod]
    while w[2]!=1:
        q = r[2]//w[2]
        r_new = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = w
        w = r_new
        x,y = w[0],w[1]    # a*x+y*mod = 1
        return (mod+x%mod)%mod

max_num = 2*10**5+1
fact = [0 for _ in range(max_num)]
ifact = [0 for _ in range(max_num)]

fact[0] = fact[1] = 1
ifact[0] = ifact[1] = 1

for i in range(2,max_num):
    fact[i] = fact[i-1] * i % mod

ifact[max_num-1] = inv(fact[max_num-1],mod)

for i in range(2,max_num):
    ifact[max_num-i] = (ifact[max_num-i+1] * (max_num-i+2)) %mod

def comb(x,y):
    return fact[x] * ifact[y] * ifact[x-y] % mod


def solve(r, c):
    ans = 0
    for i in range(r+1):
        ans += comb(c+i+1, c)
        ans %= mod
    return ans


r1, c1, r2, c2 = map(int, input().split())

ans = solve(r2, c2) - solve(r2, c1-1) - solve(r1-1, c2) + solve(r1-1, c1-1)
ans %= mod

print(ans)


### FIXED CODE ###

mod = 10**9+7


def inv(a, mod):
    r = [1, 0, a]
    w = [0, 1, mod]
    while w[2] != 1:
        q = r[2]//w[2]
        r_new = [r[0]-q*w[0], r[1]-q*w[1], r[2]-q*w[2]]
        r = w
        w = r_new
    x, y = w[0], w[1]    # a*x+y*mod = 1
    return (mod+x % mod) % mod


max_num = 2*10**6+100
fact = [0 for _ in range(max_num)]
ifact = [0 for _ in range(max_num)]

fact[0] = fact[1] = 1
ifact[0] = ifact[1] = 1

for i in range(2, max_num):
    fact[i] = fact[i-1] * i % mod
    ifact[i] = ifact[i-1] * inv(i, mod) % mod


def cmb(x, y):
    return fact[x] * ifact[y] * ifact[x-y] % mod


def solve(r, c):
    ans = 0
    for i in range(r+1):
        ans += cmb(c+i+1, c)
        ans %= mod
    return ans


r1, c1, r2, c2 = map(int, input().split())

ans = solve(r2, c2) - solve(r2, c1-1) - solve(r1-1, c2) + solve(r1-1, c1-1)
ans %= mod

print(ans)
iN,iM = [int(x) for x in input().split()]
iD = 10**9 +7 #法

def fPrimeCounter(iM):
    iS = int(iM ** 0.5) + 1
    aRet = []
    for i in range(2,iS + 1):
        iCounter = 0
        while iM % i == 0:
            iM = iM / i
            iCounter += 1
        if 0 < iCounter : aRet.append(iCounter)
        if iM == 1 : break
    if 1 < iM  : aRet.append(1)
    return aRet
def fnCr(iN,iR,iD):
    iR = min(iR,iN-iR)
    if iR == 1 :
        return iN
    return (iN % iD) * pow(iR,iD-2,iD) * fnCr(iN-1,iR-1,iD) % iD

aP = fPrimeCounter(iM)
if len(aP) == 0:
    print(1)
    exut()
iRet = 1
for i in aP:
    # i + iN -1  C  iN -1
    iRet *= fnCr(i+iN-1,iN-1,iD)
iRet %= iD
print(iRet)


### FIXED CODE ###

iN,iM = [int(x) for x in input().split()]
iD = 10**9 +7 #法

def fPrimeCounter(iM):
    i = 2
    iS = int(iM ** 0.5) + 1
    aRet = []
    while i < iS or iM != 1:
        iCounter = 0
        while iM % i == 0:
            iM = iM // i
            iCounter += 1
        if 0 < iCounter : aRet.append(iCounter)
        i += 1

    return aRet

#二分累乗法 iDを法として
def fBiPow(iX,iN,iD):
    iY = 1
    while iN > 0:
        if iN % 2 == 0:
            iX = iX * iX % iD
            iN = iN // 2
        else:
            iY = iX * iY % iD
            iN = iN - 1
    return iY

aP = fPrimeCounter(iM)
if aP == [] :
    print (1)
else:
    iMax = max(aP) + iN - 1
    aM = [1] * (iMax + 1)
    #階乗 iD を法とした
    for i in range(1,iMax + 1):
        aM[i] = aM[i-1] * i  % iD
    aInvM = [1]* (iMax + 1)
    aInvM[iMax] = fBiPow(aM[iMax],iD-2,iD)
    #階乗の逆元 iD を法とした
    for i in range(iMax,0,-1):
        aInvM[i-1] = aInvM[i]*i % iD

    iRet = 1
    for i in aP:
        # i + iN -1  C  iN -1
        iRet *= aM[i+iN-1] * aInvM[iN-1] * aInvM[i] % iD
    iRet %= iD
    print(iRet)
n, k = map(int, input().split())
h = [int(x) for x in input().split() if x>=k]
print(sum(h))

### FIXED CODE ###

n, k = map(int, input().split())
h = [int(x) for x in input().split() if int(x)>=k]
print(len(h))
import numpy as np

L,R = map(int, input().split())

A = np.arange(L, R+1)

if  R-L > 2018:
    print(0)
    
elif np.count_nonzero(A % 2019 == 0) > 0:
    print(0)
    
else:
    ans = 2019
    for i in np.arange(L, R+1):
        for j in np.arange(i+1, R+1):
            ans = np.amin(np.array([i * j % 2019, ans]))
    print(ans)    

### FIXED CODE ###

import numpy as np

L,R = map(int, input().split())

if  R-L > 2018:
    print(0)
    
else:
    ans = 2018
    
    R = R % 2019
    L = L % 2019

    if L > R:
        R += 2019
        
    if R - L > 500:
        print(0)
        
    else:
        for i in np.arange(L, R+1):
            for j in np.arange(i+1, R+1):
                i = i % 2019
                j = j % 2019
                k = i * j % 2019
                ans = np.amin(np.array([k, ans]))
            
        print(ans)
S = input()

if S[0] == S[1] && S[2] == S[3] && S[0] != S[2]:
  print('Yes')
elif S[0] == S[2] && S[1] == S[3] && S[0] != S[1]:
  print('Yes')
elif S[0] == S[3] && S[1] == S[2] && S[0] != S[1]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S = input()
 
if S[0] == S[1] and S[2] == S[3] and S[0] != S[2]:
  print('Yes')
elif S[0] == S[2] and S[1] == S[3] and S[0] != S[1]:
  print('Yes')
elif S[0] == S[3] and S[1] == S[2] and S[0] != S[1]:
  print('Yes')
else:
  print('No')
import sys

p = 0
x1 = []
for line in open('test.txt','r'):#sys.stdin:
    x = [int(i) for i in line.split()]
    if p == 0:
        r,c = x
        p = 1
    else:
        x1.append(x)

for i in range(r):
    x1[i].append(sum(x1[i]))
x=[]
for j in range(c+1):
    s = 0
    for i in range(r):
        s += x1[i][j]
    x.append(s)
x1.append(x)

for i in range(r+1):
    for j in range(c+1):
        print x1[i][j],
    print

### FIXED CODE ###

r, c = map(int, raw_input().split())

x = [map(int, raw_input().split()) for i in range(r)]

x.append([sum([x[i][j] for i in range(r)]) for j in range(c)])

for e1 in x:
    for e in e1:
        print e,
    print sum(e1)
from collections import defaultdict, deque
import sys
#input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))
N = int(input())
A = sorted(inpl())

print(sum(map(abs, A[1:])) - A[0])
for i in range(N-2, 0, -1):
  a = A[i]
  if a > 0:
    print(A[0], a)
    A[0] -= a
    else:
      print(A[-1], a)
      A[-1] -= a
      print(A[-1], A[0])


### FIXED CODE ###

def inpl(): return list(map(int, input().split()))
N, K = inpl()
if K == 1:
    print(0)
else:
    print(N-K)
import math
a,b,c,d=map(int,input().split())
a-=1
y=int(c*d/math.gcd(c,d))

p=a-((a//c)+(a//d)-(a//y))

q=b-((b//c)+(b//d)-(b//y))

print(int(q-p))

### FIXED CODE ###

import fractions
a,b,c,d=map(int,input().split())
a-=1
y=int(c*d/fractions.gcd(c,d))

p=a-((a//c)+(a//d)-(a//y))

q=b-((b//c)+(b//d)-(b//y))

print(int(q-p))
R = int(input())
if R<1200:


### FIXED CODE ###

R = int(input())
if R<1200:
    print('ABC')
elif R<2800:
    print('ARC')
else:
    print('AGC')
n = int(input())
a = list(map(int, input().split()))
forward = [0]
back =[0]
for i in range(0,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))

back.reverse()

ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(forward[i], back[i]))
print(ans)

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
forward = [0]
back =[0]
for i in range(0,n-1):
    forward.append(fractions.gcd(forward[i], a[i]))
    back.append(fractions.gcd(back[i], a[n-i-1]))
ans = 0
for i in range(n):
    ans = max(ans, fractions.gcd(forward[i], back[n-1-i]))
print(ans)
import math
if __name__ = "__main__":
	R = eval(input())
    print(math.pi*R**2)


### FIXED CODE ###

R = float(input())
print(2*3.141592653589793*R)
S=input()
T = input()

checked_s=[0]*26

for i in range(len(S)):
    if S[i] != T[i]:
        if T[i] in S:
            S = S.translate(str.maketrans({S[i]:T[i], T[i]: S[i]}))
        elif checked_s[i] == 0:
            S = S.replace(S[i], T[i])
            
if S==T:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from collections import Counter
 
S = input()
T = input()
 
s = Counter(S)
t = Counter(T)
 
if sorted(s.values()) == sorted(t.values()):
	print("Yes")
else:
	print("No")
import numpy as np
n= int(input())
a_list = sorted(list(map(int, input().split())),reverse=True)
a_array = np.array(a_list)
alice = a_array[::2]
bob = a_array[1::2]
print(sum(alice-bob))

### FIXED CODE ###

import numpy as np
n= int(input())
a_list = sorted(list(map(int, input().split())),reverse=True)
a_array = np.array(a_list)
alice = a_array[::2]
bob = a_array[1::2]
print(sum(alice)-sum(bob))
n,m = map(int,input().split())
a = list(map(int,iuput().split()))
a_sum = sum(a)
x = n - a_sum
if x >= 0:
    print(x)
else:
    print(-1)

### FIXED CODE ###

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

c = list(map(int,input().split()))
c_sum = sum(c)

day_count = n-c_sum

if day_count>=0:
  print(day_count)
else:
  print(-1)
def d170(n,a):
    sa=sorted(a)
    dp=[0 for i in range(max(a)+1)]
    if sa[0]==1:
        if sa[1]==1:
            return 0
        else:
            return 1
    else:
        for x in sa:
            if dp[x]==0:
                for j in range(x,n):
                    if j%x==0:
                            dp[j]+1
        return dp.count(1)
    
n=int(input())
a=list(map(int, input().split()))    
print(d170(n,a))
            

### FIXED CODE ###

def d170(n,a):
    k=max(a)+1
    count=0
    dp=[0 for i in range(k)]
    for x in a:
        if dp[x]!=0:
                dp[x]=2
                
        else:
            for j in range(x,k,x):
                     dp[j]+=1
    for x in a:
        if dp[x]==1:
            count+=1
    return count
    
n=int(input())
a=list(map(int, input().split()))    
print(d170(n,a))
import numpy as np

from sys import stdin
from numba import njit


@njit
def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))
    sa = set(a)

    lcm = 1

    for ai in sa:
        lcm = (ai * lcm) // fractions.gcd(ai, lcm)

    ans = 0

    ans = np.sum([lcm // ai for ai in a])

    ans %= 10 ** 9 + 7

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import fractions

from sys import stdin


def main():
    n = int(stdin.readline())
    a = list(map(int, stdin.readline().split()))
    sa = set(a)

    lcm = 1

    for ai in sa:
        lcm = (ai * lcm) // fractions.gcd(ai, lcm)

    ans = 0

    for ai in a:
        ans += lcm // ai
    ans %= 10 ** 9 + 7

    print(ans)


if __name__ == "__main__":
    main()
import math
import numpy as np
N = int(input())
xy = [[0,0] for _ in range(N)]
for a in xy:
    a[0], a[1] = map(int, input().split())
x=a[0]
y=a[1]

def distance(x, y, i, j):
    d = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
    return d

da = np.zeros([N, N])
for i in range(N):
    for j in range(N):
        Da = distance(x, y, i, j)
        da[i][j] = Da
avg = da.sum() * math.factorial(N-1) / math.factorial(N)
print(avg)

### FIXED CODE ###

import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
at=[]
for i in range(N):
    for j in range(N):
        ea = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)
n, m = map(int, input().split())
info = [list(map(int, input().split())) for i in range(m)]
tree = [[] for i in range(n)]
start_point = [True] * n
for i in range(m):
    tree[info[i][0] - 1].append(info[i][1] - 1)
    start_point[info[i][1] - 1] = False
     
dp = [0]*n

def dfs(pos):
    for i in tree[pos]:
        if dp[i] < dp[pos] + 1:
            dp[i] = dp[pos] + 1
            dfs(i)

for i in range(len(start_point)):
    if start_point[i]:
        dfs(i)
print(max(dp))
          

### FIXED CODE ###

import sys


input = sys.stdin.readline
sys.setrecursionlimit(200000)

n, m = map(int, input().split())
info = [list(map(int, input().split())) for i in range(m)]
tree = [[] for i in range(n)]
start_point = [True] * n
for i in range(m):
    tree[info[i][0] - 1].append(info[i][1] - 1)
    start_point[info[i][1] - 1] = False
     
dp = [-1]*n

def dfs(pos):
    if dp[pos] !=-1:
        return dp[pos]
    if not tree[pos]:
        dp[pos] = 0
        return 0
    ans = 0
    for i in tree[pos]:
        ans = max(ans, dfs(i) + 1)
    dp[pos] = ans
    return ans

for i in range(n):
    dfs(i)
print(max(dp))
a,b=map(int(),input().sprit())
print(max(a + b,a - b,a * b))

### FIXED CODE ###

a,b=map(int,input().split())
print(max(a + b,a - b,a * b))
L=list()
N=int(input())
for i in range(N):
  a=int(input())
  L.append(a)
L=L.sorted(L)
c=L[-1]
d=L[-2]
for i in range(N):
  if L[i]==c:
    print(d)
  else:
    print(c)

### FIXED CODE ###

L=list()
N=int(input())
for i in range(N):
  a=int(input())
  L.append(a)
c=max(L)
d=sorted(L)[-2]
for i in range(N):
  if L[i]==c:
    print(d)
  else:
    print(c)
a,b,c,d=map(int,input().split())
if a/d>c/b:
    print('Yes')
elif a/d==c/b:
  if c/b>0 and a/d==0
  print('No')
  else:
    print('Yes')
elif a/d+1==c/b:
    if c%b==0 and a%d!=0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
x=a//d
y=c//b
if y<x:
    print('Yes')
elif y==x:
    if c%b==0:
        print('Yes')
    else:
        if a%d==0:
            print('No')
        else:
            print('Yes')
            
elif y==x+1:
    if c%b==0:
        print('Yes')
    else:
        print('No')
            
else:
    print('No')
import fractions
N,K=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
for i in range(1,N):
	if i==1:
		tmp=fractions.gcd(L[0],L[1])
	else:
		tmp=fractions.gcd(tmp,L[i])
if max(L)>=K and K%tmp==0:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")

### FIXED CODE ###

import fractions
N,K=map(int,input().split())
L=list(map(int,input().split()))
tmp=0
if N==1:
	if L[0]==K:
		print("POSSIBLE")
		exit()
	else:
		print("IMPOSSIBLE")
		exit()
for i in range(1,N):
	if i==1:
		tmp=fractions.gcd(L[0],L[1])
	else:
		tmp=fractions.gcd(tmp,L[i])
if max(L)>=K and K%tmp==0:
	print("POSSIBLE")
else:
	print("IMPOSSIBLE")