peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

j = 0
Ta = 1e5 + 1
for i in range(N):
    Tm = T - H[i] * 0.006
    Tb = abs(Tm - A)
    if Ta > Tb:
        Ta = Tb
        j = i
print(j + 1)
# Judge status: Accepted
n, k = map(int,input().split())
l = sorted([list(map(int, input().split())) for _ in range(n)])

x = 0
for i in range(n):
    x += l[i][1]
    if x >= k:
        print(l[i][0])
        break
# Judge status: Accepted
def resolve():
    N, A, B = map(int, input().split())
    division = N // (A + B)
    mod = N % (A + B)
    ans = division * A

    if (mod > A):
        ans += A
    else:
        ans += mod

    print(ans)


resolve()
# Judge status: Accepted
n,k = map(int,input().split())
p = list(map(int,input().split()))
s = [0]
ans = [0]

#累積和
for i in range(n):
    s.append(s[i]+(p[i]+1)/2)

#区間kの和をリストに格納
for i in range(n-k+1):
    ans[i] = s[k+i] - s[i]
    ans.append(ans[i])

#区間kの和の中で最大値
print(max(ans))
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9+7
def nCr(N, R, mod):
	R = min(R, N-R)
	numer = denom = 1
	for i in range(1, R+1):
		numer = numer * (N+1-i) % mod
		denom = denom * i % mod
	return numer * pow(denom, mod-2, mod) % mod


ans = pow(2,n,mod)
ans -= 1
ans -= nCr(n,a,mod)
ans %= mod
ans -= nCr(n,b,mod)
ans %= mod
print (ans)
# Judge status: Wrong Answer
N=int(input())
n=[str(input()) for i in range(N)]
M=int(input())
m=[str(input()) for i in range(M)]
# Judge status: Wrong Answer
a = input()
b = input()

a_len = len(a)
b_len = len(b)

huku = []

for i in range(a_len):
    if a_len != b_len & i==a_len-1:
        break
    else:
        huku.append(a[i])
        huku.append(b[i])
for i in range(len(huku)):
    print(huku[i],end="")
# Judge status: Wrong Answer
import math
def main():
	N = int(input())
	if N%2 == 1 or N==0:
		print(0)
	else:
		P = int(math.log(N,5))
		N = int(N/2)
		ans = [ int(N/(5**p)) for p in range(1,P+1)]
		print(sum(ans))

if __name__ == '__main__':
	main()
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
print('YES' if a<x and a+b>x else 'NO')
# Judge status: Wrong Answer
N = int(input())
a_s = list(map(int,input().split()))
cnt = [0] * (max(a_s)+1)
for a in a_s:
    cnt[a] += 1
answer = 1
for i,c in enumerate(cnt):
    if i < 1:
        continue
    if i < 2:
        answer = max(answer, sum(cnt[i-1:i+1]))
        continue
    answer = max(answer, sum(cnt[i-2:i+1]))
print(answer)
# Judge status: Accepted
S = input()
T = input()

if S in T:
    print('0')
else:
    count = 0
    for i in range(len(S) - len(T) + 1):
        tmp = 0
        for p in range(len(T)):
            if S[i + p] == T[p]:
                tmp += 1
        
        if count < tmp:
            count = tmp
    
    print(len(T) - count)
# Judge status: Accepted
#151_A
print(chr(ord(input()) + 1))
# Judge status: Accepted
n,k=map(int,input().split())
ans=0
for i in range(k,n+2):
    ans+=1+(i*(n+n-i+1)- i*(i-1))/2
if ans>10**9+7: ans%=10**9+7
print(int(ans))
# Judge status: Wrong Answer
n = int(input())

a = [i+1 for i in range(n)]

for i in range(n ** 2):
    g = []
    for j in range(n):
        if ((i >> j) & 1):
            g.append(a[j])
    if sum(g) == n:
        print(*g)
        break
# Judge status: Accepted
h,a=map(int,input().split())
x=0
if h%a>0:
  x=1
