Harryxun/stf_run huggingface dataset:
import math

S=int(input())
if S>= 7:
    ans = 2
    n = S//3
    b = S%3
    a = 3+b
    z = 10**9+7
    c = n-1
    for i in range(n-2):
        # s=math.factorial(a+c-1)/(math.factorial(a)*math.factorial(c-1))
        y = max([a,c-1])
        r = min([a,c-1])
        # print(y,r,a+c)
        s = 1
        for k in range(y+1,a+c):
            s*=k
        # print(s)
        s//=math.factorial(r)
        s%=z
        ans += s
        a +=3
        c-=1
        # print(s)
    ans += n-1
elif S==6:
    ans = 2
elif 3<=S<6:
    ans =1
else:
    ans= 0
print(ans%z)

### FIXED CODE ###

import math

S=int(input())
z = 10**9+7
if S>= 7:
    ans = 1
    n = S//3
    b = S%3
    a = 3+b
    
    c = n-1
    for i in range(n-2):
        # s=math.factorial(a+c-1)/(math.factorial(a)*math.factorial(c-1))
        y = max([a,c-1])
        r = min([a,c-1])
        # print(y,r,a+c)
        s = 1
        for k in range(y+1,a+c):
            s*=k
        # print(s)
        s//=math.factorial(r)
        s%=z
        ans += s
        a +=3
        c-=1
        # print(s)
    if b==0:
        ans+= 1
    if b==1:
        ans += n
    if b == 2:
        ans += n*(n-1)//2 +n
elif S==6:
    ans = 2
elif 3<=S<6:
    ans =1
else:
    ans= 0
print(ans%z)
from bisect import *
N,M=map(int,input().split())
kagi=[]
for i in range(M):
    a,b=map(int,input().split())
    C=list(map(int,input().split()))
    for i in range(b):
        C[i]-=1
    kagi.append([a,set(C)])

value=10**7
idx=-1
for i in range(M):
    if 0 in kagi[i][1] and kagi[i][0]<value:
        value=kagi[i][0]
        idx=i
if idx==-1:
    print(-1)
    exit()
kagilst=[idx]

takara=[set() for i in range(N)]
for m in range(M):
    for k in kagi[m][1]:
        takara[k].add(m)

for n in range(1,N):
    if [k for k in kagilst if n in kagi[k][1]]:
        continue
    tempvalue=10**7
    for k in takara[n]:
        lst=[0 for i in range(n)]
        for z in kagilst+[k]:
            for m in kagi[z][1]:
                if m<len(lst):
                    lst[m]=1
        for i in range(len(kagilst)**2):
            A=bin(i)[:2]
            A=list(reversed(list(A)))
            for a in range(len(kagilst)):
                if A[a]=="1":
                    for h in kagi[kagilst[a]][1]:
                        if h<len(lst):
                            lst[h]=1
            if not 0 in lst:
                temptempvalue=value+sum([kagi[a][0] for a in range(len(kagilst)) if A[a]=="1"])+kagi[k][0]
                if temptempvalue<tempvalue:
                    tempvalue=temptempvalue
                    tempkagi=k
    if tempvalue==10**7:
        print(-1)
        exit()
    value=tempvalue
    kagilst.append(k)
print(value)


### FIXED CODE ###

from bisect import *
N,M=map(int,input().split())
kagi=[]
for i in range(M):
    a,b=map(int,input().split())
    C=list(map(int,input().split()))
    value=0
    for i in range(b):
        C[i]-=1
        value+=2**C[i]

    kagi.append([a,value])


dp=[[10**8 for i in range(2**N)] for m in range(M+1)]
dp[0][0]=0
for i in range(M):
    for s in range(2**N):
        dp[i+1][s]=min(dp[i][s],dp[i+1][s])
        dp[i+1][s|kagi[i][1]]=min(dp[i+1][s|kagi[i][1]],dp[i][s]+kagi[i][0])
if 10**8==dp[M][-1]:
    print(-1)
else:
    print(dp[M][-1])
def root(x,rt):
    if rt[x] == x:
        return x
    else:
        while rt[x] != x:
            rt[x] = root(rt[x],rt)
            return rt[x]
