Harryxun/stf_run huggingface dataset:
data = []
try:
    while True:
        data.append(raw_input())

except EOFError:
        pass

for i in data:
    a, b, c, d, e, f = i.split()
    a, b, c, d, e, f = int(a), int(b), int(c), int(d), int(e), int(f)
    if abs(a) or abs(b) or abs(c) or abs(d) or abs(e) or abs(f) <= 1000:
        for j in range(-1000, 1001):
            if j != 0:
                y1 = (c - (a*j)) / float(b)
                y2 = (f - (d*j)) / float(e)
                if y1 == y2:
                    print "{:.3f} {:.3f}".format(j, y1)
                    break

### FIXED CODE ###

data = []
try:
    while True:
        data.append(raw_input())

except EOFError:
    pass

for i in data:
    a, b, c, d, e, f = map(float, (i.split()))
    if (abs(a) <= 1000
        and abs(b) <= 1000
        and abs(c) <= 1000
        and abs(d) <= 1000
        and abs(e) <= 1000
        and abs(f) <= 1000):
        y = (a*f - c*d) / (a*e - b*d)
        x = (c - b*y) / a
        print "{:.3f} {:.3f}".format(x, y)
def participants_maker(number_of_participates,point):
    return [point]*number_of_participates



def point_getter(participates,respondents):
    for i in range(len(respondents)):
        participates = list(map(lambda x : x-1, participates))
        participates[respondents[i]-1] += 1
    return participates

def discriminate_serviver(result_score):
    for i in range(len(result_score)):
        if result_score[i] <= 0:
            print("NO")
        else:
            print("YES")








def main():
    li = list(map(int,input().split()))
    respondents = [int(input()) for i in range(li[2])]
    participates = participants_maker(li[0],li[1])
    result_score = point_getter(participates,respondents)
    discriminate_serviver(result_score)


if __name__ == "__main__":
    main()


### FIXED CODE ###

S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Rainy":
    print("Sunny")
else:
    print("Rainy")
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a<k and k<=a+b 
  print(0,a+b-k)
else:
  print(0,0)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif a<k and k<=a+b:
  print(0,a+b-k)
else:
  print(0,0)
K = int(input())
A = int(input())
B = int(input())
""" K=4
A=5
B=7 """


if A==B:
    if A%K==0:
        print("OK")
    else:
        print("NG")

num=A
while num <= B:

    if num%K == 0:
        print("OK") 
        exit()
    if num==B:
        print("NG")
        exit()
    num += 1


### FIXED CODE ###

k=int(input())
a,b= map(int, input().split())
q=0
 
for i in range(1,1000):
  if a<=k*i and k*i<=b:
    print('OK')
    q=1
    break
 
if q==0:
  print('NG')
a, b = map(int, input().split())
print'No' if a%2==0 or b%2==0 else 'Yes'

### FIXED CODE ###

a, b = map(int, input().split())
print('No' if a%2==0 or b%2==0 else 'Yes')
n, m = map(int, input().split())
lrs = [list(map(int, input().split())) for _ in range(m)]

l_max = 1
r_min = n
for l, r in lrs:
    l_max = max(l, l_max)
    r_min = min(r, r_min)

print(min(r_min - l_max + 1), 0)


### FIXED CODE ###

n, m = map(int, input().split())
lrs = [list(map(int, input().split())) for _ in range(m)]

l_max = 1
r_min = n
for l, r in lrs:
    l_max = max(l, l_max)
    r_min = min(r, r_min)

print(max(r_min - l_max + 1, 0))
n,x=map(int,input().split())
l=list(map(int, input().split()))
d=0
dlist=[]
dlist.append(0)
for i in range(2,n+2):
    d=d+l[i-1]
    if d <= x:
        dlist.append(d)
print(len(dlist))


### FIXED CODE ###

n,x=map(int,input().split())
l=list(map(int, input().split()))
d=0
dlist=[]
dlist.append(0)
for i in range(1,n+1):
    d=d+l[i-1]
    if d <= x:
        dlist.append(d)
print(len(dlist))
a, b = list(map(int, input()))

print(a*b)