print(h//a+x)
# Judge status: Accepted
N = int(input())
a = 0
for i in range(N):
    a+= i+1
print(a)
# Judge status: Wrong Answer
N, M = map(int,input().split())
A = list(map(int, input().split()))
for i in range(M):
    B, C = map(int,input().split())
    A += [C]*B
print(A)
A.sort()
print(sum(A[-N:-1])+A[-1])
# Judge status: Wrong Answer
from collections import Counter
n=int(input())
s=[ input() for i in range(n)]
alf=list("abcdefghijklmnopqrstuvwxyz")
ans=dict()
for i in alf:
  ans[i]=1000
for i in s:
  sl=list(i)
  sl=Counter(sl)
  for j in alf:
    if not sl[j]:
      ans[j]=0
    elif ans[j]>sl[j]:
      ans[j]=sl[j]
s=""
for i in ans:
  if ans[i]!=0:
    s+=str((i*int(ans[i])))
print(s)
# Judge status: Accepted
import math
A, B, H, M = map(int, input().split())
angle = abs((H*30 + M*0.5) - M*6)%360
print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(angle*math.pi/180)))
# Judge status: Wrong Answer
k=int(input())
if k % 2 == 0:
  print((k / 2) * (k / 2))
else:
  print(int(k // 2 * (k // 2 + 1)))
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
s_a = s[0:a]
s_b = s[(a+1):(a+2)+b]
minus = s[a]
if minus == "-" and s_a.isdecimal() and s_b.isdecimal():
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# -*- coding: utf-8 -*-
n=int(input())
alist=list(map(int,input().split()))
blist=sorted(alist,reverse=True)
total=blist[0]
for i in range(1,int(n/2)):
  total+=blist[i]*2
if n%2:
  total+=blist[int(n/2)]
print(total)
# Judge status: Accepted
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'
for t in s:
	alphabet = alphabet.replace(t, '')
r = alphabet[0] if len(alphabet) > 0 else 'None'
print(r)
# Judge status: Accepted
n = int(input())
d1, d2 = [], []
for i in range(n):
    a, b = input().split()
    d1.append(int(a))
    d2.append(int(b))

count = 0
for a, b in zip(d1, d2):
    if a == b:
        count += 1
    else:
        count = 0
    if count == 3:
        print('Yes')
        break

if count != 3:
    print('No')
# Judge status: Wrong Answer
N=input()
N=N.replace(' ','')
N=list(N)
if (int(N[1])-int(N[0]))==(int(N[2])-int(N[1])):
    print("YES")
else :
    print("NO")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = ""
for i in a:
  if i % 2 == 0:
    if (i % 3 == 0 or i % 5 == 0):
      b = "APPROVED"
    else:
      b = "DENIED"
      break
print(b)
# Judge status: Accepted
s = input()
t = 'keyence'

idx = 0
for i in range(len(s)):
    if i < len(t):
        if s[i] != t[i]:
            idx = i
            break
    elif i == len(t):
        print('YES')
        exit()

for i in range(idx,len(s)):
    if s[:idx] + s[i:] == t:
        print('YES')
        exit()

print('NO')
# Judge status: Accepted
a,b=map(int, input().split()) 
B = b**2
ans = 0

for i in range(a):
    x,y=map(int, input().split())
    if x**2 + y**2 <= B:
        ans += 1

print(ans)
# Judge status: Accepted
import sys

ri = lambda: int(sys.stdin.readline())

s = ri()
print(['Christmas Eve Eve Eve', 'Christmas Eve Eve', 'Christmas Eve', 'Christmas'][s-22])
# Judge status: Wrong Answer
x,y = map(int,input().split())

#2^60 = 1,152,921,504,606,846,976 > 10^18である。
for i in range(60):
    if y / x < 2**i:
        print(i)
        exit()
# Judge status: Wrong Answer
N = int(input())
print(sum([i * j + k == N for i in range(1,N)for j in range(i,N)for k in range(1,N)]))
# Judge status: Accepted
x,n=map(int,input().split())
l=list(map(int,input().split()))
num=[]
for i in range(-100,102):
    num.append(i)
for i in l:
    num.remove(i)
dif=101
ans=[]
for i in num:
    if dif>abs(i-x):
        dif=abs(i-x)
        ans=[i]
    elif dif==abs(i-x):
        ans.append(i)
print(min(ans))
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))
# A = [0]*N
if N < K*2:
    for i in range(N):
        print(N, end=' ')
    print('')
else:
    for k in range(K):
        B = [0]*N
        for i in range(N):
            for j in range(max(i-A[i], 0), min(A[i]+i+1, N)):
                B[j] += 1
        A = B
        # print(A)
    print(A)
# Judge status: Accepted
n = int(input())
ans = "Yes"
now_x = 0
now_y = 0
now_t = 0

