Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N,K = map(int,input().split())
XY = [list(map(int,input().split())) for i in range(N)]

ans = float("inf")
import itertools
I = [i for i in range(N)]

for B in itertools.combinations(I,4):
    i,j,k,kk = B
    x1,y1 = XY[i]
    x2,y2 = XY[j]
    x3,y3 = XY[k]
    x4,y4 = XY[kk]
    u = max(y1,y2,y3,y4)
    d = min(y1,y2,y3,y4)
    r = max(x1,x2,x3,x4)
    l = min(x1,x2,x3,x4)
    num = 0
    for m in range(N):
        x,y = XY[m]
        if l<=x<=r and d<=y<=u:
            num += 1
    if num >= K:
        tmp = (u-d)*(r-l)
        if tmp < ans:
            ans = tmp
for B in itertools.combinations(I,3):
    i,j,k = B
    x1,y1 = XY[i]
    x2,y2 = XY[j]
    x3,y3 = XY[k]
    u = max(y1,y2,y3)
    d = min(y1,y2,y3)
    r = max(x1,x2,x3)
    l = min(x1,x2,x3)
    num = 0
    for m in range(N):
        x,y = XY[m]
        if l<=x<=r and d<=y<=u:
            num += 1
    if num >= K:
        tmp = (u-d)*(r-l)
        if tmp < ans:
            ans = tmp
for B in itertools.combinations(I,2):
    i,j = B
    x1,y1 = XY[i]
    x2,y2 = XY[j]
    u = max(y1,y2)
    d = min(y1,y2)
    r = max(x1,x2)
    l = min(x1,x2)
    num = 0
    for m in range(N):
        x,y = XY[m]
        if l<=x<=r and d<=y<=u:
            num += 1
    if num >= K:
        tmp = (u-d)*(r-l)
        if tmp < ans:
            ans = tmp
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
XY = [list(map(int,input().split())) for i in range(N)]

ans = float("inf")
for i in range(N):
    x1,y1 = XY[i]
    for j in range(i+1,N):
        x2,y2 = XY[j]
        u2 = max(y1,y2)
        d2 = min(y1,y2)
        r2 = max(x1,x2)
        l2 = min(x1,x2)
        for k in range(j+1,N):
            x3,y3 = XY[k]
            u3 = max(u2,y3)
            d3 = min(d2,y3)
            r3 = max(r2,x3)
            l3 = min(l2,x3)
            for kk in range(k+1,N):
                x4,y4 = XY[kk]
                u4 = max(u3,y4)
                d4 = min(d3,y4)
                r4 = max(r3,x4)
                l4 = min(l3,x4)
                num = 0
                for m in range(N):
                    x,y = XY[m]
                    if l4<=x<=r4 and d4<=y<=u4:
                        num += 1
                if num >= K:
                    tmp = (u4-d4)*(r4-l4)
                    if tmp < ans:
                        ans = tmp
            num = 0
            for m in range(N):
                x,y = XY[m]
                if l3<=x<=r3 and d3<=y<=u3:
                    num += 1
            if num >= K:
                tmp = (u3-d3)*(r3-l3)
                if tmp < ans:
                    ans = tmp
        num = 0
        for m in range(N):
            x,y = XY[m]
            if l2<=x<=r2 and d2<=y<=u2:
                num += 1
        if num >= K:
            tmp = (u2-d2)*(r2-l2)
            if tmp < ans:
                ans = tmp
print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import random
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def main():

	N = int(input())
	#S = list(input())
	#L,R = map(int, input().split(" "))
	#L = list(map(int, input().split(" ")))

	A = input().split()
	A = [int(s) for s in A]

	ans = [0 for _ in range(N)]
	
	ed = min(A[0]*2, A[-1]*2)
	s = 0
	if ed > 1000000 * 2:
		s = 100000000
	for i in range(s, ed+1, 2):
		fin = True
		for j in range(N):
			if j == 0:
				ans[j] = i
				continue
			tmp = (A[j-1] - (ans[j-1] / 2))*2

			if tmp < 0 or tmp % 2 == 1:
				fin = False
				break
			else :
				ans[j] = int(tmp)
		
		if fin == False:
			pass
		else:
			if (ans[-1] / 2) + (ans[0] / 2) == A[-1]:
				#print("sss")
				break

	ans = [str(a) for a in ans]
	print(' '.join(ans))