### FIXED CODE ###

a, b = list(map(int, input().split()))
print(a*b)
ii=lambda:int(input())
miis=lambda:map(int,input().split())
lmiis=lambda:list(:map(int,input().split()))

a,b=miis()
print(a+b if b%a==0 else b-a)

### FIXED CODE ###

A, B = map(int, input().split())

if B % A ==0:
    print(A + B)
else:
    print(B - A)
n = int(input())
b = list(map(int, input().split()))
a = [b[0], b[n-1]]
for i in range(n-2):
    a.append(min(b[i:i+2]))
print(sum(a))

### FIXED CODE ###

n = int(input())
b = list(map(int, input().split()))
a = [b[0], b[n-2]]
for i in range(n-2):
    a.append(min(b[i:i+2]))
print(sum(a))
n = int(input())
a = []
for i in range(n):
  a.append(input().split())
  a[i][0] = int(a[i][0])
  a[i][1] = int(a[i][1])
b = []
d = []
e = []
a.sort()
dic = {}
for i in range(n-1):
  if [a[i+1][0] - a[i][0], a[i+1][1] - a[i][1]] not in d:
    d.append([a[i+1][0] - a[i][0], a[i+1][1] - a[i][1]])
    e.append(1)
  else:
    e[d.index([a[i+1][0] - a[i][0], a[i+1][1] - a[i][1]])] += 1
# f = d[e.index(max(e))]
# p = f[0]
# q = f[1]
print(n-max(e))

### FIXED CODE ###

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

if k == 1:
  print(0)
else:
  print(n-k)
import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  #resource.setrlimit(RLIMIT_STACK, (128*1024*1024,hard))

def dfs(i,fromup):
    y[i] = fromup + v[i]
    for d in dst[i]:
        dfs(d,y[i])

n,q = inm()
dst = [ [] for i in range(n) ]
for i in range(n-1):
    a,b = inm()
    a -= 1
    b -= 1
    dst[a].append(b)
v = [0]*n
for i in range(q):
    p,x = inm()
    p -= 1
    v[p] += x
y = [0]*n
dfs(0,0)
for i in range(n):
    printn((' ' if i>0 else '') + str(y[i]))
print("")


### FIXED CODE ###

import sys,resource
from collections import deque
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inm   = lambda:      map(int, input().split())
DBG = True # and False
R = 10**9 + 7

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(resource.RLIMIT_STACK)
  # setrlimit works on ubuntu (and atcoder), but not on WSL
  resource.setrlimit(resource.RLIMIT_STACK, (256*1024*1024,hard))

n,q = inm()
dst = [ [] for i in range(n) ]
for i in range(n-1):
    a,b = inm()
    a -= 1
    b -= 1
    dst[a].append(b)
v = [0]*n
for i in range(q):
    p,x = inm()
    p -= 1
    v[p] += x
y = [0]*n

d = deque([])
d.append(0)
while len(d)>0:
    i = d.popleft()
    for j in dst[i]:
        v[j] += v[i]
        d.append(j)

for i in range(n):
    printn((' ' if i>0 else '') + str(v[i]))
print("")
N = int(input())
X = input()
def popcount(k):
    return bin(k).count('1')

K = int(X, 2)
one = popcount(K)
K_MOD   = K % one
K_MOD_M = K % (one-1)
K_MOD_P = K % (one+1)
#print('k_mod_m=', K_MOD_M)
#print('k_mod_p=', K_MOD_P)
T = 2**(N-1)
for i in range(N):
    if X[i] == '1':
        pop = one - 1
        k = K_MOD_M - T
    else:
        pop = one + 1
        k = K_MOD_P + T
    k %= pop

    if pop == 0:
        print(0)
    else:
        ans = 1
        #print('  ', k, pop, ans)
        pop = popcount(k)
        while k > 0:
            k %= pop
            pop = popcount(k)
            ans += 1
            #print('  ', k, pop, ans)
        print(ans)
        T //= 2


### FIXED CODE ###

N = int(input())
X = input()
memo = [-1] * (N+1)
memo[0] = 0

def popcount(k):
    return bin(k).count('1')

