Harryxun/stf_run huggingface dataset:
N, K = map(int, input().split())
p = 0.0
if N >= K:
    p1 = (N-K+1)/N
    p2 = 1.0
    p += p1
    temp = 0.0
    for i in range(1, K): # 1 to K-1
        n = int(log2(K-1)-log2(i))+1
        temp += (0.5)**n
    p2 *= temp*(1/N)
    p += p2
else:
    temp = 0
    for i in range(1, N+1): # 1 to N
        n = int(log2(K-1)-log2(i))+1
        temp += (0.5)**n
    p = temp*(1.0/N)
print(p)            

### FIXED CODE ###

from math import log2
N, K = map(int, input().split())
p = 0.0
if N >= K:
    p1 = (N-K+1)/N
    p2 = 1.0
    p += p1
    temp = 0.0
    for i in range(1, K): # 1 to K-1
        n = int(log2(K-1)-log2(i))+1
        temp += (0.5)**n
    p2 *= temp*(1/N)
    p += p2
else:
    temp = 0
    for i in range(1, N+1): # 1 to N
        n = int(log2(K-1)-log2(i))+1
        temp += (0.5)**n
    p = temp*(1.0/N)
print(p)
l = input()
m = input()
z = l.split(" ")
M = int(z[1])
F = m.split(" ")
X = []
amount=0
for item in F:
  votes = int(item)
  amount = amount + votes
  X.append(votes)
X.sort(reverse=True)
C = (1/4*M)*amount
for i in range(M):
  if X[i]<C:
    print("No")
    return
print("Yes")

### FIXED CODE ###

l = input()
m = input()
z = l.split(' ')
M = int(z[1])
N = int(z[0])
F = m.split(' ')
X = []
 
for item in F:
  votes = int(item)
  X.append(votes)

S = sum(X)
C = (S/(4*M))
X.sort(reverse=True)
if X[M-1]<C:
  print("No")
else:
  print("Yes")
import numpy as np

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

total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M] > threshold:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import numpy as np

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

total_vote = np.sum(A)
threshold = total_vote/(4*M)
A.sort(reverse = True)
if A[M-1] >= threshold:
    print('Yes')
else:
    print('No')
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    n,k = map(int, input().split())
    a = list(map(int, input().split()))

    c = []
    mark = [-1]*n
    pos,l = 0,0
    while 1:
        if mark[pos] >= 0:
            l = mark[pos]
            break
        mark[pos] = len(c)
        c.append(pos)
        pos = a[pos] - 1
    if k <= 1:
        print(c[k] + 1)
    else:
        k -= l
        print(c[l + k%(len(c) - 1)] + 1)
if __name__=="__main__":
    main()


### FIXED CODE ###

import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    n,k = map(int, input().split())
    a = list(map(int, input().split()))

    c = []
    mark = [-1]*n
    pos,l = 0,0
    while 1:
        if mark[pos] >= 0:
            l = mark[pos]
            break
        mark[pos] = len(c)
        c.append(pos)
        pos = a[pos] - 1
    if k <= l:
        print(c[k] + 1)
    else:
        k -= l
        print(c[l + k%(len(c) - l)] + 1)
if __name__=="__main__":
    main()
N = int(input())
T,A = map(float,input().split())

num = 0
pre = A
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(num)

### FIXED CODE ###

N = int(input())
T,A = map(float,input().split())
H = list(map(int,input().split()))

dis = []
for i in range(N):
    dis.append(abs(A-(T-H[i]*0.006)))
