Harryxun/stf_run huggingface dataset:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
import math
F = sys.stdin
a, b, x = F.readline().rstrip().split()
a = int(a)
b = int(b)
x = int(x)
h = x / (a**2)
h2 = x/a
y = a * b / 2


if h2 <= y:
    c = 2*h2/b
    ans = math.degrees(math.atan(c/b))
    print(90 - ans)

if h2 > y:
    c = (2*h2/a) - b
    ans = math.degrees(math.atan(a/(b-c)))
    print(90 - ans)


### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
import math
F = sys.stdin
N = int(F.readline())
sqN = int(math.sqrt(N))
ans = 0

for i in range(1, sqN+1):
    if N % i == 0:
        A = int(i - 1)
        B = int((N / i) - 1)
        if ans == 0 or A + B < ans:
            ans = A + B

print(ans)
def main():
    n, m = (int(i) for i in input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]
    
    equal_flag = False
    k = 0
    for i in range(n):
        for j in range(n-m+1):
            if a[i][j:j+m] == b[k]:
                plus = 1
                while k+plus != m:
                    if a[i+plus][j:j+m] != b[k+plus]:
                        break
                    plus += 1
                else:
                    equal_flag = True
        if equal_flag:
            print("Yes")
            break
    else:
        print("No")

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n, m = (int(i) for i in input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]
    
    equal_flag = False
    k = 0
    for i in range(n):
        for j in range(n-m+1):
            if a[i][j:j+m] == b[k]:
                plus = 1
                while k+plus != m:
                    if i+plus >= n or a[i+plus][j:j+m] != b[k+plus]:
                        break
                    plus += 1
                else:
                    equal_flag = True
        if equal_flag:
            print("Yes")
            break
    else:
        print("No")
 
if __name__ == '__main__':
    main()
import sys
input = sys.stdin.readline
read = sys.stdin.read

def main():
  n, q = map(int, input().split())
  event = []
  stop = set()
  for _ in range(n):
    s, t, x = map(int, input().split())
    event.append((s-x, 1, x))
    event.append((t-x, -1, x))
  event.sort()
  event.append((float("inf"), 0, 0))
  D = list(map(int, read().split()))
  now = 0
  for t, b, x in event:
    while t > D[now]:
      if stop:
        print(min(stop))
      else:
        print(-1)
      now += 1
      if now == q:
        exit()
    if b == 1:
      stop.add(x)
    else:
      stop.remove(x)
      
if __name__ == "__main__":
  main()

### FIXED CODE ###