def union(x,y,rt,rank):
    rootx = rt[x]
    rooty = rt[y]
    if rootx == rooty:
        return 0
    else:
        if rank[rootx] < rank[rooty]:
            rt[rooty] = rootx
        else:
            rt[rootx] = rooty
            if rank[rootx] == rank[rooty]:
                rank[rootx] += 1

def issame(x,y,rt):
    return root(x,rt) == root(y,rt)

length,query = (int(n) for n in input().split(" "))
rootlist = [n for n in range(length)]
rank = [0 for n in range(length)]

for q in range(query):
    #print(root)
    com,x,y = (int(n) for n in input().split(" "))
    if com == 0:
        union(x,y,rootlist,rank)
    else:
        print(1 if issame(x,y,rootlist) else 0)

### FIXED CODE ###

class UnionFind:
    import sys
    sys.setrecursionlimit(100000)

    def __init__(self, v_num):
        self.parent = [n for n in range(v_num)]
        self.rank = [0 for n in range(v_num)]

    def find(self, v):
        if v == self.parent[v]:
            return v
        else:
            root = self.find(self.parent[v])
            self.parent[v] = root
            return root

    def unite(self, a_v, other_v):
        a_root = self.find(a_v)
        other_root = self.find(other_v)
        if a_root == other_root:
            return
        if self.rank[a_root] < self.rank[other_root]:
            self.parent[a_root] = other_root
        else:
            self.parent[other_root] = a_root
            if self.rank[a_root] == self.rank[other_root]:
                self.rank[a_root] += 1

    def same(self, a_v, other_v):
        return self.find(a_v) == self.find(other_v)

v_num, query = (int(n) for n in input().split(" "))
uf = UnionFind(v_num)
for _ in range(query):
    com, a, b = (int(n) for n in input().split(" "))
    if com == 0:
        uf.unite(a, b)
    else:
        if uf.same(a, b):
            print(1)
        else:
            print(0)
#! -*- coding: utf-8-unix -*-
import sys

if __name__=='__main__':
  lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  n = int(lines[0])
  for i in xrange(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    if x1 == x2:
      if x3 == x4:
        print 'YES'
      else:
        print 'NO'
    elif y1 == y2:
      if y3 == y4:
        print 'YES'
      else:
        print 'NO'
    a1 = (y2 - y1) / (x2 - x1)
    b1 = y1 - a1 * x1
    a2 = (y4 - y3) / (x4 - x3)
    b2 = y3 - a2 * x3
    if (a1 == a2) and (b1 != b2):
      print 'YES'
    else:
      print 'NO'

### FIXED CODE ###

#! -*- coding: utf-8-unix -*-
import math

if __name__=='__main__':
  # lines = [x.strip() for x in sys.stdin.readlines() if x != '' and x != '\n']
  # n = int(lines[0])
  n = int(raw_input())
  for i in xrange(n):
    # x1, y1, x2, y2, x3, y3, x4, y4 = map(float, lines[i+1].split(' '))
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))
    # if x1 == x2 or x3 == x4:
    #   if x1 == x2 and x3 == x4:
    #     print 'YES'
    #   else:
    #     print 'NO'
    #   continue
    # elif y1 == y2 or y3 == y4:
    #   if y1 == y2 and y3 == y4:
    #     print 'YES'
    #   else:
    #     print 'NO'
    #   continue
    # else:
      # if (y2 - y1) * (x4 - x3) == (y4 - y3) * (x2 - x1):
    if math.fabs((y2 - y1) * (x4 - x3) - (y4 - y3) * (x2 - x1)) < 1e-10:
      print 'YES'
    else:
      print 'NO'
      # a1 = (y2 - y1) / (x2 - x1)
      # b1 = y1 - a1 * x1
      # a2 = (y4 - y3) / (x4 - x3)
      # b2 = y3 - a2 * x3
      # if (a1 == a2):# and (b1 != b2):
      #   print 'YES'
      # else:
      #   print 'NO'
    # except:
    #   break