print(dis.index(min(dis))+1)
k=int(input())+1
from math import gcd
print(sum(gcd(gcd(i,j),r) for i in range(1,k)   for j in range(1,k)  for r in range(1,k) )


### FIXED CODE ###

k=int(input())
from math import gcd
l=[0]*(k)
for i in range(1,k+1):
    for j in range(1,k+1):
        l[gcd(i,j)-1]+=1

ans=0
for i in range(1,k+1):
    for j in range(1,1+k):
        ans+=gcd(i,j)*l[i-1]
print(ans)
a,b=map(int,input().split())
hatsugen=["H","D"]
idx=hatsugen.index(b)
if a=="H":
    print(hatsugen[idx])
else:
    print(hatsugen[1-idx])

### FIXED CODE ###

a,b=input().split()
hatsugen=["H","D"]
idx=hatsugen.index(b)
if a=="H":
    print(hatsugen[idx])
else:
    print(hatsugen[1-idx])
def uq(a,c):
    return c if a%c==0 else uq(c,a%c)

n=(int)(input())
T=[]

for i in range(0,n):
    T.append((int)(input()))

result = 1

for j in T:
    result=(int)((result*j)/uq(result,j))
    
print(result)

### FIXED CODE ###

def uq(a,c):
    return c if a%c==0 else uq(c,a%c)

n=(int)(input())

result = 1

for j in range(0,n):
    f=(int)(input())
    result=((result//uq(result,f)))*f
    
print((int)(result))
a, b = int(input())
print('GREATER') if a>b else print('LESS') if b>a else print('EQUAL')

### FIXED CODE ###

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

print('GREATER') if a>b else print ('LESS') if b>a else print('EQUAL')
N = int(raw_input())
if N %= 2 == 0:
  print N
else:
  print N * 2

### FIXED CODE ###

N = int(raw_input())
if N % 2 == 0:
  print N
else:
  print N * 2
N,M=list(map(int,input().split()))

bridge=[None]*M

for i in range(M):
    bridge[i]=tuple(map(int,input().split()))


def intersection(x,y):
    if x[1]<=y[0] or y[1]<=x[0]:
        return 0
    else:
        return {(max(x[0],y[0]),min(x[1],y[1]))}

ANS=intersection(bridge[0],bridge[1])
check=1

for i in range(2,M):
    check=1
    for j in ANS:
        if intersection(j,bridge[i])==0:
            continue
        else:
            ANS=(ANS- {j})|intersection(j,bridge[i])
            check=0
            break
    if check==1:
        ANS=ANS|{bridge[i]}
    #print(ANS)

print(len(ANS))


### FIXED CODE ###

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

bridge=[None]*M

for i in range(M):
    bridge[i]=tuple(map(int,input().split()))


bridge.sort()

brilist=[0]*(10**5)
brilist[bridge[0][0]]=bridge[0][1]
#print(brilist[:15])
for i in range(1,M):
    if bridge[i][0]==bridge[i-1][0]:
        brilist[bridge[i][0]]=min(bridge[i][1],brilist[bridge[i][0]])

    elif bridge[i][0]<brilist[bridge[i-1][0]]:

        brilist[bridge[i][0]]=min(bridge[i][1],brilist[bridge[i-1][0]])
        brilist[bridge[i-1][0]]=0
        

    else:

        brilist[bridge[i][0]]=bridge[i][1]

    #print(brilist[:15])


ANS=0
for i in range(10**5):
    if brilist[i]!=0:
        ANS+=1

print(ANS)
#print(brilist[:15])
a_yen , b_yen, c_yen , a_count,b_count = map(int,input().split())

abmax = max(a_count, b_count)
c_count = 0
kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count

while c <= 2*abmax:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count and a_counnt > -1 and b_count > -1:
        kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count
    c_count = c_count + 2
    a_count = a_count - 1
    b_count = b_count - 1





### FIXED CODE ###

a_yen , b_yen, c_yen , a_count,b_count = map(int,input().split())

abmax = max(a_count, b_count)
c_count = 0
kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count

while c_count <= 2*abmax:
    if kouhopiza > a_yen * a_count + b_yen * b_count + c_yen * c_count and a_count > -1 and b_count > -1:
        kouhopiza = a_yen * a_count + b_yen * b_count + c_yen * c_count
    elif a_count > -1 and b_count < 0:
        if kouhopiza > a_yen * a_count + c_yen * c_count:
            kouhopiza = a_yen * a_count + c_yen * c_count
    elif a_count < 0 and b_count > -1:
        if kouhopiza > b_yen * b_count + c_yen * c_count:
            kouhopiza = b_yen * b_count + c_yen * c_count
        
    c_count = c_count + 2
    a_count = a_count - 1
    b_count = b_count - 1
print(kouhopiza)
import sys
input = sys.stdin.readline
n, q = 500000, 500000
c = [randint(1, n) - 1 for i in range(n)]
query = []
for i in range(q):
    l, r = randint(1, n) - 1, randint(1, n) - 1
    if l > r:
        l, r = r, l
    query.append(l << 40 | r << 20 | i)

query.sort()
ball = [list() for i in range(n)]
for i, x in enumerate(c):
    ball[x].append(i)

# binary indexed tree
bit = [0] * (n + 1)
def add(i, x):
    i += 1
    while i <= n:
        bit[i] += x
        i += i & -i

def get(i):
    i += 1
    s = 0
    while i:
        s += bit[i]
        i -= i & -i
    return s

for i in ball:
    if i:
        add(i[0], 1)
        i.reverse()

at = 0
ans = [0] * q
for x in query:
    l = x >> 40
    r = x >> 20 & 0xfffff
    i = x & 0xfffff
    while at < l:
        b = ball[c[at]]
        add(b[-1], -1)
        b.pop()
        if b:
            add(b[-1], 1)
        at += 1
    ans[i] = get(r) - get(l - 1)

for i in ans:
    print(i)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n, q = map(int, input().split())
c = list(map(lambda x: int(x) - 1, input().split()))
query = []
for i in range(q):
    l, r = map(lambda x: int(x) - 1, input().split())
    query.append(l << 40 | r << 20 | i)

query.sort()
ball = [list() for i in range(n)]
for i, x in enumerate(c):
    ball[x].append(i)

# binary indexed tree
bit = [0] * (n + 1)
def add(i, x):
    i += 1
    while i <= n:
        bit[i] += x
        i += i & -i

def get(i):
    i += 1
    s = 0
    while i:
        s += bit[i]
        i -= i & -i
    return s

for i in ball:
    if i:
        add(i[0], 1)
        i.reverse()

at = 0
ans = [0] * q
for x in query:
    l = x >> 40
    r = x >> 20 & 0xfffff
    i = x & 0xfffff
    while at < l:
        b = ball[c[at]]
        add(b[-1], -1)
        b.pop()
        if b:
            add(b[-1], 1)
        at += 1
    ans[i] = get(r) - get(l - 1)

for i in ans:
    print(i)
# -*- coding: utf-8 -*-
n, k = map(int, input().split())
A = sorted([int(i) for i in input().split()])
F = sorted([int(i) for i in input().split()], reverse = True)
P = [A[i]*F[i] for i in range(n)]
min_list = sorted(list(set(P)))
if sum(A) <= k: print('0')
else:
    new_P = [0 for i in range(n)]
    i=0
    while k > sum(new_P):
        print(new_P)
        new_min = min_list[i]
        i += 1
        for j in range(n):
            if (P[j] - new_min) > 0: new_P[j] = (P[i] - new_min) // F[j] + 1
    print(new_min)

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
n, k = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort(reverse = True)
F = [int(i) for i in input().split()]
F.sort()
"""
n = 11
k = 14
A = [1,1,2,3,3,4,5,5,5,6,9]
F = [9,9,8,8,7,6,4,3,3,2,2]
"""

 
P = [A[i]*F[i] for i in range(n)]
sum_A = sum(A)
 
def b(p):
    result = 0
    for i in range(n):
        if P[i] > p:
            r = (P[i] - p) // F[i]
            if P[i] - r * F[i] > p:
                r += 1
            result += r
    return result
 
if sum_A <= k: print('0')
else: 
    left = 0
    right = max(P)
    middle = int((left + right) / 2)
    bm = b(middle)
    
    
    
    while right - left > 1:
        
        if bm > k: left = middle
        else: right = middle
            
        middle = int((left + right) / 2)
        bm = b(middle)
 
    if b(left) <= k: print(left)
    else: print(right)
#ABC164 B
p = [int(x) for x in input().split()]

takahashi_turn = True
while (p[0]<=0) or (p[2]<=0):
    if takahashi_turn:
        p[2] = p[2] - p[1]
    else:
        p[0] = p[0] - p[3]
    takahashi_turn = ! takahashi_turn

if p[0] > 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

#ABC164 B
p = [int(x) for x in input().split()]

takahashi_turn = True
while (p[0]>0) and (p[2]>0):
    if takahashi_turn:
        p[2] = p[2] - p[1]
    else:
        p[0] = p[0] - p[3]
    takahashi_turn = not takahashi_turn

if p[0] > 0:
    print("Yes")
else:
    print("No")
N = int(input())
Y = int(input())
for a in range(N):
    for b in range(N):
        10000*a+5000*b+1000*(N-a-b) == Y
        print(a,b,N-a-b)
    break

### FIXED CODE ###

N,Y = map(int,input().split())
for i in range(N+1):
    for n in range(N-i+1):
        if 10000*i+5000*n+1000*(N-i-n) == Y:
            print(i,n,N-i-n)
            break
    else:
        continue
    break
else:
    print(-1,-1,-1)
n = input()
ans = 0.5 * n * (n - 1)
print(int(ans))

### FIXED CODE ###

n = int(input())
ans = n * (n - 1) // 2
print(int(ans))
n,m,x = map(int, input().split())
ca = []
for i in range(m):
    ca.append(list(map(int, input().split())))

c = []
a = []
for i in range(len(ca)):
    c.append(ca[i][0])
    a.append(ca[i])
    del a[i][0]

ans = 12345678
for i in range(2 ** n):
    cost = 0
    level = [0] * m
    for j in range(n):
        if(i>>j&1):
            cost += c[j]
            for k in range(m):
                level[k] += a[j][k]
    flag = True
    for k in range(m):
        if(level[k] < x):
            flag = False
    if(flag):
        ans = min(ans,cost)
if(ans == 12345678):
    print(-1)
else:
    print(ans)

### FIXED CODE ###

n,m,x = map(int, input().split())
ca = []
for i in range(n):
    ca.append(list(map(int, input().split())))

c = []
a = []
for i in range(len(ca)):
    c.append(ca[i][0])
    a.append(ca[i])
    del a[i][0]

ans = 12345678
for i in range(2 ** n):
    cost = 0
    level = [0] * m
    for j in range(n):
        if((i>>j)&1):
            cost += c[j]
            for k in range(m):
                level[k] += a[j][k]
    flag = True
    for k in range(m):
        if(level[k] < x):
            flag = False
    if(flag):
        ans = min(ans,cost)
if(ans == 12345678):
    print(-1)
else:
    print(ans)
import math

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

Sum = 0
mod = (10 ** 9) + 7

for i in range(int(math.log2(max(A))) + 1):
    Sum_1 = 0
    for j in range(N):
        #print(i, j)
        if ((A[j] >> i) & 1):
            Sum_1 += 1

    Sum_0 = N - Sum_1

    Sum = (Sum + ((Sum_0 * Sum_1) % mod * (2 ** i)) % mod) % mod
    # print(Sum_0,Sum_1)

print(Sum)


### FIXED CODE ###

import math

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

Sum = 0
mod = (10 ** 9) + 7

for i in range(len(bin(max(A)))-2):
    Sum_1 = 0
    for j in range(N):
        #print(i, j)
        if ((A[j] >> i) & 1):
            Sum_1 += 1

    Sum_0 = N - Sum_1

    Sum = (Sum + ((Sum_0 * Sum_1) % mod * (2 ** i)) % mod) % mod
    # print(Sum_0,Sum_1)

print(Sum)
import math

prime = {}

N = int(input())

isPrime = [True]*(N+1)
isPrime[0] = False
isPrime[1] = False
for i in range(2,int(math.sqrt(N))+2):
    if isPrime[i]:
        n = 2*i
        while n<=N:
            isPrime[n] = False
            n += i

for i in range(N+1):
    if isPrime[i]:
        prime[i] = 0

key_list = list(prime.keys())

for num in range(2,N+1):
    res = num
    idx = 0
    while res>1:
        k = key_list[idx]
        if res%k == 0:
            prime[k] += 1
            res = res//k
        else:
            idx += 1
    
ans = 1
for v in prime.values():
    ans *= (v+1) 
    ans = ans % (10**9+7)
    if ans==0:
        ans = 1
    
print(ans)

### FIXED CODE ###

import math

prime = {}

N = int(input())

def judge(N):

    if N==1:
        print(1)
        return 0

    isPrime = [True]*(N+1)
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2,int(math.sqrt(N))+2):
        if isPrime[i]:
            n = 2*i
            while n<=N:
                isPrime[n] = False
                n += i
    
    for i in range(N+1):
        if isPrime[i]:
            prime[i] = 0
    
    key_list = list(prime.keys())
    
    for num in range(2,N+1):
        res = num
        idx = 0
        while res>1:
            k = key_list[idx]
            if res%k == 0:
                prime[k] += 1
                res = res//k
            else:
                idx += 1
        
    ans = 1
    for v in prime.values():
        ans *= (v+1) 
        ans = ans % (10**9+7)
        if ans==0:
            ans = 1
        
    print(ans)
    return 0

judge(N)
import sys 
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = [int(input()) - 1 for _ in range(m)]
a.append(n)

dp = [-1] * max(3, n)
dp[0] = 1
dp[1] = 1
dp[2] = 2
def stepsum(n):
    if dp[n] != -1:
        return dp[n]
    dp[n] = stepsum(n-1) + stepsum(n-2)
    return dp[n]
prev = 0
ans = 1
for ai in a:
    if prev != 0 and ai - prev < 0:
        ans = 0
        break
    ans *= stepsum(ai - prev)
    prev = ai + 2

print(ans % ( 10 ** 9 + 7 ))


### FIXED CODE ###

import sys 
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
a = [int(input()) - 1 for _ in range(m)]
a.append(n)

dp = [-1] * max(3, n + 1)
dp[0] = 1
dp[1] = 1
dp[2] = 2
def stepsum(n):
    if dp[n] != -1:
        return dp[n]
    dp[n] = stepsum(n-1) + stepsum(n-2)
    return dp[n]
prev = 0
ans = 1
for ai in a:
    if prev != 0 and ai - prev < 0:
        ans = 0
        break
    ans *= stepsum(ai - prev)
    prev = ai + 2

print(ans % ( 10 ** 9 + 7 ))
import bisect

n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n-1):a[i+1]+= a[i]
  
cnt = 0
for i in range(n)[::-1]:
  if a[i]<k:
    break
  t = bisect.bisect_right(a,a[i]-k)
  print(t)
  cnt+=t+1
print(cnt)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input=lambda :sys.stdin.readline()

def sol():

  N,Q = map(int,input().split())
  graph = [[] for i in range(N)]
  ans = [0 for i in range(N)]
  for _ in range(N-1):
    a,b = map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

  for _ in range(Q):
    p, x = map(int,input().split())
    ans[p-1] += x 
 
  def dfs(v,p=-1):
    for u in graph[v]:
      if u == p: continue
      ans[u] += ans[v]
      dfs(u,v)
  dfs(0)
  print(*ans)

sol()
N, M, K = map(int, input().split())
graph = [[] for _ in range(N)]
block = [[] for _ in range(N)]
count = 0
counts = []
def dfs(v, c, seen, origin):
    global count
    seen[v] = True
    for node in graph[v]:
        if seen[node] == True:
            continue
        if node not in block[origin]:
            count += 1
        dfs(node, c+1, seen, origin)

for Mi in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

for Ki in range(K):
    a, b = map(int, input().split())
    block[a-1].append(b-1)
    block[b-1].append(a-1)

for v in range(N):
    seen = [False for _ in range(N)]
    count = 0
    dfs(v, count, seen, v)
    counts.append(count-len(graph[v]))
print(' '.join(map(str, counts)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
input = sys.stdin.readline

N, M, K = map(int, input().split())
friends = {i: set() for i in range(N)}
blocks = {i: set() for i in range(N)}

for _ in range(M):
    a, b = map(int, input().split())
    friends[a-1].add(b-1)
    friends[b-1].add(a-1)

for _ in range(K):
    a, b = map(int, input().split())
    blocks[a-1].add(b-1)
    blocks[b-1].add(a-1)

counts = [0] * N
seen = [False] * N
def dfs(v):
    if seen[v] == True:
        return
    seen[v] = True
    for node in friends[v]:
        c.add(node)
        dfs(node)
 
for v in range(N):
    if seen[v] == True:
        continue
    c = set()
    dfs(v)
    l = len(c)
    for i in c:
        counts[i] = l - 1
        counts[i] -= len(c & friends[i])
        counts[i] -= len(c & blocks[i])
print(' '.join(map(str, counts)))
D,N = map(int,input().split())
from math import pow
print(int(pow(100,D) * N)) if N != 100 elseprint(int(pow(100,D) * 101))

### FIXED CODE ###

D,N = map(int,input().split())
from math import pow
print(int(pow(100,D) * N)) if N != 100 else print(int(pow(100,D) * 101))
a,b,c,d = map(int,input().split())
import math
e =  (c*d) // math.gcd(c,d)
count = 0
if c != d:
    count =  (b-a)//c + (b-a)//d - (b-a)//e
else:
    count = (b-a)//c
print(b-a-count)

### FIXED CODE ###

from fractions import gcd
a,b,c,d = map(int,input().split())
 
e = c*d//gcd(c,d)
A = (a-1)//c + (a-1)//d - (a-1)//e
B = b//c + b//d -b//e
print(b - a + 1 + A - B)
import math
a,b,c=map(int,input.split())
if math.sqrt(a)+math.sqrt(b)<math.sqrt(c):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int,input().split())
if c-a-b>0 and 4*a*b<(c-a-b)**2:
  print('Yes')
else:
  print('No')
da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
 
def aaa(d,a,t):
  k = [0]*3
  k[0] = d + a
  k[1] = d + t
  k[2] = a + t
  return k
 
for i in range(da[3]):
  if da[0] == da[1] and da[1] == da[2]:
    break
  da = aaa(da[0],da[1],da[2])
  if abs(da[0] -da[1]) >= l:
    break
  elif abs(2(da[0] -da[1])) < l or m == 1:
    m = 1
    break
 
if abs(da[0] - da[1]) < l:
  print(da[0] - da[1])
elif abs(da[0] - da[1]) >= l:
  print("Unfair")


### FIXED CODE ###

da = list(map(int,input().split()))
 
m = 0
l = pow(10,18)
  
if da[3] % 2 == 1:
  k = da[1] -da[0]
else:
  k = da[0] -da[1]

if abs(da[0] - da[1]) <= l:
  print(k)
elif abs(da[0] - da[1]) > l:
  print("Unfair")
x = input()

print(x**3)

### FIXED CODE ###

x = int(input())
print(x**3)
x = int(input())
ans = 0
for _ in range():
  a = 100**1.01
  ans += 1
  if a >= x:
    exit()
print(ans)

### FIXED CODE ###

X = int(input())
y = 100
ans = 0
while True:
  ans += 1
  y += y//100
  if X <= y:
    break
print(ans)
n = int(input())
Y = [list(map(int,input().split())) for _ in range(n)]
X = []
for y in Y:
    X.append(y[0]-y[1],y[0]+y[1])
X.sort()
ans = n
right = X[0][1]
for i in range(1,n):
    left = X[i][0]
    if left < right:
        ans -= 1
    else:
        right = X[i][1]
print(ans)

### FIXED CODE ###

n = int(input())
Y = [list(map(int,input().split())) for _ in range(n)]
X = []
for y in Y:
    X.append([y[0]+y[1],y[0]-y[1]])
X.sort()
ans = n
right = X[0][0]
for i in range(1,n):
    left = X[i][1]
    if left < right:
        ans -= 1
    else:
        right = X[i][0]
print(ans)
n=int(input())

alphabet=[None] + [chr(i) for i in range(97,97+26)]

if n<27:
    print(alphabet[n])
    exit()
rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

ans=''
for i in range(len(rest)):
    ans+=alphabet[rest[i]]
print(ans)


### FIXED CODE ###

n=int(input())

alphabet=[None] + [chr(i) for i in range(97,97+26)]

rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

for i in range(len(rest)-1):
    if rest[len(rest)-1-i]<=0:
        rest[len(rest)-1-i]+=26
        rest[len(rest)-2-i]-=1
if rest[0]<=0:
    rest=rest[1:]

ans=''
for i in range(len(rest)):
    ans+=alphabet[rest[i]]
print(ans)
N = int(input())
S = input().split()
x = 0

for N in S:
  if S[N] == "I":
    x += 1
  elif S[N] == "D":
    x -= 1
print(x)

### FIXED CODE ###

N = int(input())
S = input()
x = 0
ans = 0
 
for i in S:
  if i == "I":
    x += 1
  elif i == "D":
    x -= 1
  ans = max(ans,x)
  
print(ans)
a,b = map(int,input().split())
print(a*b+' '+2*(a+b))


### FIXED CODE ###

a,b = map(int,input().split())
print(a*b,2*(a+b))
a = list(map(int,input().split()))
k = a[0]
s = a[1]
num=0
for l in range(k+1):
    for m in range(l,k+1):
        n = s-l-m
        if(n <= k & n >= 0):
            if(l!=m and l!= n and m!=n):
                num+=3
            else if (l==m and m==n):
                num+=1
            else:
                num+=2
                
print(num)


### FIXED CODE ###

inputs= list(map(int,input().split()))
k = inputs[0]
s = inputs[1]
answer = 0
for i in range(k+1):
  x = i
  for l in range(k+1):
    y = l
    z = s-x-y
    if z >= 0 and z <= k :
      answer += 1
print(answer)
a = int(input())
b = int(input())

menseki = a * b
print(menseki)

nagasa = a + a + b + b
print(nagasa)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b, a*2 + b*2)
n = input()
s = input()
flag = 0
for i in range(1,n-1):
	if s[i-1]+s[i]+[i+1] = "ABC":
    	flag++
print(flag)      

### FIXED CODE ###

N = int(input())
S = input()
print(S.count("ABC"))
n = input()
li = list(map(int, input().split()))
a = 1
for x in li:
    a *= x
if a > 10**18:
    print(-1)
elif n > 10**5:
    print(-1)
else:
    print(a)

### FIXED CODE ###

n = int(input())
ls = list(map(int, input().split()))
res = 1
if 0 in ls:
    print(0)
    quit()
for x in ls:
    res *= x
    if res > 10**18:
        print(-1)
        quit()
print(res)