for i in range(n):
  t,x,y = map(int,input().split())
  
  if abs(now_x-x)+abs(now_y-y) > (t-now_t):
    ans = "No"
    break
    
  if (abs(now_x-x)+abs(now_y-y)-(t-now_t))%2 == 1:
    ans = "No"
    break
    
  now_x = x
  now_y = y
  now_t = t
    
print(ans)
# Judge status: Accepted
from bisect import bisect_left

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

"""
前処理で中部に大きさb以下のパーツを使える場合の組み合わせの数を計算しておく。
"""

tmp1 = [0]
for b in B:
    a = bisect_left(A,b)
    tmp1.append(tmp1[-1]+a)

tmp2 = 0
for c in C:
    idx = bisect_left(B,c)
    tmp2 += tmp1[idx]
print(tmp2)
# Judge status: Accepted
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;cnt = 0 ;pro = 1

n = int(input())
A = list(map(int, input().split()))
now = 1000
for i in range(n-1):
    if A[i] < A[i+1]:
        stocks = now//A[i]
        now += (A[i+1] - A[i])*stocks
print(now)
# Judge status: Accepted
N = int(input())
S = input()
maxi = 0
for i in range(1,N):
  a = S[0:i]
  b = S[i:]
  aa = set(a)
  bb = set(b)
  ans = bb&aa
  if len(ans) > maxi:
    maxi = len(ans)
print(maxi)
# Judge status: Accepted
from functools import reduce
from math import ceil

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

alist = list(map(int,input().split(' ')))
# alist = [i // 2  for i in alist]


from fractions import gcd

def getLCM(a, b):
    return a * b // gcd(a, b)

def get_lcm_for(your_list):
    return reduce(lambda x, y: getLCM(x, y), your_list)

lcmr = get_lcm_for(alist)

for a in alist:
    if (lcmr//a)%2 == 0:
        if (lcmr != a):
            print(0)
            exit(0)

result = m//lcmr + 2*m//lcmr%2


print(result)
# Judge status: Accepted
a,b,k=map(int,input().split())
R=range(a,b+1)
for x in sorted(set(R[:k])|set(R[-k:])):
    print(x)
# Judge status: Accepted
a,b = map(int,input().split())
if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline

MOD = 10 ** 9 + 7
N = int(input())

dp = [0 for _ in range(N + 1)]
dp[N] = 1

for i in range(N, -1, -1):
    for j in range(i - 3 + 1):
        dp[j] = (dp[j] + dp[i]) % MOD

print(dp[0])
# Judge status: Wrong Answer
n = int(input())
a = int(n**0.5)+1

if n == 0:
    print(0)
    exit()
ans = 0
for i in range(2, a+1):
    j = 1
    while 1:
        if n % pow(i, j) == 0:
            n = n//pow(i, j)
            ans += 1
            j += 1
        else:
            break
if ans == 0:
    print(1)
    exit()
print(ans)
# Judge status: Wrong Answer
import numpy as np
n,m = map(int, input().split())
arr = np.ones(m)
for i in range(n):
    ka = np.array([int(i) for i in input().split()])
    for j in range(ka[0]):
        arr[ka[j+1]-1] = 0
ans = int(arr.sum())
print(ans)
# Judge status: Accepted
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))

pointID = -1
min_diff = 9999999999

for i in range (N):
    #地点i の温度 と 平均気温の差(絶対値)
    diff = abs(T - H[i] * 0.006 - A)

    if diff < min_diff:
        pointID = i+1
        min_diff = diff

print(pointID)
# Judge status: Accepted
x, y = map(int, input().split())

group = ['a', 'c', 'a', 'b', 'a', 'b', 'a', 'a', 'b', 'a', 'b', 'a']

if group[x-1] == group[y-1]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
n, k = map(int, input().split())
a = list(map(int, input().split()))

left = math.ceil(a.index(min(a)) / (k - 1))
surplus = (k-(a.index(min(a)) % (k - 1))) % k + 1
right = math.ceil((len(a)-a.index(min(a))-surplus)/(k-1))
print(left+right)
# Judge status: Wrong Answer
n = int(input())

r = n % 27
if r == 13 or r == 26:
    print(':)')
elif r ==0:
    x = int(100*n/108)
    print(x)
else:
    for i in range(1, 25):
        if 1.08*(i-1) < r <= 1.08*i:
            break
    x = int(100*(n - i)/108) + i
    print(x)
# Judge status: Accepted
n,h = map(int, input().split())
ab = []
for _ in range(n):
    data = list(map(int,input().split()))
    ab.append(data)

ab.sort()
ab.reverse()

