Harryxun/stf_run huggingface dataset:
N, K = map(int, input().split())
S = input()
S = S + "2"
chokuritsu = []
sakadachi = []
flag = S[0]
count = 1
for c in S:
    if flag != c:
        if c == "1":
            chokuritsu.append(count)
        elif c == "0":
            sakadachi.append(count)
        elif c == "2":
            if flag == "1":
                sakadachi.append(count-1)
            else:
                chokuritsu.append(count-1)

        count = 1
        flag = c
    else:
        count += 1
ans = 0
sub_ans = 0

if S[0] == "1":
    for i in range(min(K, len(sakadachi) - 1)):
        sub_ans += sakadachi[i] + chokuritsu[i]
    sub_ans += sakadachi[min(K-1, len(sakadachi)-1)]
    ans = max(ans, sub_ans)
    for i in range(len(sakadachi) - K):
        sub_ans += sakadachi[i+K] + chokuritsu[i+K-1]
        sub_ans -= sakadachi[i] + chokuritsu[i-1]
        ans = max(ans, sub_ans)

    if S[-1] == "0":
        sub_ans = chokuritsu[-1]
        for i in ragne(len(sakadachi)-1, len(sakadachi) - 1 - min(K -1, len(sakadachi)), -1):
            sub_ans += sakadachi[i] + chokuritsu[i]
    ans = max(ans, sub_ans)

else:
    sub_ans = chokuritsu[0]
    for i in range(min(K - 1, len(sakadachi) - 1)):
        sub_ans += sakadachi[i] + chokuritsu[i]
    ans = max(ans, sub_ans)
    sub_ans = 0
    for i in range(min(K, len(sakadachi) - 1)):
        sub_ans += sakadachi[i] + chokuritsu[i+1]
    sub_ans += sakadachi[min(K-1, len(sakadachi)-1)]

    for i in range(len(sakadachi) - K):
        sub_ans += sakadachi[i+K] + chokuritsu[i+K]
        sub_ans -= sakadachi[i] + chokuritsu[i]
        ans = max(ans, sub_ans)

    if S[-1] == "0":
        sub_ans = chokuritsu[-1]
        for i in ragne(len(sakadachi)-1, len(sakadachi) - 1 - min(K -1, len(sakadachi)), -1):
            sub_ans += sakadachi[i] + chokuritsu[i]
    ans = max(ans, sub_ans)

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
S = input()

nums = []
now = 1
seq_count = 0
for char in S:
    if char == str(now):
        seq_count += 1
    else:
        now = 1 - now
        nums.append(seq_count)
        seq_count = 1

nums.append(seq_count)

if len(nums) % 2 == 0:
    nums.append(0)

sums = [0] * (len(nums) + 1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]

ans = 0
for i in range(1, len(sums), 2):
    left = i - 1
    right = min(i + 2 * K, len(sums) - 1)
    ans = max(ans, sums[right] - sums[left])
print(ans)
from math import gcd
from math import sqrt
A, B = map(int, input().split())
if (A == 1 or B == 1 or A == B):
    print(1)
    exit(0)

C = gcd(A, B)
ans = 0
for i in range(1, C + 1):
    if (C % i == 0):
        C //= i
        ans += 1
    if (i >= C): break
print(ans)


### FIXED CODE ###

from fractions import gcd
from math import sqrt


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    A, B = map(int, input().split())
    C = gcd(A, B)
    if (C == 1):
        print(1)
        exit(0)
    arr = factorization(C)
    # print(arr)
    print(len(arr) + 1)


if __name__ == "__main__":
    main()
ab = input( )

ab = ab.split()

SUM = 1
for i in range(int(ab[0])):
    SUM = SUM * int(ab[i+1])
    
if (int(SUM) < 10 ** 18):
    print(SUM)
else:
    print(-1)

### FIXED CODE ###

def main ():
    N = int(input())
    A = list(map(int,input().split()))
    if 0 in A:
        print (0)
        return
    prod = 1 
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1) 
            return
    print(prod)

    
