Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 7)
read = sys.stdin.buffer.read 
inp = sys.stdin.buffer.readline
 
from numba import njit
import numpy as np
@njit
def resolve():
    N, K = map(int, inp().split())
    A = np.array(list(map(int, inp().split())), np.int64)
 
    for _ in range(K):
        imos_table = np.zeros(N + 1, np.int64)
        for i, a in enumerate(A):
            # 配列の個数を超えないように注意
            imos_table[max(i - a, 0)] += 1
            imos_table[min(i + a + 1, N)] -= 1
        A = np.cumsum(imos_table)[:-1]
        if np.all(A == N):
            print(*A)
            return
    else:
        print(*A)
        
if __name__ == "__main__":
    resolve()

### FIXED CODE ###


from itertools import accumulate
def resolve():

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

    for _ in range(K):
        imos_table = [0]*(N+1)
        for i, a in enumerate(A):
            # 配列の個数を超えないように注意
            imos_table[max(i - a, 0)] += 1
            imos_table[min(i + a + 1, N)] -= 1
        A = list(accumulate(imos_table))[:-1]
        if all([True if a == N else False for a in A]):
            print(*A)
            return
    else:
        print(*A)

if __name__ == "__main__":
    resolve()
n = int(input())
v = [int(input()) for _ in range(n)]
c = [int(input()) for _ in range(n)]
result = 0
for i in range(n):
  if v[i] > c[i]:
    result += v[i] - c[i]
print(result)


### FIXED CODE ###

n = int(input())
v = [int(e) for e in input().split()]
c = [int(e) for e in input().split()]
result = 0
for i in range(n):
  if v[i] > c[i]:
    result += v[i] - c[i]
print(result)
from sys import stdin
from collections import Counter

input = stdin.readline

n = int(input())
xy = [tuple(map(int, input().split())) for _ in range(n)]

l = []
append = l.append
for i in range(n):
  for j in range(n):
    if not i == j:
      append((xy[j][0]-xy[i][0], xy[j][1]-xy[i][1]))
c = Counter(l)
print(n-c.most_common()[0][1])

### FIXED CODE ###

from sys import stdin
from collections import Counter

input = stdin.readline

n = int(input())
if n == 1:
  print(1)
  exit()

xy = [tuple(map(int, input().split())) for _ in range(n)]

l = []
append = l.append
for i in range(n):
  for j in range(n):
    if not i == j:
      append((xy[j][0]-xy[i][0], xy[j][1]-xy[i][1]))
c = Counter(l)
print(n-c.most_common()[0][1])
h, w = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
a = [[] for i in range(h)]
for i in range(h):
    a[i] = input()

d = [[0, -1], [1, 0], [0, 1], [-1, 0]]
ans = 0
stock 
root_list = []
def dfs(start_h, start_w, r2):
    a[start_h][start_w] = '#'
    if (start_h==Dh) && (start_w==Dw):
        return True
    for i in range(-2, 3):
        for j in range(-2, 3):
            if ((i<-1)||(i>1)) && ((j<-1)||(j>1)):
                s_h = start_h+i; s_w = start_w+j
                if(0<=(start_h+i)<h) && (0<=(start_w+j)<w):
                    if a[s_h][s_w]=='.':
                        root_list.append([s_h, s_w, ans])
    for i in d:
        next_h=start_h+i[0]; next_w=start_w+i[1]
        if(0<=next_h<h) && (0<=next_w<w) && (a[next_h][next_w]=='.')):
            dfs(next_h, next_w, root_list)
def main():
    if(dfs(Ch, Cw, 0)):
        print(0)
        return
    while root_list:
        r0 = root_list[0][0]; r1 = root_list[0][1]; r2=root_list[0][2]+1
        root_list.pop(0)
        if a[r0][r1] == '.':
            root_list[2]
            if dfs(r0, r1, r2):
                print(r2)
                break
    print(-1)
main()

### FIXED CODE ###

from collections import deque

def inc(y, x):
	return 0 <= y < H and 0 <= x < W

H, W = map(int, input().split())
Sy, Sx = map(int, input().split())
Gy, Gx = map(int, input().split())
"""
a = [[] for i in range(h)]
for i in range(h):
    a[i] = input()
"""
a = [input() for i in range(H)]

DH = [1, 0, -1, 0]
DW = [0, 1, 0, -1]