a, p = map(int, input().split())
print((3*a+p)//2)
a=input().sprit()
x=0
for n in a:
  x+=1
  if n=="0":
    aa=x
print(aa)

### FIXED CODE ###

a=input().split()
x=0
for n in a:
  x+=1
  if n=="0":
    aa=x
print(aa)
nl=list(map((int,input().split())))
a=[i+nl[1] for i in range(nl[0])]
 
a_sum = sum(a)
abs_ = []
for i in range(nl[0]):
  abs_.append(abs(a_sum - a[i]))
idx=abs_.index(min(abs_))
print(a_sum-a[idx])

### FIXED CODE ###

N, L = map(int, input().split())
 
if L > 0: print(sum([i for i in range(L+1, L+N)]))
elif L+N-1 < 0: print(sum([i for i in range(L, L+N-1)]))
else: print(sum([i for i in range(L, L+N)]))
X = int(input())
a = 1
while True:
    b = (a ** 5 - X) ** (1/5)
    if b.is_integer():
        b = int(b)
        break
    a += 1
print(a, b)

### FIXED CODE ###

X = int(input())
a = 1
flug = True
while flug:
    b = -119
    while b <= 118:
        if a ** 5 - b ** 5 == X:
            print(a, b)
            flug = False
            break
        else:
            b += 1
    a += 1
import sys,math
W,H,x,y = map(int,input().split())
if W % x == 0 and H % y == 0 and H!=y and W!=x and H!=0 and W!=0:
    print(W*H/2,'1')
else:
    print(W*H/2,'0')


### FIXED CODE ###

import sys,math
W,H,x,y = map(int,input().split())
if W/2 == x and H/2 == y:
    print(W*H/2,'1')
else:
    print(W*H/2,'0')
# coding: utf-8

import sys

S = input()

i = 0
while i < len(S):
	if S[i : i + 5] == "dream":
		if S[i + 5 : i + 7] == "er":
			if S[i + 7 : i + 10] == "ase":
				if S[i + 10] == "r":
					i += 11
				else:
					i += 10
			else:
				i += 7
		else:
			i += 5
	else:
		if S[i : i + 5] == "erase":
			if S[i + 5] == "r":
				i += 6
			else:
				i += 5
		else:
			print("NO")
			sys.exit()

print("YES")

### FIXED CODE ###

# coding: utf-8

import sys

S = input()

i = 0
while i < len(S):
	if i + 4 < len(S) and S[i : i + 5] == "dream":
		if i + 6 < len(S) and S[i + 5 : i + 7] == "er":
			if i + 9 < len(S) and S[i + 7 : i + 10] == "ase":
				if i + 10 < len(S) and S[i + 10] == "r":
					i += 11
				else:
					i += 10
			else:
				i += 7
		else:
			i += 5
	else:
		if i + 4 < len(S) and S[i : i + 5] == "erase":
			if i + 5 < len(S) and S[i + 5] == "r":
				i += 6
			else:
				i += 5
		else:
			print("NO")
			sys.exit()

print("YES")
T = [int(input()) for _ in range(5)]

ans = 643

for i0 in range(5):
  tmp = i0
  tmp += (10-tmp)//10
  l = range(5)
  l.remove(i0)
  for i1 in l:
    tmp += i1
    tmp += (10-tmp)//10
    l.remove(i1)
    for i2 in l:
      tmp += i2
      tmp += (10-tmp)//10
      l.remove(i2)
      for i3 in l:
        tmp += i3
        tmp += (10-tmp)//10
        l.remove(i3)
        for i4 in l:
          tmp += i4
          ans = min(ans,tmp)
print(ans)

### FIXED CODE ###

T = [int(input()) for _ in range(5)]

ans = 1000
for i in range(5):
    tmp = 0
    for j in range(5):
        if i==j:
            tmp += T[j]
        else:
            tmp += T[j] + (-T[j])%10
    ans = min(tmp,ans)
print(ans)
x,y,a,b,c = map(int, input().split())
A = list(map(int, input().split())) 
B = list(map(int, input().split())) 
C = list(map(int, input().split())) 

A.sort()
B.sort()
C.sort(reverse=True)

X = A[len(A)-x:]
Y = B[len(B)-y:]


xi = 0
yi = 0
ci = 0
for ci in range(c):
    if C[ci] <= X[xi] and C[ci] <= Y[yi]:
        break
    
    if X[xi] < Y[yi]:
        if C[ci] > X[xi]:
            X[xi] = C[ci]
            xi = xi + 1
    else:
        if C[ci] > Y[yi]:
            Y[yi] = C[ci]
            yi = yi + 1

print(sum(X)+sum(Y))

### FIXED CODE ###


x,y,a,b,c = map(int, input().split())
A = list(map(int, input().split())) 
B = list(map(int, input().split())) 
C = list(map(int, input().split())) 

A.sort()
B.sort()
C.sort(reverse=True)

X = A[len(A)-x:]
Y = B[len(B)-y:]

#print(X,Y,C)

xi = 0
yi = 0
ci = 0
for ci in range(c):
    #print(ci,xi,yi)
    if xi < len(X) and yi < len(Y):
        if C[ci] <= X[xi] and C[ci] <= Y[yi]:
            break
        
        if X[xi] < Y[yi]:
            if C[ci] > X[xi]:
                X[xi] = C[ci]
                xi = xi + 1
        else:
            if C[ci] > Y[yi]:
                Y[yi] = C[ci]
                yi = yi + 1
                
    elif xi < len(X):
        if C[ci] <= X[xi]:
            break
        
        if C[ci] > X[xi]:
            X[xi] = C[ci]
            xi = xi + 1
        
    elif yi < len(Y):
        if C[ci] <= Y[yi]:
            break
        
        if C[ci] > Y[yi]:
            Y[yi] = C[ci]
            yi = yi + 1
            
    else:
        break

print(sum(X)+sum(Y))
s=input()
d='dream'
dr='dreamer'
e='erase'
er='eraser'
l=len(s)
def solve(s,end):
    if end==-1:
        print('YES')
        exit(0)
    if s[end-6:end+1]==dr:
        end-=7
    elif s[end-5:end+1]==er:
        end-=6
    elif s[end-4:end+1]==e or s[end-4:end+1]==d:
        end-=5
    else:
        print('NO')
        exit(0)
    solve(s,end)
solve(s,l-1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000000)
s=input()
d='dream'
dr='dreamer'
e='erase'
er='eraser'
l=len(s)
def solve(s,end):
    if end==-1:
        print('YES')
        exit(0)
    if s[end-6:end+1]==dr:
        end-=7
    elif s[end-5:end+1]==er:
        end-=6
    elif s[end-4:end+1]==e or s[end-4:end+1]==d:
        end-=5
    else:
        print('NO')
        exit(0)
    solve(s,end)
solve(s,l-1)
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

n,ma,mb=map(int,input().split())
abc=[list(map(int,input().split())) for i in range(n)]
# dp=[[[float('inf')]*(400+1) for i in range(400+1)] for j in range(n+1)]
dp=[]
tmp=[]
for j in range(401):
    tmp2=[]
    for k in range(401):
        tmp2.append(float('inf'))
    tmp.append(tmp2)

for i in range(n+1):
    dp.append(tmp[:])
dp[0][0][0]=0
for i in range(n):
    a,b,c=abc[i]
    for j in range(400):
        for k in range(400):
            if dp[i][j][k]!=float('inf'):
                dp[i+1][j+a][k+b]=min(dp[i+1][j+a][k+b],dp[i][j][k]+c)
                dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])