if __name__ == "__main__":
	main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	N = int(input())
	A = input().split(" ")
	A = [int(s) for s in A]
	
	tmp = 0
	for i, val in enumerate(A):
		if i == 0:
			tmp += 2*val
			continue
		if i % 2 == 1:
			tmp -= 2*val
		else:
			tmp += 2*val
	
	x = tmp / 2
	
	ans = []
	ans.append(int(x))
	for i, val in enumerate(A):
		tmp = (val - (ans[i]/2)) * 2
		ans.append(int(tmp))
	
	ans = ans[:-1]
	ans = [str(s) for s in ans]
	print(" ".join(ans))
	
if __name__ == "__main__":
	main()
### BUGGY CODE ###

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

items = [i for i in range(A, B + 1) if i - A + 1 <= K or B - i + 1 <= K]
for item in items:
    print(item)

### FIXED CODE ###

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

if A + K - 1 >=  B - K + 1:
    for item in range(A, B + 1):
        print(item)
else:
    for item in range(A, A + K):
        print(item)
    for item in range(B - K + 1, B + 1):
        print(item)
### BUGGY CODE ###

N, P = map(int, input().split())
ans = 0
if N == 1:
    print(P)
else:
    for i in range(1, int(P**(1/N)+5)):
        if P % i**N == 0:
            ans = i
    print(ans)


### FIXED CODE ###

N, P = map(int, input().split())
ans = 0
if N == 1:
    print(P)
elif N >= P or N > 50:
    print(1)

else:
    for i in range(1, int(P**(1/N)+2)):
        if P % i**N == 0:
            ans = i
    print(ans)
### BUGGY CODE ###

K = int(input())
if K % 2 == 0:
    print('-1')
    exit()

i = 1
A = 7 % K
while A != 0:
    A = (10 * A + 7) % K
    i += 1
print(i)


### FIXED CODE ###

K = int(input())
if K % 2 == 0 or K % 5 == 0:
    print('-1')
    exit()

A = 0
for i in range(K):
    A = (10 * A + 7) % K
    if A == 0:
        print(i+1)
        break
### BUGGY CODE ###

def main():
    X, K, D = map(int, input().split())

    val = [0] * 100000000
    val[0] = X
    #val = X
    #val_new = 0
    if K % 2 == 0 :
        limit = 10
    else :
        limit = 11
    i = 0
    if abs(X) > K * D :
        if X > 0 :
            print(X - K * D)
        else :
            print(abs(X + K * D))
    elif abs(X) == K * D :
        print("0")
    elif X == 0 :
        if limit == 10 :
            print('0')
        else :
            print(abs(D))
    else :
        for j in val :
            #print(i)
            if abs(val[i] - D) < abs(val[i] + D) :
                val[i+1] = val[i] - D
            else :
                val[i+1] = val[i] + D
            if (abs(val[i+1]) == abs(val[i-1])) and i > limit :
                print(abs(val[i + 1]))
                break
            i += 1
            if i == K :
                print(abs(val[i]))
                break


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    X, K, D = map(int, input().split())

    val = [0] * 100000000
    val[0] = X
    #val = X
    #val_new = 0
    if K % 2 == 0 :
        limit = 4
    else :
        limit = 5
    i = 0
    if abs(X) > K * D :
        if X > 0 :
            print(X - K * D)
        else :
            print(abs(X + K * D))
    elif abs(X) == K * D :
        print("0")
    elif X == 0 :
        if limit == 4 :
            print('0')
        else :
            print(abs(D))
    else :
        syo = abs(X) // D
        #print(syo)
        if syo > 3 :
            if X > 0 :
                val[0] = X - (syo-2) * D
            else :
                val[0] = X + (syo - 2) * D
            #print(val[0])
            K = K -(syo-2)
            if K % 2 == 0:
                limit = 2
            else:
                limit = 3
        for j in val :
            #print(i)
            if abs(val[i] - D) < abs(val[i] + D) :
                val[i+1] = val[i] - D
            else :
                val[i+1] = val[i] + D
            #print(val[i+1])
            if (abs(val[i+1]) == abs(val[i-1])) and i > limit :
                #print("a")
                print(abs(val[i + 1]))
                break
            i += 1
            if i == K :
                #print("b")
                print(abs(val[i]))
                break


if __name__ == '__main__':
    main()