main ()
n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n+1):
        if listA[0][j] not in listA[i] and listA[0][j] == listA[i][0]:
            break
    else:
    	x += 1
print(x)

### FIXED CODE ###

n,m = map(int,input().split())
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;
x = 0
for j in range(1,listA[0][0]+1):
    for i in range(1,n):
        listB = []
        for k in range(1,listA[i][0]+1):
          listB.append(listA[i][k])
        if listA[0][j] not in listB:
          break
    else:
    	x += 1
print(x)
n = input()
ps = [map(int, raw_input().split()) for i in xrange(n)]
def intersection(p1, p2, q1, q2):
    dx0 = p2[0] - p1[0]
    dy0 = p2[1] - p1[1]
    dx1 = q2[0] - q1[0]
    dy1 = q2[1] - q1[1]
    a = dy0*dx1; b = dy1*dx0; c = dx0*dx1; d = dy0*dy1
    if a == b: return None
    x = (a*p1[0] - b*q1[0] + c*(q1[1] - p1[1])) / float(a - b)
    y = (c*p1[1] - a*q1[1] + d*(q1[0] - p1[0])) / float(b - a)
    return x, y
def cross(a, b, c):
    return (b[0]-a[0])*(c[1]-a[1]) - (b[1]-a[1])*(c[0]-a[0])
def calc_area(ps):
    return abs(sum(ps[i][0]*ps[i-1][1] - ps[i][1]*ps[i-1][0] for i in xrange(n))) / 2.
for t in xrange(input()):
    vs = []
    x1, y1, x2, y2 = map(int, raw_input().split())
    p1 = (x1, y1); p2 = (x2, y2)
    for i in xrange(n):
        q1 = ps[i-1]; q2 = ps[i]
        if cross(p1, p2, q1) * cross(p1, p2, q2) <= 0:
            r = intersection(p1, p2, q1, q2)
            if r is not None:
                vs.append(r)
        if cross(p1, p2, q2) >= 0:
            vs.append(q2)
    print "%.09f" % calc_area(vs)

### FIXED CODE ###

import sys
readline = sys.stdin.readline
write = sys.stdout.write
def cross3(O, A, B):
    ox, oy = O; ax, ay = A; bx, by = B
    return (ax - ox) * (by - oy) - (bx - ox) * (ay - oy)
def cross_point(p0, p1, q0, q1):
    x0, y0 = p0; x1, y1 = p1
    x2, y2 = q0; x3, y3 = q1
    dx0 = x1 - x0; dy0 = y1 - y0
    dx1 = x3 - x2; dy1 = y3 - y2
    s = (y0-y2)*dx1 - (x0-x2)*dy1
    sm = dx0*dy1 - dy0*dx1
    if -EPS < sm < EPS:
        return None
    return x0 + s*dx0/sm, y0 + s*dy0/sm
EPS = 1e-9
def convex_cut(P, line):
    q0, q1 = line
    N = len(P)
    Q = []
    for i in range(N):
        p0 = P[i-1]; p1 = P[i]
        cv0 = cross3(q0, q1, p0)
        cv1 = cross3(q0, q1, p1)
        if cv0 * cv1 < EPS:
            v = cross_point(q0, q1, p0, p1)
            if v is not None:
                Q.append(v)
        if cv1 > -EPS:
            Q.append(p1)
    return Q
def polygon_area(P):
    s = 0
    N = len(P)
    for i in range(N):
        p0 = P[i-1]; p1 = P[i]
        s += p0[0]*p1[1] - p0[1]*p1[0]
    return abs(s) / 2
def solve():
    N = int(readline())
    P = [list(map(int, readline().split())) for i in range(N)]
    Q = int(readline())
    for i in range(Q):
        x0, y0, x1, y1 = map(int, readline().split())
        P0 = convex_cut(P, ((x0, y0), (x1, y1)))
        write("%.16f\n" % polygon_area(P0))