ans=float('inf')
now=[ma,mb]
while 1:
    a,b=now
    ans=min(ans,dp[n][a][b])
    if a+ma>400 or b+mb>400:
        break
    now=[a+ma,b+mb]
if ans==float('inf'):
    print(-1)
else:
    print(ans)

### FIXED CODE ###

import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

n,ma,mb=map(int,input().split())
abc=[list(map(int,input().split())) for i in range(n)]
dp=[[[float('inf')]*(400+1) for i in range(400+1)] for j in range(n+1)]
dp[0][0][0]=0
for i in range(n):
    a,b,c=abc[i]
    for j in range(400):
        for k in range(400):
            if dp[i][j][k]!=float('inf'):
                dp[i+1][j+a][k+b]=min(dp[i+1][j+a][k+b],dp[i][j][k]+c)
                dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])
ans=float('inf')
now=[ma,mb]
while 1:
    a,b=now
    ans=min(ans,dp[n][a][b])
    if a+ma>400 or b+mb>400:
        break
    now=[a+ma,b+mb]
if ans==float('inf'):
    print(-1)
else:
    print(ans)
a,b, k=map(int, input().split())
for i in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1

print(str(a)+" "+str(b)

### FIXED CODE ###

a,b, k=map(int, input().split())
if k>=a+b:
    print("0 0")
elif k>a:
    print("0"+" "+str(b-(k-a)))
else:
    print(str(a-k)+" "+str(b))
n, k = map(int, input().split())
l = [*map(int, input().split())]
res = float('inf')
for i in range(n - k + 1):
    a = max(0, - l[i])
    b = max(0, l[i + k - 1])
    res = min(res, a + b + min(a, b))
print(res)

### FIXED CODE ###

n, k = map(int, input().split())
l = list(map(int, input().split()))
res = float('inf')
for i in range(n - k + 1):
    a = max(0, - l[i])
    b = max(0, l[i + k - 1])
    res = min(res, a + b + min(a, b))
print(res)
x, y, a, b, c = map(int, input().split())
P = sorted(list(map(int, input().split())), reverse = True)
Q = sorted(list(map(int, input().split())), reverse = True)
R = sorted(list(map(int, input().split())), reverse = True)

pnum, qnum, rnum = 0, 0, 0
ans = 0
for i in range(x+y):
    O = [0 for j in range(3)]
    if pnum >= x:
        O[0] = 0
    else:
        O[0] = P[pnum]
    
    if qnum >= y:
        O[1] = 0
    else:
        O[1] = Q[qnum]

    O[2] = R[rnum] 
    c = 0
    num = 0
    for j in range(3):
        if c <= O[j]:
            c = O[j]
            num = j
        else:
            pass
    
    if num == 0:
        pnum += 1
    elif num == 1:
        qnum += 1
    elif num == 2:
        rnum += 1
    else:
        pass
    ans += c
    
print(ans)

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
P = sorted(list(map(int, input().split())), reverse=True)
Q = sorted(list(map(int, input().split())), reverse=True)
R = sorted(list(map(int, input().split())), reverse=True)

pnum, qnum, rnum = 0, 0, 0
ans = 0
time = 0
while time < x+y:
    #P, Q, Rのなかで現状最大の値を取り出す(x,yの値も考慮)
    #P
    if pnum >= x:
        p = 0
    else:
        p = P[pnum]
    #Q
    if qnum >= y:
        q = 0
    else:
        q = Q[qnum]
    #R
    if rnum >=  c:
        r = 0
    else:
        r = R[rnum]
    Option = [p, q, r]

    #今の状況の中でおいしさ最大のものを取り出す
    m = 0
    color = 0
    for i in range(3):
        if m < Option[i]:
            m = Option[i]
            color = i
        else:
            pass
    ans += m

    #選択済みのリンゴを反映
    if color == 0:
        pnum += 1
    elif color == 1:
        qnum += 1
    elif color == 2:
        rnum += 1
    else:   
        print('error')

    #今まで選んだリンゴの数を反映
    time += 1

print(ans)
n = input()
for i in range(3):
    if n[i] == '9':
        n[i] = '1'
    else:
        n[i] = '9'
print(int(n))


### FIXED CODE ###

n = input()
ans = ''
for i in range(3):
    if n[i] == '9':
        ans += '1'
    else:
        ans +=  '9'
print(int(ans))
n, k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))