x=int(input(""))
y=int(input(""))
z=int(input(""))
answer= (x-z)//(z+y)
print(answer)

### FIXED CODE ###


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

nu=(x[0]-x[2]) % (x[1]+x[2])
res=(x[0]-x[2]-nu) / (x[1]+x[2])
print(int(res))
import sys
from math import *
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return



def main():
    n, m, k = map(int, input().split())
    fgraph = [list() for i in range(n)]
    bgraph = [list() for i in range(n)]
    cgraph = [list() for i in range(n)]


    seen = [False]*n
    def dfs(graph,s,t):
        seen[s] = True
        if t+1 in graph[s]:
            return True
        for i in range(len(graph[s])):
            if seen[graph[s][i]-1]:
                continue
            if dfs(graph, graph[s][i]-1, t):
                return True
        return False

    for i in range(m):
        a,b = map(int, input().split())

        fgraph[a-1].append(b)
        fgraph[b-1].append(a)

    for i in range(k):
        c,d = map(int, input().split())
        bgraph[d-1].append(c)
        bgraph[c-1].append(d)

    # print(fgraph)
    #print(bgraph)

    for i in range(n):
        for j in range(n):
            if j == i or j+1 in bgraph[i] or j+1 in fgraph[i]:
                continue
            # print(i+1,j+1)
            seen = [False]*n
            if dfs(fgraph, i, j):
                cgraph[i].append(j)
                cgraph[j].append(i)
            # i+1 から j+1 への経路の存在を探索する
    #print(cgraph)    
    for i in range(n):

        print(len(set(cgraph[i])))
    
    return

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from math import *
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def main():
    n, m, k = map(int, input().split())
    fgraph = [list() for i in range(n)]
    bgraph = [list() for i in range(n)]
    cgraph = [list() for i in range(n)]
    
    is_all_seen = [False]*n
    cnt = 0
    seen = [None]*n
    rks = [None] *n
    sys.setrecursionlimit(10**9)
    def dfs(graph,s,r):
        seen[s] = s+1
        if rks[s] is None:
            rks[s] = r

        for i in range(len(graph[s])):
            if seen[graph[s][i]-1]:
                continue
            dfs(graph, graph[s][i]-1,r)

    for i in range(m):
        a,b = map(int, input().split())

        fgraph[a-1].append(b)
        fgraph[b-1].append(a)

    # print(fgraph)
    #print(bgraph)
    # 連結成分に対してid的なindexをつける
    c = -1
    for i in range(n):

        if rks[i] is None:
            c += 1
            dfs(fgraph, i, c)
    
    for i in range(k):
        c,d = map(int, input().split())
        if rks[c-1] == rks[d-1]:
            bgraph[d-1].append(c)
            bgraph[c-1].append(d)

    counter = Counter(rks)
    for i in range(n):
        # counter[rks[i]] 連結成分のサイズ
        # len(fgraph[i]) 友達の数
        # len(bgraph[i]) 連結成分内のブロックの数
        # 1 自分
        print(counter[rks[i]] - len(fgraph[i]) - len(bgraph[i]) - 1)

if __name__ == '__main__':
    main()
s = raw_input()
if s == "1 1 0" or s == "0 0 1":
 print "Open"
else
 print "Close"

### FIXED CODE ###

s = raw_input()
if s == "1 1 0" or s == "0 0 1":
 print "Open"
else:
 print "Close"
[a,b] = map(int,input(),split())
if a < b:
    print(a < b)
elif a > b:
    print(a > b)
else:
    print(a == b)

### FIXED CODE ###

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

if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')
n, m = map(int, input().split())
ctr = [-1 for _ in range(n)]
flag = True
for i in range(m):
  p, q = map(int, input().split())
  p -= 1
  if ctr[p] == -1:
    ctr[p] = q
  else:
    flag = False
    break

flag = False if ctr[0] = 0

if flag:
  for i in ctr:
    print(1 if i == -1 else i, end="")
else:
  print(-1)

### FIXED CODE ###