def calc(k):
    pop = popcount(k)
    #print('  ', k, pop)
    key = k
    if memo[key] < 0:
        k %= pop
        if k == 0:
            memo[key] = 1
        else:
            memo[key] = calc(k) + 1
    return memo[key]

K = int(X, 2)
one = popcount(K)
if one == 0:
    K_MOD = K
elif one == 1:
    K_MOD   = 0
    K_MOD_M = K
else:
    K_MOD   = K % one
    K_MOD_M = K % (one-1)
K_MOD_P = K % (one+1)

T_M = [1]*(N+1)
T_P = [1]*(N+1)
for i in range(1,N+1):
    if one > 1:
        T_M[i] = (T_M[i-1]*2) % (one-1)
    T_P[i] = (T_P[i-1]*2) % (one+1)

for i in range(N):
    if X[i] == '1':
        pop = one - 1
        k = K_MOD_M - T_M[N-i-1]
    else:
        pop = one + 1
        k = K_MOD_P + T_P[N-i-1]

    if pop == 0:
        print(0)
    else:
        k %= pop
        print(calc(k)+1)
import math

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

print((a * b) // math.gcd(a, b))

### FIXED CODE ###

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

print(6-a-b)
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

# -*- coding: utf-8 -*-


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, n, r):
        """
        nPrの値を返す
        """
        ret = self.f[n] * self.inv[n-r]
        ret %= self.mod
        return ret


X, Y = map(int, input().split())

y = (2*Y-X)/3
x = (2*X-Y)/3
F = FactMod(x+y, 10**9+7)

if 0 <= x and x == int(x) and 0 <= y and y == int(y):
    ans = F.comb(x+y, x)
else:
    ans = 0
print(ans)


### FIXED CODE ###


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

# -*- coding: utf-8 -*-


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, n, r):
        """
        nPrの値を返す
        """
        ret = self.f[n] * self.inv[n-r]
        ret %= self.mod
        return ret


X, Y = map(int, input().split())

x = (2*Y-X)/3
y = (2*X-Y)/3

if 0 <= x and x == int(x) and 0 <= y and y == int(y):
    x = int(x)
    y = int(y)
    F = FactMod(x+y+1, 10**9+7)
    ans = F.comb(x+y, x)
else:
    ans = 0
print(ans)
n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
    l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
    cheby.append(l)

xmax = 1
xmin = 10**9
ymax = 1
ymin = 10**9
for i in range(n):
    if cheby[i][0] >= xmax :
        xmax = cheby[i][0]
        xa = i
    if cheby[i][0] <= xmin :
        xmin = cheby[i][0]
        xi = i
    if cheby[i][1] >= ymax :
        ymax = cheby[i][1]
        ya = i
    if cheby[i][1] <= ymin :
        ymin = cheby[i][1]
        yi = i

if abs(xmax-xmin) > abs(ymax-ymin):
    print(abs(xy[xa][0]-xy[xi][0])+abs(xy[xa][1]-xy[xi][1]))
else :
    print(abs(xy[ya][0]-xy[yi][0])+abs(xy[ya][1]-xy[yi][1]))


### FIXED CODE ###

n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
    l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
    cheby.append(l)

xmax = -10**10
xmin = 10**10
ymax = -10**10
ymin = 10**10
for i in range(n):
    if cheby[i][0] > xmax :
        xmax = cheby[i][0]
        xa = i
    if cheby[i][0] < xmin :
        xmin = cheby[i][0]
        xi = i
    if cheby[i][1] > ymax :
        ymax = cheby[i][1]
        ya = i
    if cheby[i][1] < ymin :
        ymin = cheby[i][1]
        yi = i

if abs(xmax-xmin) > abs(ymax-ymin):
    print(abs(xy[xa][0]-xy[xi][0])+abs(xy[xa][1]-xy[xi][1]))
else :
    print(abs(xy[ya][0]-xy[yi][0])+abs(xy[ya][1]-xy[yi][1]))
N = int(input())
s = [input() for _ in range(N)]
 
import collections
sortedList = [''.join(sorted(x)) for x in s]
countNum = list(collections.Counter(sortedList).values())
 
