Harryxun/stf_run huggingface dataset:
'''
https://atcoder.jp/contests/abc150/tasks/abc150_d
'''
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

    if n == 1:
        if m >= a[0]:
            print((m-a[0]) // a[0] + 1)
        else:
            print(0)
        exit()

    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    def gcd_group(arr):
        g = gcd(arr[0], arr[1])
        for i in range(2, len(arr)):
            g = gcd(g, arr[i])
        return g
    
    def lcm(a, b):
        g = gcd(a, b)
        return (a*b)//g
    
    def lcm_group(arr):
        l = lcm(arr[0], arr[1])
        for i in range(2, len(arr)):
            l = lcm(l, arr[i])
        return l
    g = gcd_group(a)
    for i in a:
        if (i//g)%2 == 0:
            print(0)
            exit()
    lcm = lcm_group(a)
    semi_lcm = lcm // 2
    if m >= semi_lcm:
        print((m-semi_lcm)//lcm + 1)
    else:
        print(0)


if __name__ == '__main__':
    main()

### FIXED CODE ###

'''
https://atcoder.jp/contests/abc150/tasks/abc150_d
'''
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

    if len(a) == 1:
        if m >= a[0]//2:
            print((m-a[0]//2) // a[0] + 1)
        else:
            print(0)
        exit()

    def gcd(a, b):
        if b == 0:
            return a
        else:
            return gcd(b, a % b)
    
    def gcd_group(arr):
        g = gcd(arr[0], arr[1])
        for i in range(2, len(arr)):
            g = gcd(g, arr[i])
        return g
    
    def lcm(a, b):
        g = gcd(a, b)
        return (a*b)//g
    
    def lcm_group(arr):
        l = lcm(arr[0], arr[1])
        for i in range(2, len(arr)):
            l = lcm(l, arr[i])
        return l
    g = gcd_group(a)
    for i in a:
        if (i//g)%2 == 0:
            print(0)
            exit()
    lcm = lcm_group(a)
    semi_lcm = lcm // 2
    if m >= semi_lcm:
        print((m-semi_lcm)//lcm + 1)
    else:
        print(0)


if __name__ == '__main__':
    main()
import math
N = int(input())
num = 1
ans = 0
for i in range(1, N + 1):
    num *= i

maxx = int(math.sqrt(num)) + 2

print(num)
print(maxx)
for i in range(1, (num // 2) + 3):
    if num % i == 0:
        ans += 1
        ans %= (10**9) + 7

print(ans + 1)

### FIXED CODE ###

import math
import collections

N = int(input())
a = math.factorial(N)
check = []
ans = 1
i = 2

while a != 1:
    if a % i == 0:
        a //= i
        check.append(i)
    else:
        i += 1
        
check = collections.Counter(check).values()
for i in check:
    ans *= (i+1)
    ans %= 10**9+7
print(ans)
n=int(input())
k=int(input())
x=map(int,input().split())
l=[]
for i in range(n):
    p=2*min(x[i],k-x[i])
    l.append(p)
print(sum(l))

### FIXED CODE ###

n=int(input())
k=int(input())
x=list(map(int,input().split()))
l=[]
for i in range(n):
    p=2*min(x[i],k-x[i])
    l.append(p)
print(sum(l))
s=list(input())
for c in s:
  if c == "1":
    print("9",end="")
  elif c = "9":
    print("1",end="")
  else:
    print(c)
print()

### FIXED CODE ###

s=list(input())
for c in s:
  if c == "1":
    print("9",end="")
  elif c == "9":
    print("1",end="")
  else:
    print(c)
print()
M=10**6
_,*l=map(int,open(0).read().split())
a=[0]*M
for i in sorted(l):
  a[i]+=1
  if a[i]==1:
    for j in range(2*i,M,i):a[j]+=9
print(a.count(1))

### FIXED CODE ###

from collections import Counter
def i(): return int(input())
def l(): return list(map(int,input().split()))
N = i();A = l();A.sort();dp = [1]*(10**6+1);C = Counter(A);ans = 0
for a,b in C.items():
    if b != 1:dp[a] = 0
    elif dp[a]:ans += 1
    for j in range(a,10**6+1,a):dp[j] = 0
print(ans)
import sys
sys.setrecursionlimit(1000000)
class Node:
    nodes = {}
    @classmethod
    def get_root_node(cls):
        #n = Node.nodes[next(iter(Node.nodes))]
        n = Node.nodes[1]
        for _ in range(len(Node.nodes)):
            if n.parent is None:
                return n
            else:
                n = n.parent

    @classmethod
    def largest_num_color(cls):
        r = 0
        for key, node in Node.nodes.items():
            if node.num_color > r:
                r = node.num_color
        return r

    @classmethod
    def dump_all_nodes(cls):
        for key, node in Node.nodes.items():
            print(str(node))

    @classmethod
    def get_instance(cls, id, parent):
        if id in Node.nodes:
            if Node.nodes[id].parent is None:
                Node.nodes[id].parent = parent
            return Node.nodes[id]
        else:
            return Node(id, parent)

    @classmethod
    def color_childs(clf, start_node):
        c = 1
        list_to_visit = []
        list_to_visit += start_node.childs
        list_to_visit.append(-1)
        while(len(list_to_visit)>0):
            if list_to_visit[0]==-1:
                c = 1
                list_to_visit.remove(list_to_visit[0])
                continue
            node = list_to_visit[0]
            list_to_visit.remove(list_to_visit[0])
            if c == node.parent.parent_edge_color:
                c += 1
            node.parent_edge_color = c
            list_to_visit += node.childs
            list_to_visit.append(-1)
            c += 1

    def __init__(self, id, parent):
        self.id = id
        self.parent = parent # None if root Node
        self.parent_edge_color = None
        self.childs = []
        Node.nodes[id] = self
        self.used_color = []

    def __str__(self):
        x = self.parent.id if self.parent else "None"
        return f"id: {self.id}, parent: {x}, parent_edge_color: {self.parent_edge_color} ,num_child {len(self.childs)}, num_color {self.num_color}"

    def append_child(self, node):
        self.childs.append(node)

    @property
    def num_color(self):
        if self.parent_edge_color is None:
            return len(self.childs)
        else:
            return len(self.childs) + 1

N = int(input())

Edges = []
Edges_color = []
for i in range(N-1):
    edge = list(map(int, input().split()))
    Edges.append(edge)


for edge in Edges:
    pnode = Node.get_instance(edge[0], None)
    cnode = Node.get_instance(edge[1], pnode)
    pnode.append_child(cnode)

root = Node.get_root_node()

Node.color_childs(root)
#Node.dump_all_nodes()
K = Node.largest_num_color()
print(K)

for edge in Edges:
    print(Node.get_instance(edge[1], edge[0]).parent_edge_color)

### FIXED CODE ###

s = input()

if s=='MON':
    print(6)
elif s=='TUE':
    print(5)
elif s=='WED':
    print(4)
elif s=='THU':
    print(3)
elif s=='FRI':
    print(2)
elif s=='SAT':
    print(1)
elif s=='SUN':
    print(7)
import sys
# sys.setrecursionlimit(100000)
from collections import defaultdict


def input():
    return sys.stdin.readline().strip()


def main():
    h, w, m = [int(i) for i in input().split()]
    d_h = defaultdict(int)
    d_w = defaultdict(int)
    bom = set()
    for _ in range(m):
        h, w = [int(i) for i in input().split()]
        bom.add((h, w))
        d_h[h] += 1
        d_w[w] += 1
    H = sorted(d_h.items(), key=lambda x: -x[1])
    W = sorted(d_w.items(), key=lambda x: -x[1])
    ans = H[0][1] + W[0][1]
    if (H[0][0], W[0][0]) in bom:
        ans -= 1

    ans2 = H[1][1] + W[0][1]
    if (H[1][0], W[0][0]) in bom:
        ans2 -= 1
    ans3 = H[0][1] + W[1][1]
    if (H[0][0], W[1][0]) in bom:
        ans3 -= 1

    print(max(ans, ans2, ans3))

    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
# sys.setrecursionlimit(100000)
from collections import defaultdict


def input():
    return sys.stdin.readline().strip()


def main():
    h, w, m = [int(i) for i in input().split()]
    d_h = defaultdict(int)
    d_w = defaultdict(int)
    bom = set()
    for _ in range(m):
        h, w = [int(i) for i in input().split()]
        bom.add((h, w))
        d_h[h] += 1
        d_w[w] += 1
    H = sorted(d_h.items(), key=lambda x: -x[1])
    W = sorted(d_w.items(), key=lambda x: -x[1])
    ans = 0
    for k_h, v_h in H:
        for k_w, v_w in W:
            tmp = v_h + v_w
            if (k_h, k_w) in bom:
                tmp -= 1
                ans = max(tmp, ans)
            else:
                ans = max(tmp, ans)
                break
        else:
            continue
        break

    for k_w, v_w in W:
        for k_h, v_h in H:
            tmp = v_h + v_w
            if (k_h, k_w) in bom:
                tmp -= 1
                ans = max(tmp, ans)
            else:
                ans = max(tmp, ans)
                break
        else:
            continue
        break
    print(ans)


if __name__ == "__main__":
    main()
def f1():
	L.sort(key = (lambda x: - x[1]/(w1-x[0])))
	ans = 0
	w2 = 0
	i = 0
	while i < N:
		w2 = w2 + L[i][0]
		if w2 > W:
			break
		ans = ans + L[i][1]
		i = i + 1
	
	return ans

def f2():
	dp = [[0] * (W + 1) for i in range(N + 1)]
	for n in range(1,N + 1):
		w,v = L[n - 1]
		if w > W:
			continue
		for m in range(w):
			dp[n][m] = dp[n - 1][m]
		for m in range(w,W + 1):
			dp[n][m] = max(dp[n - 1][m - w] + v, dp[n - 1][m])
	return max(dp[-1])
	
N,W = map(int,input().split())
L = [list(map(int,input().split())) for i in range(N)]
w1 = L[0][0]
if w1 > 10000:
	print(f1())
else:
	print(f2())


### FIXED CODE ###

def f1():
	L.sort(key = (lambda x: - x[1]//(x[0] - w1 + 40)))
	ans = 0
	w2 = 0
	i = 0
	while i < N:
		w2 = w2 + L[i][0]
		if w2 > W:
			break
		ans = ans + L[i][1]
		i = i + 1
	
	return ans
	
def f3():
	L.sort(key = (lambda x: - x[1]//x[0]))
	ans = 0
	w2 = 0
	i = 0
	while i < N:
		w2 = w2 + L[i][0]
		if w2 > W:
			break
		ans = ans + L[i][1]
		i = i + 1
	
	return ans
def f2():
	dp = [[0] * (W + 1) for i in range(N + 1)]
	for n in range(1,N + 1):
		w,v = L[n - 1]
		if w > W:
			continue
		for m in range(w):
			dp[n][m] = dp[n - 1][m]
		for m in range(w,W + 1):
			dp[n][m] = max(dp[n - 1][m - w] + v, dp[n - 1][m])
	return max(dp[-1])
	
N,W = map(int,input().split())
L = [list(map(int,input().split())) for i in range(N)]
w1 = L[0][0]
if w1 > 10000000:
	print(f1())
elif W > 10000000:
	print(f3())
else:
	print(f2())
import random
D=int(input())
c=input().split()
c=[int(a) for a in c]
S=[]
for _ in range(D):
    s=input().split()
    s=[int(a) for a in s]
    S.append(s)
answers=[]
scores=[]
M=10
numbers=[]
for _ in range(M):
    d=random.randrange(0,26,1)
    q=random.randrange(0,26,1)
    numbers.append([d,q])
whole=sum(c)
number=1
suuji=1
T=[]
while suuji<=365:
    T.append(number)
    number+=1
    suuji+=1
    if number==27:
        number=1
for m in range(M):
    anss=[]
    ans = 0
    held = [0 for _ in range(26)]
    e=numbers[m][0]-1
    q=numbers[m][1]-1
    a=T[e]
    T[e]=q
    wholes=0
    for d in range(D):
        s = S[d]
        place = T[d]
        ans += s[place]
        wholes+=whole
        wholes-=c[place]*((d+1)-held[place])
        held[place] = d + 1
        ans-=wholes
        scores.append(ans)
    answers.append(T)
saidai=max(scores)
basho=scores.index(saidai)
answer=answers[basho]
for answer_ in answer:
    print(answer_)
    

### FIXED CODE ###

D=int(input())
c=input().split()
c=[int(a) for a in c]
S=[]
for _ in range(D):
    s=input().split()
    s=[int(a) for a in s]
    S.append(s)

for d in range(D):
    if d%27==0:
        print(20)
    else:
        print(d%27)
n=int(input())
A=list(map(int,input().split()))
r=set()
def f(s,k):
    if k>=0:
        global r
        r|=set(s)
        f(s+A[k-1],k-1)
        f(s,k-1)
f(0,n)
input()
for e in map(int,input().split()):print(['no','yes'][e in r])


### FIXED CODE ###

b=1
input()
for a in map(int,input().split()):b|=b<<a
input()
for m in map(int,input().split()):print(['no','yes'][(b>>m)&1])
import numpy as np

N = int(input())
A = np.array(map(int, input().split()))

A %= (1000000000+7)
_sum = 0

for n in range(N-1):
  for i in range(n+1):
    _sum += A[n+1] * A[i]
    _sum = %= (1000000000+7)
    
print(_sum)

### FIXED CODE ###

#標準入力
N = int(input())
A = list(map(int, input().split()))

#累積和
S = [0]*N
for n in range(N):
  S[n] = S[n-1] + A[n]

_sum = int(0)
for i in range(N-1):
  _sum = _sum + (A[i] * (S[-1] - S[i]))

#modulo
_sum = _sum % (1000000000+7)
  
print(_sum)
#!/usr/bin/env python3
 
import sys
# 以下を記述しないとTLEになる, 何故？
from heapq import heappush, heappop, heappushpop
from collections import defaultdict
# ---- ここまで -----------------------

input = sys.stdin.readline
 
S = input()
T = input()
lenS = len(S)
lenT = len(T)
F1 = [False]*26
F2 = [False]*26
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(lenS):
    F1[alpha.index(S[i])] = True
for i in range(lenT):
    F2[alpha.index(T[i])] = True
for i in range(26):
    if not F1[i] and F2[i]:
        print(-1)
        sys.exit()
 
ind = S.index(T[0])
ans = ind+1
for i in range(1,lenT):
    S = S[ind+1:] + S[:ind+1]
    ind = S.index(T[i])
    ans += ind+1
 
print(ans)

### FIXED CODE ###

import bisect
s = input().rstrip()
t = input().rstrip()

a_ord = ord("a")
ch_place = [[] for _ in range(26)]
for i, ch in enumerate(s):
    ch_place[ord(ch) - a_ord].append(i)

# print(ch_place)

count = 0
idx = -1 
for ch in t:
    ch_num = ord(ch) - a_ord
    if len(ch_place[ch_num]) == 0:
        print(-1)
        exit()
    place = bisect.bisect_right(ch_place[ch_num], idx)
    # print(ch_place[ch_num], idx, place)
    if place == len(ch_place[ch_num]):
        idx = ch_place[ch_num][0]
        count += 1
    else:
        idx = ch_place[ch_num][place]

# print(count, idx)
print(count * len(s) + idx + 1)
n,k=map(int,input().split())
a=list(map(int,input().split()))
next=0
visited=[0]*n #index:訪れたとき
teleport=[] #index
for i in range(k):
    now=next
    if visited[now]==0:
        visited[now]=i+1
        teleport.append(now)
        next=a[now]-1
        k-=1
    else:
        loop=i+1-visited[now]
        break
print(teleport[len(teleport)-loop+k%loop]+1)

### FIXED CODE ###

n,k=map(int, input().split())
a=list(map(int, input().split()))
b=[False]*n
pos=0
for i in range(min(n,k)):
    if b[pos]!=False:
        loop=i-b[pos]+1
        break
    b[pos]=i+1
    pos=a[pos]-1
    k-=1
if k>0:
    for i in range(k%loop):
        pos=a[pos]-1
print(pos+1)
line = ((input().split()))
a = int(line[0]+line[1])
for i in range(a):
  if i**2==a:
    print(Yes)
    return
print(No)

### FIXED CODE ###

line = input().split()
a = int(line[0]+line[1])
for i in range(a):
  if i**2==a:
    print('Yes')
    exit()
print('No')
x = input()
for i in xrange(x):
	grad1,grad2 = 0, 0
	x1,y1,x2,y2,x3,y3,x4,y4 = map(float, raw_input().split())
	grad1, grad2 = ((y1 - y2)/(x1 - x2)), ((y3 - y4)/(x3 - x4))
	if grad1 == grad2:
		print "YES"
	else:
		print "NO"

### FIXED CODE ###

n = int(raw_input())
for l in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split())
    if abs((y4-y3)*(x2-x1)-(y2-y1)*(x4-x3))< 1e-10:
        print "YES"
    else:
        print "NO"
N,A,B=map(int,input().split())
ab='u'*A+'r'*B
S=ab*1000
S4ans=S[:N]
print(S4ans.count('u'))

### FIXED CODE ###

N,A,B=map(int,input().split())
full=N//(A+B)
rest=N%(A+B)
if rest <=A:
    print(full*A+rest)
    exit()
else:
    print(full*A+A)
    exit()
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IS(): return str(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

N = II()
A = LI()
A_r = A[::-1]
ans = 1
ans_r = 1
flag  = False
if 0 in A:
    print(0)
else:
    if N%2 == 1:
        ans *= A[N/2]
    for i in range(0,N//2):
        ans *= A[i]
        ans_r *= A_r[i]


    if ans*ans_r > pow(10,18):
        print(-1)
    else:print(ans*ans_r)

### FIXED CODE ###

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IS(): return str(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")


def solve(N,A):
    ans = 1
    if 0 in A:
        print(0)
        return
    
    for i in A:
        ans *= i
        if ans > pow(10,18):
            print(-1)
            return
    print(ans)

def main():
    N = II()
    A = LI()
    solve(N,A)

#main
if __name__ == '__main__':
    main()
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N+1):
  distance += L[i]
  if distance >= X:
    print(i+1)
    break

### FIXED CODE ###

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

distance = 0
for i in range(N):
  distance += L[i]
  if distance > X:
    print(i+1)
    break
else: 
  print(N+1)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N-1)]

class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self,rank,parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank+1,parent=self)



trees = {i:Tree(i) for i in range(1,N+1)}

for a,b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
trees[1].set_rank(1,None)

group0 = [node.v for node in  trees.values() if node.rank %2 ==0]
group1 = [node.v for node in  trees.values() if node.rank %2]
x = [set(),set(),set()]
for i in range(1,N+1):
    x[i%3].add(i)
if len(group1) < len(group0):
    group1,group0 = group0,group1

result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()]= x[0].pop()
    y = x[0]|x[1]|x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
    if y:
        import time
        time.sleep(10)
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()


print(' '.join(str(result[i]) for i in range(1,N+1)))



### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
try:
    trees[1].set_rank(1, None)
except:
    print(-1)
    exit()

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))
a,b = map(int,input()).split()
ans = 0
for i in range(1,a+1):
  c = 0
  bai = b/i
  while bai > 1:
    bai /= 2
    c += 1
  ans += 1/(2**c)
print(ans/a)

    
  

### FIXED CODE ###

a,b = map(int,input().split())
ans = 0
for i in range(1,a+1):
  c = 0
  bai = b/i
  while bai > 1:
    bai /= 2
    c += 1
  ans += 1/(2**c)
print(ans/a)
import numpy as np
def calc_double(nn):
    return nn -x

x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
p_all = list(range(-200,200,1))

for i in enumerate(p):
    l_in = [s for s in p_all if s not in p]

data2 = []
for val in l_in:
    data2.append(abs(calc_double(val)))

min_index =np.argmin(data2)
print(l_in[min_index])

### FIXED CODE ###

import numpy as np
def calc_double(nn):
    return nn -x

x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
p_all = list(range(-200,200,1))

l_in = [s for s in p_all if s not in p]

data2 = []
for val in l_in:
    data2.append(abs(calc_double(val)))

min_index =np.argmin(data2)
print(l_in[min_index])
from fractions import gcd
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return x * y // math.gcd(x, y)

def F(a, c, d):
    x = a - a//c - a//d + a//lcm(c, d)
    return x

ans = int(F(B, C, D) - F(A-1, C, D))
print(ans)

### FIXED CODE ###

from fractions import gcd
A, B, C, D = map(int, input().split())

def lcm(x, y):
    return x * y // gcd(x, y)

def F(a, c, d):
    x = a - a//c - a//d + a//lcm(c, d)
    return x

ans = int(F(B, C, D) - F(A-1, C, D))
print(ans)
N = int(input())
P = list(map(int, input().split()))
count = 1
for i in range(1, N):
  if P[i] <= min(P[0,i]):
    count += 1
print(count)


### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
count = 1
tmp_min = P[0]
for i in range(1, N):
  if P[i] <= tmp_min:
    count += 1
    tmp_min = P[i]
print(count)
n=int(input().split())
l=list(map(int,input().split()))
cnt=0
for i in range(n-1):
  if l[i] == i+1 and l[i+1] == i+2:
    {l[i],l[i+1]}={l[i+1],l[i]}
    cnt+=1
print(cnt)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
cnt=0
for i in range(n-1):
  if l[i] == i+1:
    l[i],l[i+1]=l[i+1],l[i]
    cnt+=1
if l[-1]==n:
  cnt+=1
print(cnt)