n, m = map(int, input().split())
ctr = [-1 for _ in range(n)]
flag = True
for i in range(m):
  p, q = map(int, input().split())
  p -= 1
  if ctr[p] == -1:
    ctr[p] = q
  else:
    if(ctr[p] != q):
      flag = False
      break

if ctr[0] == 0 and n > 1:
  flag = False

if ctr[0] == -1:
  ctr[0] = 0 if n == 1 else 1
if flag:
  for i in ctr:
    print(0 if i == -1 else i, end="")
else:
  print(-1)
string = input().split()
print(string[1]+string[0])

### FIXED CODE ###

print("".join(str(a) for a in ({1,2,3}-{int(input()), int(input())})))
# 期待値
def func_d(n):
    if n == 1:
        return 1
    else:
        return n + func_d(n-1)

N, K = [int(i) for i in input().split()]
P = [func_d(int(i))/int(i) for i in input().split()]

# 累積和
A = [0]
for i in P:
    A.append(A[-1]+i)
    
ans = []
for i in range(N-K+1):
    ans.append(A[i+K]-A[i])
print(max(ans))

### FIXED CODE ###

def func(x):
    return (x+1)/2
N, K = [int(i) for i in input().split()]
P = [func(int(i)) for i in input().split()]

# 累積和
A = [0]
for i in P:
    A.append(A[-1]+i)

ans = []
for i in range(K, N+1):
    ans.append(A[i] - A[i-K])
    
print(max(ans))
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(a,b):
	g = gcd(a,b)
	return a*b//g

a,b = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b)
print(ans)


### FIXED CODE ###

# ANSHUL GAUTAM
# IIIT-D

from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)


'''

'''

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

def solve(a,b):
	g = gcd(a,b)
	return a*b//g

a,b = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b)
print(ans)
n=int(input())
from collections import deque
d=deque()
e=deque()
d.append("a")

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x=d.popleft()
 
        for j in range(dic[(x[-1])]+2):
            e.append(x+alpha[int(j)])  
    d=e.copy()
    e=deque()
d=list(d)

if n==1:
    print("a")
else:
    for some in d:
        print(some)

### FIXED CODE ###

n=int(input())
from collections import deque
d=deque()
e=deque()
d.append(("a",0))

alpha=list("abcdefghijklmnopqrstuvwxyz")
dic={alpha[i]:i for i in range(26)}
for i in range(n-1):
    while d:
        x,y=d.popleft() 
        for j in range(y+2):
            e.append((x+alpha[int(j)],max(y,j)))
    d=e
    e=deque()
d=list(d)
if n==1:
    print("a")
else:
    d=sorted(d,key=lambda x:x[0])
    for some in d:
        print(some[0])
A,B=[int(s) for s in input().split()]
if A>B:
  print(2*A-1)
elif A=B:
  print(2*A)
else:
  print(2*B-1)

### FIXED CODE ###

A,B=[int(s) for s in input().split()]
if A>B:
  print(2*A-1)
elif A==B:
  print(2*A)
else:
  print(2*B-1)
N,K = map(int,input().split())
if K == 1:
    print(1)