import sys
sys.setrecursionlimit(10000000)

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

count = 0
memo = [0]*10**4
for n in countNum:
    if n!=1:
        if memo[n] == 0:
            memo[n] = cmb(n, 2)
        count += memo[n]

print(count)

### FIXED CODE ###

N = int(input())
s = [input() for _ in range(N)]
 
import collections
sortedList = [''.join(sorted(x)) for x in s]
countNum = list(collections.Counter(sortedList).values())
 
import sys
sys.setrecursionlimit(100000000)
 
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
  
count = 0
memo = [0]*10**6
for n in countNum:
    if n!=1:
        if memo[n] == 0:
            memo[n] = cmb(n, 2)
        count += memo[n]
        
print(count)
n = int(input())
ans = 0
for i in range(n):
  a = int(input())
  ans += 1 / a;
print(1 / ans)

### FIXED CODE ###

n = int(input())
ans = 0
lis = list(map(int, input().split()))
for i in lis:
  ans += 1 / i;
print(1 / ans)
from collections import defaultdict

n=int(input())
dct=defaultdict(list)

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

q,k=map(int,input().split())
lk=[0]*(n)

def dfs(v,p,d):
  lk[v-1]=d
  for l in dct[v]:
    if l[0]==p:
      continue
    dfs(l[0],v,d+l[1])
  return

dfs(k,-1,0)


for i in range(q):
  x,y=map(int,input().split())
  print(lk[x-1]+lk[y-1])
  
  
  
  
  
  


### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(10**9)

n=int(input())
dct=defaultdict(list)

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


q,k=map(int,input().split())
lk=[0]*(n)

def dfs(v,p,d):
  lk[v-1]=d

  for l in dct[v]:
    if l[0]==p or lk[l[0]-1]!=0:
      continue
    else:
      dfs(l[0],v,d+l[1])
  return

dfs(k,-1,0)



for i in range(q):
  x,y=map(int,input().split())
  print(lk[x-1]+lk[y-1])
x = input()
if x >= 30:
  print("Yes")
else:
  print('No')

### FIXED CODE ###

x = int(input())
if x >= 30:
  print("Yes")
else:
  print("No")
p = int(input())


def div(a, b):
    n = len(a)
    m = len(b)
    res = [0] * (n - m + 1)
    for i in range(n - m, -1, -1):
        t = a[i + m - 1] * pow(b[-1], p - 2, p) % p
        res[i] = t
        for j in range(m):
            a[i + j] = (a[i + j] - t * b[j]) % p
    return res


a = list(map(int, input().split()))
ans = [0] * p
f = [0] * (p + 1)
f[0] = 1
for i in range(p):
    for j in range(p, 0, -1):
        f[j] += f[j - 1]
        f[j - 1] = -f[j - 1] * i
        f[j] %= p
for i in range(p):
    if a[i] == 1:
        fm = div(f.copy(), [-i, 1])
        t = 1
        r = 0
        for j in range(len(fm)):
            r += fm[j] * t
            t = t * i % p
        for j in range(len(fm)):
            ans[j] += fm[j] * pow(r, p - 2, p) % p
for i in range(p):
    ans[i] %= p
print(' '.join(map(str, ans)))


### FIXED CODE ###

p = int(input())


def div(a, b):
    n = len(a)
    m = len(b)
    res = [0] * (n - m + 1)
    tmp = pow(b[-1], p - 2, p)
    for i in range(n - m, -1, -1):
        t = a[i + m - 1] * tmp % p
        res[i] = t
        for j in range(m):
            a[i + j] = (a[i + j] - t * b[j]) % p
    return res


a = list(map(int, input().split()))
ans = [0] * p
f = [0] * (p + 1)
f[0] = 1
for i in range(p):
    for j in range(p, 0, -1):
        f[j] += f[j - 1]
        f[j - 1] = -f[j - 1] * i
        f[j] %= p
for i in range(p):
    if a[i] == 1:
        fm = div(f[:], [-i, 1])
        t = 1
        r = 0
        for v in fm:
            r += v * t
            t = t * i % p
        t = pow(r, p - 2, p)
        for j in range(len(fm)):
            ans[j] += fm[j] * t