solve()
a = []
for i in range(3):
  a[i] = input().split()
print(a[0][0]+a[1][1]+a[2][2])

### FIXED CODE ###

a = []
for i in range(3):
  a.append(input())
print(a[0][0]+a[1][1]+a[2][2])
import numpy
import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = np.array([K for _ in range(N)])

for q in range(Q):
    A = int(input()) - 1
    points -= 1
    points[A] +=1

for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')


### FIXED CODE ###

import numpy as np
import sys
def input():
    return sys.stdin.readline()[:-1]

N, K, Q = map(int, input().split())

points = np.array([K - Q for _ in range(N)])

for q in range(Q):
    A = int(input()) - 1
    points[A] +=1

for p in points:
    if p < 1:
        print('No')
    else:
        print('Yes')
#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int
import math
from itertools import accumulate

def solve(N: int, x: "List[int]"):
    gyakusu = []
    dif_x = []
    for i in range(1,N):
        gyakusu.append(1/i)
        dif_x.append(x[i]-x[i-1])
    
    accum_gyakusu = list(accumulate(gyakusu))
    answer = 0

    for i in range(N-1):
        answer += accum_gyakusu[i]*dif_x[i]
        answer %= MOD
    
    print(int(answer*math.factorial(N-1)%MOD))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, x)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int
import math
from itertools import accumulate

def mod_factorial(n):
    value = 1
    for i in range(n,0,-1):
        value*=i
        value%=MOD

    return value

def solve(N: int, x: "List[int]"):
    dif_x = []

    # factmod[i] = (N-1)!/iをMODで割ったあまり
    factmod = [0]*(N)
    factmod[1] = mod_factorial(N-1)
    for i in range(1,N):
        dif_x.append(x[i]-x[i-1])
    
    for i in range(2,N):
        factmod[i] = factmod[1]*pow(i,MOD-2,MOD)
    
    accum_fact_mod = list(accumulate(factmod))
        
    answer = 0

    for i in range(N-1):
        answer += accum_fact_mod[i+1]*dif_x[i]
        answer %= MOD
    
    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, x)

if __name__ == '__main__':
    main()
n, l = map(int, input().split())
if l>=0:
	print(n**2/2+l*n-n/2-l)
if l<0 and n-1<l:
  	print(n**2/2+l*n-n/2)
else:
  	print((n**2/2)+l*n-n/2-l-n+1)

### FIXED CODE ###

S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
	print('Bad')
else:
  	print('Good')
import numpy as np
n,k = map(int,input().split())

arr = list(map(int,input().split()))
s = [0 for i in range(n)]
temp = 0

ans = 0
for i in range(n):
    temp += arr[i]
    s[i] = temp

for i in range(1,k+1):
    upper = min(n,i)
    for j in range(upper+1):
        v = 0
        a = []
        for l in range(j):
            v += arr[l]
            a.append(arr[l])
        for l in range(1,i+1-j):
            v+= arr[-l]
            a.append(arr[-l])
        a.sort()
        # print(a,v)
        if k-i > 0:
            up = min(k-i,i)
            for l in range(up):
                if a[l] < 0:
                    v -= a[l]
                else:
                    break
        if v > ans:
            ans = v

print(ans)




### FIXED CODE ###

import numpy as np
n,k = map(int,input().split())

arr = list(map(int,input().split()))
s = [0 for i in range(n)]
temp = 0
ans = 0

for i in range(1,k+1):
    upper = min(n,i)
    for j in range(upper+1):
        v = 0
        a = []
        for l in range(j):
            v += arr[l]
            a.append(arr[l])
        for l in range(1,upper+1-j):
            v+= arr[-l]
            a.append(arr[-l])
        a.sort()
        # print(a,v)
        up = min(k-upper,i)
        for l in range(up):
            if a[l] < 0:
                v -= a[l]
            else:
                break
        if v > ans:
            ans = v

