Harryxun/stf_run huggingface dataset:
N, K = map(int, input().split())
S = list(input())
import re

def kazo(memo):
    zeronum = []
    zerotmp = 0
    l, r = 0, 1
    for i in range(0, N):
        if memo[i+1] > memo[i]:
            zeronum.append([zerotmp, l, r-1])
            zerotmp = 0
            l = i+1
            r = l
        else:
            zerotmp += 1
            r += 1
    return sorted(zeronum, key=lambda x: x[0])[-1]

for i in range(K):
    memo = [0]*(N+1)
    for i in range(N):
        if S[i] == '1':
            memo[i+1] = memo[i]+1
        else:
            memo[i+1] = memo[i]
    num, l, r = kazo(memo)
    for j in range(l, r+1):
        S[j] = '1'

import re

def renzoku(string):
    return len(sorted(re.findall(r'1+', string), key=lambda x: -len(x))[0])

print(renzoku(''.join(S)))


### FIXED CODE ###

N, K = map(int, input().split())
S = list(map(int, list(input())))
now = 1
cnt = 0
Nums = []
for i in range(N):
    if S[i] == now:
        cnt += 1
    else:
        Nums.append(cnt)
        now = 1 - now
        cnt = 1
if cnt != 0:
    Nums.append(cnt)

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

add = 2*K+1
ans = 0
left, right = 0, 0
tmp = 0  # sum of [left, right)
for i in range(len(Nums))[::2]:
    next_left = i
    next_right = min(i + add, len(Nums))
    while next_left > left:
        tmp -= Nums[left]
        left += 1
    while next_right > right:
        tmp += Nums[right]
        right += 1

    ans = max(tmp, ans)

print(ans)
n = int(input())
print('Yes' if n/9 == n//9 else 'No')

### FIXED CODE ###

n = int(input())
print('Yes' if n % 9 == 0 else 'No')
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

for _ in range(int(input())):
    a = input()
    b = input()
    if a == b[:-1]: print("Yes")
    else: print("No")

### FIXED CODE ###

#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())


a = input()
b = input()
if a == b[:-1]:
    print("Yes")
else:
    print("No")
i=0
while True:
    i+=1
    x=raw_input()
    if x=='0':
        break
    print 'Case %d: %d' % (i,x)

### FIXED CODE ###

i=0
while True:
    i+=1
    x=raw_input()
    if x=='0':
        break
    print 'Case %d: %s' % (i,x)
2
1 2
50 50
50

### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


n = I()
a = LI()
a = list(map(lambda x: x - 1, a))
b = LI()
c = LI()

ans = 0
for i in range(n):
    ans += b[a[i]]
    if i > 0 and a[i - 1] + 1 == a[i]:
        ans += c[a[i - 1]]
print(ans)
n=int(inpput())
print(int((n+n**2+n**3)))

### FIXED CODE ###

n=int(input())
print(int(n+n**2+n**3))
n,k=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*14
for i in range(n):
    p=l[i]
    j=0
    while p>0:
        a[j]+=p%2
        p=p//2
        j+=1
ans=0
for i in range(13,-1,-1):
    if a[i]<n-a[i]:
        if k>=2**i:
            k-=2**i
            ans+=(2**i)*(n-a[i])
        else:
            ans+=(2**i)*a[i]
    else:
        ans+=(2**i)*a[i]
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))
a=[0]*42
for i in range(n):
    p=l[i]
    j=0
    while p>0:
        a[j]+=p%2
        p=p//2
        j+=1
ans=0
for i in range(41,-1,-1):
    if a[i]<n-a[i]:
        if k>=2**i:
            k-=2**i
            ans+=(2**i)*(n-a[i])
        else:
            ans+=(2**i)*a[i]
    else:
        ans+=(2**i)*a[i]
print(ans)
import math
from functools import reduce
# 長さN
# 整数M
N, M = map(int, input().split())

# 長さNからなる偶数列: a
a = list(set(map(int, input().split())))
print(a)

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

if M//(lcm_list(a)) == 0:
    print(0)
