peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
import math
input = sys.stdin.readline


def main():
    A, B = map(int, input().split())
    assert A <= 100
    assert B <= 100
    for i in range(1000):
        if math.floor((i+1) * 0.08) == A and math.floor((i+1) * 0.1) == B:
            print(i+1)
            exit()
    print("-1")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
X,Y,A,B,C = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p = sorted(p)
q = sorted(q)
r = sorted(r)
P = A - X
Q = B - Y
R = C - 1
found = True
for i in range(C):
    if (r[R-i] > p[P]):
        if (q[Q] > p[P]):
            P += 1
    elif (r[R-i] > q[Q]):
        Q += 1
    else:
        break
print(sum(p[P:])+sum(q[Q:])+sum(r[R:]))
# Judge status: Wrong Answer
import collections

n,k = map(int,input().split())
a = [int(i) for i in input().split()]
b = collections.Counter(a)
c = sorted(b.items(), key=lambda x:x[1])
ans = 0
d = len(c)
i = 0
while d >= k:
    d -= c[i][1]
    ans += c[i][1]
    i +=1
print(ans)
# Judge status: Wrong Answer

N,M = map(int,input().split())
if(min(N,M)==1):
    if(max(N,M)>2):
        print(max(N,M)-2)
    else:
        print(0)
elif(min(N,M)==2):
    print(0)
else:
    print(N*M - (N*2+M*2 - 4))
# Judge status: Wrong Answer
n=[int(input()) for _ in range(5)]
try:
  m=10-min([i%10 for i in n if i%10!=0])
  n=[i if i%10==0 else i+(10-i%10) for i in n]
  print(sum(n)-m)
except:
  print(50)
# Judge status: Accepted
S = set(input())
if S == {'W', 'E', 'N', 'S'} or S == {'W', 'E'} or S == {'N', 'S'}:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def factrize(x):
    f = {}
    if x == 1:
        return f
    tmp = x
    i = 2
    while i**2 <= tmp:
        cnt = 0
        while tmp % i == 0:
            cnt += 1
            tmp = tmp//i
        if cnt > 0:
            f[i] = cnt
        i += 1
    if tmp != 1 or f == {}:
        f[tmp] = 1
    return f

from fractions import gcd
A, B= map(int, input().split())
G = gcd(A, B)
dict = factrize(G)
print(1+len(dict))
# Judge status: Accepted
n = int(input())
ans = -(-n // 2)
print(ans)
# Judge status: Accepted
def solve():
    min_number, max_number = list(map(int, input().split()))

    current_number = min_number
    answer = 0

    while current_number <= max_number:
        answer += 1
        current_number = current_number * 2

    print(answer)
    
solve()
# Judge status: Accepted
S=input()
S1=''.join(sorted(S))
S=str(S1)
if S[0]==S[1] and S[1]!=S[2] and S[2]==S[3]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
if a == b and b != c:
    print('Yes')
elif b == c and c != a:
    print('Yes')
elif c == a and a != b:
    print('Yes')

else:
    print("No")
# Judge status: Accepted
n=int(input())
ans=0

for i in range(1,n+1):
    ans+=i

print(ans)
# Judge status: Accepted
def resolve():
	n = int(input())
	d = dict()
	for _ in range(n):
		v = input()
		if d.get(v):
			d[v] += 1
		else:
			d[v] = 1
	m = int(input())
	for _ in range(m):
		v = input()
		if d.get(v):
			d[v] -= 1
		else:
			d[v] = -1
	ans = float('-inf')
	for k in d.keys():
		ans = max(ans, d[k])
	print(max(ans, 0))
resolve()
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())
if x == 1 and y == 1:
    print(0)
else:
    print(int(math.log2(y/x) + 1))
# Judge status: Accepted
x=int(input())

for i in range(290):
        n=x+(i-145)**5
        for j in range(290):
            if (j-145)**5==n:
                print(j-145,i-145)
                exit()