if n >= k:
    ans = -float('inf')
    for i in range(n):
        now = i
        score = []
        for j in range(k):
            now = p[now] - 1
            if j == 0:
                score.append(c[now])
            else:
                score.append(score[j] + c[now])
        ans = max(max(score), ans)
    print(ans)
else:
    ans = -float('inf')
    for i in range(n):
        now = i
        score = []
        check = [0] * n
        for j in range(k):
            go = p[now] - 1
            if check[go] == 1:
                break
            now = go
            if j == 0:
                score.append(c[now])
            else:
                score.append(score[j] + c[now])
            check[now] = 1
        d = k % j
        t = k // j
        score_2 = []
        for j in range(d):
            now = p[now] - 1
            if j == 0:
                score_2.append(c[now])
            else:
                score_2.append(score_2[j] + c[now])
        res = max(score)
        res_2 = score[-1] * t + max(score_2)
        ans = max(ans, res, res_2)

    print(ans)

### FIXED CODE ###

n, k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = -float('inf')
for i in range(n):
    score = []
    check = [0] * n
    now = i
    cycle = 0
    for _ in range(k):
        go = p[now] - 1
        if check[go] == 1:
            break
        now = go
        if len(score) == 0:
            score.append(c[now])
        else:
            score.append(score[-1] + c[now])
        check[now] = 1
        cycle += 1

    t = k // cycle
    m = k % cycle

    sum_cycle = score[-1]
    if m == 0:
        ans = max(sum_cycle * t, sum_cycle * (t - 1) + max(score), max(score), ans)
    else:
        ans = max(sum_cycle * t + max(score[:m]), sum_cycle * (t - 1) + max(score), max(score), ans)

print(ans)
n, y = map(int, input().split())

ans = "-1 -1 -1"

for i in range(n+1):
    for j in range(n+1):
        if i + j > n:
            break
        k = n - i - j
        if 10000*i + 5000*j + 1000*k == y:
            ans = f"{i} {j} {k}"

print(ans)


### FIXED CODE ###

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

num_10 = 0
num_5  = 0
num_1  = 0
none = True

for i in range(n+1):
    for j in range(n+1):
        k = n-i-j
        if (i*10000 + j*5000 + k*1000) == y and k >= 0:
            num_10 = i
            num_5 = j
            num_1 = k
            none = False
            break
    if none == False:
        break
if none:
    print('-1 -1 -1')
else:
    print("{} {} {}".format(num_10, num_5, num_1))
