Harryxun/stf_run huggingface dataset:
n=int(input())
t,a=map(int,input().split())
lis=list(map(int,input().split()))
li=abs((t-lis[0]*0.006)-a)
l=0
for i in range(1,n):
    if abs((t-lis[i]*0.006)-a) < li:
        li=abs((t-lis[i]*0.006)-a)
        l=i
print(l+1)

### FIXED CODE ###

a,b = map(int,input().split())
print(a+int(b/2))
n, a, b = map(int, input().split())
x = n - a
y = x % b
print(a + y)

### FIXED CODE ###

n, a, b = map(int, input().split())
ans = n // (a + b) * a
x = n % (a + b)
ans += min(a, x)
print(ans)
import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

if N%2:
    print(0)
    exit()

print(sum([N//(2*5**i) for i in range(1, 50)]))

import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

if N%2:
    print(0)
    exit()

print(sum([N//(2*5**i) for i in range(1, 50)]))



### FIXED CODE ###

import math
import sys
from collections import defaultdict
from itertools import product, permutations, combinations

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]


N = int(input())
if N % 2:
    print(0)
    exit()
else:
    N //= 2

ans = 0
while N > 0:
    N //= 5
    ans += N
print(ans)
x = input()
i=1
while (x! = "0"):
    print("Case {0}: {1}".format(i,x));
    i+=1;
    x=input()


### FIXED CODE ###

x=input()
i=1
while (x!='0'):
    print("Case {0}: {1}".format(i,x));
    i+=1;
    x=input()
a,b=map(input().split())
a=int(a)
b=list(b)
b=[b[0],b[2],b[3]]
c=a*b[0]+a*b[2]//10+a*b[3]//100
print(c)

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=list(b)
b=[int(b[0]),int(b[2]),int(b[3])]
c=(a*b[0]*100+a*b[1]*10+a*b[2])//100
print(c)
from decimal import Decimal
n,k = input().split()
n =int(n)
k =Decimal(k)
a = math.floor(n*k)
print(a)

### FIXED CODE ###

from decimal import *
import math 
n,k = input().split()
n =Decimal(n)
k =Decimal(k)
a = math.floor(n*k)
print(a)
n,a,b=map(int,input().split)
print(min(n*a,b))

### FIXED CODE ###

n,a,b=map(int,input().split())
print(min(n*a,b))
h = int(input())
result, i = 0, 1
while h > 0:
    h //= 2
    result += i
    i *= 2
    
print(result)

### FIXED CODE ###

import math

H, A = [int(x) for x in input().split()]
print(math.ceil(H/A))
N, Q = map(int, input().split())
nodes = [[] for _ in range(N+1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    nodes[a] += [b]

PX = [0 for _ in range(N+1)]
for _ in range(Q):
    p, x = map(int, input().split())
    PX[p] += x


node_cnts = [0] * (N+1)


def gen_subtree_nodes(node, count):
    node_cnts[node] = count
    for n in nodes[node]:
        subtree_nodes = gen_subtree_nodes(n, count + PX[n])


gen_subtree_nodes(1, PX[1])

print(*node_cnts[1:])


### FIXED CODE ###

N, Q = map(int, input().split())
nodes = [[] for _ in range(2*(10**5)+1)]
for _ in range(N-1):
    a, b = map(int, input().split())
    nodes[a] += [b]

PX = [0 for _ in range(2*(10**5)+1)]
for _ in range(Q):
    p, x = map(int, input().split())
    PX[p] += x


node_cnts = [0] * (2*(10**5)+1)

q = [(1, PX[1])]
while q:
    node, count = q.pop()
    node_cnts[node] = count
    for n in nodes[node]:
        subtree_nodes = q.append((n, count + PX[n]))


print(*node_cnts[1:N+1], sep=' ')
N,M = (int(i) for i in input().split())
a = [int(input()) for i in range(M)]
hoge = [0] * N
hoge[0] = 1
for i in range(N):
    if i = 0:
        hoge[i] = 0
    elif (i-1) in a and (i-2) in a:
        hoge[i] = 0
    elif (i-1) in a:
        hoge[i] = hoge[i - 2]
    elif (i-2) in a:
        hoge[i] = hoge[i - 1]
    else hoge[i] = hoge[i-1] + hoge[i-2]
print(hoge[N])

### FIXED CODE ###

N, M = map(int, input().split())
A = set(int(input()) for _ in range(M))
mod = 10 ** 9 + 7

dp = [0] * (N+1)
dp[0] = 1
for i in range(1, N+1):
    if i in A:
        continue
    if i == 1:
        dp[i] = 1
        continue
    dp[i] = dp[i-1] + dp[i-2]

print(dp[N] % mod)
# -*- coding: utf-8 -*-


def main():
    s = input()
    removed_a = s.replace('A', '')

    if 5 < len(s) < 10 and removed_a != 'KIHBR':
        print('NO')
    else:
        if s.index('K') <= 1 and (s.index('B') - s.index('H')) <= 1 and (len(s) - 1 - s.index('R')) <= 1:
            print('YES')
        else:
            print('NO')


if __name__ == '__main__':
    main()


### FIXED CODE ###

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


def main():
    from re import search

    s = input()
    removed_a = s.replace('A', '')

    if (len(s) < 5 or len(s) < 10) and removed_a != 'KIHBR':
        print('NO')
    else:
        pattern = r'^A?KIHA?BA?RA?$'
        is_match = search(pattern, s)

        if is_match:
            print('YES')
        else:
            print('NO')


if __name__ == '__main__':
    main()
while(1):
  a,b,op = raw_input().split()
  a = int(a)
  b = int(b)
  if op == "+":
    print (a+b)
  elif op == "-":
    print (a-b)
  elif op == "*":
    print (a*b)
  elif op == "/":
    print (a/b)
  elif op == "?":
    break

### FIXED CODE ###

while(1):
  a,op,b = raw_input().split()
  a = int(a)
  b = int(b)
  if op == "+":
    print (a+b)
  elif op == "-":
    print (a-b)
  elif op == "*":
    print (a*b)
  elif op == "/":
    print (a/b)
  elif op == "?":
    break
N, T = map(int, input().split())

c_min = 1001
t_ = None
for _ in range(N):
    c, t = map(int, input().split())
    if T >= t and c_min > c:
        c_min = c
        t_ = t
if t_ == None:
    print("TLE")
else:
    print(c_min)

### FIXED CODE ###

n = int(input())

if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)
A = input()
B = input()
C = input()

xa = 0
xb = 0
xc = 0

#配列の次のカードの文字を返す
def next(X, i):
    if X[i - 1] == 'a':
        return A[xa]
    elif X[i - 1] == 'b':
        return B[xb]
    else:
        return C[xc]

h = 'A'
xa += 1
k = next(A, xa) #最初

while True:
    if k == 'a':
        h = 'A'
        xa += 1
        if xa < len(A):
            k = next(A, xa)
        else:
            break
    elif k == 'b':
        h = 'B'
        xb += 1
        if xb < len(B):
            k = next(B, xb)
        else:
            break
    else:
        h = 'C'
        xc += 1
        if xc < len(C):
            k = next(C, xc)
        else:
            break

print(h)


### FIXED CODE ###

A = input()
B = input()
C = input()

xa = 0
xb = 0
xc = 0

h = 'A'
k = A[0] #最初の１枚を抜く
xa += 1

while True:

    if k == 'a':
        h = 'A'
        if xa < len(A):
            k = A[xa]
            xa += 1
        else:
            break
    elif k == 'b':
        h = 'B'
        xb += 1
        if xb < len(B):
            k = B[xb]
            xb += 1
        else:
            break
    elif k == 'c':
        h = 'C'
        xc += 1
        if xc < len(C):
            k = C[xc]
            xc += 1
        else:
            break

print(h)
s = input()
t = s[::-1]
a = s.index('a')
z = t.index('z')
print(len(s)-a-z)

### FIXED CODE ###

s = input()
t = s[::-1]
a = s.index('A')
z = t.index('Z')
print(len(s)-a-z)
5
2 5 2
2 3 10
1 3 8
3 4 2

### FIXED CODE ###

from collections import deque
import math
from functools import reduce

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n = int(input())
ans = [-1] * n
ans[0] = 0

edges = [ [] for _ in range(n)]
for i in range(n-1):
    u,v,w = get_nums_l()
    edges[u-1].append([v-1,w%2==0])
    edges[v-1].append([u-1,w%2==0])

def aaa(x):
    # xを含むエッジ

    # breakpoint()

    for edge in edges[x]:
        to = edge[0] # edgeのうちxじゃないほう
        if ans[to] != -1:
            continue
        same = edge[1]
        ans[to] = ans[x] ^ (not same)

        queue.append(to)

queue = deque()
queue.append(0)
while queue:
    aaa(queue.popleft())
for annn in ans:
    print(annn)
import math

H = int(input())

print(int(math.pow(2, int(math.log2(H)) +1) - 1))

### FIXED CODE ###

import math

H = int(input())

print(int(math.pow(2, int(math.log2(H)) +1) - 1))
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = set(a)
c = []
for i in b:
  c.append(a.count(i))
c.sort(reverse=True)
#if len(c) == k:
  #print(0)
#else:
print(sum(c[k:]))

### FIXED CODE ###

print(input().count("1"))
while True:
    n = int(input())
    if n == 0:
        break
    x = {}
    for _ in range(n):
        a = input().split()
        x.update({a[0]: a[1]})
    m = int(input())
    y = []
    for _ in range(m):
        b = input()
        if x[b] :
            y.append(x[b])
        else:
            y.append(b)
    for i in range(m):
        print(y[i], end="")
    print()

### FIXED CODE ###

while True:
    n = int(input())
    if n == 0:
        break;
    x = {}
    for i in range(n):
        k,v = input().split()
        x[k] = v
    y = []
    for i in range(int(input())):
        a = input().rstrip()
        if a in x:
            y.append(x[a])
        else:
            y.append(a)
    print(''.join(y))
s = input()
x,y = map(int,input().split())
#%%
mx = []
my = []
mx2 = []
my2 = []


cnt = 0
it = 0
for t in s:
    if t == 'T':
        if cnt:
            if it%2==0:
                mx.append(cnt)
                mx2.append(cnt*2)
            else:
                my.append(cnt)
                my2.append(cnt*2)
        it += 1
        cnt = 0
    else:
        cnt += 1
    
if it%2==0:
    mx.append(cnt)
    mx2.append(cnt*2)
else:
    my.append(cnt)
    my2.append(cnt*2)
    
        
dx = sum(mx)-x
dy = sum(my)-y


# dp[i+1][j] : i個目までの要素の和でjを作れるか？

MAX = max(sum(mx2),sum(my2))+10
dpx = [[False]*MAX for _ in range(len(mx2)+1)]
dpy = [[False]*MAX for _ in range(len(my2)+1)]

dpx[0][0] = True
dpy[0][0] = True

for i in range(len(mx2)):
    for j in range(MAX):
        if j<mx2[i]:
            dpx[i+1][j] = dpx[i][j]
        else:
            dpx[i+1][j] = dpx[i][j-mx2[i]] or dpx[i][j]

for i in range(len(my2)):
    for j in range(MAX):
        if j<my2[i]:
            dpy[i+1][j] = dpy[i][j]
        else:
            dpy[i+1][j] = dpy[i][j-my2[i]] or dpy[i][j]


if dpx[len(mx2)][dx] and dpy[len(my2)][dy]:
    print('Yes')
else:
    print('No')
    



### FIXED CODE ###

s = input()
x,y = map(int,input().split())
#%%
mx = []
my = []
mx2 = []
my2 = []


cnt = 0
it = 0
firstFlag = (s[0]=='F')
for t in s:
    if t == 'T':
        
        
        if cnt:
            if it%2==0:
                mx.append(cnt)
                mx2.append(cnt*2)
            else:
                my.append(cnt)
                my2.append(cnt*2)
        it += 1
        cnt = 0
    else:
        cnt += 1
    
if it%2==0:
    mx.append(cnt)
    mx2.append(cnt*2)
else:
    my.append(cnt)
    my2.append(cnt*2)

if firstFlag:
    x -= mx[0]
    mx[0] = 0
    mx2[0] = 0
        
dx = sum(mx)-x
dy = sum(my)-y


# dp[i+1][j] : i個目までの要素の和でjを作れるか？

MAX = max(sum(mx2),sum(my2)) + 10
dpx = [[False]*MAX for _ in range(len(mx2)+1)]
dpy = [[False]*MAX for _ in range(len(my2)+1)]

dpx[0][0] = True
dpy[0][0] = True

for i in range(len(mx2)):
    for j in range(MAX):
        if j<mx2[i]:
            dpx[i+1][j] = dpx[i][j]
        else:
            dpx[i+1][j] = dpx[i][j-mx2[i]] or dpx[i][j]

for i in range(len(my2)):
    for j in range(MAX):
        if j<my2[i]:
            dpy[i+1][j] = dpy[i][j]
        else:
            dpy[i+1][j] = dpy[i][j-my2[i]] or dpy[i][j]



if dx<0 or dy<0:
    print('No')

elif dx>sum(mx2) or dy>sum(my2):
    print('No')

else:
    if dpx[len(mx2)][dx] and dpy[len(my2)][dy]:
        print('Yes')
    else:
        print('No')
from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *

N=int(input())

if N==3:
    print(2,5,63)
elif N==4:
    print(2,5,20,63)
elif N==5:
    print(2,5,20,63,30)
else:
    lst=[2,3,4,6,9,12]
    count=N-6
    div2=[i for i in range(14,30001,2) if i%6!=0]
    if len(div2)%2==1:
        div2.pop()
    div3=[i for i in range(15,30001,6)]
    if len(div3)%2==1:
        div3.pop()
    div6=[i for i in range(18,30001,6)]

    while count>=2 and div2:
        lst.append(div2.pop())
        lst.append(div2.pop())
        count-=2
    while count>=2 and div3:
        lst.append(div3.pop())
        lst.append(div3.pop())
        count-=2
    while count>=1:
        lst.append(div6.pop())
        count-=1
    print(" ".join(list(map(str,lst))))


### FIXED CODE ###

from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *

N=int(input())

if N==3:
    print(2,5,63)
elif N==4:
    print(2,5,20,63)
elif N==5:
    print(2,5,20,63,30)
else:
    lst=[2,3,4,6,9,12]
    count=N-6
    div2=[i for i in range(10,30001,2) if i%6!=0]
    div2.append(8)
    #if len(div2)%2==1:
    #    div2.pop()
    div3=[i for i in range(15,30001,6)]
    #if len(div3)%2==1:
    #    div3.pop()
    div6=[i for i in range(18,30001,6)]
    #print(len(div2),len(div3),len(div6))
    while count>=2 and len(div2)>=2:
        lst.append(div2.pop())
        lst.append(div2.pop())
        count-=2
    while count>=2 and len(div3)>=2:
        lst.append(div3.pop())
        lst.append(div3.pop())
        count-=2
    while count>=1:
        lst.append(div6.pop())
        count-=1
    print(" ".join(list(map(str,lst))))
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    #max_num = 10**5
    max_num = 10
    n = int(input())
    a_list = list(map(int, input().split()))
    q = int(input())
    
    query = [map(int, input().split()) for _ in range(q)]
    num = [0 for _ in range(max_num+1)]
    for i in a_list:
        num[i] += 1

    ans = sum(a_list)

    for b,c in query:
        n = num[b]
        num[b] = 0
        num[c] += n
        ans += (c-b)*n
        print(ans)

    
if __name__ == "__main__":
    main()

### FIXED CODE ###

import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    max_num = 10**5
    n = int(input())
    a_list = list(map(int, input().split()))
    q = int(input())
    
    query = [map(int, input().split()) for _ in range(q)]
    num = [0 for _ in range(max_num+1)]
    for i in a_list:
        num[i] += 1

    ans = sum(a_list)

    for b,c in query:
        n = num[b]
        num[b] = 0
        num[c] += n
        ans += (c-b)*n
        print(ans)

    
if __name__ == "__main__":
    main()
N,M = [int(i) for i in input().split()]

relations = []
for i in range(M):
    relations.append({int(i) for i in input().split()})
    

def search(node,stock):
    
    n_member = 0
    
    while(len(node)>0):
        n_member += len(node)
        go_list = []
        ng_list = []
        
        for s in stock:
            if len(s & node)>0:
                go_list = np.append(go_list,list(s))
            else:
                ng_list.append(s)
        node = set(np.unique(go_list)) - node
        stock = ng_list
            
    return n_member,stock
    
    
MaxMember = 1    
while(len(relations)>1):
    l_member,relations = search(relations[0],relations[1:])
    MaxMember = max(MaxMember,l_member)

print(MaxMember)

### FIXED CODE ###

import numpy as np

class union_find:
    def __init__(self,N):
        self.r = np.ones(N)*-1
    
    def root(self,x):
        if self.r[x]<0:
            return int(x)
        else:
            self.r[x] = self.root(int(self.r[x]))
            return int(self.r[x])
        
    def unite(self,x,y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        else:
            self.r[x] += self.r[y]
            self.r[y] = int(x)
            return True
        
    def size(self,x):
        return -self.r[self.root(x)]


N,M = [int(i) for i in input().split()]

Union = union_find(N)
for i in range(M):
    x,y = [int(i) for i in input().split()]
    Union.unite(x-1,y-1)

Y = - min(Union.r)
print(int(Y))
N = int(input())
A = list(map(int, input().split()))

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

### FIXED CODE ###

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

bun = 0
for i in range(N):
  bun += 1/A[i]
  
ans = 1/bun
print(ans)
import sys
input=sys.stdin.readline


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

def solve_knapsack(capacity):
    # basic checks
    n = len(profits)
 
    dp = [0]*(capacity + 1)
    # populate the capacity = 0 columns, with '0' capacity we have '0' profit

    for i in range(0, n):
        weights,profits = map(int,input().split())
        for c in range(capacity, weights-1, -1):
            tmp = profits + dp[c - weights
            if tmp > dp[c]: dp[c] = tmp
 
    # maximum profit will be at the bottom-right corner.
    return dp[capacity]
  
def main():
 
    res = solve_knapsack(W)
 
    print(res)
if __name__ == "__main__":
	main()

### FIXED CODE ###

def main():
  n, w = [int(e) for e in input().split()]
  t = [-1 for i in range(w + 1)]
  t[w] = 0
  for _ in range(n):
    nw, nv = [int(e) for e in input().split()]
    for i in range(nw, w + 1):
      if t[i] == -1:
        continue
      if t[i - nw] < t[i] + nv:
        t[i - nw] = t[i] + nv
  print(max(t))
main()
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from math import ceil, floor, gcd
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

def main():
    n = int(input())
    p = tuple(map(int, input().split()))
    q = tuple(map(int, input().split()))
    l = permutations(list(range(1, n+1)))
    if p == q:
        print(0)
        exit()
    for idx, item in enumerate(l):
        if item == p:
            idp = idx
        elif item == q:
            idq = idx
    print(abs(idp - idq))

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

def main():
    n = int(input())
    p = tuple(map(int, input().split()))
    q = tuple(map(int, input().split()))
    l = permutations(list(range(1, n+1)))
    if p == q:
        print(0)
    else:
        for idx, item in enumerate(l):
            if item == p:
                idp = idx
            elif item == q:
                idq = idx
        print(abs(idp - idq))

if __name__ == '__main__':
    main()
def main():

    n, w = map(int, input().split())

    INF = 10 ** 20
    dp = [INF] * (n * 1000)
    dp[0] = 0

    max_vi = 0
    for _ in range(n):
        wi, vi = map(int, input().split())
        max_vi += vi

        for vj in range(max_vi + 1, vi - 1, -1):
            nw = dp[vj - vi] + wi
            if dp[vj] > nw:
                dp[vj] = nw

    for i in range(max_vi, -1, -1):
        if dp[i] <= w:
            print(i)
            return

main()


### FIXED CODE ###

def main():

    n, w = map(int, input().split())

    INF = 10 ** 20
    dp = [INF] * (n * 100001)
    dp[0] = 0

    max_vi = 0
    for _ in range(n):
        wi, vi = map(int, input().split())
        max_vi += vi

        for vj in range(max_vi + 1, vi - 1, -1):
            nw = dp[vj - vi] + wi
            if dp[vj] > nw:
                dp[vj] = nw

    for i in range(max_vi, -1, -1):
        if dp[i] <= w:
            print(i)
            return

main()
n=int(input())
*l,=map(int,input().split())

*a,=range(1,n+1)
b=a[::-1]

for i,j in enumerate(l):
  b[j-1]+=i
for i in range(1,n):
  if not b[i-1]>b[i]:
    df=b[i]-b[i-1]+1
    b[i]-=df
    a[i]+=df

if b[-1]<1:
  tg=abs(b[-1])+1
  *b=map(lambda x:x+tg,b)

print(*a)
print(*b)

### FIXED CODE ###

n=int(input())
*l,=map(int,input().split())

*a,=range(1,30000*n+1,30000)
b=a[::-1]

for i,j in enumerate(l):
  b[j-1]+=i

print(*a)
print(*b)
import sys

input=sys.stdin.buffer.readline
sys.setrcursionlimit(2*10**5)

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

root=0
for i in range(N):
    if len(edge[i])!=1:
        root=i
        break

def dfs(v,pv):
    s=A[v]
    t=0
    for nv in edge[v]:
        if nv!=pv:
            y=dfs(nv,v)
            t+=y
    #2*a+b=t
    #a+b=s
    if t==0:
        if len(edge[v])!=1:
            print("NO")
            exit()
        else:
            return s
    a=t-s
    b=2*s-t
    if 2*a>t:
        print("NO")
        exit()
    return b

res=dfs(root,-1)
print("YES" if res==0 else "NO")


### FIXED CODE ###

import sys

input=sys.stdin.buffer.readline
sys.setrecursionlimit(2*10**5)

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

if N==2:
    if A[0]==A[1]:
        print("YES")
    else:
        print("NO")
    exit()

root=0
for i in range(N):
    if len(edge[i])!=1:
        root=i
        break

def cond(L,n):
    check=0
    for i in L:
        check+=min(n,i)
    return check>=2*n

def dfs(v,pv):
    s=A[v]
    t=[]
    for nv in edge[v]:
        if nv!=pv:
            y=dfs(nv,v)
            t.append(y)
    #2*a+b=t
    #a+b=s
    T=sum(t)
    if T==0:
        if len(edge[v])==1:
            return s

    start=0
    end=T//2
    while end-start>1:
        test=(end+start)//2
        if cond(t,test):
            start=test
        else:
            end=test
    if cond(t,end):
        M=end
    else:
        M=start

    a=T-s
    b=2*s-T
    if 0>a or 0>b:
        print("NO")
        exit()
    elif a>M:
        print("NO")
        exit()
    return b

res=dfs(root,-1)
print("YES" if res==0 else "NO")
n=int(input())
ans=0
g[[-1 for i in range(n)] for j in range(n)]
for i in range(n):
  a=int(input())
  for j in range(a):
    x,y=map(int,input().split())
    g[i][x-1]=y
for i in range(2**n):
  ok=True
  for j in range(n):
    if (i>>j)&1:
      for k in range(n):
        if g[j][k]==-1:
          continue
        if (i>>j)&1!=g[j][k]:
          ok=False
  if ok:
    d=str(bin(i))
    t=d.count('1')
    ans=max(t,ans)
print(ans)
    
    
      

### FIXED CODE ###

n=int(input())
ans=0
g=[[-1 for i in range(n)] for j in range(n)]
for i in range(n):
  a=int(input())
  for j in range(a):
    x,y=map(int,input().split())
    g[i][x-1]=y
for i in range(2**n):
  ok=True
  for j in range(n):
    if (i>>j)&1:
      for k in range(n):
        if g[j][k]==-1:
          continue
        if (i>>k)&1!=g[j][k]:
          ok=False
  if ok:
    d=i
    t=str(bin(d)).count('1')
    ans=max(t,ans)
print(ans)
n,q=map(int,input().split())
s=input()
count=[0]*n

for i in range(1,n):
  count[i] += count[i-1]
  if s[i-1:i+1]=="AC":
    count[i]+=1
for i in range(q):
  l,r=map(int,input().split())
  print(count([r-1]-count[l-1])

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
count=[0]*N
for i in range(1,N):
    count[i]+=count[i-1]
    if S[i-1:i+1]=="AC":count[i]+=1
for i in range(Q):
    l,r=map(int,input().split())
    print(count[r-1]-count[l-1])
list_num = [int(i) for i in input().split()]

players = list_num[0:1]
k = list_num[-1]

for i in range(k):
    players[i%2] = int(players[i%2]/2)
    players[(i+1)%2] += players[i%2]

for i in range(2):
    print(players[i], end="")

print("")

### FIXED CODE ###

list_num = [int(i) for i in input().split()]

players = list_num[0:2]
k = list_num[-1]

for i in range(k):
    players[i%2] = players[i%2]//2
    players[(i+1)%2] += players[i%2]

print(players[0], players[1])