# Judge status: Wrong Answer
if input()==input()[:-1:-1]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
x = list(map(int, input().split()))

for i in range(5):
    if x[i] == 0:
        print(i + 1)
    else:
        pass
# Judge status: Accepted
arr = list(map(int, input().split()))
arr.sort()
if (arr[0] == arr[1]) and (arr[2] != arr[1]):
	print("Yes")
elif (arr[1] == arr[2]) and (arr[0] != arr[1]):
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

l = [0]*N
for i,a in enumerate(A):
  l[i]=a
  
for x in l:
  print(x, end=' ')
# Judge status: Accepted
N= input()
for i in range (3):
  if N[i]=='7':
    print('Yes')
    exit()

print('No')
# Judge status: Accepted
s = str(input())
print("ABC" if s == "ARC" else "ARC")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
f=[]
od=[]
ev=[]

for i in range(n):
  if a[i]%4==0:
    f.append(a[i])
  elif a[i]%2==1:
    od.append(a[i])
  else:
    ev.append(a[i])
if len(f)>=len(od) and ev!=[]:
  print('Yes')
elif len(f)<len(od) and ev!=[]:
  print('No')
elif ev==[] and len(f)>=len(od)-1:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
my=input()
if my[2]==my[3] and my[4]==my[5]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import math
a,b = list(map(float, input().split()))
b2 = int(b * 100)
Ans1 = a * b2 / 100
Ans = math.floor(a * b) 
print(Ans)
# Judge status: Accepted
def resolve():
    n, r = map(int, input().split())
    if n < 10:
        print(r + 100*(10 - n))

    else:
        print(r)

resolve()
# Judge status: Accepted
# -*- coding: utf-8 -*-
a, b = map(int, input().split(" "))
 
if (a * b) % 2:
  print("Odd")
else:
  print("Even")
# Judge status: Wrong Answer
n, k, x, y = [int(input()) for i in range(4)]
print(k*x + (n-k)*y)
# Judge status: Wrong Answer
n,m = map(int,input().split())

if n == 1:
    print(max(0,m-2))
elif m == 1:
    print(max(0,n-2))
else:
    a = max(0,m-2)
    b = max(0,n-2)
    print(a*b)
# Judge status: Accepted
N,K=map(int,input().split())
print((N-1)//(K-1)+1)if(N-1)%(K-1)else print((N-1)//(K-1))
# Judge status: Wrong Answer
X=int(input())
ans=0
for i in range(1,X):
    for j in range(2,11):
        tmp=i**j
        if ans<tmp<=X:
            ans=tmp
print(ans)
# Judge status: Accepted
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    A = int(_in[1])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    TF = 'Yes' if N%500<=A else 'No'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)
# Judge status: Accepted
X, Y = map(int, input().split())

if (X+Y)%3 != 0 or X*2 < Y or Y*2 < X:
    print(0)
    exit()

n = (2*X - Y) // 3
m = (2*Y - X) // 3