N = str(input("Enter something:"))
    if N[3] == N[4] and N[5] == N[6]:
        print("yes")
    else:
        print("No")

### FIXED CODE ###

s = input()
if s[2] == s[3] and s[4] == s[5]:
	print('Yes')
else:
	print('No')
N = input(N)
N = N % 10
if N in 2, 4, 5, 7, 9:
    print('hon')

elif N in 0, 1, 6, 8:
    print('pon')

else:
    print('bon')

### FIXED CODE ###

N = int(input())
N = N % 10
if N in [2, 4, 5, 7, 9]:
    print('hon')

elif N in [0, 1, 6, 8]:
    print('pon')

else:
    print('bon')
import sys

n = int(input())
a = list(map(int,input().split()))
a.sort()

if 0 in a:
    print(0)
else:
    cur = 1
    for x in a:
        cur *= a
        if cur > 10 ** 18:
            print(-1)
            sys.exit()
        print(cur)


### FIXED CODE ###

import sys

n = int(input())
a = list(map(int,input().split()))
a.sort()

if 0 in a:
    print(0)
else:
    cur = 1
    for x in a:
        cur *= x
        if cur > 10 ** 18:
            print(-1)
            sys.exit()
    print(cur)
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[-1 for i in range(N+1)]
C=[0 for i in range(N)]

B[1]=1
i=0

C[0]=1
for i in range(1,N+1):

    if(B[A[C[i-1]-1]]==-1):

        B[A[C[i-1]-1]]=A[C[i-1]-1]
        C[i]=A[C[i-1]-1]




    else:
        bfirst=C.index(A[C[i-1]-1])
        blast=i

        roop=blast-bfirst

        ans=(K-bfirst)%roop

        print(C[bfirst+ans])
        while(1):
            print(f)
        exit()


### FIXED CODE ###

N, K = map(int, input().split())
A = [int(a) - 1 for a in input().split()]

if K <= N:
    p = 0
    for i in range(K):
        p = A[p]
    print(p + 1)
    exit()

p = 0
t = [-1] * N
t[0] = 0
for i in range(1, N):
    p = A[p]
    if t[p] != -1:
        break
    t[p] = i

d = i - t[p]
K -= i
K %= d

for i in range(K):
    p = A[p]
print(p + 1)
A, B, K = map(int, input().split())
K2=B-A
K3=K2-K*2
if K3 > 0:
    for i in range (K):
        print ('%d'%(A+i))
    for i in range (K):
        print ('%d'%(B-K+i+1))
if K3 <= 0:
    for i in range (B-A+1):
        print ('%d'%(A+i))

### FIXED CODE ###

S = input()

S1='abc'
S2='acb'
S3='bac'
S4='bca'
S5='cab'
S6='cba'
if S==S1:
    print ('Yes')
elif S==S2:
    print ('Yes')
elif S==S3:
    print ('Yes')
elif S==S4:
    print ('Yes')
elif S==S5:
    print ('Yes')
elif S==S6:
    print ('Yes')
else:
    print ('No')
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
b = [0]*n
for i in range(n):
  if a[i]%2:
    b[i] = 1
  elif a[i]:
    b[i] = 2
DP = [[10**18 for i in range(5)] for j in range(n+1)]
for i in range(5):
    DP[0][i] = 0
for i in range(1,n+1):
  for j in range(5):
    for k in range(j,5):
      if k == 0 or k == 4:
        DP[i][k] = min(DP[i][k],DP[i-1][j]+a[i-1])
      elif k == 1 or k == 3:
        DP[i][k] = min(DP[i][k],DP[i-1][j]+abs(b[i-1]-2))
      else:
        DP[i][k] = min(DP[i][k],DP[i-1][j]+abs(b[i-1]-1))
print(min(DP[n]))

### FIXED CODE ###

n,k=map(int,input().split())
if (n+1)//2>=k:
  print("YES")
else:
  print("NO")
n = int(input())
a = list(map(int,input()))
c = 0
min = 9
for i in range(0,n):
    minj = i
    for j in range(i+1,n):
        if a[j] < a[minj]:
            minj = j
    a[i],a[minj] = a[minj],a[j]
    c += 1
    