print(ans)
s=input()
t=input()
u=''
v=[]
count=0

for i in range(len(s)-len(t)+1):
    for j in range(len(t)):
        if t[j]==s[i+j] or s[i+j]=='?':
            count+=1
    if count==len(t):
        for k in range(len(s)):
            if k>=i:
                u+=t[k-i]
            elif s[k]=='?':
                u+='a'
            else:
                u+=s[k]
                    
                    
        v.append(u)
        u=''
    count=0
if v==[]:
    print('UNRESTORABLE')
else:
    print(min(v))

### FIXED CODE ###

s=input()
t=input()
u=''
v=[]
count=0

for i in range(len(s)-len(t)+1):
    for j in range(len(t)):
        if t[j]==s[i+j] or s[i+j]=='?':
            count+=1
    if count==len(t):
        for k in range(len(s)):
            if i<=k<=i+len(t)-1:
                u+=t[k-i]
            elif s[k]=='?':
                u+='a'
            else:
                u+=s[k]
                    
                    
        v.append(u)
        u=''
    count=0
if v==[]:
    print('UNRESTORABLE')
else:
    print(min(v))
N = int(input())
A = list(map(int,input().split()))
res = rep(0,N)
for i in range(N-1):
  res[A[i]-1] += 1
for i in res:
  print(i)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
res = [0 for i in range(N)]
for i in range(N-1):
  res[A[i]-1] += 1
for i in res:
  print(i)
import math
n, m = map(int,input().split(' '))
d = list(map(int,input().split(' ')))
d.sort()
inf = n

dp = [ [ inf for i in range(m+1)] for j in range(n+1) ]

# dp
for j in range(m+1):
    dp[0][j]=0

for j in range(m-1,-1,-1):
    for i in range(n+1):
        #for k in range(math.floor(i/d[j])+1):
        k=1
        r = k*d[j]
        #print(i,j,k)
        dp[i][j] = min( dp[i][j], dp[i][j+1], dp[i-r][j]+k ) 
        #print("dp:",i,j,dp[i][j])
print(dp[n][0])



### FIXED CODE ###

import math
n, m = map(int,input().split(' '))
d = list(map(int,input().split(' ')))
d.sort()
inf = n

dp = [ [ inf for i in range(m+1)] for j in range(n+1) ]

# dp
for j in range(m+1):
    dp[0][j]=0

for j in range(m-1,-1,-1):
    for i in range(n+1):
        #for k in range(math.floor(i/d[j])+1):
        if math.floor(i/d[j]) >=1:
            k=1
        else:
            k=0
        r = k*d[j]
        #print(i,j,k)
        dp[i][j] = min( dp[i][j], dp[i][j+1], dp[i-r][j]+k ) 
        #print("dp:",i,j,dp[i][j])
print(dp[n][0])
num = list(map(int,input()
.split()))
if num[2] !=100:
    if num[0] == 0:
        ans = num[1]
    elif num[0] == 1:
        ans = num[1]*100
    elif num[0] == 2:
        ans = num[1]*10000
else:
    if num[0] == 0:
        ans = num[1]+1
    elif num[0] == 1:
        ans = num[1]*100+100
    elif num[0] == 2:
        ans = num[1]*10000+10000

print(ans)

### FIXED CODE ###

num = list(map(int,input()
.split()))
if num[1] !=100:
    if num[0] == 0:
        ans = num[1]
    elif num[0] == 1:
        ans = num[1]*100
    elif num[0] == 2:
        ans = num[1]*10000
else:
    if num[0] == 0:
        ans = num[1]+1
    elif num[0] == 1:
        ans = num[1]*100+100
    elif num[0] == 2:
        ans = num[1]*10000+10000

print(ans)
n, k = map(int,input().split())
a_list = list(map(int,input().split()))
a_list.sort()

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