else:
    for i in range(1,K+1):
        if i == 1 or i == K:
            print(comb(N-K+1,i,10**9+7))
        else:
            k = factorial(N-K+1) % (10**9+7)
            l = factorial(N-K+1-i) % (10**9+7)
            m = factorial(i-1) % (10**9+7)
            #print(k,l,m)
            print( (k//(l*m)) % (10**9+7) )
            #print( (k//(l*m)))
            #print(comb(N-K+1,i,10**9+7))

### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7
MAX = 4000
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range( 2, MAX + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
n,k= map(int,input().split())
for i in range(1,k+1):
    pre = cmb(k-1,i-1,mod)
    pos = cmb(n-k+1,i,mod)
    print((pre*pos)%mod)
print(“ABC” if int(input()) <=1200 else(“ARC”))

### FIXED CODE ###

print("ABC" if int(input())<1200 else("ARC"))
def jump_cost(value1, value2):
  return abs(value1 - value2)

n = int(input())
stones = [int(i) for i in input().split()]
cost = [float("inf")] * n
cost[0] = 0

for index in range(len(stones) - 1):
  cost[index + 1] = min(cost[index + 1], cost[index] + jump_cost(stones[index], stones[index + 1]))
  if index + 2 < n:
    cost[index + 2] = min(cost[index + 2], cost[index] + jump_cost(stones[index], stones[index + 2]))

return cost[-1]

### FIXED CODE ###

def jump_cost(value1, value2):
  return abs(value1 - value2)

def stone_jump(n, stones):
  cost = [float("inf")] * n
  cost[0] = 0

  for index in range(len(stones) - 1):
    cost[index + 1] = min(cost[index + 1], cost[index] + jump_cost(stones[index], stones[index + 1]))
    if index + 2 < n:
      cost[index + 2] = min(cost[index + 2], cost[index] + jump_cost(stones[index], stones[index + 2]))

  print(cost[-1])
  return cost[-1]

n = int(input())
stones = [int(i) for i in input().split()]
stone_jump(n, stones)
l = input().split()
A = l[0]
B = l[1]
T = A + B
if T < 24:
	print(T)
else:
	print(T-24)

### FIXED CODE ###

l = input().split()
A = int(l[0])
B = int(l[1])

T = int(A + B)
if T < 24:
	print(T)
else:
	print(T - 24)
from math import lcm

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

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

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

### FIXED CODE ###

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

def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

def lcm(a, b):
    return (a * b)//gcd(a,b)

lcm_a = 1

for i in range(N):
    lcm_a = lcm(lcm_a,A[i])

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

mod = int(1e9+7)

print(ans%mod)
N,k = map(int,input().split())
S = input()
lenth = 0
AllLen =[]
preS0,preS1 = S.split('1'),S.split('0')
S0 = [i for i in preS0 if i != '']
S1 = [i for i in preS1 if i != '']
num0 = k
if len(S0) <= k:
	print(len(S))
if S[0] == '0':
	J = k
else:J = k + 1
FirstLen = sum([len(S0[i]) for i in range(k)]) + sum([len(S1[j]) for j in range(J)])
AllLen.append(FirstLen)
CheckLen = FirstLen
if S[0] == '1' and S[-1] == '1':
    for i in range(len(S0) - k):
	    CheckLen = CheckLen - len(S0[i]) - len(S1[i]) + len(S0[i + k]) + len(S1[i + k + 1])
	    AllLen.append(CheckLen)
if S[0] == '0' and S[-1] == '1':
	CheckLen = CheckLen - len(S0[0]) + len(S0[k]) + len(S1[k])
	AllLen.append(CheckLen)
	for i in range(len(S0) - k - 1):
		CheckLen = CheckLen - len(S0[i]) - len(S1[i]) + len(S0[i + k]) + len(S1[i + k + 1])
		AllLen.append(CheckLen)
if S[0] == '1' and S[-1] == '0':
	for i in range(len(S0) - k - 1):
		CheckLen = CheckLen - len(S0[i]) - len(S1[i]) + len(S0[i + k]) + len(S1[i + k + 1])
		AllLen.append(CheckLen)
	CheckLen = CheckLen - len(S0[len(S0) - k - 1]) - len(S1[len(S0) - k - 1]) + len(S0[len(S0) - 1])
	AllLen.append(CheckLen)
if S[0] == '0' and S[-1] == '0':
	CheckLen = CheckLen - len(S0[0]) + len(S0[k]) + len(S1[k])
	AllLen.append(CheckLen)
	for i in range(len(S0) - k - 2):
		CheckLen = CheckLen - len(S0[i]) - len(S1[i]) + len(S0[i + k]) + len(S1[i + k + 1])
		AllLen.append(CheckLen)
	CheckLen = CheckLen - len(S0[len(S0) - k - 1]) - len(S1[len(S0) - k - 1]) + len(S0[len(S0) - 1])
	AllLen.append(CheckLen)
print(max(AllLen))

### FIXED CODE ###

n,k = map(int,input().split())
s = input()
befores = '1'
cnt = 0
snum = []
for S in s:
	if S == befores:
		cnt += 1
	else:
		snum.append(cnt)
		cnt = 1
		befores = S
snum.append(cnt)
if s[-1] == '0':
    snum.append(0)
kazu = sum(snum[0:k * 2  + 1])
kaisuu = sum(snum[0:k * 2  + 1])
time = int((len(snum) - k * 2 - 1) / 2 )
one = 0
zero = 1
k = k * 2
for i in range(time):
	kazu = kazu - snum[one] - snum[zero] + snum[one + k + 2] + snum[zero + k]
	kaisuu = max(kaisuu,kazu)
	one += 2
	zero += 2
print(kaisuu)
x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = []
for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])


ab.sort(reversed=True)
c.sort(reversed=True)

abc = []
for i in range(k):
    for j in range(z):
        abc.append(ab[i] + c[i])


abc.sort(reversed=True)
for i in range(k):
    print(abc[i])


### FIXED CODE ###

import heapq

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

cnt = 0
q = []
arg = (0, 0, 0)
visited = {}
visited[arg] = True
heapq.heappush(q, (-(a[arg[0]] + b[arg[1]] + c[arg[2]]),) + arg)

while cnt < k:
    score, ia, ib, ic = heapq.heappop(q)
    print(-score)
    cnt += 1
    arg_a = (ia + 1, ib, ic)
    arg_b = (ia, ib + 1, ic)
    arg_c = (ia, ib, ic + 1)
    if arg_a[0] <= x - 1 and arg_a not in visited:
        heapq.heappush(
            q, (-(a[arg_a[0]] + b[arg_a[1]] + c[arg_a[2]]),) + arg_a)
        visited[arg_a] = True
    if arg_b[1] <= y - 1 and arg_b not in visited:
        heapq.heappush(
            q, (-(a[arg_b[0]] + b[arg_b[1]] + c[arg_b[2]]),) + arg_b)
        visited[arg_b] = True
    if arg_c[2] <= z - 1 and arg_c not in visited:
        heapq.heappush(
            q, (-(a[arg_c[0]] + b[arg_c[1]] + c[arg_c[2]]),) + arg_c)
        visited[arg_c] = True
S = input()
K = int(input())
index = 0
for i in range(len(S)):
    if S[i] != "1":
        break
    else:
        n += 1

if K < n-1:
    print(S[n])
else:
    print(S[n])

### FIXED CODE ###

S = list(input())
K = int(input())
n = 0
for i in range(len(S)):
    if S[i] != "1":
        n = i +1
        break

if K < n:
    print(1)
else:
    print(int(S[n-1]))
S=input()
res1,res2=0
for i in range(1000):
  S=S.replace("10","3")
  S=S.replace("01","3")
  res1+=S.count("3")*2
  S=S.replace("3","")
for j in range(1000):
  S=S.replace("10","3")
  S=S.replace("01","3")
  res2+=S.count("3")*2
  S=S.replace("3","")
if res1>res2:
  print(res2)
else:
  print(res1)

### FIXED CODE ###

S=input()
if S.count("1")>=S.count("0"):
  print(S.count("0")*2)
else:
  print(S.count("1")*2)
def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d-3):
            if s[i] == s[i+1] == s[i+2] and s[i] = '.':
                print('Yes')
                return
                

        print('No')



if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No')



if __name__ == '__main__':
    main()
import math
import bisect

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

def XX(A, M):
  if M <= 0:
    return
  A[0] = A[0]/2
  M -= 1
  for i in range(1, len(A)):
    if A[i] > A[0] and M > 0:
      A[i] = A[i]/2
      M -= 1
    else:
      break
  A.sort(reverse = True)
  XX(A, M)
  
A = list(map(math.floor, A))
XX(A, M)
print(sum(A))
  
           

### FIXED CODE ###

import math
import bisect

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

def XX(A, M):
  if M <= 0 or A[0]<1:
    return
  A[0] = A[0]/2
  M -= 1
  for i in range(1, len(A)):
    if A[i] > A[0] and M > 0:
      A[i] = A[i]/2
      M -= 1
    else:
      break
  A.sort(reverse = True)
  XX(A, M)
  
XX(A, M)
A = list(map(math.floor, A))
print(sum(A))