### BUGGY CODE ###

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 998244353
N, S = lr()
A = lr()
# dp[i][j][k] i番目まで見て和がjとなる総数
# k=0がL,Rが決まっていない、k=1がLだけ決定、k=2がLとRが決定
dp = [[[0] * 3 for _ in range(S+1)] for _ in range(N+1)]
dp[0][0][0] = 1
for i in range(N):
    a = A[i]
    for j in range(S+1):
        zero = dp[i][j][0]; one = dp[i][j][1]; two = dp[i][j][2]
        dp[i+1][j][0] += zero
        dp[i+1][j][1] += zero + one
        dp[i+1][j][2] += zero + one + two
        dp[i+1][j][1] %= MOD; dp[i+1][j][2] %= MOD
        if a + j <= S:
            dp[i+1][j+a][1] = zero + one
            dp[i+1][j+a][2] = zero + one
            dp[i+1][j+a][1] %= MOD; dp[i+1][j+a][2] %= MOD
        
answer = dp[N][S][2] % MOD
print(answer)
# 11


### FIXED CODE ###

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 998244353
N, S = lr()
A = lr()
dp = [0] * (S+1)
answer = 0
for a in A:
    dp[0] += 1 # Lの数は１個ずつ加わる
    prev = dp.copy()
    for i in range(S-a+1):
        dp[i+a] += prev[i]
    answer += dp[-1] # その位置Rとした時

print(answer % MOD)
# 26
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
score=0
mod=10**9+7

for i in range(0,n-1):
  j=n-1
  while i < j:    
    score+=a[i]*a[j]
    j-=1
print(score%mod)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b=sum(a)
score=0
for i in range(len(a)):
  b -= a[i]
  score+=a[i]*b
  
print(score%(10**9+7))
### BUGGY CODE ###

R,G,B,N = map(int, input().split())
sum = 0
for i in range(int(N / R) + 1):
  for j in range(int((N - (i * R)) / G) + 1):
    for k in range(int((N - (i * R) - (j * G)) / B) + 1):
      ans = i * R + j * G + k * B
      if (ans == N):
        sum += 1
print(sum)


### FIXED CODE ###

R,G,B,N = map(int, input().split())