#同じ大きさの行列を作って最短路をメモする発想がなかった
visit = [[1e8 for i in range(W)] for j in range(H)]
visit[Sy-1][Sx-1]=0 #sy-1, sx-1に注意
deq = deque([(Sy-1, Sx-1)])

while deq:
    h, w = deq.pop()
    for dh, dw in zip(DH, DW):
        x = w+dw; y=h+dh
        if inc(y, x)==False or a[y][x]=='#':
            continue
        if visit[y][x] > visit[h][w]:
            visit[y][x] = visit[h][w]
            deq.append((y,x))
    for dh in range(-2, 3):
        for dw in range(-2, 3):
            if inc(h+dh, w+dw)==False or a[h+dh][w+dw]=='#':
                continue
            if visit[h+dh][w+dw] > visit[h][w]+1: 
                visit[h+dh][w+dw] = visit[h][w]+1
                deq.appendleft((h+dh, w+dw))
if visit[Gy-1][Gx-1] == 1e8:
    print(-1)
else:
    print(visit[Gy-1][Gx-1])
n, m = map(int, input().split())
a = list(map(int, input().split()))

for i in range(n):
    a[i] = a[i]/2
    

def calc(n):
    ret = 0
    while n%2 == 0:
        ret +=1
        n/=2
    return ret


flag = True
t = 0
for i in range(n-1):
    t = 2**calc(a[i])
    if calc(a[i]) == calc(a[i+1]):
        continue
    else:
        flag = False
        print(0)
        exit()