max_a = ab[0][0]

throw_dmgs = []
for tmp in ab:
    if tmp[1] > max_a:
        throw_dmgs.append(tmp[1])

throw_dmgs.sort()
throw_dmgs.reverse()

ans=0
for i in range(len(throw_dmgs)):
    ans+=1
    h -= throw_dmgs[i]
    if h <= 0:
        print(ans)
        exit()
import math

swing = math.ceil(h / max_a)
print(ans+swing)
# Judge status: Accepted
from collections import deque
k = int(input())

dq = deque(list(range(1, 10)))
rep = 0
while rep < k:
    now = dq.popleft()
    rep+=1
    for i in (-1, 0, 1):
        if 0<=now%10+i<10: dq.append(now*10+now%10+i)
print(now)
# Judge status: Accepted
T, N = list(map(int,input().split()))

ans_c = 1001
for i in range(T):
    c, t = list(map(int,input().split()))
    if (N >= t) and (c <= ans_c):
        ans_c = c

if ans_c == 1001:
    print("TLE")
else:
    print(ans_c)
# Judge status: Accepted
import bisect

n = int(input())
a = sorted(list(map(int, input().split())))
b = list(map(int, input().split()))
c = sorted(list(map(int, input().split())))

ans = 0
for i in b:
    a_pos = bisect.bisect_left(a, i)
    c_pos = n - bisect.bisect_right(c, i)
    ans += a_pos * c_pos

print(ans)
# Judge status: Accepted
N,K = map(int,input().split())

ans = 0
prob = 1
pow2 = 1
for i in range(N,0,-1):
    if i*pow2 >= K:
        ans += prob/N 
    else:
        while(1):
            prob = prob/2
            pow2 = pow2*2
            if i*pow2 >= K:
                ans += prob/N
                break
print(ans)
# Judge status: Accepted
temp = input()
temp2 = temp.split(" ")
temp = []
for i in temp2:
    temp.append(int(i))

for i in range(1,100000000):
    ans1 = temp[0]*i
    if ans1 % temp[1] != 0:
        break
    if ans1 >= 10^18:
        ans1 = -1
        break
print(ans1)
# Judge status: Wrong Answer
n,m= list(map(int, input().split()))
if n>=m*2:
    print(1000000007)