for i in range(p):
    ans[i] %= p
print(' '.join(map(str, ans)))
n = int(input())
ans = 1
for i in range(1,1001):
    for j in range(2,1001):
        if i**j > n:
            break
        if ans < i**j =< n:
            ans = i**j
print(ans)    

### FIXED CODE ###

n = int(input())
ans = 1
for i in range(1,1001):
    for j in range(2,1001):
        if i**j > n:
            break
        if ans < i**j <= n:
            ans = i**j
print(ans)
n = raw_input()
nums = map(int, raw_input().split()).reverse
print " ".join(map(str, nums))

### FIXED CODE ###

n = raw_input()
nums = map(int, raw_input().split())
nums.reverse()
print " ".join(map(str, nums))
I'm Yata Ryuichi.

### FIXED CODE ###

import math

def calc(H, T, a, b):
    cnt = 0
    for h in H:
        if (h -b*T) >= 0:
            cnt += math.ceil((h - b * T) / (a - b))
    if cnt <= T:
        return True
    else:
        return False

tmp = [int(n) for n in input().split()]
a = tmp[1]
b = tmp[2]
H = []

H = sorted([int(input()) for i in range(tmp[0])])[::-1]
minT = 0
maxT = math.ceil(H[0] / b)
T = int((maxT + minT) / 2)

while True:
    T = math.ceil((maxT + minT) / 2)
    if calc(H, T, a, b):
        maxT = T
    else:
        minT = T
    if maxT - minT <= 1:
        break
print(maxT)
n=int(input())
a=list(map(int,input(),split()))

print(' '.join(map(str,a)))

for i in range(1,n):
	v=a[i]
	j=i-1
	while j>=0 and a[j]>v:
		a[j+1]=a[j]
		j=j-1
	a[j+1]=v
	print(' '.join(map(str,a)))


### FIXED CODE ###

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

for i in range(n):
	v=a[i]
	j=i-1
	while j>=0 and a[j]>v:
		a[j+1]=a[j]
		j=j-1
	a[j+1]=v
	print(' '.join(map(str,a)))
n = int(input())
ls = list(map(int, input().split(' ')))
ans = 1
m = max(set(ls))
d = {}
for l in ls:
    d[l] = d.get(l, 0) + 1
if ans != 0:
    for i in range(1, m+1):
        if d.get(i, 0) == 0:
            ans = 0
            break
        ans = (ans * (d[i-1] ** d[i])) % 998244353
print(ans)


### FIXED CODE ###

n = int(input())
ls = list(map(int, input().split(' ')))
m = max(set(ls))
d = {}
for l in ls:
    d[l] = d.get(l, 0) + 1
ans = 0 if (ls[0] != 0 or d.get(0) >= 2) else 1
for i in range(1, m+1):
    if i not in d:
        ans = 0
    ans = (ans * (d.get(i-1, 0) ** d.get(i, 0))) % 998244353 
print(ans)
s=input()
count1=0
for i in range(0,len(s)-1,2):
  if s[i]=='0':
    count+=1
  if s[i+1]=='1':
    count+=1
if len(s)%2==1:
  if s[len(s)-1]=='0':
    count+=1
print(min(count,len(s)-count))

### FIXED CODE ###

s=input()
count=0
for i in range(0,len(s)-1,2):
  if s[i]=='0':
    count+=1
  if s[i+1]=='1':
    count+=1
if len(s)%2==1:
  if s[len(s)-1]=='0':
    count+=1
print(min(count,len(s)-count))
# -*- coding: utf-8 -*-

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

abs_A = [abs(A[i]) for i in A]
ans = 0
if N % 2 == 0:
    ans = sum(abs_A)
else:
    ans = sum(abs_A) - 2*min(abs_A)

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-

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

cnt = 0
abs_A = []
for i in range(N):
    if A[i] < 0:
        cnt += 1
        abs_A.append(-A[i])
    else:
        abs_A.append(A[i])
ans = sum(abs_A)
if cnt % 2 != 0:
    ans -= 2*min(abs_A)