sum_val = 0
val = cmb(n-1, k-1)
for i in range(n-k+1):
    if i != 0:
        val = val*(n-i-k+1)/(n-i)
    sum_val = (sum_val + (((a_list[-(i+1)])*val) - ((a_list[i])*val)+(10**9+7))%(10**9+7))%(10**9+7)


print(int(sum_val))

### FIXED CODE ###

n, k = map(int, input().split())
a_list = list(map(int, input().split()))
a_list.sort()


mod = 10 ** 9 + 7
f_list = [1]
for i in range(1,n+1):
    f_list.append((f_list[-1] * i) % mod)
def comb(n,r):
    return f_list[n] * (pow(f_list[r], mod-2, mod) * pow(f_list[n-r], mod-2, mod) % mod) % mod


max_val = 0
min_val = 0
for i in range(n - k + 1):
    val = comb(n - i - 1, k - 1)
    max_val = (max_val + (((a_list[-(i + 1)]) * val))) % (10 ** 9 + 7)
    min_val = (min_val + ((a_list[i]) * val)) % (10 ** 9 + 7)

print(int((max_val - min_val) % (10 ** 9 + 7)))
n=int(input())
max=-1000001;min=1000001;g=0;i=0;
num=list()
while i<n:
 num+=map(int,input().split())
 i=i+1
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
print(min,max,g)


### FIXED CODE ###

n=int(input())
max=-1000001;min=1000001;g=0;i=0;
num=list(map(int,input().split()))
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
 i+=1
print(min,max,g)
W, H, x, y, r = map(int, input(). split())
if 2*r >= W or 2*r >= H or x >= W or y >= H:
       print(‘No’)
else
       print(‘Yes’)


### FIXED CODE ###

W, H, x, y, r = map(int, input().split())
if x < r or y < r or W - x < r or H - y < r:
    print("No")
else:
    print("Yes")
def _input(n):
    return [int(raw_input()) if i in xrange(n)]

def LIS(arr):
    arr = [0] + arr
    L = [0] + [0] * len(arr)
    P = [-1] + [0] * len(arr)

    for i in xrange(1, len(arr)):
        k = 0
        for j in xrange(0, i):
            if arr[j] < arr[i] and L[j] > L[k]:
                k = j
        L[i] = L[k] + 1
        P[i] = k

    return max(L)

#==============================================
def main():
    n = int(raw_input())
    arr = _input(n)
    print LIS(arr)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import bisect

def _input(n):
    return [int(raw_input()) for i in xrange(n)]

# Wrapper for built-in function
def lower_bound(arr, target):
    return bisect.bisect_right(arr, target)


def LIS(arr, n):
    L = [0] * n

    L[0] = arr[0]
    length = 1

    for i in xrange(1, n):
        if L[length - 1] < arr[i]:
            L[length] = arr[i]#L.append(A[i])
            length += 1
        else:
            if L[lower_bound(L[:length], arr[i])-1 if lower_bound(L[:length], arr[i])-1 > 0 else 0] \
                    != arr[i]: # Fix common item - Dont insert common item and zero Problem
                L[lower_bound(L[:length], arr[i])] = arr[i]
    return length, L

#=========================================================
def main():

    n = int(raw_input())
    arr = _input(n)
    print LIS(arr, n)[0]#, LIS(arr, n)[1]#, arr

if __name__ == "__main__":
    main()
a,b,c,d = map(int, input().split())
res = a+b - (c+d)
if res > 0:
  print('Left')
elif res = 0:
  print('Balanced')
else:
  print('Right')

### FIXED CODE ###

a,b,c,d = map(int, input().split())
res = a+b - (c+d)
if res > 0:
  print('Left')
elif res == 0:
  print('Balanced')
else:
  print('Right')
n = int(input())
aka = []
ao = []
for _ in range(n):
    ab = sorted(list(map(int, input().split())), key=lambda x:x[1], reverse=True)
    aka.append(ab)
for _ in range(n):
    cd = sorted(list(map(int, input().split())))
    ao.append(cd)