else:
    print(n+(m-n*2)//4)
# Judge status: Accepted
d,t,s = map(int,input().split())
if d/s <= t :
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
V = list(map(int, input().split()))
V.sort(reverse=True)
V = iter(V)
res = 0
L = N.bit_length()
for i in range(L):
    if (N>>i)&1 != 1:
        continue
    for _ in range(1<<i):
        v = next(V)
        res += v/(1<<(i+1))

print(res)
# Judge status: Wrong Answer
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
if a.count(x)==a.count(y):
    print("Yes")
elif b.count(x)==b.count(y):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import numpy as np
import math

A, B, H, M = map(int, input().split())


def H_angle(H):
    return H * 30

def M_angle(M):
    return M * 6

angle = abs(H_angle(H) - M_angle(M))
if angle >= 180:
    angle = angle - 180
angle = math.radians(angle)

def compute(A, B, angle):
    A2 = np.square(A)
    B2 = np.square(B)
    AB = A * B
    cos = np.cos(angle)
    return A2 + B2 - 2 * AB * cos


print(np.sqrt(compute(A, B, angle)))
# Judge status: Wrong Answer
S_list = list(map(int,input().split()))
ans = S_list[0] + S_list[1]
if  ans <=24 :
    result = ans
else:
    result = ans - 24
print(result)
# Judge status: Accepted
k,n=map(int,input().split())
poses=list(map(int,input().split()))
print(k-max(k-poses[-1]+poses[0],max(pos1-pos0 for pos1,pos0 in zip(poses[1:],poses))))
# Judge status: Wrong Answer
n = int(input())
l = list(int(i) for i in input().split())
s = l.copy()
s.sort()

flag = False
if s == l:
  flag = True
else:
  for i in range(n):
    for j in range(i+1, n):
      t = l.copy()
      t[i], t[j] = t[j], t[i]
      if s == t:
        flag = True

if flag:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import numpy as np
N, K = map(int, input().split())
A = list(map(int, input().split()))

score = []
for i in range(N - K + 1) :
  score.append(np.prod(A[i:i + K]))

for i in range(N - K) :
  if score[i + 1] > score[i] :
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
#--Infinite Coins
cost = int(input())
one_coins = int(input())

for i in range(one_coins+1):
  calculate = cost - i
  if (calculate % 500 == 0):
    print ("Yes")
    exit()
  else:
    pass

print("No")
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b,c=map(int, input().split())
    print(a*b//2)
resolve()
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print("Yes" if (a+b)*2 >= c else "No")
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
c = input()
v = ["a", "e", "i", "u", "o"]
if c in v:
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
_,s=input(),input()
t=0
for c in s:
  if c=='(': t+=1
  else: t-=1
  if t<0: s='('+s; t+=1
print(s+')'*t)
# Judge status: Accepted
x, y = map(int, input().split())
ans = min(abs(x+y)+1, max(y-x, x-y+2))
print(ans)
# Judge status: Accepted
h,w=map(int,input().split())
a=h*w
if h!=1 and w!=1:
  if a%2==0:
    print(a//2)
  else:
    v=(a-1)//2
    print(a-v)
else:
  print(1)
# Judge status: Accepted
S = input()

cnt = 0
remove = 0
for s in S:
    if s == "S":
        cnt += 1
    else:
        if cnt > 0:
            remove += 2
            cnt -= 1

ans = len(S) - remove
print(ans)
# Judge status: Wrong Answer
n = input()
if len(n) == 3:
    print('ABC')
else:
    print('ABD')
# Judge status: Accepted
n, k = map(int, input().split())
H = list(map(int, input().split()))
dp = [0] * n
for i in range(1, n):
    dp[i] = min(dp[i - j - 1] + abs(H[i] - H[i - j - 1]) for j in range(min(k, i)))

print(dp[n - 1])
# Judge status: Accepted
a,b = map(int,input().split())

if a * b <= 0:
    print("Zero")
elif a > 0:
    print("Positive")
else:
    if (b - a) % 2 == 0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Accepted
#!/usr/bin/env python3
import sys

def main():
    from math import sqrt
    input = sys.stdin.readline
    n = int(input())
    m = int(sqrt(n)) + 1

    ans = 0
    for i in range(1, n + 1):
        j = n // i
        if n % i == 0:
            j -= 1
        ans += j
    
    print(ans)



if __name__ == '__main__':
    main()
# Judge status: Accepted
import re
A, B = map(int,input().split())
S = input()

p = f"\d{{{A}}}-\d{{{B}}}"
pattern = re.compile(p)
if pattern.fullmatch(S):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
import fractions

def input(): return sys.stdin.readline().strip()
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    T = [Z() for _ in range(N)]
    ans = T[0]
    for i in range(1, N):
        g = fractions.gcd(ans, T[i])
        ans *= T[i]
        ans //= g
    print(ans)

    return

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N=input();print('Yes')if set(N[:3])==1or set(N[1:])==1else print('No')
# Judge status: Accepted
N,M,X,Y = map(int,input().split())
lx = list(map(int,input().split()))
lx.append(X)
ly = list(map(int,input().split()))
ly.append(Y)
if max(lx) < min(ly):
    print('No War')
else:
    print('War')
# Judge status: Accepted
wa, num = map(int, input().split())
kame = (num / 2) - wa
turu = wa - kame

if (kame >= 0 and turu >= 0) and (wa == kame + turu) and (num == 2 * turu + 4 * kame) and (
        kame.is_integer() and turu.is_integer()):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
d = int(input())
c = [int(i) for i in input().split()]
s = [[int(i) for i in input().split()] for j in range(d)]

#t = [int(input()) for i in range(d)]

for i in range(d):
    print(1)
# Judge status: Wrong Answer
n = int(input())
print(int(((1 + 5**(1/2)) / 2)**(n) + ((1 - 5**(1/2)) / 2)**(n)))
# Judge status: Wrong Answer
n,k=map(int, input().split())
val=n%k
num=abs(n-k)
if num==0:
    print(0)
else:
    val1=min(num%k,k%num)
    print(min(val,val1))
# Judge status: Accepted
import math
h, a = map(int, input().split())
print(math.ceil(h/a))
# Judge status: Wrong Answer
x, y = map(int, input().split())
if x >= 0:
    if y >= 0:
        if x <= y:
            ans = y - x
        else:
            ans = x - y + 2
    else:
        ans = abs(x + y) + 1
else:
    if y <= 0:
        if x <= y:
            ans = y - x
        else:
            ans = x - y + 2
    else:
        ans = abs(x + y) + 1

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
if abs(a-b)%2 == 1:
    print('IMPOSSIBLE')
else:
    print((a+b)//2)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
mod = 10**9+7
X,Y = map(int,readline().split())
if X > Y:
    X,Y = Y,X
Z = X+Y
if Z % 3 == 0 and X <= Y <= 2*X:
    N = Z//3
    r = (N-(Y-X)) // 2
else:
    print(0)
    sys.exit()
f = [1]*(N+1)
for i in range(1,N+1):
    f[i] = i * f[i-1] % mod
a = pow(f[r],mod-2,mod)
b = pow(f[N-r],mod-2,mod)
ans = f[N] * a * b % mod
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int, input().split()))
l=a[0]
sm=0
for h in a:
  if(h<l):
    sm+=(l-h)
  elif(h>l):
    l=h
print(sm)
# Judge status: Wrong Answer
S = input()
 
for i in range(3):
    if S[i] == S[i+1]:
        print("Bad")
        break
else:
    print("Good")
# Judge status: Accepted
N = input()

def digsum(n):
    total = 0
    while n > 0:
        total += n%10
        n /= 10
        n = int(n)
    return total

if len(N)==1:
    print(N)
    exit()

if N[1:].count('9') == len(N)-1:
    print(digsum(int(N)))
    exit()

ans = int(str(int(N[0])-1) + '9'*(len(N)-1))
print(digsum(ans))
# Judge status: Accepted
#B

A,B,C,K=map(int,input().split())

if K<=A:
    Sum=K
elif K<=A+B:
    Sum=A
else:
    Sum=A-(K-A-B)
    
print(Sum)
# Judge status: Wrong Answer
import sys
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    n = I()
    a = list(IL())
    sa = set(a)
    stick = []
    for rep in sa:
        if 2<=a.count(rep): stick.append(rep)
    if len(stick)<2:  print(0)
    else:
        stick.sort()
        print(stick[-1]*stick[-2])
    return

if __name__=='__main__':
    Main()
# Judge status: Accepted
k,n=list(map(int,input().split()))
A=list(map(int,input().split()))
l=[]
for i in range(n-1):
  l.append(A[i+1]-A[i])
l.append(k-A[-1]+A[0])
print(sum(l)-max(l))
# Judge status: Wrong Answer
NK = list(map(int,input().split()))
A = list(map(int,input().split()))
N = NK[0]
K = NK[1]

# print(N)
# print(K)
# print(A)

min_index = A.index(min(A))
# print(min_index)

leftLength = min_index
rightLength = N - 1 - leftLength
# print(leftLength)
# print(rightLength)

delta = K - 1
# print(delta)

count = 0
leftTimes = leftLength // delta
remain = leftLength % delta
if remain > 0:
    leftTimes = leftTimes + 1
    rightLength = rightLength - remain

rightTimes = rightLength // delta
remain = rightLength % delta
if remain > 0:
    rightTimes = rightTimes + 1

count = leftTimes + rightTimes

print(count)
# Judge status: Wrong Answer
input_line =  input()
N = input_line[::-1]
count = 0
for i in range(len(input_line)):
    if input_line[i] != N[i]:
        count += 1
print(count)
# Judge status: Wrong Answer
import sys
import numpy as np
# input処理を高速化する
input = sys.stdin.readline

L=int(input())

V=0
for x in np.arange(0,L+0.1,0.1):
    for y in np.arange(0,L+0.1-x,0.1):
        z = L-x-y
        V = max(V, x*y*z)
print(V)
# Judge status: Accepted

K = int(input())
S = input()
if len(S) <= K:
  print(S)
else:
  print(S[: K] + "...")
# Judge status: Accepted
N = int(input())

def digit(x, base):
    if x == 0:
        return 0
    return digit(x // base, base) + x % base

def calc(six, nine):
    return digit(six, 6) + digit(nine, 9)

ans = 10**18
for six in range(N + 1):
    ans = min(ans, calc(six, N - six))
print(ans)
# Judge status: Wrong Answer
def main():
    N = int(input())
    dict = {}
    for i in range(N):
        s = "".join(sorted(input()))
        if s in dict:
            dict[s] = dict[s] * 2
        else:
            dict[s] = 1
    result = 0
    l = list(dict.keys())
    for j in l:
        result += int(dict[j])
    print(result - len(l))


if __name__ == '__main__':
    main()
# Judge status: Accepted
from math import sqrt

n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

result = 0
for i in range(n):
    for j in range(n):
        if i != j:
            result += sqrt((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)

print(result/n)