Harryxun/stf_run huggingface dataset:
import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    ls = [True] * 100001
    ls[0] = False
    ls[1] = False
    p = collections.deque()
    for i in range(2, 100000):
        if ls[i]:
            p.append(i)
            for j in range(i, 100000, i):
                if ls[j]:
                    ls[j] = False
    ans = []
    while True:
        if len(ans) == n:
            break
        else:
            if pv % 5 == 1:
                ans.append(pv)
    print(ans)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
import collections


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n = int(input().rstrip('\n'))
    ls = [True] * 100001
    ls[0] = False
    ls[1] = False
    p = collections.deque()
    for i in range(2, 100000):
        if ls[i]:
            p.append(i)
            for j in range(i, 100000, i):
                if ls[j]:
                    ls[j] = False
    ans = []
    while True:
        if len(ans) == n:
            break
        else:
            pv = p.popleft()
            if pv % 5 == 1:
                ans.append(pv)
    print(*ans)


if __name__ == '__main__':
    solve()
n=int(input())
k=int(input())
x=int(input())
y=int(input())
print(k*x+(max(0,n-k)*y)

### FIXED CODE ###

n=int(input())
k=int(input())
x=int(input())
y=int(input())
print(min(n,k)*x+max(0,n-k)*y)
n = int(input())
a = map(int, input().split())

ans = 0
for i in a:
  if i != a[i]:
    ans += 1
    
if ans <= 2:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

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

ans = 0
for i in range(len(a)):
  if i != a[i]-1:
    ans += 1
    
if ans <= 2:
  print("YES")
else:
  print("NO")
a, b, x = map(int,input().split())
tmp = a
while True:
    if tmp % x == 0:
        break
    else:
        tmp += 1
print((b//tmp)-(a//tmp))


### FIXED CODE ###

a, b, x = map(int,input().split())
print((b//x)-(a-1)//x)
x,y)=map(int, input().split(" "))
print(x * y, 2 * x + 2* y)

### FIXED CODE ###

x,y=map(int,raw_input().split())
print x*y,2*(x+y)
a = input()
count = a.count()
print(a[0]+str(count)+a[count-1])

### FIXED CODE ###

a = input()
count = len(a)
print(a[0]+str(count-2)+a[count-1])
a, b, c = [input(i) for i in input().split()]

total = 0
for d in range(a, b + 1):
    
    a == c % d 
    if a == 0:
    total += 1

print(total)

### FIXED CODE ###

a, b, c = [int(i) for i in input().split()]

total = 0
for d in range(a, b + 1):
    
    if c % d == 0:
        total += 1

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

def count(s):
    ans = 0
    for i, a in enumerate(A):
        if i == 0:
            continue
        if s < 0:
            if 1-s-a >= 0:
                ans += 1-s-a
                s = 1
            else:
                s += a
        elif s > 0:
            if s+a+1 >= 0:
                ans += s+a+1
                s = -1
            else:
                s += a
    return ans

b = A[0]
ans1 = count(b)
if b > 0:
    ans2 = count(-1)+b+1
elif b < 0:
    ans2 = count(1)+1-b

print(min(ans1, ans2))

### FIXED CODE ###

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

def count(s):
    ans = 0
    for i, a in enumerate(A):
        if i == 0:
            continue
        if s < 0:
            if 1-s-a >= 0:
                ans += 1-s-a
                s = 1
            else:
                s += a
        elif s > 0:
            if s+a+1 >= 0:
                ans += s+a+1
                s = -1
            else:
                s += a
    return ans

b = A[0]
ans1 = count(b)
if b > 0:
    ans2 = count(-1)+b+1
elif b < 0:
    ans2 = count(1)+1-b
else:
    ans1 = count(1)+1
    ans2 = count(-1)+1
print(min(ans1, ans2))
num = input().split(" ")
ki = int(num[1]) - gu
gu = int(num[1]) // 2
sum_kaku = 0
a = 0
while a < int(num[0]):
  if a % 2 == 0:
    sum_kaku += ki
  else:
    sum_kaku += gu
  a += 1
print(sum_kaku)
  

### FIXED CODE ###

num = input().split(" ")
if "1" in num:
  print(1)
else:
	gu = int(num[1]) // 2
	ki = int(num[1]) - int(gu)
	gu2 = int(num[0]) // 2
	ki2 = int(num[0]) - int(gu2)
	print(gu * gu2 + ki * ki2)
N,K = map(int,input().split())
P = list(map(int,input().split()))



PP = P *0.5+0.5

ans = float(0)
final = 0
repeat = N-K+1
for j in range(repeat):
    ans = 0
    for i in range(K):
        ans = ans+PP[i+j]
        if final <= ans :
            final = ans
        
print(final)

### FIXED CODE ###

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

wa = float(0)
for i in range(K):
    wa = wa + P[i]

ans = wa 
  
repeat = N-K
for i in range(repeat):
    wa = wa + P[i+K]-P[i]
    if ans <= wa :
        ans = wa
      
print(ans/2+(K*0.5))
import math
n,m,k=map(int,input().split())
print(math.gcd(n,m))

### FIXED CODE ###

n,m,k=map(int,input().split())
for i in range(min(n,m),0,-1):
	if n%i==0 and m%i==0:
		k-=1
		if k==0:
			print(i)
			exit()
num = [input(), input(), input()]
k = int(input())

m = max(num)
ans = sum(num) - m + 2**k * m

print(ans)

### FIXED CODE ###

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

m = max(a, b, c)
ans = a + b + c - m + (2**k) * m

print(ans)
import numpy as np

N, W = map(int, input().split())

items = [tuple(map(int, input().split())) for _ in range(N)]
dp = np.zeros(W+1, dtype=np.int64)

for i, (w, v) in enumerate(items):
  tmp = np.zeros(W+1, dtype=np.int64)
  tmp[w:] = dp[:-w] + v
  dp = np.maximum(dp, tmp)
print(dp[W])

### FIXED CODE ###

import numpy as np

N, W = map(int, input().split())
items = [tuple(map(int, input().split())) for _ in range(N)]

dp = np.full(10**5+1, 10**18, dtype=np.int64)
dp[0] = 0

for i, (w, v) in enumerate(items):
  tmp = dp[:-v] + w
  dp[v:] = np.minimum(dp[v:], tmp)
print(np.max(np.where(dp <= W)))
# UnionFind

# 配列で、子のID番目:(親のID), 親のID番目:(その塊の-サイズ)
# Union Findを使う
class UnionFind:
    def __init__(self, size):
        self.parent_indexes = [-1] * size
        
    def find_parent(self, n):
#         print(self.parent_indexes[n])
        if self.parent_indexes[n] < 0:
            return n
#         print('hewe')
        # 探しているnodeが指し示しているのが現在の親ではない場合、
        # 現在の親に書き換え(memo化)た上で返す
        self.parent_indexes[n] = self.find_parent(self.parent_indexes[n])
        return self.parent_indexes[n] 
    
    def union(self, n1, n2):
        if self.same_group(n1, n2):
            return False
        
        # サイズの大きい方の親が親であり続ける
        if self.size(n1) >= self.size(n2):
            tmp = self.size(n2)
            self.parent_indexes[self.find_parent(n2)] = self.find_parent(n1)
            self.parent_indexes[self.find_parent(n1)] -= tmp
            return True
        
        tmp = self.size(n1)
        self.parent_indexes[self.find_parent(n1)] = self.find_parent(n2)
        self.parent_indexes[self.find_parent(n2)] -= tmp
        return True
        
    
    def size(self, n):
        return -self.parent_indexes[self.find_parent(n)]
    
    def same_group(self, n1, n2):
        return self.find_parent(n1) == self.find_parent(n2)


n, m = map(lambda x: int(x), input().split())
uf = UnionFind(n)

for _ in range(m):
    a, b = map(lambda x: int(x), input().split())
    uf.union(a-1, b-1)
    
print(-min(uf.parent_indexes))


n, m = map(lambda x: int(x), input().split())

uf = UnionFind(n)

for _ in range(m):
    a, b = map(lambda x: int(x), input().split())
    uf.union(a-1, b-1)
    
print(-min(uf.parent_indexes))

### FIXED CODE ###

# UnionFind

# 配列で、子のID番目:(親のID), 親のID番目:(その塊の-サイズ)
# Union Findを使う
class UnionFind:
    def __init__(self, size):
        self.parent_indexes = [-1] * size
        
    def find_parent(self, n):
#         print(self.parent_indexes[n])
        if self.parent_indexes[n] < 0:
            return n
#         print('hewe')
        # 探しているnodeが指し示しているのが現在の親ではない場合、
        # 現在の親に書き換え(memo化)た上で返す
        self.parent_indexes[n] = self.find_parent(self.parent_indexes[n])
        return self.parent_indexes[n] 
    
    def union(self, n1, n2):
        if self.same_group(n1, n2):
            return False
        
        # サイズの大きい方の親が親であり続ける
        if self.size(n1) >= self.size(n2):
            tmp = self.size(n2)
            self.parent_indexes[self.find_parent(n2)] = self.find_parent(n1)
            self.parent_indexes[self.find_parent(n1)] -= tmp
            return True
        
        tmp = self.size(n1)
        self.parent_indexes[self.find_parent(n1)] = self.find_parent(n2)
        self.parent_indexes[self.find_parent(n2)] -= tmp
        return True
        
    
    def size(self, n):
        return -self.parent_indexes[self.find_parent(n)]
    
    def same_group(self, n1, n2):
        return self.find_parent(n1) == self.find_parent(n2)



n, m = map(lambda x: int(x), input().split())
uf = UnionFind(n)

for _ in range(m):
    a, b = map(lambda x: int(x), input().split())
    uf.union(a-1, b-1)
    
print(-min(uf.parent_indexes))
s = sorted(input())
t = sorted(input(), reverse = True)
jud = False

if len(s) < len(t):
    for i in range(len(s)):
        if ord(s[i]) > ord(t[i]):
            break
    jud = True
else:
    for i in range(len(s)):
        count = 0
        if ord(s[i]) < ord(t[i]):
            count += 1
        elif ord(s[i]) > ord(t[i]):
            break
    if count >= 1:
        jud = True

print('Yes' if jud == True else 'No')
        

### FIXED CODE ###

s = sorted(list(input()))
t = sorted(list(input()), reverse=True)

ss = ''.join(s)
tt = ''.join(t)

ans = sorted([tt,ss])

if ss == tt:
    print('No')
else:
    print(['No', 'Yes'][ans[0] == ss])
S, W = map(int, input().split())

if S =< W:
  print("unsafe")
print("safe")

### FIXED CODE ###

S, W = map(int, input().split())

if S <= W:
  print("unsafe")
else:
  print("safe")
from decimal import *
import math
import sys

num = list(map(int, input().split()))

A = num[0]
B = num[1]
C = num[2]
D = num[3]

def ans_mthd(i, j, k):
    return Decimal((i - i // j - i // k + i * math.gcd(j, k) / j // k ))

ans = ans_mthd(B, C, D)-ans_mthd(A-1, C, D)
# print(math.gcd(C, D))
# print(C * D)
# print(ans_mthd(B, C, D) // 1)
print(ans)

### FIXED CODE ###

import fractions
A,B,C,D=map(int, input().split())
def ans_mthd(i, j, k):
    return (i - i // j - i // k + i * fractions.gcd(j, k) // j // k )
ans = ans_mthd(B, C, D)-ans_mthd(A-1, C, D)
print(ans)
import sys
from collections import defaultdict

N,M=map(int, sys.stdin.readline().split())
A=[ map(int, sys.stdin.readline().split()) for i  in range(M) ] 

par=[ i for i in range(N+1) ]

size=[ 1 for i in range(N+1) ]

def root(x):
	if par[x]==x:
		return x
	else:
		par[x]=root( par[x] )
		return par[x]

def same(x,y):
	return root(x)==root(y)

def unite(x,y):
	x=root(x)
	y=root(y)
	if x==y: return
	par[x]=y
	size[y]+=size[x]

def getsize(x):
	return size[root(x)]


ans=N*(N-1)/2

L=[]

for a,b in reversed(A):
	L.append(max(0,ans))
	if root(a)==root(b):
		n1=getsize(a)
		ans+=n1*(n1-1)/2	
	else:
		n1=getsize(a)
		n2=getsize(b)
		ans+=n1*(n1-1)/2
		ans+=n2*(n2-1)/2

	unite(a,b)

	n=getsize(a)
	ans-=n*(n-1)/2



for x in reversed(L):
	print x


### FIXED CODE ###

import sys
from collections import defaultdict
sys.setrecursionlimit(1000000)

N,M=map(int, sys.stdin.readline().split())
A=[ map(int, sys.stdin.readline().split()) for i  in range(M) ] 

par=[ i for i in range(N+1) ]

size=[ 1 for i in range(N+1) ]

def root(x):
	if par[x]==x:
		return x
	else:
		par[x]=root( par[x] )
		return par[x]

def same(x,y):
	return root(x)==root(y)

def unite(x,y):
	x=root(x)
	y=root(y)
	if x==y: return
	par[x]=y
	size[y]+=size[x]

def getsize(x):
	return size[root(x)]


ans=N*(N-1)/2

L=[]

for a,b in reversed(A):
	L.append(max(0,ans))
	if root(a)==root(b):
		n1=getsize(a)
		ans+=n1*(n1-1)/2	
	else:
		n1=getsize(a)
		n2=getsize(b)
		ans+=n1*(n1-1)/2
		ans+=n2*(n2-1)/2

	unite(a,b)

	n=getsize(a)
	ans-=n*(n-1)/2



for x in reversed(L):
	print x
import sys
n=int(input())
a=list(map(int,input().split()))
if n==0:
  print(Yes)
  sys.exit()
for i in range(1,n-1):
  if a[i+1] >= a[i] and a[i] >=a [i-1]:
    continue
  if a[i+1]>=a[i]-1 and a[i]-1>=a[i-1]:
    a[i]=a[i]-1
    continue
  else if i==1 and a[0]-1==a[1]:
    a[0]-=1
    continue
  else:
    print("No")
    sys.exit()
print("Yes")

### FIXED CODE ###

import sys
n=int(input())
a=list(map(int,input().split()))
if len(a)==1:
  print("Yes")
  sys.exit()
if len(a)==2 and a[0]<=a[1]:
  print("Yes")
  sys.exit()
elif len(a)==2:
  print("No")
  sys.exit()
  
for i in range(1,n-1):
  if a[i+1]>=a[i]-1 and a[i]-1>=a[i-1]:
    a[i]=a[i]-1
    continue

  if a[i+1] >= a[i] and a[i] >=a [i-1]:
    continue
  else:
    print("No")
    sys.exit()
print("Yes")
A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())

if A < B and V <= W:
    print('NO')
    exit()

val1 = A-B
val2 = V-W

if val1%val2 == 0:
    print('YES')
else:
    print('NO')


### FIXED CODE ###

A,V = map(int, input().split())
B,W = map(int, input().split())
T = int(input())
 
if A < B: 
    Ap = A + V*T
    Bp = B + W*T

    if Ap >= Bp:
        print('YES')
    else:
        print('NO')    
else:
    Ap = A + (-V*T)
    Bp = B + (-W*T)

    if Ap <= Bp:
        print('YES')
    else:
        print('NO')
import math

a, b = map(int, input())
print(math.ceil((a+b)/2))

### FIXED CODE ###

import math

a, b = map(int, input().split())
print(math.ceil((a+b)/2))
import math
a,b = map(int,input().split())
print(a*b//math.gcd(a,b))

### FIXED CODE ###

# C - Snack
from fractions import gcd
a,b = map(int,input().split())
print(a*b//gcd(a,b))
from scipy.special import comb
n,m = map(int,(input().split()))
bulb = [0]*m
p = [0]*m
j = 1
odd = 0
even = 0
for i in range(m):
    bulb[i] = list(map(int,input().split()))
p = list(map(int,input().split()))

for i in range(m):
    print('bulb='+str(bulb[i][0]))
    if not bulb[i][0]%2==p[i]:
        print(0)
        exit()
    elif bulb[i][0]%2==0:
        for j in range(0,bulb[i][0]+1,2):
            even = even + comb(bulb[i][0],j, exact=True)
            
        if len(bulb[i])==2:
            even = even/2
            
    else:
        for j in range(1,bulb[i][0]+1,2):
            odd = odd + comb(bulb[i][0],j, exact=True)
          
        if len(bulb[i])==2:
            odd = odd/2              

print(int(odd*even))

### FIXED CODE ###

n,m = map(int,input().split())
res = 0

q = []
for i in range(m):
    q.append(list(map(int,input().split())))
p = list(map(int,input().split()))

for s in range(2**n):
    judge = True
    for i in range(m):
        cnt = 0
        for j in range(1,len(q[i])):
            w = q[i][j]
            if s>>(w-1) &1 == 1:
                cnt += 1
        if cnt % 2 != p[i]:
            judge = False
    if judge:
        res += 1
print(res)
K = int(input())
S = input()

if len(S) =< K:
 print(S)
else:
 print(S[1:K+1])

### FIXED CODE ###

K = int(input())
S = input()
if len(S) <= K:
 print(S)
else:
 print(S[:K] + '...')
a,b = list(map(int, input().split()))
if a % 2 == 0:
  if a / 2 >= b:
    print("YES")
  else:
    print("NO")
else:
  if (a + 1) / 2 >= b:
    print("YES")
  else:
	print("NO")

### FIXED CODE ###

a,b = list(map(int, input().split()))
if a % 2 == 0:
    if a / 2 >= b:
        print("YES")
    else:
        print("NO")
else:
    if (a + 1) / 2 >= b:
        print("YES")
    else:
        print("NO")
l=[int(x) for x in input().split()]
cnt=0
x=0
y=0
b=0
for i in range(n):
    if(i+1!=l[i]):
        cnt+=1
        if(cnt==1):
            x=l[i]
        elif(cnt==2):
            y=l[i]
        elif(cnt>0):
            b=1
            break
if(b==1):
    print("NO")
elif(l[x-1]!=y and l[y-1]!=x):
    print("NO")
else:
    print("YES")
            

### FIXED CODE ###

n=int(input())
ordenado=[]
a =list(map(int,input().split()))
ordenado = sorted(a)
maiden=0
for i in range(n):
    if(a[i]==ordenado[i]):
        continue
    else:
        maiden=maiden+1
if(maiden==2 or maiden==0):
    print('YES')
else:
    print('NO')
# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = np.array(map(int, input().split()))


A = np.append(np.append([0], A), [0])
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += np.abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - np.abs(A[i + 1] - A[i]) - np.abs(A[i] - A[i - 1]) + np.abs(A[i + 1] - A[i - 1])
    print(partial_sum)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np
N = input()
A = map(int, input().split())
A = list(A)

A = [0] + A + [0]
total_sum = 0
for i in range(0, len(A) - 1):
    total_sum += abs(A[i + 1] - A[i])

for i in range(1, len(A) - 1):
    partial_sum = total_sum - abs(A[i + 1] - A[i]) - abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i - 1])
    print(partial_sum)
from typing import Tuple, List

def main()->None:
    # ヒント見たけど参考にしてない
    N, x = map(int, input().split())
    a:List[int] = list(map(int, input().split()))
    sorted_a:List[int] = sorted(a) # 小さい順にならべる
    count:int = 0 # 何回配ったか
    for d in sorted_a:
        x -= d
        if x < 0: # 持ってた量が配る総量より少なかった時
            break
        count += 1
    # ちょうど配れない、必要な量より多く持ってた時はおおもらう人が出てくる。
    # 幸福人数の最大を求めればいいから余りを全部一人にあげればいいから−１
    if x > 0:
        print(count-1)
    else: # ちょうどの時はcount=N,持ってた量が配る総量より少なかった時は配れた人数
        print(count)

if __name__ == "__main__":
    main()

### FIXED CODE ###



def main()->None:
    # 解説見た
    # 強さを弱い順に並べて、初めからN番目までは各チームの１番弱い人
    # N番から２N番は各チームで２番目に強い人
    N = int(input()) # team数
    a = list(map(int, input().split()))
    sorted_a = sorted(a)
    
    sum_a = 0 # ２番目の人の和
    range_N = range(N)
    for i in range(N):
        sum_a += sorted_a[3*N - 2*i - 2]
    print(sum_a)


if __name__ == "__main__":
    main()
a=[]
b=[]
for i in range(5):
    buf = int(input())
    a.append(buf)
    if buf%10 != 0:
        b.append(10-buf%10)
print(sum(a)+sum(b)-max(b))


### FIXED CODE ###

a=[]
b=[]
for i in range(5):
    buf = int(input())
    a.append(buf)
    if buf%10 != 0:
        b.append(10-buf%10)
if b:
    print(sum(a)+sum(b)-max(b))
else:
    print(sum(a))
# https://atcoder.jp/contests/agc028/tasks/agc028_a

import sys
# sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]
# Greatest Common Divisor(Euclidean algorithm)


def gcd(x: int, y: int) -> int:
    if x < y:
        x, y = y, x
    while y > 0:
        r = x % y
        x, y = y, r
    return x


# Least Common Multiple
def lcm(x: int, y: int) -> int:
    _gcd = gcd(x, y)
    return (x * y) // _gcd


def main():
    n, m = input_int_list()
    size = lcm(m, n)
    X = [None] * (size + 1)
    S = input()
    T = input()
    for i in range(n):
        X[i * (size // n) + 1] = S[i]
    for i in range(m):
        if X[i * (size // m) + 1] == T[i]:
            continue
        elif not X[i * (size // m) + 1]:
            X[i * (size // m) + 1] = T[i]
        else:
            print(-1)
            return
    print(size)
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

# https://atcoder.jp/contests/agc028/tasks/agc028_a

import sys
# sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]
# Greatest Common Divisor(Euclidean algorithm)


def gcd(x: int, y: int) -> int:
    if x < y:
        x, y = y, x
    while y > 0:
        r = x % y
        x, y = y, r
    return x


# Least Common Multiple
def lcm(x: int, y: int) -> int:
    _gcd = gcd(x, y)
    return (x * y) // _gcd


def main():
    n, m = input_int_list()
    _gcd = gcd(m, n)
    size = lcm(m, n)
    S = input()
    T = input()
    if S[::n // _gcd] == T[::m // _gcd]:
        print(size)
    else:
        print(-1)


if __name__ == "__main__":
    main()
import sys


sys.setrecursionlimit(10 ** 7)

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

E = []
for _ in range(N):
    x, h = map(int, input().split())
    E.append((x, h))


E = sorted(E, key=lambda x: x[0])

damage = 0
BOMB = defaultdict(int)
x = 0
ans = 0
for i in range(N):
    x, h = E[i]

    dlt = []
    for xd, d in BOMB.items():
        if x > xd:
            damage -= d
            dlt.append(xd)
    for dl in dlt:
        BOMB.pop(dl)

    h -= damage

    if h <= 0:
        continue
    xm = x + 2 * D
    cnt = -1 * (-h // A)
    damage += cnt * A
    BOMB[xm] = cnt * A
    ans += cnt

print(ans)


### FIXED CODE ###

import sys
from collections import defaultdict

sys.setrecursionlimit(10 ** 7)

N, D, A = map(int, input().split())
E = []
for _ in range(N):
    x, h = map(int, input().split())
    E.append((x, h))
    E.append((x+2*D, 0))

E = sorted(E, key=lambda x: (x[0], -x[1]))

for i in range(len(E)-1, -1, -1):
    x, h = E[i]
    if h != 0:
        xmax = x
        break

bomb = defaultdict(int)
damage = 0
ans = 0
for i in range(len(E)):
    x, h = E[i]

    if x > xmax:
        break

    # x+2D: damageをマイナス
    if h == 0:
        damage -= bomb[x]
        continue

    h -= damage

    if h <= 0:
        continue

    x = x + 2 * D
    cnt = -1 * (-h // A)
    damage += cnt * A
    bomb[x] = cnt * A
    ans += cnt

print(ans)
import fractions
import math

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

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

def chk(i):
    cnt=0
    while True:
        if i%2==0:
            i/=2
            cnt+=1
        else:
            break
    return cnt

flag=0
number=chk(A[0])
for i in A:
    if chk(i)!=number:
        print(0)
        flag=1

num=A[0]//2
if flag==0:
    for i in range(1,len(A)):
        num=lcm(num,A[i]//2)
        if num>m:
            num=0
            break
    print(math.ceil(m//num/2))



### FIXED CODE ###

import fractions
import math

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

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

def chk(i):
    cnt=0
    while True:
        if i%2==0:
            i/=2
            cnt+=1
        else:
            break
    return cnt

flag=0
number=chk(A[0])
for i in A:
    if chk(i)!=number:
        print(0)
        exit()

l = 1
for i in A:
    l = l * i//2 // fractions.gcd(l, i//2)
 
print((m // l + 1) // 2)

"""
num=A[0]//2
flag2=0
if flag==0:
    for i in range(1,len(A)):
        num=lcm(num,A[i]//2)
        if num>m:
            flag2=1
            break
    if flag2==1:
        print(0)
    else:
        print(math.ceil(m//num/2))
"""
n, k = map(int, input().split())

import math
ans = 0
for i in range(1, n+1):
    if i >= k:
        t = 0
    else:
        t = math.ceil(math.log2(k/i))
    #print(t)
    ans += (1/n)*((1/2)**t)
print(ans)


### FIXED CODE ###

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

ans = 0
for i in range(1, n+1):
  x = max(math.ceil(math.log2(k)-math.log2(i)), 0)
  # print(x)
  ans += (1/n) * ((1/2)**x)
print(ans)
import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10

r = np.array([a, b, c, d, e])
k = (r > 0).sum()
l = r[r != 0].min()
print(A + B + C + D + E + 10*(k-1) + l)

### FIXED CODE ###

import numpy as np
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
 
a = A % 10
b = B % 10
c = C % 10
d = D % 10
e = E % 10
 
aa = A // 10
bb = B // 10
cc = C // 10
dd = D // 10
ee = E // 10
 
r = np.array([a, b, c, d, e])
k = (r > 0).sum()
if k > 0:
  l = r[r != 0].min()
  print((aa + bb + cc + dd + ee) * 10 + 10*(k-1) + l)
else:
  print(A + B + C + D + E)