sum = 0
for i in range(N // R + 1):
  for j in range(N // G + 1):
    b = N - (i * R) - (j * G)
    if (b >= 0 and b % B == 0):
      sum += 1
print(sum)
### BUGGY CODE ###

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

cnt = 0
for i in range(N):
    for j in range(N):
        if i != j and A[i] % A[j] == 0:
            break
        elif i != j and A[j] >= A[i]:
            cnt += 1
            break
        elif j == N-1:
            cnt += 1

print(cnt)


### FIXED CODE ###

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

ans = [False] * (Amax + 1)
for x in A:
    for j in range(x, Amax + 1, x):
        ans[j] += 1

print(sum(ans[i] == 1 for i in A))
### BUGGY CODE ###

n, k = map(int, input().split())
hs = list(map(int, input().split()))
min_cost = [float('inf')] * n
min_cost[0] = 0
for i in range(n):
    for j in range(1, k+1):
        if i+j < n:
            min_cost[i+j] = min(min_cost[i+j], min_cost[i] + abs(hs[i] - hs[i+j]))
        else:
            continue
print(min_cost[n-1])


### FIXED CODE ###

n, k = map(int, input().split())
hs = list(map(int, input().split()))
min_cost = [float('inf')] * n
min_cost[0] = 0
for i in range(1, n):
    min_cost[i] = min([min_cost[i-j] + abs(hs[i] - hs[i-j]) for j in range(1, k+1) if i-j >= 0])
print(min_cost[n-1])
### BUGGY CODE ###

import re


n, k = map(int, input().split())
s = input()
s_re = re.split(r'(0+)', s)
srl = len(s_re)
m = [0] * srl
if srl // 2 <= k:
    ans = [n]
else:
    for i, w in enumerate(s_re):
        m[i] = len(w)
    ans = [1]
    for i in range(0, srl, 2):
        ie = i + k * 2 + 1
        if ie <= srl:
            ans += [sum(m[i:ie])]
        else:
            break
print(max(ans))

### FIXED CODE ###

import re


n, k = map(int, input().split())
s = input()
s_re = re.split(r'(0+)', s)
srl = len(s_re)
m = [0] * srl
if srl // 2 <= k:
    ans = n
else:
    for i, w in enumerate(s_re):
        m[i] = len(w)
    tmp = sum(m[:k * 2 + 1])
    ans = tmp
    for i in range(0, srl, 2):
        ie = i + k * 2 + 1
        if ie < srl:
            tmp = tmp - m[i] - m[i+1] + m[ie] + m[ie+1]
            ans = max(ans, tmp)
        else:
            break
print(ans)
### BUGGY CODE ###

n = int(input())
stack = []
for _ in range(n):
    stack.append(int(input()))
length = len(stack)

candidate = [-float('inf')]
for i in range(1, length // 2 + 1):
    for r1, r2 in zip(stack[::1], stack[i::1]):
        if r2 - r1 > candidate[0]:
            candidate.append(r2 - r1)
    if i - length != i:
        for r1, r2 in zip(stack[::1], stack[length - i::1]):
            if r2 - r1 > candidate[0]:
                candidate.append(r2 - r1)
    candidate = [max(candidate)]

print(candidate[0])

### FIXED CODE ###

n = int(input())
stack = []
for _ in range(n):
    stack.append(int(input()))

maxv = -10**9
minv = stack[0]
for i in range(1, len(stack)):
    maxv = max(maxv, stack[i] - minv)
    minv = min(minv, stack[i])

print(maxv)
### BUGGY CODE ###

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

flag = False
k = 0
while(not flag and k<n):
    if A[k] <= B[k]:
        As = A[:k] + A[k+1:]
        Bs = B[:k] + B[k+1:]

        As.sort()
        Bs.sort()

        for i in range(n-1):
            if As[i] > Bs[i]:
                break
        else:
            flag = True

    k += 1

if flag:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
lsa = list(map(int, input().split()))
lsb = list(map(int, input().split()))

ls = [[a, b] for a, b in zip(lsa, lsb)]
ls.sort(key=lambda x: x[1])
lsa = [l[0] for l in ls]
lsb = [l[1] for l in ls]

lsasort = sorted(lsa)
for i in range(n):
    if lsasort[i]>lsb[i]:
        flag = False
        break
else:
    flag = True

if flag:
    lscycle = [[p, q] for p, q in zip(range(n), lsa)]
    lscycle.sort(key=lambda x: x[1])

    count=0
    idx=0
    while True:
        idx=lscycle[idx][0]
        count+=1
        if idx == 0:
            break

    if count != n:
        flag = True
    else:
        for i in range(n-1):
            if lsasort[i+1] <= lsb[i]:
                flag = True
                break
        else:
            flag = False

if flag:
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(n):
    if i  % 2 == 0: b.append(a[i])
    else: b = [a[i]] + b
if i % 2 == 0: b.reverse()
print(*b)

### FIXED CODE ###

from collections import deque
n = int(input())
a = [int(i) for i in input().split()]
b = deque()
f = True
for i in range(n):
    if f: b.append(a[i])
    else: b.appendleft(a[i])
    f = not f
if i % 2 == 0: b.reverse()
print(*b)
### BUGGY CODE ###

import sys
from operator import itemgetter


scan = sys.stdin.readline


def main():
  n, m = map(int, scan().rstrip().split())
  a = list(map(int, scan().rstrip().split()))
  operations = [tuple(map(int, scan().rstrip().split())) for _ in range(m)]
  operations.sort(key=itemgetter(1), reverse=True)
  
  for b, c in operations:
    a.sort()
    count = 0
    while count < b and a[count] < c:
      a[count] = c
      count += 1
  
  print(sum(a))
  

if __name__ == "__main__":
  main()


### FIXED CODE ###

import sys
from operator import itemgetter
from collections import deque


scan = sys.stdin.readline


def main():
  n, m = map(int, scan().rstrip().split())
  a = list(map(int, scan().rstrip().split()))
  operations = [tuple(map(int, scan().rstrip().split())) for _ in range(m)]
  
  a.sort()
  operations.sort(key=itemgetter(1), reverse=True)
  
  a = deque(a)
  
  for b, c in operations:
    count = 0
    while count < b:
      if a[0] < c:
        a.append(c)
        count += 1
        a.popleft()
      else:
        print(sum(a))
        exit(0)

  print(sum(a))
  

if __name__ == "__main__":
  main()
### BUGGY CODE ###

from heapq import heapify,heappop,heappush
xs,ys,xt,yt=map(int,input().split())
P=[]
inf=float("inf")
P.append((xs,ys,0))
N=int(input())
for i in range(N):
  x,y,r=map(int,input().split())
  P.append((x,y,r))
P.append((xt,yt,0))
G=[set() for i in range(N+2)]
for i in range(N+2):
  for j in range(N+2):
    if i!=j:
      x1,y1,r1,x2,y2,r2=P[i][0],P[i][1],P[i][2],P[j][0],P[j][1],P[j][2]
      d=((x1-x2)**2+(y1-y2)**2)**(1/2)
      if d<=r1+r2:
        G[i].add((0,j))
      else:
        G[i].add((d-r1-r2,j))

def dijkstra(s,n,links):
  cost=[inf]*n
  cost[s]=0
  heap=[(0,s)]
  heapify(heap)
  while heap:
    hc,hp=heappop(heap)
    for c,p in links[hp]:
      if c+hc<cost[p]:
        cost[p]=c+hc
        heappush(heap,(cost[p],p))
  return cost        

c=dijkstra(0,N+2,G)
print(c[-1])

### FIXED CODE ###

from collections import defaultdict
xs,ys,xt,yt=map(int,input().split())
P=[]
inf=float("inf")
P.append((xs,ys,0))
P.append((xt,yt,0))
N=int(input())
for i in range(N):
  x,y,r=map(int,input().split())
  P.append((x,y,r))

G=defaultdict(int)
for i in range(N+2):
  for j in range(N+2):
      x1,y1,r1,x2,y2,r2=P[i][0],P[i][1],P[i][2],P[j][0],P[j][1],P[j][2]
      d=((x1-x2)**2+(y1-y2)**2)**(1/2)
      G[(i,j)]=max(0,d-r1-r2)

def dijkstra():
  d=[inf]*(N+2)
  d[0]=0
  used=[False]*(N+2)
  
  while True:
    v=-1
    for i in range(N+2):
      if used[i]==False and (v==-1 or d[i]<d[v]):
        v=i
    if v==-1:
      break
    used[v]=True
    for j in range(N+2):
      d[j]=min(d[j],d[v]+G[(v,j)])    
  return d[1]
print(dijkstra())
### BUGGY CODE ###

N=int(input())
*A,=map(int, input().split())
A=[-1]+A
ans=0
for i in range(1,N+1):
    for j in range(i+1,N+1):
        if A[i]==j and A[j]==i: ans+=1
print(ans)

### FIXED CODE ###

N = int(input())
A = [0] + list(map(int, input().split()))
ans2 = 0
for i in range(N+1):
    if A[A[i]] == i: ans2 += 1
print(ans2//2)
### BUGGY CODE ###

#pragma GCC optimize("Ofast")

a=int(input())

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

sum=0

for i in range(a-1):
  for j in range(i+1,a):
    sum=sum+d[i]*d[j]

print(sum%(pow(10,9)+7))

### FIXED CODE ###

MOD = 10 ** 9 + 7

n=int(input())
alst=list(map(int,input().split()))

total=sum(alst)
sum=0

# for i in range(n-1):
#   for j in range(i+1,n):
#     sum=pow(sum+alst[i]*alst[j],1,MOD)

# print(sum)

for a in alst:
  sum = sum+a * (total - a)
  sum %= MOD

sum *= pow(2, MOD - 2, MOD)
sum %= MOD
print(sum)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [0]*n

for i in range(n):
  b[i] = a.index(i+1)+1
  
  
print(" ".join(map(str, b)))

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
d=[0]*n
for i,val in enumerate(l):
  d[val-1]=i+1
print(*d)
### BUGGY CODE ###

N = int(input())
S = []
for _ in range(N):
    s = list(input())
    s.sort()
    s = tuple(s)
    S.append(s)

ans = 0
for i in range(N):
    for j in range(i + 1, N):
        if S[i] == S[j]:
            ans += 1
print(ans)


### FIXED CODE ###

from collections import Counter

N = int(input())
S = []
for _ in range(N):
    s = list(input())
    s.sort()
    s = ''.join(s)
    S.append(s)

counter = Counter(S)

ans = 0
for v in counter.values():
    ans += v * (v - 1) // 2
print(ans)
### BUGGY CODE ###

def main():
    red, green, blue  = map(int, input().split())
    K = int(input())

    while(K > 0):
        if green <= red:
            green *= 2
            K -= 1
            continue
        if blue <= green:
            blue *= 2
            K -= 1
            continue

    if blue > green:
        if green > red:
            print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()


### FIXED CODE ###

def judge(red, green,blue):
    if blue > green:
        if green > red:
            return (True)
    else:
        return(False)


def main():
    red, green, blue  = map(int, input().split())
    K = int(input())

    while(K > 0):
        if green <= red:
            green *= 2
            K -= 1
            continue
        if blue <= green:
            blue *= 2
            K -= 1
            continue
        if judge(red, green, blue):
            break
        
    if judge(red, green, blue):
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
### BUGGY CODE ###

n = int(input())
l = 0
s = []
for i in range(20):
	print(l)
	stemp = str(input())
	s.append(stemp)
	if stemp[i] == 'Vacant':
		break
	elif i!=0:
		if s[i] == s[i-1]:
			if ((n-l)//2)%2 == 0:
				l = (n-l)//2
			else:
				l = (n-l)//2+1
	elif i==0:
		if (n//2)%2==0:
			l = l+n//2
		else:
			l = l+(n//2)+1

### FIXED CODE ###

n = int(input())
l = 0
s = []
start = [0]
end = [n]
check = 1

for i in range(20):
	print(l)
	stemp = str(input())
	s.append(stemp)
	if stemp == 'Vacant':
		break
	elif i!=0:
		if check == 1:
			if s[i-1] == s[i]:
				start[0] = l
				if ((end[0]-start[0])//2)%2==0:
					l = start[0]+(end[0]-start[0])//2
				else:
					l = start[0]+(end[0]-start[0])//2+1
				
			else:
				end[0] = l
				if ((end[0]-start[0])//2)%2==0:
					l = start[0]+(end[0]-start[0])//2
				else:
					l = start[0]+(end[0]-start[0])//2+1
				check = check*-1

		elif check == -1:
			if s[i-1] == s[i]:
				end[0] = l
				if ((end[0]-start[0])//2)%2==0:
					l = start[0]+(end[0]-start[0])//2
				else:
					if abs((end[0]-start[0])) == 2:
						l = start[0]+(end[0]-start[0])//2
					else:
						l = start[0]+(end[0]-start[0])//2-1
				
			else:
				start[0] = l
				if ((end[0]-start[0])//2)%2==0:
					l = start[0]+(end[0]-start[0])//2
				else:
					l = start[0]+(end[0]-start[0])//2+1
				check = check*-1
	else:
		if (n//2)%2==0:
			l = l+n//2
		else:
			l = l+(n//2)+1
### BUGGY CODE ###

n, m = map(int, input().split())
li = []
for i in range(m):
  li.append(list(input().split()))
a = []
b = 0
for j in range(m):
  if li[j][1] == "AC":
    a.append(int(li[j][0]))
  elif li[j][1] == "WA" and int(li[j][0]) not in a:
    b += 1
for k in range(m):
  if int(li[k][0]) not in a:
    b -= 1
print(len(set(a)), b)


### FIXED CODE ###

n, m = map(int, input().split())
li = []
for i in range(m):
  li.append(list(input().split()))
li_a = [0 for i in range(n)]
li_b = [0 for i in range(n)]
a = 0
b = 0
for j in range(m):
  if li[j][1] == "WA":
    li_b[int(li[j][0])-1] += 1
  elif li[j][1] == "AC" and li_a[int(li[j][0])-1] == 0:
    a += 1
    b += li_b[int(li[j][0])-1]
    li_a[int(li[j][0])-1] += 1
print(a, b)
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
S = [0]*N
D = [0]*N

for i in range(N):
    S[i] = A[i]+i
    D[i] = i - A[i]

ans = 0
for l in range(N-1):
    ans += D[l+1:].count(S[l])

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
S = [0]*N
D = [0]*N

for i in range(N):
    if A[i]+i < N:
        S[A[i]+i] += 1
    if i - A[i] > 0:
        D[i - A[i]] += 1
ans = 0
for l in range(N):
    ans += S[l]*D[l]
    

print(ans)
### BUGGY CODE ###

import itertools
 
x1 = int(input())
x2 = input()
RGB = {"R", "G", "B"}
_sum = 0
for i, rgb in zip(itertools.combinations(range(x1), 3), itertools.combinations(x2, 3)):
    if set(rgb) == RGB and (i[1] - i[0]) != (i[2] - i[1]):
        _sum += 1
print(_sum)

### FIXED CODE ###

from itertools import product

x1 = int(input())
x2 = input()

R_i = [i for i, x in enumerate(x2) if x == "R"]
G_i = [i for i, x in enumerate(x2) if x == "G"]
B_i = {i for i, x in enumerate(x2) if x == "B"}

R = len(R_i)
G = len(G_i)
B = len(B_i)

xs = map(sorted, product(R_i, G_i))

s = 0
for a in xs:
    k = a[1]*2 - a[0]  # 2j-i
    if k in B_i:
        s +=1
    i = a[0]*2 - a[1]  # 2j-k
    if i in B_i:
        s +=1
    j = (a[0] + a[1]) / 2
    if j.is_integer():
        j = int(j)
        if j in B_i:
            s +=1
print(R*G*B - s)