else:
    print(M//(lcm_list(a))+1)

### FIXED CODE ###

import fractions
n,m=map(int,input().split())
lis  = list(map(int,input().split()))
#aそれぞれを2で割ったものを持っておく
div = []
for i in range(n):
    div.append(lis[i]//2)
#lisそれぞれの要素を2で割り切れる回数をすべて数える
L = []
for i in range(n):
    cnt = 0
    while lis[i] %2 ==0:
        lis[i] //= 2
        cnt += 1
    L.append(cnt)

bl = True
#重複要素を削除して要素数でLがすべて一緒か判断
def set_list(es):
    return len(list(set(es))) == 1

if set_list(L) != 1:
    print(0)
    exit()

#div内の最小子公倍数ansを求める

ans = div[0]
for i in range(1,n):
    ans =ans*div[i]//fractions.gcd(ans,div[i])

S = m//ans
if S %2 ==0:
    print(S//2)
else:
    print(S//2 +1)
#in1 = '10 10 20'
#in2 = ['1 1', '1 4', '1 9', '2 5', '3 10', '4 2', '4 7', '5 9', '6 4', '6 6', '6 7', '7 1', '7 3', '7 7', '8 1', '8 5', '8 10', '9 2', '10 4', '10 9']
#in1 = '1000000000 1000000000 0'
h, w, n = map(int, input().split())
#h, w, n = map(int, in1.split())

idx1 = 0
ab = [[0 for i in range(2)] for j in range(n)]

black_cnt = [0] * 10
black_cnt[0] = (h - 2) * (w - 2)

if n != 0:
    while idx1 < n:
        x = input().split()
        #x = in2[idx1].split()
        ab[idx1][0] = int(x[0])
        ab[idx1][1] = int(x[1])
        idx1 += 1

    for idx1 in range(len(in2)):
        if ab[idx1][0] < 3:
            s = 0
        else:
            s = ab[idx1][0] - 3
        if ab[idx1][0] > h - 2:
            l = h - 2
        else:
            l = ab[idx1][0]
        Rrange = range(s, l)
        if ab[idx1][1] < 3:
            s = 0
        else:
            s = ab[idx1][1] - 3
        if ab[idx1][1] > w - 2:
            l = h - 2
        else:
            l = ab[idx1][1]
        Crange = range(s, l)

        for nowRow in Rrange:
            for nowCol in Crange:
                w_black = 0
                for idx2 in range(idx1):
                    if nowRow < ab[idx2][0] <= nowRow + 3 and nowCol < ab[idx2][1] <= nowCol + 3:
                        w_black += 1
                black_cnt[w_black]     -= 1
                black_cnt[w_black + 1] += 1

for idx1 in range(len(black_cnt)):
    print(black_cnt[idx1])


### FIXED CODE ###

#in1 = '4 5 8'
#in2 = ['1 1', '1 4', '1 5', '2 3', '3 1', '3 2', '3 4', '4 4']
#in1 = '10 10 20'
#in2 = ['1 1', '1 4', '1 9', '2 5', '3 10', '4 2', '4 7', '5 9', '6 4', '6 6', '6 7', '7 1', '7 3', '7 7', '8 1', '8 5', '8 10', '9 2', '10 4', '10 9']
#in1 = '1000000000 1000000000 0'
#h, w, n = map(int, in1.split())
h, w, n = map(int, input().split())

idx1 = 0
ab = [[0 for i in range(2)] for j in range(n)]

black_cnt = [0] * 10
black_cnt[0] = (h - 2) * (w - 2)

if n != 0:
    while idx1 < n:
        x = input().split()
        #x = in2[idx1].split()
        ab[idx1] = [int(x[0]), int(x[1])]
        idx1 += 1

    myDict = {}
    for abitem in ab:
        if abitem[0] < 3:
            sr = 0
        else:
            sr = abitem[0] - 3
        if abitem[0] > h - 3:
            lr = h - 2
        else:
            lr = abitem[0]
        if abitem[1] < 3:
            sc = 0
        else:
            sc = abitem[1] - 3
        if abitem[1] > w - 3:
            lc = w - 2
        else:
            lc = abitem[1]

        for nowRow in range(sr, lr):
            for nowCol in range(sc, lc):
                key = str(nowRow) + ',' + str(nowCol)
                if key in myDict:
                    myDict[key] += 1
                else:
                    myDict[key] = 1

    for bcnt in myDict.values():
        black_cnt[bcnt] += 1
        black_cnt[0]    -= 1

for item in black_cnt:
    print(item)
s = input()

import sys

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] not in 'RUD':
        print('No')
        sys.exit(1)
    if (i + 1) % 2 == 0 and s[i] not in 'LUD':
        print('No')
        sys.exit(1)
print('Yes')


### FIXED CODE ###

s = input()

import sys

for i in range(len(s)):
    if (i + 1) % 2 == 1 and s[i] not in 'RUD':
        print('No')
        sys.exit(0)
    if (i + 1) % 2 == 0 and s[i] not in 'LUD':
        print('No')
        sys.exit(0)
print('Yes')
n=int(input())
a=[int(x) for x in input().split()]
b=0
for i in a:
  b=b^a
if b==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
b=0
for i in a:
  b=b^i
if b==0:
  print("Yes")
else:
  print("No")
a,b,c,d = map(int, input().split())

nc = int(b/c) - int((a-1)/c)
# print(nc)

nd = int(b/d) - int((a-1)/d)
# print(nd)

import math 

def lcm(a,b):
    y = a*b/math.gcd(a,b)
    return int(y)

ncd = int(b/lcm(c,d)) - int((a-1)/lcm(c,d))
# print(ncd)

u = b - a + 1
# print(u)

ans = u - nc - nd + ncd

print(ans)

### FIXED CODE ###

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

nc = (b//c) - ((a-1)//c)
# print(nc)

nd = (b//d) - ((a-1)//d)
# print(nd)

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

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

ncd = (b//lcm(c,d)) - ((a-1)//lcm(c,d))
# print(ncd)

u = b - a + 1
# print(u)

ans = u - nc - nd + ncd

print(ans)
N = int(input())
a = list(map(int, input().split()))
point = 0
while True:
	for i in range(len(a)):
		if a[i] % 2 == 1:
			break
		else:
			point += 1
			a[i] //= 2
	print(point-1)
    break

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
 
count = 0
flag = True
while flag:
    for i in range(len(a)):
        if a[i] % 2 == 1:
            flag = False
        else:
            a[i] //= 2
    count += 1
 
print(count - 1)
s = input()
num = len(s)
ans = 0

def count(pos, befor):
  co = 0
  if pos >= num:
    ans = 12
    #print(li, len(li))
    return 1
  
  for p in range(1, num-pos+1):
    if s[pos:pos+p] != befor:
      a = count(pos + p, s[pos:pos+p])
      if a and a > co:
        co = a
        

  return co + 1

ans = count(0, "")
print(ans - 1)


### FIXED CODE ###

s = input()
num = len(s)
ans = 0
pos = 0
 
while True:
  c = s[pos]
  count = 0
  for i in range(num - pos):
    if s[pos + i] == c:
      count += 1
    else:
      ans += (count//3)*2  
      if i < num:
        if count % 3 == 1:
          ans += 1
        elif count % 3 == 2:
          ans += 2
          pos += 1
          pos += count
          count = 0
          
      break
  pos += count
  
  if pos >= num:
    ans += (count // 3) * 2 
    if count % 3 != 0:
      ans += 1
 
    break
 
 
print(ans)
N = list(map(int, input()))
N = N[::-1] + [0]
out = 0

def moveUp(i, N):
  if N[i] != 9:
      N[i] += 1
  else:
    N[i] = 0
    moveUp(i+1, N)

for i, n in enumerate(N):
  n = int(n)
  if n < 6:
    out += n
  else:
    out += 10-n
    moveUp(i+1, N)
print(out)


### FIXED CODE ###

N = list(map(int, input()))
N = N[::-1] + [0]

count = 0

for i, n in enumerate(N):
  if n < 5:
    count += n
  elif n > 5:
    count += 10 - n
    N[i+1] += 1
  elif n == 5:
    if N[i+1] >= 5:
      N[i+1] += 1
    count += 5
    
print(count)
a,b = map(int,input().split())

if (a+b)%2 ==0:
  print((a+B)/2)
else:
  print("IMPOSSIBLE")
        

### FIXED CODE ###

A,B = map(int,input().split())
 
if (A+B)%2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")
a = int(input())
b = int(input())
if a<9 and b<9: print("Yey!")
else: print(":(")

### FIXED CODE ###

a,b = (int(i) for i in input().split())
if a<9 and b<9: print("Yay!")
else: print(":(")
pi = 3.1415926535897
r = int(input())
print(pi*r**2, 2*pi*r)


### FIXED CODE ###

pi = 3.1415926535897
r = float(input())
print(pi*r**2, 2*pi*r)
from math import factorial
N=int(input())
count=[0]
u=0
s=[sorted(input()) for i in range(N)]
s=sorted(s)
for t in range(N-1):
    if s[t+1]==s[t]:
        count[u]+=1
    else:
        u.append(0)
for i in range(u):
    a=factorial(u)/factorial(2)/factorial(u-2)
print(a)

### FIXED CODE ###

N=int(input())
S=[''.join(sorted((input()))) for i in range(N)]
P={}
for i in range(N):
    if S[i] in P:
        P[S[i]]+=1
    else:
        P[S[i]]=0
for i in P.keys():
    if P[i]>=2:
        P[i]=P[i]*(P[i]+1)/2
print(int(sum(P.values())))
s = input()

if s in ['a', 'i', 'u', 'e'. 'o']:
  print('vowel')
else:
  print('consonant')

### FIXED CODE ###

s = input()

if s in ['a', 'i', 'u', 'e', 'o']:
  print('vowel')
else:
  print('consonant')
N,M=map(int,input().split())
S,r,s=input(),[],N-M
for _ in range(2*N):
    if S[s]=='1':
        s += 1
    else:
        r.append(str(N-s))
        N,s=s,max(0,s-M)
    if s == 0:
        break
print(-1 if s else " ".join(r[::-1]).strip('0 '))

### FIXED CODE ###

from collections import deque
INF = 10**18

def append_dq(i, x, dq, dp1):
    while True:
        if not len(dq):
            dq.append(i)
            break
        lxi = dq[-1]
        if x > dp1[lxi]:
            dq.append(i)
            break
        dq.pop()
    return dq
dq = deque()
N,M = map(int, input().split())
S = input().strip()
dp1 = [0] + [INF]*N
dp2 = [-1 for _ in range(N+1)]
dq.append(0)
for i, c in enumerate(S[1:]):
    i+=1
    dq = append_dq(i, dp1[i], dq, dp1)
    idx = dq[0]
    if c != "1" and dp1[idx] != INF:
        dp1[i] = dp1[idx] + 1
        dp2[i] = idx
    if i >= M:
        sxi = dq[0]
        if sxi == (i - M):
            dq.popleft()
if dp1[-1] == INF:
    print(-1)
else:
    r = []
    s = N
    while True:
        if s == 0:
            break
        ns = dp2[s]
        r.append(s-ns)
        s = ns
    print(" ".join(map(str, r[::-1])))
import collections
n = int(input())
v = [int(i) for i in input().split()]

dummy = (-1, -1)
(av1, ak1), (av2, ak2) = (collections.Counter(v[::2]).most_common(2) + dummy)[:2]
(bv1, bk1), (bv2, bk2) = (collections.Counter(v[1::2]).most_common(2) + dummy)[:2]

if av1 != bv1:
    print(n-ak1-bk1)
elif ak1 < bk1:
    print(n-ak2-bk1)
else:
    print(n-ak1-bk2)

### FIXED CODE ###

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

a, b = dict(), dict()
for i in range(n):
    if i%2 == 0:
        a[v[i]] = a.get(v[i], 0) + 1
    else:
        b[v[i]] = b.get(v[i], 0) + 1
alst = sorted(list(a.items()), key=lambda x: x[1], reverse=True)
blst = sorted(list(b.items()), key=lambda x: x[1], reverse=True)

if alst[0][0] != blst[0][0]:
    print(n-alst[0][1]-blst[0][1])
elif len(alst) == 1 and len(blst) == 1:
    print(blst[0][1])    
elif len(alst) == 1:
    print(n-alst[0][1]-blst[1][1])
elif len(blst) == 1:
    print(n-alst[1][1]-blst[0][1])
elif blst[0][1]+alst[1][1] > alst[0][1]+blst[1][1]:
    print(n-alst[1][1]-blst[0][1])
else:
    print(n-alst[0][1]-blst[1][1])
H,N=map(int,input().split())

A=[]
B=[]
DP=[10000000000]*(H+1)
DP[0]=0
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
    DP[a]=b



minA=A[A.index(min(A))]
minB=B[B.index(min(B))]

for i in range(1,A.index(min(A))):
    DP[i]=minB

for i in range(A.index(min(A)),H+1):
    temp=[]
    for j in range(i+1):
        temp.append(DP[j]+DP[i-j])
    DP[i]=min(temp)

print(DP[H])


### FIXED CODE ###

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

A=[]
B=[]

for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)

DP=[[1000000000]*(H+max(A)+1) for i in range(N+1)]


for i in range(N):
    DP[i+1][A[i]]=B[i]


for i in range(N):
    for h in range(H+max(A)+1):
        DP[i+1][h]=min(DP[i+1][h],DP[i][h])
        if h-A[i]>=0:
            DP[i+1][h]=min(DP[i+1][h-A[i]]+B[i],DP[i+1][h])

print(min(DP[N][H:]))
[a, b] = map(int, input().split())
if a < b:
print("a < b")
elif:a > b:
print("a > b")
else:
print("a == 0")

### FIXED CODE ###

a,b=map(int,input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
if len(div_arr) == 2:
    ans_num = max(div_arr)
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            print(div_arr)
            print(div_arr[i] * div_arr[last_idx])
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        print(div_arr)
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

### FIXED CODE ###

N = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
div_arr = make_divisors(N)

if len(div_arr) == 1:
    print(1)
elif len(div_arr) == 2:
    ans_num = max(div_arr)
    print(len(str(ans_num)))
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))
s=input().sorted()
t=input().sorted()
if a>b:
  print('Yes')
else:
  print('No')


### FIXED CODE ###

s=input()
t=input()
s=sorted(s)
t=sorted(t,reverse=True)
if s<t:
  print('Yes')
else:
  print('No')
a,b = map(int,input().split())
if a==b:
  print('Draw')
elif a==1:
  print('Alice')
elif b==1 or :
  print('Bob')
elif a>b:
  print('Alice')
else:
  print('Bob')

### FIXED CODE ###

a,b = map(int,input().split())
card = [2,3,4,5,6,7,8,9,10,11,12,13,1]
if card.index(a)==card.index(b):
  print('Draw')
elif card.index(a)>card.index(b):
  print('Alice')
else:
  print('Bob')
a,b=map(int,input().split())
j=0
while b>=2**j:
    j+=1
k=1
l=[0 for i in range(j)]
bia=[0 for i in range(j)]
A=a
i=0
while A>2**(k-1):
    l[i]=A%(2**k)
    m=(l[i]-2**(k-1))
    if m<=0:
        bia[i]=0
    else:
        if m%2==1:
            bia[i]=1
        else:
            bia[i]=0
    k+=1
    i+=1
if (A//2)%2==0:
    bia[0]=0
else:
    bia[0]=1
k=1
l=[0 for i in range(j)]
bib=[0 for i in range(j)]
B=b+1
i=0
while B>2**(k-1):
    l[i]=B%(2**k)
    m=(l[i]-2**(k-1))
    if m<=0:
        bib[i]=0
    else:
        if m%2==1:
            bib[i]=1
        else:
            bib[i]=0
    k+=1
    i+=1
if (B//2)%2==0:
    bib[0]=0
else:
    bib[0]=1
ans=0
for i in range(j):
    if bia[i]==bib[i]:
        ans=ans
    else:
        ans+=2**i
print(ans)

### FIXED CODE ###

H,W=list(map(int,input().split(" ")))
h,w=list(map(int,input().split(" ")))
print(H*W+h*w-H*w-W*h)
N=int(input())/2
print(int(N)

### FIXED CODE ###

N=int(input())
c=-(-N//2)-1
print(c)
s = input()
 
count = 0
 
for i in s:
  if s[i] == '1':
    count = count + 1
  
print(count)

### FIXED CODE ###

s = input()
 
count = 0
 
for i in s:
  if i == '1':
    count = count + 1
  
print(count)
import math
def countYakusu(n):
  count = 0
  for i in range(math.floor(n**0.5)):
    if n % i == 0:
      count = count + 1
  return count == 8

N = int(input())
count = 0
for i in range(math.floor(N/2)):
  count = count + countYakusu(i*2+1)
print(count)

### FIXED CODE ###

import math
def countYakusu(n):
  count = 0
  for i in range(n):
    if n % (i+1) == 0:
      count = count + 1
#      print(n,i+1)
#  if count == 8: print(n)
  return count == 8

N = int(input())
count = 0
for i in range(math.ceil(N/2)):
  count = count + countYakusu(i*2+1)
#  print(i*2+1)
print(count)
ans = 0
way = 0

if x == 0 and y == 0:
  ans = 0
  way = 0
elif x == 0:
  if H == y:
    ans = 0
    way = 0
  elif H - y > y:
    ans = W * y
    way = 0
  elif H - y < y:
    ans = W * (H-y)
    way = 0
  elif H - y == y:
    ans = W * (H-y)
    way = 0
elif y == 0:
  if W == x:
    ans = 0
    way = 0
  elif W - x > x:
    ans = x * H
    way = 0
  elif W - x < x:
    ans = (W-x) * H
    way = 0
  elif W - x == x:
    ans = (W-x) * H
    way = 0
elif x != 0 and y != 0:
  mi = 0

  s = (W-x) * H
  t = x * H

  if s > t:
    mi = t
  else:
    mi = s

  si = 0
  s = W * (H-y)
  t = W * y

  if s > t:
    si = t
  else:
    si = s

  if mi > si:
    ans = mi
    way = 0
  elif mi < si:
    ans = si
    way = 0
  elif mi == si:
    ans = mi
    way = 1

print("{} {}".format(ans, way))

### FIXED CODE ###

import sys
W,H,x,y = map(int, input().split())

ans = W * H / 2

if W / 2 == x and H / 2 == y:
  print("{} {}".format(ans, 1))
else:
  print("{} {}".format(ans, 0))
import math;

# input 現在座標ｘ, 移動回数k, 移動距離d
x, k, d = map(int, input().split())


a = math.floor(x / d);

if a > k:
    for i in range(k):
        if x > 0:
            x = x - d;
        elif x <= 0:
            x = x + d;

elif a <= k:
    # あまり
    s = k%a;
    
    for i in range(a+s):
        if x > 0:
            x = x - d;
        elif x <= 0:
            x = x + d;
            
# xが負の数の場合正の数に編集する
if x < 0:
    x = x * (-1);

print(x);

### FIXED CODE ###

x,k,d=map(int,input().split())
x=abs(x)
if x>k*d:
    print(x-k*d)
else:
    k-=x//d
    x-=(d*(x//d))
    ans=[x,abs(d-x)]
    print(ans[k%2])
class Test:
    def __init__(self):
        pass

class CustomUtils:
    def __init__(self):
        pass
    def to_int(self, inputs, sp=' '):
        if sp == '':
            return [int(d) for d in list(inputs)]
        else:
            # return map(int,input().split())
            return [int(d) for d in inputs.split(sp)]
    def debug_print(self, inputs, debug=False):
        if debug:
            print(inputs)

# 引用　python する man,「Pythonでの再帰関数とメモ化」, PSM, ２０１７、７/４
# http://muromura.hatenablog.com/entry/2017/07/04/204908#%E3%83%A1%E3%83%A2%E5%8C%96
def memorize(f):
    table = {}
    def func(*args):
        if not args in table:
            table[args] = f(*args)
        return table[args]
    return func
debug = False

u = CustomUtils()

n, q = u.to_int(input())
s = input()

import re
# カウントに関わる要素が同時に起こることはない（独立でもある。）
# この問題のみに特化したアルゴを書く
# そこまでに含まれているACの数とそこまでに崩されているACの数を数える。


ss = []
# 文字列をreで
# 先に処理, 同じことをなんどもやらんですむように
m = re.finditer('AC', s)
for match in m:
    st, en= match.span()
    ss.append(st)
ss.sort()
ss = np.array(ss)

### FIXED CODE ###

class Test:
    def __init__(self):
        pass

class CustomUtils:
    def __init__(self):
        pass
    def to_int(self, inputs, sp=' '):
        if sp == '':
            return [int(d) for d in list(inputs)]
        else:
            return [int(d) for d in inputs.split(sp)]
    def debug_print(self, inputs, debug=False):
        if debug:
            print(inputs)

# 引用　python する man,「Pythonでの再帰関数とメモ化」, PSM, ２０１７、７/４
# http://muromura.hatenablog.com/entry/2017/07/04/204908#%E3%83%A1%E3%83%A2%E5%8C%96
def memorize(f):
    table = {}
    def func(*args):
        if not args in table:
            table[args] = f(*args)
        return table[args]
    return func
debug = False



iarray = ['A', 'C', 'G', 'T']
oarray = ['T', 'G', 'C', 'A']
idx = iarray.index(input())

print("{}".format(oarray[idx]))
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
count = 0
for i in arr:
  if i%2==1: count+= 1
print(count)

### FIXED CODE ###

n = int(input())
arr = list(map(int,input().split()))
def odd(n) : return (n%2==1)
lst = list(filter(odd,arr[0:n:2]))
print(len(lst))
a = int(input())
x = list(map(int,input().split()))
t = [range(1,a+1)]
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1)+t[x[i-1]])
print(*A)
print(*B)



### FIXED CODE ###

a = int(input())
x = list(map(int,input().split()))
t = range(1,a+1)
A = []
B = []
for i in range(1,a+1):
    A.append(30000*i)
    B.append(30000*(a-i+1))
for i ,d in enumerate(x):
    A[d-1] -= a-i
print(*A)
print(*B)