Harryxun/stf_run huggingface dataset:
import collections

N = int(input())
v = list(map(int,input().rstrip().split()))
list_odd = v[1::2]
list_even = v[0::2]

odd_count = collections.Counter(list_odd)
even_count = collections.Counter(list_even)


max_flq_odd = [kv for kv in odd_count.items() if kv[1] == max(odd_count.values())]
max_flq_even = [kv for kv in even_count.items() if kv[1] == max(even_count.values())]


if max_flq_odd[0][0] != max_flq_even[0][0] or len(max_flq_odd) > 1 or len(max_flq_even) > 1:
    #最大値のキーが違うものは最初にはじいた方が良い？
    print(N-max_flq_odd[0][1]-max_flq_even[0][1])
elif len(odd_count) == 1 and len(even_count) == 1:
    #数字が一種類しかない
    print(N//2)
elif len(odd_count) == 1:
    even_count.pop(max_flq_even[0][0])
    secondmax_even = max(even_count.values())
    print(N//2-secondmax_even)
elif len(even_count) == 1:
    odd_count.pop(max_flq_odd[0][0])
    secondmax_odd = max(odd_count.values())
    print(N//2-secondmax_odd)
else:
    even_count.pop(max_flq_even[0][0])
    secondmax_even = max(even_count.values())
    odd_count.pop(max_flq_odd[0][0])
    secondmax_odd = max(odd_count.values())
    print(min(N-max_flq_odd-secondmax_even, N-max_flq_even-secondmax_odd))

### FIXED CODE ###

import collections

N = int(input())
v = list(map(int,input().rstrip().split()))
list_odd = v[0::2]
list_even = v[1::2]

odd_count = collections.Counter(list_odd).most_common()
even_count = collections.Counter(list_even).most_common()

if len(odd_count) == 1 and len(even_count) == 1:
    if odd_count[0][0] == even_count[0][0]:
        print(N//2)
    else:
        print(0)
elif odd_count[0][0] != even_count[0][0]:
    print(N-odd_count[0][1]-even_count[0][1])
elif len(odd_count) == 1:
    print(N//2-even_count[1][1])
elif len(even_count) == 1:
    print(N//2-odd_count[1][1])
else:
    print(min(N-odd_count[0][1]-even_count[1][1], N-even_count[0][1]-odd_count[1][1]))
import sys
sys.setrecursionlimit(20000)

class UnionFind:
    def __init__(self,N):
        self.par = [i for i in range(N)]
 
    def root(self,x):
        if self.par[x] == x:
            return x
        self.par[x] = self.root(self.par[x])
        return self.par[x]
 
    def unite(self,x,y):
        self.rx = self.root(x)
        self.ry = self.root(y)
        if self.rx == self.ry:
            return
        self.par[self.rx] = self.ry
 
    def same(self,x,y):
        self.rx = self.root(x)
        self.ry = self.root(y)
        return self.rx == self.ry
 
N,M = [int(i) for i in input().split()]
uf = UnionFind(N)
 
for _ in range(M):
    x,y,_ = [int(i)-1 for i in input().split()]
    uf.unite(x,y)
 
ans = set()
for i in range(N):
    ans.add(uf.root(i))
 
print(len(ans))


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

class UnionFind:
    def __init__(self,N):
        self.par = [i for i in range(N)]
 
    def root(self,x):
        if self.par[x] == x:
            return x
        self.par[x] = self.root(self.par[x])
        return self.par[x]
 
    def unite(self,x,y):
        self.rx = self.root(x)
        self.ry = self.root(y)
        if self.rx == self.ry:
            return
        self.par[self.rx] = self.ry
 
    def same(self,x,y):
        self.rx = self.root(x)
        self.ry = self.root(y)
        return self.rx == self.ry
 
N,M = [int(i) for i in input().split()]
uf = UnionFind(N)
 
for _ in range(M):
    x,y,_ = [int(i)-1 for i in input().split()]
    uf.unite(x,y)
 
ans = set()
for i in range(N):
    ans.add(uf.root(i))
 
print(len(ans))
ans=0
bef=-10
for i in range(n):
    ans+=b[a[i]-1]
    if a[i]-1 == bef:
        ans+=c[a[i]-2]
    bef=a[i]
print(ans)

### FIXED CODE ###

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

ans=0
bef=-10
for i in range(n):
    ans+=b[a[i]-1]
    if a[i]-1 == bef:
        ans+=c[a[i]-2]
    bef=a[i]
print(ans)
N=int(input())
X=input()

k=0
for i in range(N):
  if X[i]=="1":
    k+=1

A=int(X,2)
#apは0->1の時の一回目の変換の値。
ap=A%(k+1)
am=A%(k-1)

popc_list=[-1]*(k+3)

def F(num):
  if num==0:
    return 0
  if popc_list[num]!=-1:
    return popc_list[num]
  
  popc=0
  for i in range(10000000):
    if num>>i==1:
      popc+=1
    if num>pow(2,i):
      break
  popc_list[num]=F(num%popc)+1
  return popc_list[num]
  

for i in range(N):
  if X[i] == "0":
    print(F((ap+pow(2,N-i,k+1))%(k+1))+1)
  else:
    print(F((am+pow(2,N-i,k-1))%(k-1))+1)


### FIXED CODE ###

N=int(input())
X=input()

k=0
for i in range(N):
  if X[i]=="1":
    k+=1

A=int(X,2)
#apは0->1の時の一回目の変換の値。
ap=A%(k+1)

am=100
if k != 1:
  am=A%(k-1)

popc_list=[-1]*(k+3)

def F(num):
  #print(str(num)+"called")
  if num==0:
    return 0
  if popc_list[num]!=-1:
    return popc_list[num]
  
  popc=0
  for s in bin(num):
    if s == "1":
      popc+=1
      
  popc_list[num]=F(num%popc)+1
  return popc_list[num]
  

for i in range(N):
  if X[i] == "0":
    print(F((ap+pow(2,N-1-i,k+1))%(k+1))+1)
  else:
    if k == 1:
      print(0)
      continue
    print(F((am-pow(2,N-1-i,k-1))%(k-1))+1)
"""
print(popc_list)
print(k)
"""
N=input()
A=input()
B=input()
a=A+B
b=str(N/a)
c=str(N%a)
if c<A:
  print(b*A+c)
else:
  print(b*A+A)


### FIXED CODE ###

N,A,B=(int(x) for x in input().split())
a=int(A+B)
b=int(N/a)
c=int(N%a)
if c<A:
  print(int(b*A+c))
else:
  print(int(b*A+A))
from typing import *

def main(N,Y):
    # type: (int, int) -> None
    """
    次の方程式
        x + y + z = N
        10x + 5y + z = Y
    の解を探索する．zを消去すると
        9x + 4y = Y - N
      where
        x >= 0
        y >= 0
        x + y <= N
    w = 2x+y と置くと
        x + 4w = Y - N
      where
        x >= 0
        w >= 0
        w - x <= Y
    xを消去すると条件は
        w  >= 0
        4w <= Y - N
        9w >= 2(Y - N)
    であり
        x = Y - N - 4w
        y = w - 2x
        z = N - x - y
    """
    Y = Y // 1000
    lb = (2*(Y-N)-1) // 9 + 1
    ub = (Y-N) // 4
    ans = None
    for w in range(lb,ub+1):
        x = Y - N - 4*w
        y = w - 2*x
        z = N - x - y
        assert(x >= 0 and y >= 0 and z >= 0)
        ans = (x,y,z)
        break
    if ans is not None:
        print("{0} {1} {2}".format(x,y,z))
    else:
        print("{0} {1} {2}".format(-1,-1,-1))
    return

if __name__ == '__main__':
    N, Y, *_ = map(int, input().split())
    main(N,Y)


### FIXED CODE ###

def main(N,Y):
    # type: (int, int) -> None
    """
    次の方程式
        x + y + z = N
        10x + 5y + z = Y
    の解を探索する．zを消去すると
        9x + 4y = Y - N
      where
        x >= 0
        y >= 0
        x + y <= N
    w = 2x+y と置くと
        x + 4w = Y - N
      where
        x >= 0
        w >= 0
        w - x <= N
    xを消去すると条件は
        w  >= 0
        4w <= Y - N
        5w <= Y
        9w >= 2(Y - N)
    であり
        x = Y - N - 4w
        y = w - 2x
        z = N - x - y
    wを適当にboundした後は x>=0 and y>=0 and z >= 0 でfilteringするのが安心だが
    練習のために w のみでfilteringしてみる
    """
    Y = Y // 1000
    lb = (2*(Y-N)-1) // 9 + 1
    ub = min ((Y-N) // 4, Y // 5)
    ans = [ (x,y,z) for w in range(lb,ub+1) for x in [Y-N-4*w] for y in [w - 2*x] for z in [N - x - y] ]
    if ans == []:
        print("-1 -1 -1")
    else:
        x,y,z = ans[0]
        print("{0} {1} {2}".format(x,y,z))
    return

if __name__ == '__main__':
    N, Y, *_ = map(int, input().split())
    main(N,Y)
import fractions

N, X = map(int, input().split())
x_list = list(map(int, input().split()))

if N == 1:
    if X < x_list[0]:
        x_list.insert(0, X)
    else:
        x_list.insert(1, X)
else:
    for i in range(N-1):
        if x_list[i] < X < x_list[i+1]:
            x_list.insert(i+1, X)

x_list.sort()

x_diff = [0]*N
for i in range(N):
    x_diff[i] = x_list[i+1] - x_list[i]

ans = x_diff[0]
for i in range(1, N):
    ans = fractions.gcd(ans, x_diff[i])
print(ans)

### FIXED CODE ###

import fractions

N, X = map(int, input().split())
x_list = list(map(int, input().split()))

if N == 1:
    if X < x_list[0]:
        x_list.insert(0, X)
    else:
        x_list.insert(1, X)
else:
    for i in range(N-1):
        if x_list[i] < X < x_list[i+1]:
            x_list.insert(i+1, X)
        else:
            x_list.append(X)

x_list.sort()

x_diff = [0]*N
for i in range(N):
    x_diff[i] = x_list[i+1] - x_list[i]

ans = x_diff[0]
for i in range(1, N):
    ans = fractions.gcd(ans, x_diff[i])
print(ans)
def main():
    x = int(input())
    ans = "NO"
    if (x == 7 or x == 5 or x == 3):
        ans = "YES"

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
def main():
    x = int(input())
    ans = "NO"
    if (x == 7 or x == 5 or x == 3):
        ans = "YES"

    print(ans)


if __name__ == '__main__':
    main()
import math

x1, y1, x2, y2 = map(int, raw_input().split())

print math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

### FIXED CODE ###

import math

x1, y1, x2, y2 = map(float, raw_input().split())

print math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)
int("(a+b)*h/2")

### FIXED CODE ###

a=int(input())
b=int(input())
h=int(input())

print(((a+b)*h)//2)
from collections import defaultdict
# dfs, check path len, count paths                                                                                                                           
# test = 2                                                                                                                                                   
n, m = map(int, input().split())
edges = [map(int, input().split()) for i in range(n)]
graph = defaultdict(list)
for k,v in edges:
    graph[k].append(v)
    graph[v].append(k)

cnt = 0
# dfs                                                                                                                                                        
def dfs(node, visited):
    global cnt
    if node in visited:
        return None
    elif len(visited) + 1 == n:
        cnt += 1
        return None
    else:
        for v in graph[node]:
            dfs(v, visited+[node])
dfs(1, [])
print(cnt)


### FIXED CODE ###

from collections import defaultdict
# dfs, check path len, count paths                                                                                                                           
# test = 2                                                                                                                                                   
n, m = map(int, input().split())
edges = [map(int, input().split()) for i in range(m)]
graph = defaultdict(list)
for k,v in edges:
    graph[k].append(v)
    graph[v].append(k)

cnt = 0
# dfs                                                                                                                                                        
def dfs(node, visited):
    global cnt
    if node in visited:
        return None
    elif len(visited) + 1 == n:
        cnt += 1
        return None
    else:
        for v in graph[node]:
            dfs(v, visited+[node])
dfs(1, [])
print(cnt)
N = int(input())
A = list(map(int,input().split()))
S = []
for i in range(N+1):
    P = A[:(N+i)]
    Q = A[(N+i):]
    for l in range(len(Q)):
        Q[l] *= -1
    heapq.heapify(P)
    heapq.heapify(Q)
    j = 0
    k = 0
    while j < i:
        heapq.heappop(P)
    while k < N-i:
        heapq.heappop(Q)
    s = sum(P) + sum(Q)
    S.append(s)
ans = min(S)
print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
S = []
P = A[:N]
Q = A[2*N:]
for i in range(N):
    Q[i] *= -1
R = A[N:2*N]
p = [0]*(N+1)
q = [0]*(N+1)
import heapq
heapq.heapify(P)
heapq.heapify(Q)
sp = sum(P)
sq = sum(Q)
p[0] = sp
q[0] = sq

for i in range(1,N+1):
    heapq.heappush(P,R[i-1])
    x = heapq.heappop(P)
    heapq.heappush(Q,-R[-i])
    y = heapq.heappop(Q)
    sp = sp + R[i-1] - x
    sq = sq - R[-i] - y
    p[i] = sp
    q[i] = sq
ans = -(10**100)
for k in range(N+1):
    ans = max(ans,p[k] + q[N-k])
    
print(ans)
N,Q =  map(int,input().split())
graph = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

val = [0 for i in range(N)]
for i in range(Q):
    a,b = map(int,input().split())
    val[a-1] += b 
visited = [True for i in range(N)]
def dps(i):
    visited[i] = False
    if i == N :
        return 1
    else :
        for j in graph[i]:
            if visited[j]:
                val[j] += val[i]
                dps(j)
dps(0)
for i in val:
  print(val,end = " ")

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
readline = sys.stdin.readline
N,Q =  map(int,input().split())
graph = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,readline().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

val = [0 for i in range(N)]
for i in range(Q):
    a,b = map(int,readline().split())
    val[a-1] += b 

def dps(i,parent): 
    for j in graph[i]:
        if j == parent:
            continue
        val[j] += val[i]
        dps(j,i)
                
dps(0,-1)
print(*val)
N = int(input())
A = list(map(int,input().split()))
Nc = 1
if A.count(0) >= 2:
    Nc *= 0
else:
    for i in range(N):
        if (N-A[i]-1) >= 0:
                if A.count(i+1) == 2:
                    Nc = Nc*2
                elif A.count(i+1) == 0:
                else:
                    Nc *= 0
                    break
        else:
            Nc *= 0
            break

print(Nc%1000000007)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Nc = 1
e = 0
B = [0]*N
for i in A:
    if (N-i-1) < 0:
        e = 1
        Nc = 0
        break
if e ==0:
    if A.count(0) >= 2:
        Nc *= 0
    else:
        if A.count(0) == 1:
            A.remove(0)
        for i in A:
            B[i] = B[i] + 1
        for i in B:
            if i == 2:
                Nc *= 2
            elif i == 0:
                Nc *= 1
            else:
                Nc *= 0
                break
print(Nc%1000000007)
N = int(input())
T,A = [float(i) for i in input().split()]
Hi = [float(i) for i in input().split()]
Ave = [T - i*0.006 for i in Hi]
Result = [abs(i) for i in Ave - A]
print(index(min(result)) + 1)


### FIXED CODE ###

N = int(input())
T,A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
sub = [0 for i in range(N)]
for i in range(N):
    sub[i] = abs(A - (T - 0.006*H[i]))
print(sub.index(min(sub))+1)
import numpy as np
n = int(input())
A = list(map(int,input().split()))
X = [0]
C = [0] + np.cumsum(A).tolist()
for i in range(n):
    X.append(X[i-1] ^ A[i])
cnt = 0
for l in range(n):
    for r in range(l+1, n):
        if C[r]-C[l] == X[r]^X[l]:
            cnt += 1
print(cnt+n)

### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]
ans = 0
s = 0
x = 0
r = 0
for l in range(n):
    while r<n and s+a[r]==x^a[r]:
        s += a[r]
        x ^= a[r]
        r += 1
    ans += (r-l)
    if l==r:
        r += 1
    else:
        s -= a[l]
        x ^= a[l]
print(ans)
N = int(input())
a = list(map(int, input().split()))
res = 0
a.sort()
count = 1
for i in range(N-1):
    if a[i] != a[i+1]:
        count = i - count 
        if count < a[i]:
            res += count
        else:
            res += count - a[i]
        
        
print(res)
  

### FIXED CODE ###

a, b = map(int, input().split())
c = a + b

if c%2 == 0:
    print(int(c/2))
    
else:
    print(int(c/2)+1)
import math

r = int(input())
print((r * r * math.pi), (2 * r * math.pi))

### FIXED CODE ###

import math

r = float(input())
print((r * r * math.pi), (2 * r * math.pi))
from math import pi
maped = map(int, raw_input().split())
r = maped[0]
area = r*r*pi
length = 2*r*pi
print "%f %f"%(area, length)

### FIXED CODE ###

from math import pi
r, = map(float, raw_input().split())
area = r**2*pi
length = 2*r*pi
print "%f %f"%(area, length)
A = [int(input()) for i in range(5)]
time = 0
l = []
for i in A:
    if i%10 == 0:
        time+=i
    else:
        time+=(i//10+1)*10
        l.append(i%10)

print(time-(10-min(l)))
    

### FIXED CODE ###

A = [int(input()) for i in range(5)]
count=0 
max_i=0
for i in A:
    if i%10!=0:
        max_i = max(max_i,10-i%10)
        count += i//10*10+10
    else:
        count += i
print(count-max_i)
n, k = map(int, input().split())

import sys

sys.setrecursionlimit(2000)

l = [[] for i in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)

def first_search(first, depth):
    record = 0
    for i in l[first]:
        temp = search(first, i, depth-1)
        if record < temp:
            record = temp
    return record + 1

def search(before, now, depth):
    if depth <= 0:
        return 1
    else:
        ans = 1
        for i in l[now]:
            if before != i:
                ans += search(now, i, depth-1)
        return ans

ret = 0
if k%2 == 0:
    for i in range(n):
        temp = search(-1, i, k//2)
        if temp > ret:
            ret = temp
else:           
    for i in range(n):
        temp = first_search(i, k)
        if temp > ret:
            ret = temp
        
print(n-ret)

### FIXED CODE ###

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

import sys

sys.setrecursionlimit(2000)

l = [[] for i in range(n)]
e = []
for i in range(n-1):
    a, b = map(int, input().split())
    l[a-1].append(b-1)
    l[b-1].append(a-1)
    e.append([a-1, b-1])

def first_search(first, depth):
    record = 0
    for i in l[first]:
        temp = search(first, i, depth-1)
        if record < temp:
            record = temp
    return record + 1

def search(before, now, depth):
    if depth <= 0:
        return 1
    else:
        ans = 1
        for i in l[now]:
            if before != i:
                ans += search(now, i, depth-1)
        return ans

ret = 0
if k%2 == 0:
    for i in range(n):
        temp = search(-1, i, k//2)
        if temp > ret:
            ret = temp
else:           
    for i in e:
        temp = search(i[0], i[1], k//2) + search(i[1], i[0], k//2)
        if temp > ret:
            ret = temp
        

print(n-ret)
import numpy as np

def solve(posi):
    INF = 100000000000
    d = np.zeros((H, W))
    for i in range(H):
        for j in range(W):
            d[i][j] = INF
    que = [posi]
    d[posi[0],posi[1]] = 0

    move = np.array([[1,0], [-1,0], [0,1], [0,-1]])
    while len(que):
        p = que.pop(0)
        if np.allclose(posi, np.array([H-1,W-1])):
            break

        for dir in move:
            new_p = p + dir
            if 0 <= new_p[0] and new_p[0] < H and 0 <= new_p[1] and new_p[1] < W:
                if d[new_p[0],new_p[1]] == INF and maze[new_p[0]][new_p[1]] != '#':
                    que.append(new_p)
                    d[new_p[0],new_p[1]] = d[p[0], p[1]] + 1

    if d[H-1][W-1] == INF:
        return -1
    return d[H-1][W-1]

if __name__=='__main__':
    H, W  = map(int, input().split(' '))
    maze = []
    for i in range(H):
        maze.append(list(input()))
    counter = 0
    for i in range(H):
        for j in range(W):
            if maze[i][j] == '.':
                counter += 1

    posi = np.array([0,0])
    print(int(counter - solve(posi) - 1))

### FIXED CODE ###

if __name__=='__main__':
    N = int(input())
    A = int(input())

    a = N//500 * 500

    if N-a <= A:
        print('Yes')
    else:
        print('No')
a,b,c = [int(i) for i in input().split()]
if (a*b*c)%2==0:
    print(0)
else:
    ans = a*b
    ans = min(ans, b*c)
    ans = min(aans, c*a)
    print(ans)

### FIXED CODE ###

a,b,c = [int(i) for i in input().split()]
if (a*b*c)%2==0:
    print(0)
else:
    ans = a*b
    ans = min(ans, b*c)
    ans = min(ans, c*a)
    print(ans)
#再帰を使って各ノードのカウンタの値を決定
def decide_count(v,G,c):#vは1始まり
    if len(G[v])==0:
        return
    for u in G[v]:
        c[u-1]+=c[v-1]
        decide_count(u,G,c) 

N,Q = list(map(int,input().split()))
a=[0]*(N-1)
b=[0]*(N-1)
G={}
for i in range(N-1):
    a[i],b[i] = list(map(int,input().split()))
for i in range(N):
    G[i+1]=[]
p=[0]*Q
x=[0]*Q
for i in range(Q):
    p[i],x[i] = list(map(int,input().split()))

#グラフの作成
for i in range(N-1):
    G[a[i]].append(b[i])

c=[0]*N
for i in range(Q):
    c[p[i]-1] += x[i]

decide_count(1,G,c)

ans = ' '.join([str(x) for x in c])

print(ans)

### FIXED CODE ###

'''
pythonの再帰は10^5timesですら厳しい
import sys
sys.setrecursionlimit(10000000)

def dfs(v,p,G,c):
    for u in G[v]:
        if u!=p:
            c[u]+=c[v]
            dfs(u,v,G,c) 
'''
from collections import deque

N,Q = list(map(int,input().split()))

G=[]
for i in range(N):
    G.append([])
for i in range(N-1):
    a,b = list(map(int,input().split()))
    a-=1
    b-=1
    G[a].append(b)
    G[b].append(a)

p=[0]*Q
x=[0]*Q
c=[0]*N
for i in range(Q):
    p,x = list(map(int,input().split()))
    p-=1
    c[p] += x

stack=deque([0])
parent = [-1]*N

while(stack):
    v = stack.pop()
    for u in G[v]:
        if u!=parent[v]:
            c[u]+=c[v]
            parent[u]=v
            stack.appendleft(u)


ans = ' '.join([str(x) for x in c])

print(ans)
import math
A,B,K=map(int,input().split())
anslist=[]
for i in range(1,max(A,B)):
    if (A%i==0)&(B%i==0):
        anslist.append(i)
print(anslist[0-K])

### FIXED CODE ###

import math
A,B,K=map(int,input().split())
anslist=[]
for i in range(1,max(A,B)+1):
    if (A%i==0)&(B%i==0):
        anslist.append(i)
print(anslist[0-K])
print(" ".join(input().split(','))

### FIXED CODE ###

s = input().split(',')
print(*s)
import string

count = {x: 0 for x in string.ascii_lowercase}
lines = ""

while True:
    try:
        lines += input().lower()
    except EOFError:
        break
    
for c in s:
    if 'a' <= c <= 'z':
        count[c] += 1

for key in string.ascii_lowercase:
    print("{0 : {1}".format(key, count))

### FIXED CODE ###

import string
  
count = {x: 0 for x in string.ascii_lowercase}
lines = ""
  
while True:
    try:
        lines += input().lower()
    except EOFError:
        break
          
for c in lines:
    if 'a' <= c <= 'z':
        count[c] += 1
          
for key in string.ascii_lowercase:
    print("{0} : {1}".format(key, count[key]))
import fractions
import math
n = int(input())
a = list(map(int, input().split()))
MOD = 10**9 + 7
ans = 0

lcm = a[0]
for i in range(1, n):
    #lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
    lcm = lcm * a[i] // math.gcd(lcm, a[i])
lcm %= MOD
for i in range(n):
    ans += lcm * pow(a[i] , MOD-2, MOD)
    ans %= MOD
print(ans)


### FIXED CODE ###

import fractions
import math
n = int(input())
a = list(map(int, input().split()))
MOD = 10**9 + 7
ans = 0

lcm = a[0]
for i in range(1, n):
    lcm = lcm * a[i] // fractions.gcd(lcm, a[i])
    #lcm = lcm * a[i] // math.gcd(lcm, a[i])
lcm %= MOD
for i in range(n):
    ans += lcm * pow(a[i] , MOD-2, MOD)
    ans %= MOD
print(ans)
o = input()
e = input()
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[1])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(a[-1])
print(*x,sep="")
    

### FIXED CODE ###

o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(o[-1])
print(*x,sep="")
import math
N, K = map(int, input().split())

M = []
x = 1
while x < (10 ** 5) * 2:
    M.append(1 / x)
    x <<= 1

p1 = max((N - K + 1) / N, 0)
p = 0
for i in range(1, min(N + 1, K)):
    t = int(math.log2(K / i)) + 1
    if K % i == 0 and  (K // i) & (K // i - 1) == 0:
        t -= 1
    p += M[t]
ans = p / N + p1
print('{0:.10f}'.format(ans))






#*1/N


### FIXED CODE ###

import math
N, K = map(int, input().split())

M = []
x = 1
while x < (10 ** 5) * 2:
    M.append(1 / x)
    x <<= 1

p1 = max((N - K + 1) / N, 0)
p = 0
for i in range(1, min(N + 1, K)):
    t = int(math.log2(K / i)) + 1
    if K % i == 0 and  (K // i) & (K // i - 1) == 0:
        t -= 1
    p += M[t]
ans = p / N + p1
print('{0:.10f}'.format(ans))