print(ans)
inp = lambda cast=int: list(map(cast, input().split()))
printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
n, = inp()
A = [0.0] + inp(float)
dp = [[0.0 for _ in range(n + 1)] for _ in range(n + 1)]
res = 0.0
for i in range(n + 1):
    for j in range(n + 1):
        if i == 0:
            dp[i][j] = 1 if j == 0 else 0
        elif j == 0:
            dp[i][j] = dp[i-1][j] * (1 - A[i])
        else:
            dp[i][j] = dp[i-1][j] * (1 - A[i]) \
                       + dp[i-1][j-1] * A[i]
        if i == n and j > n/2:
            res += dp[i][j]
printf(res)

### FIXED CODE ###

inp = lambda cast=int: list(map(cast, input().split()))
# printf = lambda s='', *args, **kwargs: print(str(s).format(*args), flush=True, **kwargs)
n, = inp()
A = [0.0] + inp(float)
dp = [[0.0 for _ in range(n + 1)] for _ in range(n + 1)]
res = 0.0
for i in range(n + 1):
    for j in range(n + 1):
        if i == 0:
            dp[i][j] = 1 if j == 0 else 0
        elif j == 0:
            dp[i][j] = dp[i-1][j] * (1 - A[i])
        else:
            dp[i][j] = dp[i-1][j] * (1 - A[i]) \
                       + dp[i-1][j-1] * A[i]
        if i == n and j > n/2:
            res += dp[i][j]
print(res)
def solve(array, k):
    if len(array) <= 1:
        return 0
    if array[0] == array[1]:
        return solve(array[1:], k)
    if len(array) <= k:
        return 1
    return 1 + solve([min(array[:k])] + array[k:], k)

if __name__ == "__main__":
    n, k = map(int, input().split())
    array = [int(s) for s in input().split()]
    print(solve(array, k))

### FIXED CODE ###

def solve(n, k):
    div, mod = divmod(n - 1, k - 1)
    return div + (0 if mod == 0 else 1)

if __name__ == "__main__":
    n, k = map(int, input().split())
    array = [int(s) for s in input().split()]
    print(solve(n, k))
s=0
i=0
j=0
n,m,k=(int(x) for x in input().split())
a=[]
a = list(map(int, input().split()))
b=[]
b = list(map(int, input().split()))

if n<=m:
	l=m
else:
	l=n


for ind in range(0,l):
	if s>k:break;
	if a[i]<=b[j]:
		s+=a[i]
		i=i+1
	else:
		s+=b[j]
		j=j+1



print(i+j-1)

### FIXED CODE ###

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

a,b = [0], [0]

for i in range(N):
	a.append(a[i] + A[i])
for i in range(M):
	b.append(b[i] + B[i])

j=M
ans = 0
for i in range(N+1):
	if a[i]>K:
		break
	while K-a[i] < b[j]:
		j-=1
	ans=max(ans,i+j)

print(ans)
n = int(input())
s = input()

arr = []

for i in range(n-1):
    if s[i] != s[i+1]:
        arr.append(s[i])
        

if s[-1] != s[-2]:
    arr.append(s[-1])

c = len("".join(arr))

if c == 0:
    print(1)
else:
    print(c)




### FIXED CODE ###

n = int(input())
s = input()

arr = []
arr.append(s[0])
for i in range(n-1):
    if s[i+1] != s[i]:
        arr.append(s[i+1])


c = len(arr)
print(c)
x = input()
if x is "1":
    print("Hello World")
elif x is "2":
    a, b = [int(s) for s in input().split()]
    print(a+b)

### FIXED CODE ###

x = input()
if x is "1":
    print("Hello World")
elif x is "2":
    a = int(input())
    b = int(input())
    print(a+b)
n, k = [int(x) for x in input().split(' ')]
frei = [int(x) for x in input().split(' ')]

ans = 0
for x int frie:
  if x >= k:
    ans += 1
print(ans)
     

### FIXED CODE ###

n, k = [int(x) for x in input().split(' ')]
frei = [int(x) for x in input().split(' ')]

ans = 0
for x in frei:
    if x >= k:
        ans += 1
print(ans)