P = 10 ** 9 + 7
N = 10 ** 6
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
for i in range(2, N+1):
    fact.append((fact[-1]*i)%P)
    inv.append((-inv[P%i] * (P // i)) %P)
    factinv.append((factinv[-1] * inv[-1])%P)
print(fact[n+m]*factinv[n]*factinv[m]%P)
# Judge status: Wrong Answer
n = int(input())
s = input()
x = 0
ans = 0
for i in range(len(s)):
    ans = max(ans, x)
    if s[i] == 'I':
        x += 1
    else :
        x -= 1
print(ans)
# Judge status: Accepted
import numpy as np

N = int(input())
tb = np.zeros((10, 10), dtype=int)

for n in range(1, N+1):
    n = str(n)
    lhs, rhs = int(n[0]), int(n[-1])
    tb[lhs][rhs] += 1


ret = 0
for lhs in range(1, 10):
    for rhs in range(1, 10):
       ret += tb[lhs][rhs] * tb[rhs][lhs]

print(ret)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      num=[l[i],l[j],l[k]]
      if len(set(num))!=3:continue
      num.sort()
      if num[2]<num[1]+num[0]:ans+=1
print(ans)
# Judge status: Accepted
n=int(input())
s=input()
if s[0:n//2]==s[n//2:n]: print("Yes")
else: print("No")
# Judge status: Accepted
l = sorted(list(map(int, input().split())))
print(l[0] + l[2]*10+l[1])
# Judge status: Accepted
N, M = map(int, input().split())
memo = [0]*(N+1)
memo[0] = 1
mod = 10**9+7

for _ in range(M):
    ai = int(input())
    memo[ai] = None

if memo[1] != None:
    memo[1] = 1

for i in range(2, N+1):
    tmp = 0
    if memo[i] == None:
        continue
    if memo[i-1] != None:
        tmp += memo[i-1]
    if memo[i-2] != None:
        tmp += memo[i-2]
    memo[i] = tmp

if memo[N] == None:
    print(0)
else:
    print(memo[N]%mod)
# Judge status: Wrong Answer
from collections import Counter

S = input()
c = Counter(S)

if len(c) == 3 and max(c.values()) - min(c.values()) <= 1:
    print("YES")
elif len(c) == 2 and max(c.values()) == min(c.values()):
    print("YES")
elif len(S) == 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
K = 0
for i in range(N-1):
  if A[i] > A[i+1]:
    S = A[i] - A[i+1]
    # リストの前の最大値を取得して比較しないといけない。
    A[i+1] += S
    K += S
  else:
    pass
print(K)
# Judge status: Accepted
def main():
    r, g, b = map(str, input().split())
    gb = int(g + b)
    if gb % 4 == 0:
        print('YES')
    else:
        print('NO')
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
infinity=10**8
N,K = map(int,input().split())
h = list(map(int,input().split()))

dp=[infinity]*N
dp[0]=0

for i in range(1,N):
    step=min(K,i)
    for k in range(1,step+1):
        dp[i] = min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))

print(dp[-1])
# Judge status: Accepted
N,M,X=map(int,input().split())
count=0
for i in range (N+1):
	for j in range(M+1):
		if i==0:
			count=N*j
			if count==X:
				print("Yes")
				exit()
		else:
			count=(N*j-(i*j)+M*i-(i*j))
			if count==X:
				print("Yes")
				exit()
print("No")
# Judge status: Accepted
N,K = (int(X) for X in input().split())
H = sorted(int(input()) for X in range(0,N))
MIN = pow(10,9)
for T in range(0,N-K+1):
    D = H[T+K-1]-H[T]
    if D<MIN: MIN = D
print(MIN)
# Judge status: Accepted
import math
N,D=map(int,input().split())
count=0
for i in range(N):
    x,y=map(int,input().split())
    if math.sqrt(x**2+y**2)<=D:
        count+=1
print(count)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))

ans=2*10**9+10
s=sum(a)
now=0
snuke=0
for i in range(N-1):
    snuke+=a[i]
    now=s-2*snuke

    ans=min(abs(now),ans)

print(ans)
# Judge status: Wrong Answer
N = int(input())
ans = 0
ma = []
mi = []
for i in range(N):
    x1, x2 = map(int, input().split())
    mi.append(x1)
    ma.append(x2)

L = 0
R = 0