count = 0
for a, b in aka:
    for c, d in ao:
        if a<c and b<d:
            ao.remove(c,d)
            count+=1
print(count)

### FIXED CODE ###

n = int(input())
aka = []
ao = []
for _ in range(n):
    ab = list(map(int, input().split()))
    aka.append(ab)
aka = sorted(aka, key=lambda x:x[1], reverse=True)
for _ in range(n):
    cd = list(map(int, input().split()))
    ao.append(cd)
ao = sorted(ao)
count = 0
for a, b in aka:
    for c, d in ao:
        if a<c and b<d:
            ao.remove([c,d])
            count+=1
            break
print(count)
import itertools
def main():
    S = int(input())
    a = [int(i) for i in input().split()]
    x = 10**9
    
    xor = 0
    patern = list(itertools.combinations(a, 2))
    for p in patern:
        xor += p[0] ^ p[1]
    if xor >= x:
        print(xor % (x + 7))
    else:
        print(xor)

if __name__ == '__main__':
    main()

### FIXED CODE ###

N,K,Q=map(int,input().split())

if(N + K + Q >= 22):
    print("bust")
else:
    print("win")
N,M = map(int,input().split())
res = []
for i in range(N):
    res.append(list(map(int,input().split())))

if N == 1:
    print(res[0][0])
    exit()

s = [0 for i in range(M)]
for i in res:
    for j in i[1:]:
        s[j-1] += 1

count = 0
for i in range(N):
    if s[i] == N:
        count += 1

### FIXED CODE ###

N,M = map(int,input().split())
res = []
for i in range(N):
    res.append(list(map(int,input().split())))

if N == 1:
    print(res[0][0])
    exit()

s = [0 for i in range(M)]
for i in res:
    for j in i[1:]:
        #print(j)
        s[j-1] += 1

#print(s)

count = 0
for i in range(M):
    if s[i] == N:
        count += 1

print(count)
#coding:utf-8
N,M=map(int,raw_input().split())
A=map(int,raw_input().split())
dp=[-1 for i in range(N + 1)]
Cost={(i+1):v for i,v in enumerate([2,5,5,4,5,6,3,7,6])}

for a in A:
    dp[Cost[a]]=1
for n in range(N+1):
    for a in A:
        if dp[n-Cost[a]] != -1:
            dp[n]=max(dp[n], dp[n-Cost[a]]+1)
k=dp[N]
n=N
buf=[]
if dp[N]-1>0:
    for i in range(dp[N]-1):
        b=-1
        for a in A:
            if dp[n-Cost[a]] == k-1:
                b=max(b,a)
            
        k-=1
        n-=Cost[b]
        buf.append(b)
b=-1
for a in A:
    if Cost[a] == n:
        b=max(b,a)
buf.append(b)
print("".join(map(str,buf)))







### FIXED CODE ###

#coding:utf-8
N,M=map(int,raw_input().split())
A=map(int,raw_input().split())
dp=[-1 for i in range(10**4 + 1)]
Cost={(i+1):v for i,v in enumerate([2,5,5,4,5,6,3,7,6])}

for a in A:
    dp[Cost[a]]=1
for n in range(2,N+1):
    for a in A:
        if n-Cost[a]>=0 and dp[n-Cost[a]] != -1:
            dp[n]=max(dp[n], dp[n-Cost[a]]+1)
k=dp[N]
n=N
buf=[]
for i in range(dp[N]-1):
    b=-1
    for a in A:
        if n-Cost[a]>=0 and dp[n-Cost[a]] == k-1:
            b=max(b,a)
    k-=1
    n-=Cost[b]
    buf.append(b)
b=-1
for a in A:
    if Cost[a] == n:
        b=max(b,a)
buf.append(b)   
print("".join(map(str,buf)))
s = input()
print(s.rfond("Z") - s.find("A") + 1)

### FIXED CODE ###

s = input()
print(s.rfind("Z") - s.find("A") + 1)
x, a = map(int, input())