print(*a)
print(c)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
c = 0
min = 0
for i in range(n):
    minj = i
    for j in range(i,n):
        if a[j] < a[minj]:
            minj = j
    if(i != minj):
        a[i],a[minj] = a[minj],a[i]
        c += 1
    
print(*a)
print(c)
n,q=map(int,input().split())
s=input()
A=[0]*(n+1)
cnt=0
for i in range(n):
    A[i]=cnt
    if s[i]=='A' and s[i+1]=='C':
        cnt+=1
ANS=[]
for i in range(q):
    l,r=map(int,input().split())
    ANS.append(A[r-1]-A[l-1])
for ans in ANS:
    print(ANS)

### FIXED CODE ###

n,q=map(int,input().split())
s=input()+'Z'
A=[0]*(n+1)
cnt=0
for i in range(n):
    A[i]=cnt
    if s[i]=='A' and s[i+1]=='C':
        cnt+=1
ANS=[]
for i in range(q):
    l,r=map(int,input().split())
    ANS.append(A[r-1]-A[l-1])
for ans in ANS:
    print(ans)
import sys
from collections import deque

def main():
  input = sys.stdin.readline
  n = int(input())
  target_num = n*(n-1)//2

  all_set = set()
  a = [None] * n
  for i in range(n):
    a[i] = deque(map(int, input()))
  ans = 0

  while True:
    cur_set = set()
    flag = False
    for i in range(n):
      if len(a[i]):
        tup = tuple(min(i+1, a[i][0]), max(i+1, a[i][0]))
      else:
        continue
      if tup not in cur_set:
        cur_set.add(tup)
      elif tup in cur_set:
        all_set.add(tup)
        t1, t2 = tup
        a[t1-1].popleft()
        a[t2-1].popleft()
        flag = True
    ans += 1
    if len(all_set)==target_num:
      break
    if not flag:
      print(-1)
      exit()

  print(ans)

if __name__ == '__main__':
  main()

### FIXED CODE ###

from collections import deque
import time

start = time.time() # なにこれ

n = int(input())
target_num = n*(n-1)//2

all_set = set()
a = [deque(list(map(int, input().split()))) for i in range(n)]
ans = 0

while True:
  cur_set = set()
  flag = False
  for i in range(n):
    if len(a[i]):
      tup = (min(i+1, a[i][0]), max(i+1, a[i][0]))
    else:
      continue
    if tup not in cur_set:
      cur_set.add(tup)
    elif tup in cur_set:
      all_set.add(tup)
      t1, t2 = tup
      a[t1-1].popleft()
      a[t2-1].popleft()
      flag = True
  ans += 1
  if len(all_set)==target_num:
    break
  if time.time()-start>1.8:
    print(1000*999//2)
    exit()
  if not flag:
    print(-1)
    exit()

print(ans)
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N, M, D = map(int, input().split())

if D == 0:
    print(1/N*(M-1))
else:
    print(2(N-D)/N**2*(M-1))


### FIXED CODE ###

N, M, D = map(int, input().split())

if D == 0:
    print(1/N*(M-1))
else:
    print(2*(N-D)/N**2*(M-1))
import sys
input = sys.stdin.readline
from collections import Counter
def main():
    N = int(input())
    A = list(map(int, input().split()))
    cnt = Counter(A)
    A.sort()
    ans = set()
    table = {i:-1 for i in range(10 ** 6 + 1)}
    for a in A:
        table[a] = 0
    for a in A:
        if table[a] == 0 and cnt[a] == 1:
            ans.add(a)
        elif table[a] == 1:
            continue
        i = 2
        target = a
        while True:
            target = a * i
            if table[target] == 0:
                table[target] = 1
            i += 1
            if target >= A[-1]:
                break
    print(len(ans))
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import Counter
def main():
    N = int(input())
    A = list(map(int, input().split()))
    cnt = Counter(A)
    A.sort()
    ans = set()
    table = {i:-1 for i in range(1, 10 ** 6 + 1)}
    for a in A:
        table[a] = 0
    for a in A:
        if table[a] == 0 and cnt[a] == 1:
            ans.add(a)
        elif table[a] == 1:
            continue
        i = 2
        target = a
        while True:
            target = a * i
            if target > A[-1]:
                break
            if table[target] == 0:
                table[target] = 1
            i += 1
    print(len(ans))
if __name__ == "__main__":
    main()