if N % 2 == 0:
    L = (mi[N//2-1]+mi[N//2]) / 2
    R = (ma[N//2-1]+ma[N//2]) / 2
    ans = int((R-L)/0.5)+1
else:
    L = mi[N//2]
    R = ma[N//2]
    ans = R - L + 1


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

n = int(input())
s = []
for _ in range(n):
    s.append(int(input()))

s.sort()

ans = sum(s)

if ans % 10 != 0:
    print(ans)
    exit()

for i in s:
    if i % 10 != 0:
        print(ans - i)
        exit()
else:
    print(0)
# Judge status: Accepted
import collections
N = int(input())
a = [int(input())for i in range(N)]

c = collections.Counter(a)
count = 0
for i in c.values():
  if i%2==1:
    count+=1
    
print(count)
# Judge status: Wrong Answer
import numpy
N, M = map(int, input().split())
ship = numpy.array([list(map(int, input().split())) for _ in range(M)])

s_with1 = ship.T[0] == 1
s_withN = ship.T[1] == N

s_with1 = numpy.insert(s_with1, 0, False)
s_withN = numpy.append(s_withN, False)

s = s_with1 * s_withN

ans = 'IMPOSSIBLE'
if numpy.any(s):
    ans = 'POSSIBLE'

print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    a_lst = list(map(int, input().split()))
    number = 1
    count = 0

    for i in range(n):
        if a_lst[i] == number:
            number += 1
        else:
            count += 1

    if 1 not in a_lst:
        count = -1

    print(count)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif 13 > a >= 6:
    print(b / 2)
else:
    print(0)
# Judge status: Accepted
a, b  = map(lambda x: int(x),  input().split())

if a%3==0 or b%3==0 or (a+b)%3 == 0:
  print('Possible')
else:
  print('Impossible')
# Judge status: Accepted
import numpy as np

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

dp = np.zeros(w+1)

for w, v in wv:
    dp[w:] = np.maximum(dp[:-w]+v,dp[w:])
print(int(dp[-1]))
# Judge status: Wrong Answer
n = int(input())
h = list(map(int,input().split()))
m = h[0]
for i in range(1,n-1):
    m = max(m,h[i])
    if h[i] >= m-1:
        continue
    print('No')
    exit()


print('Yes')
# Judge status: Wrong Answer
n=int(input())
A=sorted([int(input()) for _ in range(n)])
cnt=0
for i in range(1,len(A)):
    if A[i-1]==A[i]:
        i+=1
        cnt+=1
print(len(A)-cnt*2)
# Judge status: Wrong Answer
n = int(input())
l = []
o = []
t = 0
c = 0
ans = -1
for i in range(n):
    l.append(int(input())-1)

for i in range(n):
    if l[t] == 1:
        ans = t
        break
    else:
        if t in o:
            break
        else:
            c += 1
            o.append(t)
            t = l[t]

print(ans)
# Judge status: Accepted
n = int(input().strip())
a = [input().strip() for _ in range(n)]
dic = {}
for elem in a:
    if dic.get(elem):
        if dic[elem] == 0:
            dic[elem] = 1
        else:
            dic[elem] = 0
    else:
        dic[elem] = 1
print(len(list(filter(lambda x: x == 1, dic.values()))))
# Judge status: Accepted
import collections

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

ans=0
A_=set(A)
if len(A_)<=K:
    pass
elif len(A_)>K:
    r=len(A_)-K
    A_Cnt=collections.Counter(A)
    A_Cnt_Sort=A_Cnt.most_common()[::-1]
    for a in A_Cnt_Sort[:r]:
        ans+=a[-1]

print(ans)
# Judge status: Accepted
import collections
n, k = map(int, input().split())
dat = list(map(int, input().split()))
dat.sort(reverse=True)
dat = collections.deque(dat)
res = 0
#print(dat)
for _ in range(min(k, len(dat) )):
    _ = dat.popleft()
    #print(dat)

res += sum(dat)
#print(dat)
print(res)
# Judge status: Accepted
n,m = [int(i) for i in input().split()]
ab = []
for i in range(n):
  a = [int(i) for i in input().split()]
  ab.append(a)
from operator import itemgetter
ab = sorted(ab,key=itemgetter(0))

ans = 0
for i in ab:
  if m>i[1]:
    ans += i[0]*i[1]
    m -= i[1]
  else:
    ans += i[0]*m
    break
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
cnt = 0
all_vote = sum(A)
for a in A:
    if a >= (all_vote/(4*M)):
        cnt += 1

if cnt >= M:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
x = list(map(int, input().split()))

if n % 2 == 0:
  print(abs(sum(x[:n//2]) - sum(x[n//2:])))

else:
  center = n // 2
  left = sum(x[:center])
  right = sum(x[center+1:])
  print(x[center] - abs(left - right))
# Judge status: Accepted
s = input()
print('Yes' if 'a' in s and 'b' in s and 'c' in s else 'No')
# Judge status: Accepted
s = input()
k = int(input())

asc = [0] * len(s)
for i in range(len(s)):
    asc[i] = ord(s[i]) - ord("a")
i = 0
for i in range(len(s)):
    if 26 - asc[i] <= k and asc[i] != 0:
        x = 26 - asc[i]
        asc[i] = 0
        k -= x
if k > 0:
    asc[-1] += k % 26
for i in range(len(s)):
    asc[i] += ord("a")
    asc[i] = chr(asc[i])
print("".join(asc))
# Judge status: Wrong Answer
import numpy as np
N, W = map(int, input().split())
wv = []
for _ in range(N):
  wv += list(map(int, input().split()))
wv = np.array(wv).reshape(N,2)
dp = np.zeros((110, 100100))
for i in range(N):
  for w in range(W+1):
    if w - wv[i,0] >= 0:
      dp[i+1,w] = max(dp[i+1,w], dp[i,(w-wv[i,0])]+wv[i,1])
    dp[i+1,w] = max(dp[i+1,w], dp[i, w])
print(dp[:N+1,:W+1])
print(int(dp[N,W]))
# Judge status: Accepted
def saiki(k) :
    if k == 1 :
        return 0
    if k == 2 :
        return 1
    return saiki(k - 2) + k - 1

K = int(input())
print(saiki(K))
# Judge status: Wrong Answer
h = int(input())
w = int(input())
n = int(input())

print(n // max(h,w))
# Judge status: Wrong Answer
import sys
N = int(sys.stdin.readline().rstrip())
A = list(map(int, sys.stdin.readline().rstrip().split()))
B = list(map(int, sys.stdin.readline().rstrip().split()))
if N == 1:
    if A[0] <= B[1]:
        print("Yes")
    else:
        print("No")
diff = [a - b for a, b in zip(A, B)]
minus = 0
plus = 0
for d in diff:
    if d < 0:
        minus += d
    else:
        plus += d
if plus * 2 + minus > 0:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
N,M = map(int,input().split())
ab = []
for _ in range(M):
    ab.append(int(input().replace(' ','')))
#print(ab)
abc = ''
for i in ab:
    abc += str(i)
#print(abc)
for j in range(1,N+1):
    print(abc.count(str(j)))
# Judge status: Wrong Answer
S = int(input())
X1 = 0
Y1 = 0
X2 = 10**9
Y2 = 0
X3 = S%(10**9)
Y3 = S//(10**9)
if X3 != 0:
  X2 = 1
print(X1,Y1,X2,Y2,X3,Y3)
# Judge status: Accepted
a=input()
num=len(a)
mod_map={0:1}
moji_int=0
Sn=[0]*(num+1)
tens=[1]*(num+1)
for i in range(-1,-num-1,-1):
    tens[-i]=tens[-i-1]*10%2019
    tmp=int(a[i])*(tens[-i-1])
    Sn[-i]=(Sn[-i-1]+tmp%2019)%2019
    mod=Sn[-i]
    if mod not in mod_map:
        mod_map[mod]=1
    else:
        mod_map[mod]+=1

res=0
for i in mod_map.values():
    res+=int(i*(i-1)/2)
print(res)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print('Yes' if c < a+b else 'No')
# Judge status: Accepted
N,Y=map(int,input().split())
for x in range(N+1):
    for y in range(N+1):
        z=N-x-y
        if z>=0 and 10000*x+5000*y+1000*z==Y:
            print(x,y,z)
            exit()

print(-1,-1,-1,sep=" ")
# Judge status: Accepted
import math
a, b, c, x, y = map(int, input().split())
n = a*x + b*y
m = c*2*max(x,y)
min_xy = min(x,y)
k = min_xy*2*c + (x-min_xy)*a + (y-min_xy)*b
print(min(n,m,k))
# Judge status: Accepted
n ,k= map(int,input().split())
h = list(map(int,input().split()))
#print(h)
inf = float("inf")
dp = [inf]*(n+1)
dp[0] = 0


for i in range(1,n):
    for j in range(1,k+1):
        if i-j >=0:
            dp[i] = min(dp[i],dp[i-j] + abs(h[i] - h[i-j]))
            #print(dp)
print(dp[n-1])
# Judge status: Wrong Answer
N, M = map(int, input().split())

if N==1:
    print(M-2)
elif M==1:
    print(N-2)
else:
    print((N-2) * (M-2))
# Judge status: Wrong Answer
N , K =map(int,input().split())
MOD=10**9+7
ans=0
if N<=K:
    print(1)
else:
    tmp_low = sum(range(K))
    tmp_high = sum(range(N-K+1,N+1))
    r=tmp_high-tmp_low+1
    ans+=r
    ans%=MOD
    for sel in range(K+1,N+2):
        tmp_low += sel-1
        tmp_high += N-sel+1
        r= tmp_high-tmp_low+1
        ans+=r
        ans%=MOD
    print(ans%MOD)
# Judge status: Accepted
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ea=[0]
for i in range(n):
    ea.append(ea[i]+a[i])
eb=[0]
for i in range(m):
    eb.append(eb[i]+b[i])
tb=m
p=0
for i in range(n+1):
    while ea[i]+eb[tb]>k:
        if tb==0:
            break
        tb-=1
    if ea[i]+eb[tb]<=k:
        p=max(i+tb,p)
print(p)
# Judge status: Accepted
a, b = map(int, input().split())
print(len([i for i in range(a, b+1) if str(i) == "".join(list(reversed(str(i))))]))
# Judge status: Accepted
N, A, B = map(int, input().split())
t = N // (A + B)
print(t * A + min(N - t * (A + B), A))
# Judge status: Wrong Answer
N,M = map(int,input().split())

d = {}
total = 0
for i in range(M):
  s,c = map(int,input().split())
  if s in d and d[s] < c:
    continue
  else:
    d[s] = c   

for a,b in d.items():    
    total += b * 10**(N-a)    
    
if len(str(total)) != N:
  print(-1)
else:
  print(total)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
firstDis = abs(A - B)
steps = (V - W)*T
print("YES" if firstDis <= steps else "NO")
# Judge status: Accepted
from collections import defaultdict
s=input()
cnt=defaultdict(lambda :0)

for i in s:
    cnt[i]+=1

if cnt['N']*cnt['S']==0 and (cnt['N']+cnt['S'])>0:
    print('No')
elif cnt['E']*cnt['W']==0 and (cnt['E']+cnt['W'])>0:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
from math import factorial, sqrt

def dist(x1, y1, x2, y2):
    return sqrt((x1 - x2)**2 + (y1 - y2)**2)


N = int(input())
x, y = [0]*N, [0]*N
for i in range(N):
    x[i], y[i] = map(int, input().split())

ans = 0

for i in range(N):
    for j in range(N):
        ans += dist(x[i], y[i], x[j], y[j])

ans = ans / factorial(N)

print(ans)
# Judge status: Accepted
import math
tree_num, range = map(int,input().split())

range_num = range * 2 + 1

print(math.ceil(tree_num / range_num))
# Judge status: Accepted
X=int(input())
for i in range(1,10**10):
    K=360*i//X
    if K*X==360*i:
        print(K)
        exit()
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

answer = 'DENIED'
for i in range(0, N):
    if A[i] % 2 == 0:
        if A[i] % 3 == 0 or A[i] % 5 == 0:
            answer = 'APPROVED'
        else:
            answer = 'DENIED'
            break

print(answer)
# Judge status: Accepted
import sys
S = input()

for i in range(len(S)-1):
    if S[i] == S[i+1]:
        print('Bad')
        sys.exit()
print('Good')
# Judge status: Accepted
n = int(input())

def Digits_sum(a):
    a_s = str(a)
    sum_ = 0
    for i in a_s:
        sum_ += int(i)
    return sum_

ans = 10000

for i in range(1,(n//2)+1):
    A = i
    B = n-A
    sum_ = Digits_sum(A)+Digits_sum(B)
    ans = min(ans,sum_)
print(ans)
# Judge status: Accepted
from collections import defaultdict as dd
import heapq
N = int(input())
a = list(map(int,input().split()))
res = 0
a = sorted(a, reverse=True)
dic=dd(list)
ls = [-a[0]]
heapq.heapify(ls)
for val in a[1:]:
    tmp = -heapq.heappop(ls)
    res += tmp
    heapq.heappush(ls,-val)
    heapq.heappush(ls,-val)
print(res)
# Judge status: Accepted
N,C,K=map(int,input().split())
Tn=sorted([int(input()) for _ in range(N)])

b_cnt=0
p_cnt=0
time=Tn[0]+K
for t in Tn:

    # print(time, p_cnt)
    if (time < t) or (p_cnt >= C) :
        # バス出発
        b_cnt+=1
        p_cnt=0
        time=t+K
        # print("ride", b_cnt)
    p_cnt+=1
else:
    b_cnt+=1

print(b_cnt)
# Judge status: Accepted
import sys, math, re
from functools import lru_cache
from collections import deque
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    S = input()
    if S[-1] == 's':
        print(S+'es')
    else:
        print(S+'s')

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
c_1 = list(map(int, input().split()))
c_2 = list(map(int, input().split()))
c_3 = list(map(int, input().split()))
d = sum(c_1) + sum(c_2) + sum(c_3)
if d % 3 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
S = input()
N = len(S)
S1 = S[:(N-1)//2]
S2 = S[(N+3)//2-1:]
print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else "No")
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
C = Counter(A)
T = []
F = []
for e in C:
    if C[e] >= 4:
        F.append(e)
    if C[e] >= 2:
        T.append(e)
ans = 0
for e in F:
    ans = max(ans,e**2)
T = sorted(T)
if len(T) >= 2:
    ans = max(ans,T[-1]*T[-2])
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
s = list(input())

if s[k-1] == 'A':
    s[k-1] = 'a'
elif s[k-1] == 'B':
    s[k-1] = 'b'
else:
    s[k-1] = 'c'

print(''.join(s))
# Judge status: Accepted
S=input()
T=input()

ans = "No"
for i in range(len(S)):
	if S[i:] + S[0:i] == T:
		ans = "Yes"

print(ans)
# Judge status: Accepted
# https://atcoder.jp/contests/abc061/tasks/abc061_c
from collections import defaultdict

n, k = [int(i) for i in input().split()]
d = defaultdict(int)

for _ in range(n):
    a, b = [int(i) for i in input().split()]
    d[a] += b

array = sorted(d.items(), key=lambda x: x[0])
for num, count in array:
    if k > count:
        k -= count
    else:
        print(num)
        quit()
# Judge status: Accepted
N, C, K = map(int, input().split())
T = []
for i in range(N):
    T += [int(input())]

sortT = sorted(T)
pre_ti = sortT[0]
ans = 1
c = 0
for ti in sortT:
    c += 1
    if ti - pre_ti <= K and c <= C:
        continue
    c = 1
    ans += 1
    pre_ti = ti

print(ans)
# Judge status: Accepted
n=int(input())
ans = 0

loop = n//15
ans += loop * 60 + 120*(loop-1)*loop//2
res = n % 15
for i in range(1,res+1):
  if i%3 != 0 and i%5 != 0:
    ans += 15*loop + i
  
print(ans)