if x < a:
    print('0')

if x >= a:
    print('10')


### FIXED CODE ###

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

if x < a:
    print('0')

if x >= a:
    print('10')
import math
r=int(input())
pi=round(math.pi,7)
length=str(round(r*2*pi,6))
area=str(round(r**2*pi,6))
print("{} {}".format(length,area))


### FIXED CODE ###

import math
pi=math.pi
r=float(input())
print("{:.5f} {:.5f}".format(r*r*pi,2*r*pi))
n, a, b= map(int, input().split())
if b < na:
  print(b)
else:
  print(na)

### FIXED CODE ###

n, a, b= map(int, input().split())
if b < n*a:
  print(b)
else:
  print(n*a)
n,m=map(int,input().split())
lst=[]
for i in range(m):
  p,y=map(int,input().split())
  lst.append([p,y])
lst.sort(lambda x:(x[0],x[1]))
j=1
for i in range(m):
  if i<m-1:
    if lst[i][0]==lst[i+1][0]:
      s=str(lst[i][0])
      t=str(j)
      s.zfill(6)
      t.zfill(6)
      u=s+t
      j+=1
      print(int(u))
    else:
      s=str(lst[i][0])
      t=str(j)
      s.zfill(6)
      t.zfill(6)
      u=s+t
      j-=j-1
      print(int(u))
    
  


### FIXED CODE ###

n,m=map(int,input().split())
lst=[]
for i in range(m):
  p,y=map(int,input().split())
  lst.append([i,p,y])
lst.sort(key=lambda x:(x[1],x[2]))
j=1
Lst=[]
for i in range(m):
  if lst[i][1]==lst[min(m-1,i+1)][1]:
    s=str(lst[i][1])
    t=str(j)
    u=s.zfill(6)+t.zfill(6)
    j+=1
    Lst.append([lst[i][0],u])
  else:
    s=str(lst[i][1])
    t=str(j)
    u=s.zfill(6)+t.zfill(6)
    j-=j-1
    Lst.append([lst[i][0],u])
Lst.sort(key=lambda x:x[0])
for k in range(m):
  print(Lst[k][1])
l=[]
for i in range(3):
  l.append(int(input()))
d=l[0]
t=l[1]
s=l[2]

time=d/s
if(time<=t):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

d,t,s=map(int,input().split())
time=d/s
if(time<=t):
  print("Yes")
else:
  print("No")
import numpy as np
INF = float('inf')
MAX_N = 10**5

N = int(input())
a,b,c = [0]*N, [0]*N, [0]*N
for i in range(N):
    a[i],b[i],c[i] = map(int, input().split())

# dp table
# dp[i][j] := 状態jにおけるi日目に得る幸福度の総和の最大値
dp = np.array([[0]*3 for _ in range(N)])

dp[0][0],dp[0][1],dp[0][2] = a[0],b[0],c[0]

for i in range(1,N):
    for j in range(3):
        if j==0:
            dp[i][j] = max(dp[i-1][j+1]+a[i],dp[i-1][j+2]+a[i])
        if j==1:
            dp[i][j] = max(dp[i-1][j-1]+b[i],dp[i-1][j+1]+b[i])
        if j==2:
            dp[i][j] = max(dp[i-1][j-2]+c[i],dp[i-1][j-1]+c[i])
print(max(dp[N-1]))

### FIXED CODE ###

N = int(input())
a = [[0 for _ in range(3)] for _ in range(N)]
for i in range(N):
    t = list(map(int, input().split()))
    for j in range(3):
        a[i][j] = t[j]

dp = [[0 for _ in range(3)] for _ in range(N+1)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = max(dp[i+1][k], dp[i][j] + a[i][k])
#print(dp)


answer = 0
for j in range(3):
    answer = max(answer, dp[N][j])

print(answer)
a,b=map(int,input().split())
print(a*b (a+b)*2\n)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,(a+b)*2)