a = [a[i]//t for i in range(n)]

def gcd(a, b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b)

gcd_a = a[0]
for i in range(1,n):
    p = max(gcd_a, a[i])
    q = min(gcd_a, a[i])
    gcd_a = gcd_a*a[i]//gcd(p, q)
print("gcd_a", gcd_a)

if flag:
    if (m//gcd_a)%2 == 0:
        print((m//gcd_a)//2)
    else:
        print((m//gcd_a+1)//2)

else:
    print(0)


### FIXED CODE ###

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

for i in range(n):
    a[i] = a[i]//2
    
# print(a)
def calc(n):
    ret = 0
    while n%2 == 0:
        ret +=1
        n//=2
    return ret


flag = True
t = 0
for i in range(n-1):
    t = 2**calc(a[i])
    if calc(a[i]) == calc(a[i+1]):
        # print(calc(a[i]),calc(a[i+1]))
        continue
    else:
        flag = False
        break


def gcd(a, b):
    if a%b == 0:
        return b
    else:
        return gcd(b, a%b)



if flag:
    lcm = 1
    for i in range(n):
        p = max(lcm, a[i])
        q = min(lcm, a[i])
        lcm = lcm*a[i]//gcd(p, q)
        # print(lcm)
    if (m//lcm)%2 == 0:
        print(int((m//lcm)//2))
    else:
        print(int((m//lcm+1)//2))

else:
    print(0)
# import sys
# sys.setrecursionlimit(10**7)
import copy

from math import gcd

def main():
    # def gcd(a, b):
    #     if b == 0:
    #         return a
    #     else:
    #         return gcd(b, a%b)

    def lcm(a, b):
        return int(a / gcd(a, b)) * b
    
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    A_ = copy.deepcopy(A)
    a_ = A.pop()
    for a in A:
        a_lcm = lcm(a_, a)
        a_ = a_lcm
    for i in A_:
        if a_lcm / 2 % i == 0:
            print(0)
            exit()
    if a_lcm / 2 > m:
        print(0)     
    else:
        ans = int((m - (a_lcm / 2))) // a_lcm + 1
        print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import copy
# from math import gcd


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def lcm(a, b):
    return (a // gcd(a, b)) * b
def main():
    n, m = map(int, input().split())
    A = set([int(x) for x in input().split()])
    a_lcm = 1
    for a in A:
        a_lcm = lcm(a_lcm, a)
        # mがlcmの半分よりも小さかったら0
        if (a_lcm / 2) > m:
            print(0)
            exit()
    for a in A:
        if (a_lcm / 2) % a == 0:
            print(0)
            exit()
    # # あとは定数倍の数調べて終わり
    ans = int((m - (a_lcm / 2)) // a_lcm) + 1
    print(ans)

if __name__ == '__main__':
    main()
r = raw_input()
l = float(math.pi)*2*r
s =float(math.pi)*r**2 
print'l s' % (r)

### FIXED CODE ###

import math
r = float(raw_input())
l = math.pi*2*r
s = math.pi*r**2
print'%f %f' % (s, l)
L,R = map(int,input().split())
 
if R - L >2019:
  print(2)
else:
  ans = 2019
  for i in range(L,R-1):
    a = (i*(i+1))%2019
    ans = min(ans,a)
  print(a)

### FIXED CODE ###

L,R = map(int,input().split())
ans = float('inf')
for i in range(L,R):
  for j in range(i+1,R+1):
    if (i*j)%2019==0:
      print(0)
      exit()
    ans = min(ans,(i*j)%2019)
print(ans)
n, c, *t = map(int, open(0).read().split())
right = [0]
left = [0]
sushi = tuple([(0, 0)]) + tuple(zip(t[::2], t[1::2])) + tuple([(c, 0)])
for i in range(1, n + 1):
    x, v = sushi[i]
    y = sushi[i - 1][0]
    cost = right[-1] + v - (x - y)
    right.append(cost)
    x, v = sushi[n + 1 - i]
    y = sushi[n + 2 - i][0]
    cost = left[-1] + v - (y - x)
    left.append(cost)
ans = max(*right, *left)
right_max = right[:]
left_max = left[:]
for i in range(1, n + 1):
    right_max[i] = max(right_max[i], right_max[i - 1])
    left_max[i] = max(left_max[i], left_max[i - 1])
for i in range(1, n + 1):
    ans = max(ans, \
            right[i] - sushi[i][0] + left_max[n - i], \
            left[i] - c + sushi[n + 1 - i][0] + right_max[n - i])
print(ans)

### FIXED CODE ###

n, c, *t = map(int, open(0).read().split())
right = [0]
left = [0]
sushi = tuple([(0, 0)]) + tuple(zip(t[::2], t[1::2])) + tuple([(c, 0)])
for i in range(1, n + 1):
    x, v = sushi[i]
    y = sushi[i - 1][0]
    cost = right[-1] + v - (x - y)
    right.append(cost)
    x, v = sushi[n + 1 - i]
    y = sushi[n + 2 - i][0]
    cost = left[-1] + v - (y - x)
    left.append(cost)
ans = max(right + left)
right_max = right[:]
left_max = left[:]
for i in range(1, n + 1):
    right_max[i] = max(right_max[i], right_max[i - 1])
    left_max[i] = max(left_max[i], left_max[i - 1])
for i in range(1, n + 1):
    ans = max(ans, \
            right[i] - sushi[i][0] + left_max[n - i], \
            left[i] - c + sushi[n + 1 - i][0] + right_max[n - i])
print(ans)
N = int(input())
A = list(map(int, input().split()))

ans = (A[0] * A[1]) / (A[0] + A[1])

for i in range(2, N):
    ans += (ans * A[i]) / (ans + A[i])

print(ans)

### FIXED CODE ###

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

ans = 0

for i in range(N):
    ans += 1 / A[i]

print(1/ans)
# | A - K | = | B - K |
raw = raw_input().split()
A = int(raw[0])
B = int(raw[1])

up = (A**2-B**2)
down = (2 * ( A-B ))

if up % down == 0:
	print(up/down)
else:
	print("IMPOSSIBLE")

### FIXED CODE ###

# | A - K | = | B - K |
A, B = map(int, input().split())

up = (A**2-B**2)
down = (2 * ( A-B ))

if up % down == 0:
	print(int(up/down))
else:
	print("IMPOSSIBLE")
import math
while True:
    try:
        a,b = map(int,input().split())
        gcd = math.gcd(a,b)
        lcm = a*b /gcd
        print(gcd,int(lcm))
    except EOFError:
        break

### FIXED CODE ###

while True:
    try:
        As,Bs = map(int,input().split())
        a,b = As, Bs
        while True:
            if a % b == 0:
                gcd = b
                break
            a,b = b, a % b
        print(gcd,int(As * Bs / gcd))
    except EOFError:
        break
while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0:
        break
    elif x => y:
        print (y,x)
    else:
        print (x,y)

### FIXED CODE ###

while True:
    x,y = map(int, input().split())
    if x == 0 and y == 0 :
        break
    elif x <= y :
        print (x,y)
    else :
        print (y,x)
from functools import lru_cache


@lru_cache(maxsize=None)
def rec(i, j, k):
    if i < 0 or j < 0 or k < 0:
        return 0.0
    if i == 0 and j == 0 and k == 0:
        return 0.0
    return (rec(i-1, j, k)*i + rec(i+1, j-1, k) * j +
            rec(i, j+1, k-1) * k + N) / (i + j + k)


def main():
    global N
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    print(rec(single, double, triple))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    dp = [[[0 for i in range(1+single+double+triple-j-k)]
           for j in range(double + triple + 1 - k)] for k in range(triple + 1)]
    for k in range(triple+1):
        for j in range(double + triple + 1-k):
            for i in range(1+single+double+triple-j-k):
                if i == 0 and j == 0 and k == 0:
                    continue
                first = second = third = 0
                if i-1 >= 0 and j >= 0 and k >= 0:
                    first = dp[k][j][i-1]
                if i+1 >= 0 and j-1 >= 0 and k >= 0:
                    second = dp[k][j - 1][i+1]
                if i >= 0 and j+1 >= 0 and k-1 >= 0:
                    third = dp[k-1][j + 1][i]
                dp[k][j][i] = (first*i + second * j +
                               third * k + N) / (i + j + k)
    print(dp[triple][double][single])


if __name__ == "__main__":
    main()
x,y = map(int,input().split())
p = 10**9+7
from math import factorial
if (x+y)%3 != 0:
    print(0)
    exit()



ans = 1
for i in range(0,x//2+2):
    j = x - 2*i
    if 2*j + i == y:
        a = i
        b = j
        break
print(((factorial(a+b)%p)*pow(factorial(a),-1,mod = p)*pow(factorial(b),-1,mod = p))%p)
'''
for i in range(1,a+b+1):
    ans *= i%p
ans %= p

a_inv = 1
for i in range(1,a+1):
    a_inv *= i%p
a_inv %= p
a_inv = pow(a_inv,p-2,p)

b_inv = 1
for i in range(1,b+1):
    b_inv *= i%p
b_inv %= p
b_inv = pow(b_inv,p-2,p)

ans *= (a_inv*b_inv)%p

print(ans)
'''

### FIXED CODE ###

x,y = map(int,input().split())
p = 10**9+7
from math import factorial


if (x+y)%3 != 0:
    print(0)
    exit()



ans = 1
for i in range(0,x//2+2):
    j = x - 2*i
    if 2*j + i == y:
        a = i
        b = j
        break
else:
    print(0)
    exit()

for i in range(1,a+b+1):
    ans *= i%p
    ans %= p
ans %= p

a_inv = 1
for i in range(1,a+1):
    a_inv *= i%p
    a_inv %= p
a_inv = pow(a_inv,p-2,p)

b_inv = 1
for i in range(1,b+1):
    b_inv *= i%p
    b_inv %= p
b_inv = pow(b_inv,p-2,p)

ans *= (a_inv*b_inv)%p

print(ans%p)
import math
import fractions
n,m=map(int, input().split())
a=list(map(int, input().split()))
b=[]
s=math.floor(math.log2(max(a)))
buf=0
for i in range(n): #aは偶数なので、1/2した値の配列を作った
    b.append(int(a[i]//2))

for i in range(s+1): #2のi乗ですべての数が割れるかどうか
    for j in b:
        if j%(2**i)==0:
            buf+=1
        else:
            continue
    if buf==n:
        buf=0
        continue
    else:
        break

def lcm(x,y): #最小公倍数を求める関数の定義
    return (x*y)//math.fractions(x,y)

if buf!=0 and buf!=n: #偶奇が入り混じってるとき
    print(0)
elif n==1: #配列の要素が1つしかないとき
    d=int(m//b[0])
    print(int((d+1)//2))
else:
    c=[lcm(b[0],b[1])] #以下のサイクルで求めた最小公倍数を入れる配列
    for i in range(1,n):
        x=lcm(c[i-1],b[i])
        c.append(x)
        if x<m:
            continue
        else:
            break
    d=int(m//c[len(c)-1]) #最後の値(c[len(c)-1])が配列bの最小公倍数
    ans=int((d+1)//2)
    print(ans)

### FIXED CODE ###

import math
import fractions
n,m=map(int, input().split())
a=list(map(int, input().split()))
b=[]
s=math.floor(math.log2(max(a)))
buf=0
for i in range(n): #aは偶数なので、1/2した値の配列を作った
    b.append(int(a[i]//2))

for i in range(s+1): #2のi乗ですべての数が割れるかどうか
    for j in b:
        if j%(2**i)==0:
            buf+=1
        else:
            continue
    if buf==n:
        buf=0
        continue
    else:
        break

def lcm(x,y): #最小公倍数を求める関数の定義
    return (x*y)//fractions.gcd(x,y)

if buf!=0 and buf!=n: #偶奇が入り混じってるとき
    print(0)
elif n==1: #配列の要素が1つしかないとき
    d=int(m//b[0])
    print(int((d+1)//2))
else:
    c=[lcm(b[0],b[1])] #以下のサイクルで求めた最小公倍数を入れる配列
    for i in range(1,n):
        x=lcm(c[i-1],b[i])
        c.append(x)
        if x<m:
            continue
        else:
            break
    d=int(m//c[len(c)-1]) #最後の値(c[len(c)-1])が配列bの最小公倍数
    ans=int((d+1)//2)
    print(ans)
a = (int(input())+13) % 15
b = (int(input())+13) % 15

print('Alice' if a > b else 'Bob' if a < b else 'Draw')


### FIXED CODE ###

x,y=map(int,input().split())
a = (x + 13) % 15
b = (y + 13) % 15
print('Alice' if a > b else 'Bob' if a < b else 'Draw')
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
move = []
move.append(a[0])
i = a[0]-1
while count != n:
    if a[i] in move:
        y = move.index(a[i])
        count = y
        move = move[y:]
        break
    else:
        move.append(a[i])
        i = a[i]-1

na = len(move)
ama = k%na
print(move[ama-y-1])


### FIXED CODE ###

import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n,k=I()
a = l()
town = []
num = [0]*(n+1)
cnt = 1
num[0]=1

for i in range(n):
    num[a[cnt-1]] += 1
    if num[a[cnt-1]] == 2:
        ans = a[cnt-1]
        p = town.index(ans)
        b = town[p:]
        x = len(town)
        y = len(b)
        q = k-x+y
        if y == 0:
            print(town[n-1])
            sys.exit()
        if q < 0:
            print(town[k-1])
            sys.exit()
        z = q%y
        if z == 0:
            print(town[z-1])
        else:
            print(b[z-1])
        sys.exit()
        break
    town.append(a[cnt-1])
    cnt = a[cnt-1]
li = []*26
alpha2num = lambda c: chr(c+26)
w = input()
for i in range(len(w)):
  k = alpha2num(w[i])
  li[k] += 1
else:
  for j in li:
    if(not j %= 2):
      print("No")
      break
  else:
    print("Yes")

### FIXED CODE ###

li = [0]*26
alpha2num = lambda c: ord(c) - ord('A')
w = input().upper()
for i in range(len(w)):
  k = alpha2num(w[i])
  li[k] += 1
for j in li:
  if j % 2:
    print("No")
    break
else:
  print("Yes")
import math
a, b, h, m = map(int,input().split())
fine = math.cos((5h - m) * math.pi / 60)
c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * fine)
print(c)


### FIXED CODE ###

import math
a, b, h, m = map(int,input().split())
fine = math.radians(30 * h - 11 * m / 2)
c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(fine))
print(c)
while True:
    letters = list(input())
    x = 1
    for letter in letters:
        if letters.count(letter) == 2:
            x *= 1
        else:
            x *= 0
    print(["No","Yes"][x])


### FIXED CODE ###

letters = list(input())
x = 1
for letter in letters:
        if letters.count(letter) == 2:
            x *= 1
        else:
            x *= 0
print(["No","Yes"][x])
def resolve():
    import numpy as np
    N = int(input())
    list = list(map(int, input().split()))
    print(numpy.prod(list) if numpy.prod(list)<=10**18 else "-1")
resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print(0)
        exit()
    for i in A:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)
resolve()
while True:
		code = raw_input()
	
	code = code.replace(",","")
	code = code.replace(".","")
	code = code.split()
	
	list = []
	
	for var in code:
		if len(var) >= 3 and len(var) <= 6:
			list.append(var)
			
	for var in list:
		print var,
		
	print ""

### FIXED CODE ###

code = raw_input()
code = code.replace(",","")
code = code.replace(".","")
code = code.split()
	
list = []
	
for var in code:
	if len(var) >= 3 and len(var) <= 6:
		list.append(var)
			
for var in list:
	print var,
A = input()
A = int(A)
B = input()
B = int(B)
sum = 0

for i in range(2):
    if A > B:
        sum = A + sum
        A = A - 1
    else:
        sum = B + sum
        B = B -1 

print(sum)

### FIXED CODE ###

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

for i in range(2):
    if A > B:
        sum = A + sum
        A = A - 1
    else:
        sum = B + sum
        B = B -1 

print(sum)
X=int(input())
Y=int(X**(0.2))
for i in range(Y,0,-1):
    for t in range(-Y//2,Y,1):
        if (i**5)-(t**5)==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

### FIXED CODE ###

X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)
            exit()
import numpy as np
while True:
    try:   
        a,b,c,d,e,f = (int(i) for i in input().split())
        x,y = (np.dot(np.linalg.inv(np.array([[a,b],[d,e]])),np.array([c,f]))[0],np.dot(np.linalg.inv(np.array([[a,b],[d,e]])),np.array([3,6]))[1])
        print(x,y)
    except EOFError:
        break

### FIXED CODE ###

while True:
    try:
        a,b,c,d,e,f = (int(i) for i in input().split())
        det=a*e-b*d
        x = (c*e-b*f)/det
        y = (a*f-c*d)/det
        if x==0:x=0
        if y==0:y=0
        print("{0:.3f} {1:.3f}".format(x,y))
    except EOFError:
        break
N = int(input())
X = input()

cnt = X.count('1')
M = 0
for x in X:
    M <<= 1
    if x == '1':
        M += 1

def solve(n):
    ret = 1
    while n > 0:
        ret += 1
        n %= bin(n).count('1')
    return ret

ans = []
p = M % (cnt + 1)
m = M % (cnt - 1)

for i in range(N):
    if X[i] == '0':
        ans.append(solve((p + pow(2, N - i - 1, cnt + 1)) % (cnt + 1)))
    else:
        ans.append(solve((m - pow(2, N - i - 1, cnt - 1)) % (cnt - 1)))
print(*ans, sep='\n')


### FIXED CODE ###

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

cnt = X.count('1')
if cnt == 1:
    for x in X[:-1]:
        if x == '0':
            print(1)
        else:
            print(0)
    if X[-1] == '1':
        print(0)
    else:
        print(2)
    exit()

M = 0
for x in X:
    M <<= 1
    if x == '1':
        M += 1

def solve(n):
    ret = 1
    while n > 0:
        ret += 1
        n %= bin(n).count('1')
    return ret

ans = []
p = M % (cnt + 1)
m = M % (cnt - 1)

for i in range(N):
    if X[i] == '0':
        ans.append(solve((p + pow(2, N - i - 1, cnt + 1)) % (cnt + 1)))
    else:
        ans.append(solve((m - pow(2, N - i - 1, cnt - 1)) % (cnt - 1)))
print(*ans, sep='\n')
n=int(input())
X=[]
Y=[]
A=[]
#for i in range(n):
  A=int(input())
  x=[]
  y=[]
  #for j in range(A[i]):
    #x,y=[int(s) for s in input().split()]
  #X.append(x)
  #Y.append(y)
  
c=0
#for i in range(n):
 # l=[1]*n
  #for j in range(i, n-i):
   # if l[j]==0:continue
    #for k in range(A[j]):
   # 　　l[X[j][k]] *= Y[j][k]
#if c<l.count(1):
 # c=l.count(1) 
  
        
  
print(c)  
   

### FIXED CODE ###

n=int(input())
X=[]
Y=[]
A=[0]*n
for i in range(n):
  A[i]=int(input())
  a=A[i]
  x=[0]*a
  y=[0]*a
  for j in range(a):
    x[j],y[j]=[int(s) for s in input().split()]
  X.append(x)
  Y.append(y)
  
s=0
for i in range(2**n):
  c=0
  d=0
  B=[0]*n
  for j in range(n):
    if((i >> j) & 1):
      c=c+1
      B[j]=1
  for k in range(n):
    if B[k]==1:
      for j in range(A[k]):
        if Y[k][j]!=B[X[k][j]-1]:
          d=-1
          break
    if d<0:
      break
  if s<c and d==0:
    s=c
      
      
print(s)
P = int(input())
Q = int(input())
R = int(input())

X = min([P, Q, R])

print(P + Q + R - X)

### FIXED CODE ###

P, Q, R = map(int, input().split())
 
X = max([P, Q, R])
 
print(P + Q + R - X)