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

H0 = 0
N_LR = 0
N_RL = 0

if S[0] == 'R' and S[1] == 'R':
    H0 += 1
if S[0] == 'R' and S[1] == 'L':
    N_RL += 1
if S[0] == 'L' and S[1] == 'R':
    N_LR += 1

if S[N-1] == 'L' and S[N-2] == 'L':
    H0 += 1

for i in range(1, N-1):
    if S[i] == 'L' and S[i-1] == 'L' or S[i] == 'R' and S[i+1] == 'R':
        H0 += 1
    if S[i] == 'R' and S[i+1] == 'L':
        N_RL += 1
    if S[i] == 'L' and S[i+1] == 'R':
        N_LR += 1

M = min(N_RL, N_LR, K)
H1 = H0 + 2 * M
K -= M
N_RL -= M
N_LR -= M

result = H1 + min(K, N_RL, N_LR)
print(result)


### FIXED CODE ###

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

if N == 1:
    print(0)
else:
    H = 0
    N_LR = 0
    N_RL = 0

    if S[0] == 'R' and S[1] == 'R':
        H += 1
    if S[0] == 'R' and S[1] == 'L':
        N_RL += 1
    if S[0] == 'L' and S[1] == 'R':
        N_LR += 1

    if S[N-1] == 'L' and S[N-2] == 'L':
        H += 1

    for i in range(1, N-1):
        if S[i] == 'L' and S[i-1] == 'L' or S[i] == 'R' and S[i+1] == 'R':
            H += 1
        if S[i] == 'R' and S[i+1] == 'L':
            N_RL += 1
        if S[i] == 'L' and S[i+1] == 'R':
            N_LR += 1

    M = min(N_RL, N_LR, K)
    H += 2 * M
    K -= M
    N_RL -= M
    N_LR -= M

    s0 = S[0]
    while K > 0 and (s0 == 'R' and N_RL > 0 or s0 == 'L' and N_LR > 0):
        if s0 == 'R' and N_RL > 0:
            H += 1
            s0 = 'L'
            N_RL -= 1
            K -=1
        elif s0 == 'L' and N_LR > 0:
            H += 1
            s0 = 'R'
            N_LR -= 1
            K -=1

    sN = S[N-1]
    while K > 0 and (sN == 'R' and N_LR > 0 or sN == 'L' and N_RL > 0):
        if sN == 'R' and N_LR > 0:
            H += 1
            sN = 'L'
            N_LR -= 1
            K -=1
        elif sN == 'L' and N_RL > 0:
            H += 1
            sN = 'R'
            N_RL -= 1
            K -=1

    print(H)
a=int(input())
b=int(input())
c=a+b
if c=3:
    print(3)
elif c=4:
    print(2)
else:
    print(1)


### FIXED CODE ###

a=int(input())
b=int(input())
c=a+b
if c==3:
    print(3)
elif c==4:
    print(2)
else:
    print(1)
s=str(input())
a=[0]
b=''
c=0
d=int(len(s)/2)
if a=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)

### FIXED CODE ###

import math
s=str(input())
b=''
c=0
d=math.ceil(len(s)/2)
if s[0]=='0':
    for i in range(d):
        b+="01"
else:
    for i in range(d):
        b+="10"
if len(s) != len(b):
    b = b[:-1]
for u in range(len(s)):
    if s[u] != b[u]:
        c+=1
print(c)
N = int(input())
S = input()
S1 = []
for i in range(N // 2):
    S1.append(S[i])

S = S[N // 2 :]
S1 = ''.join(S1)
if S1 == S:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

r = int(input())

print(r**2)
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

    N = II()
    A = LMIIS()
    A.sort()
    ans = 0
    count = defaultdict(int)
    for a in A:
        count[a] += 1
    next_A = deque()
    for a in A:
        if count[a] == 1:
            next_A.append(a)
    A = list(next_A)
    if len(A) == 0:
        print(0)
        return
    if A[0] == 1:
        print(1)
        return


    def make_divisors(n):
        lower_divisors , upper_divisors = [], []
        i = 1
        while i*i <= n:
            if n % i == 0:
                lower_divisors.append(i)
                if i != n // i:
                    upper_divisors.append(n//i)
            i += 1
        return lower_divisors + upper_divisors[::-1]




    F = deque()
    for a in A:
        F.append(make_divisors(a))
    
    Not_Divisible = defaultdict(bool)
    for i in range(N):
        for d in F[i]:
            if Not_Divisible[d]:
                break
        else:
            Not_Divisible[A[i]] = True
    print(list(Not_Divisible.values()).count(True))
                



    
main()

### FIXED CODE ###

def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

    N = II()
    A = LMIIS()
    ans = 0
    count = defaultdict(int)
    for a in A:
        count[a] += 1
    A = list(set(A))
    A.sort()

    if count[1] == 1:
        print(1)
        return
    if count[1] > 1:
        print(0)
        return

    sup = max(A)+1
    Not_Divisible = [True] * sup
    Not_Divisible[0] = False


    for a in A:
        if Not_Divisible[a]:
            for i in range(a*2,sup,a):
                Not_Divisible[i] = False

    ans = 0
    for a in A:
        if Not_Divisible[a] and count[a] == 1:
            ans += 1

    print(ans)
            


    
main()
nCr = {}
def cmb(n, r):
    if n == 1: return 0
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


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

L=[0]
s=0
for i in range(N):
    s+=a[i]
    L.append(s)

L=sorted(L)

s=0
t=L[0]
c=1
for i in range(1,len(L)):
    if(t==L[i]):
        c+=1
    else:
        s+=cmb(c,2)
        t=L[i]
        c=1
else:
    s+=cmb(c,2)
print(s)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

nCr = {}
def cmb(n, r):
    if n == 1: return 0
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


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

L=[0]
s=0
for i in range(N):
    s+=a[i]
    L.append(s)

L=sorted(L)

s=0
t=L[0]
c=1
for i in range(1,len(L)):
    if(t==L[i]):
        c+=1
    else:
        s+=cmb(c,2)
        t=L[i]
        c=1
else:
    s+=cmb(c,2)
print(s)
import sys
sys.setrecrusionlimit

def main():
    n = int(input())
    
    G=[[] for _ in range(n)]
    for _ in range(n-1):
        u,v,w = map(int, input().split())
        G[u-1].append([v-1,w])
        G[v-1].append([u-1,w])
    ans=[-1]*n
    
    def sub(node,distance):
        for next_node, edge in G[node]:
            if ans[next_node]==-1:
                ans[next_node]=(distance+edge)%2
                sub(next_node,(distance+edge)%2)
    sub(0,0)
    
    for i in ans:
        print(i)
main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)


def main():
    n = int(input())
    
    G=[[] for _ in range(n)]
    for _ in range(n-1):
        u,v,w = map(int, input().split())
        G[u-1].append([v-1,w])
        G[v-1].append([u-1,w])
    ans=[-1]*n
    
    def sub(node,distance):
        for next_node, edge in G[node]:
            if ans[next_node]==-1:
                ans[next_node]=(distance+edge)%2
                sub(next_node,(distance+edge)%2)
    sub(0,0)
    
    for i in ans:
        print(i)
main()
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in a:
  ans += 1/a
  
print(1/ans)

### FIXED CODE ###

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

ans = 0
for i in a:
  ans += 1/i
  
print(1/ans)
N,K,S = map(int, input().split())

sa = N-K+1
a = [1 for i in range(N)]

if S-sa+1 >0:
        
    a[0] = S - sa + 1

    for i in range(1,sa):
        a[i] = 1
    j = 0
    for i in range(sa,N):
        a[i] = a[j]

        j +=1
        j %= 3

    for x in a:
        print(x, end = " ")
else:
    for i in range(K):
        a[i] = S
    if S != 10**9:    
        for i in range(K,N):
            a[i] = 10**9
    else:
        for i in range(K,N):
            a[i] == 10**9 -1
    for x in a:
        print(x, end = " ")

### FIXED CODE ###

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

sa = N-K+1
a = [1 for i in range(N)]
if S-sa+1 >0:
        
    a[0] = S - sa + 1

    for i in range(1,sa):
        if i < N:
    
            a[i] = 1
    j = 0
    for i in range(sa,N):
        a[i] = a[j]

        j +=1
        j %= sa

    for x in a:
        print(x, end = " ")


else:
    for i in range(K):
        a[i] = S
    if S != 10**9:    
        for i in range(K,N):
            a[i] = 10**9
    else:
        for i in range(K,N):
            a[i] == 10**9 -1
    for x in a:
        print(x, end = " ")
number = [for i in input().split()]
number.sort()
print(' '.join(number))




### FIXED CODE ###

number = [i for i in input().split()]
number.sort()
print(' '.join(number))
print('YNeos'[['AC' not in input()]::2])

### FIXED CODE ###

print(' YNeos'['AC'in input()::2])
a = input().split()
if a[0] == D and a[1] == D:
    print('H')
elif a[0] == H and a[1] == H:
    print('H')
else:
    print('D')

### FIXED CODE ###

a,b = map(str,input().split())
if a == 'D' and b == 'D':
    print('H')
elif a == 'H' and b == 'H':
    print('H')
else:
    print('D')
import math
N = int(input())
max_D = int(1 + math.sqrt(N))
count = []
for i in range(max_D):
   if N % i == 0:
      count.append([0])
      while N%i == 0:
         N = N / i
         count[-1] += 1
   if N < i:
      break
l = len(count)
ans = 0
for i in range(l):
   E = count[i]
   j = 0
   while j * (j + 1) <= 2 * E:
      j += 1
   ans += j - 1
print(ans)

### FIXED CODE ###

import math
N = int(input())
max_D = int(2 + math.sqrt(N))
count = []
ans = 1
for i in range(2, max_D):
   if N % i == 0:
      count.append(0)
      while N % i == 0:
         N = N // i
         count[-1] += 1
   if N < i:
      ans = 0
      break
l = len(count)
for i in range(l):
   E = 2*count[i]
   j = 0
   while j * (j + 1) <= E:
      j += 1
   ans += j - 1
print(ans)
N, K = map(int, input().split())

if N % K != 0
	print(N // K - N % K)
else:
	print(N % K)

### FIXED CODE ###

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

if N % K != 0:
	print(1)
else:
	print(0)
# -*- coding: UTF-8 -*-
s = input()
a = []
for c in s:
    if (c == '0'):
        a.append('0')
    elif (c == '1'):
        a.append('1')
    else:
        a.pop()

answer = ''.join(a)
print(answer)


### FIXED CODE ###

# -*- coding: UTF-8 -*-
s = input()
ans = ''
for c in s:
    if c == 'B':
      ans = ans[:-1]
    else:
      ans += c

print(ans)
import sys
sys.setrecursionlimit(10000)

n, q = map(int, input().split())
s = input()
dic = {}
t_list = []
d_list = []

for i in range(q):
    t, d = input().split()
    t_list.append(t)
    if d == 'L':
        d_list.append(-1)
    else:
        d_list.append(1)


def find_pos(left, right):
    return left + (right - left - 1) // 2


def calc(sites, ts, ds):
    def check(idx):
        num = idx
        for j in range(q):
            site = sites[num]
            if ts[j] == site:
                num += ds[j]
            if num < 0:
                return -1
            if num > n - 1:
                return 1
        return 0

    def func(left, right):
        if right - left == 1:
            if check(right) > -1:
                return left
            else:
                return right
        pos = find_pos(left, right)
        if check(pos) > -1:
            return func(left, pos + 1)
        else:
            return func(pos + 1, right)
    return func


f1 = calc(s, t_list, d_list)
f2 = calc(s[::-1], t_list, [-i*1 for i in d_list])
left_out = f1(0, n)
right_out = f2(0, n)
print(n - left_out - right_out)


### FIXED CODE ###

n, q = map(int, input().split())
s = input()
dic = {}
t_list = []
d_list = []

for i in range(q):
    t, d = input().split()
    t_list.append(t)
    if d == 'L':
        d_list.append(-1)
    else:
        d_list.append(1)


def find_pos(left, right):
    return left + (right - left - 1) // 2


def calc(sites, ts, ds):
    def check(idx):
        num = idx
        for j in range(q):
            site = sites[num]
            if ts[j] == site:
                num += ds[j]
            if num < 0:
                return -1
            if num > n - 1:
                return 1
        return 0

    def func(left, right):
        assert left > -1
        assert right < n + 1
        if right - left == 1:
            if check(left) > -1:
                return left
            else:
                return right
        pos = find_pos(left, right)
        if check(pos) > -1:
            return func(left, pos + 1)
        else:
            return func(pos + 1, right)
    return func


f1 = calc(s, t_list, d_list)
f2 = calc(s[::-1], t_list, [-i*1 for i in d_list])
print(n - f1(0, n) - f2(0, n))
n=int(input())
ans,i="",0
while n!=0:
  if (n-(-2)**i)%((-2)**(i+1))==0:ans="1"+ans;n-=(-2)**i
  else:ans="0"+ans
  i+=1
print(int(ans))

### FIXED CODE ###

n=int(input())
if n==0:print(0);exit()
ans,i="",0
while n!=0:
  if (n-(-2)**i)%((-2)**(i+1))==0:ans="1"+ans;n-=(-2)**i
  else:ans="0"+ans
  i+=1
print(int(ans))
def calc(n, k):
  if k>100:
    print(1/0)
  # print(n, k)
  if n<=0:
    return []
  i = 0
  while (1<<(i+1)) -1 <= n:
    i += 1
  return [str(k)] * (i+1) + calc(n-((1<<i) - 1), k+1)

a=calc(int(input()), 1)
if len(a)>200:
  print(1/0)
print(len(a))
print(" ".join(a))

### FIXED CODE ###

fact = [1]
for i in range(1, 101):
    fact.append(fact[-1]*i)
    
def C(a, b):
    return fact[a]//(fact[b]*fact[a-b])

def sC(a, b):
    ret = 0
    for i in range(min(b, a-b) + 1):
        ret += C(b, i) * C(a - b, i)
    return ret

def calc(n, k):
    if n<=0:
        return []
    i = 0
    while (1<<(i+1)) -1 <= n:
        i += 1
        
    ret = [str(k)] * (i+1)
    rem = n-((1<<i) - 1)
    kk = k + 1
    i += 1
    j = i // 2
    
    while j > 0:
        while True:
            tmp = sC(i, j)
            if tmp <= rem:
                ret.insert(j, str(kk))
                ret.append(str(kk))
                kk += 1
                rem -= tmp

            else:
                break
                
        j -= 1
        
    return ret + calc(rem, kk)

N = int(input())

X = calc(N, 1)
print(len(X))
print(" ".join(X))
import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
amax = 0
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_a = sorted(Swords_a)
Swords_b = sorted(Swords_b)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  ifeuah
  print(k)

### FIXED CODE ###

import math

N, H = map(int, input().split())
Swords_a = []
Swords_b = []
for i in range(N):
  
  a, b = map(int, input().split())
  Swords_a.append(a)
  Swords_b.append(b)
  
ma = max(Swords_a)
sb = 0 # bのうち「maより大きい成分」の和

Swords_b = sorted(Swords_b, reverse = True)

c = 0
k = 0

for i in range(N):
  if ma < Swords_b[i]:
    sb += Swords_b[i]
    c += 1
  if sb >= H:
    k = c
    break

if sb < H:
  print(c + math.ceil((H-sb)/ma))
else:
  print(k)
a,b,c=int(input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")
X,N=map(int,input().split())
if N==0:
    print(X)
    exit()

P_ori=list(map(int,input().split()))
if P_ori.count(X)==0:
    print(X)
    exit()

P1=sorted(P_ori)
N=list(range(1,101))
PZ=[]
for i in range(len(N)):
    if P1.count(N[i])==0:
        PZ.append(N[i])

PZ.append(X)
P2=sorted(PZ)
t=P2.index(X)

if t==0:
    print(-1)
    exit()

dist1=abs(P2[t-1]-P2[t])
dist2=abs(P2[t]-P2[t+1])
if dist1<=dist2:
    print(P2[t-1])
else:
    print(P2[t+1])

### FIXED CODE ###

X,N=map(int,input().split())
if N==0:
    print(X)
    exit()

P_ori=list(map(int,input().split()))
if P_ori.count(X)==0:
    print(X)
    exit()


P1=sorted(P_ori)
N=list(range(0,102))
PZ=[]
for i in range(len(N)):
    if P1.count(N[i])==0:
        PZ.append(N[i])

PZ.append(X)
P2=sorted(PZ)
t=P2.index(X)
if P2[t]==P2[0]:
    print(P2[1])
    exit()
elif P2[t]==P2[-1]:
    print(P2[-2])
    exit()
else:
    dist1=abs(P2[t-1]-P2[t])
    dist2=abs(P2[t]-P2[t+1])
    if dist1<=dist2:
        print(P2[t-1])
        exit()
    else:
        print(P2[t+1])
        exit()
print(0)
import sys
sys.setrecursionlimit(10 ** 7)

n = int(input())
ab = [tuple(map(int,input().split())) for i in range(n-1)]

es = [[] for i in range(n)]
for i, (a,b) in enumerate(ab):
    a,b = a-1,b-1
    es[a].append((b, i))
    es[b].append((a, i))


# BFS
colors = {}
root = 0 # 頂点1が存在することが問題文中で保証されてるからここを根ノードとしよう
root_child0, _ = es[root][0]
colors[(root,root_child0)] = 1
K = 0
queue = [root]
visited = [0]*n
visited[root] = 1

ans_color = [0]*(n-1)

while queue:
    v = queue.pop(0)
    visited[v] = 1

    color = 1
    parent, _ = es[v][0] # vがrootの時は変なことになるけど後で弾くから大丈夫
    color_parent = colors[(v, parent)]

    for to, j in es[v]:
        if visited[to]: continue
        queue.append(to)

        if color == color_parent and v != root:
            color += 1

        colors[(v,to)] = color
        colors[(to,v)] = color

        ans_color[j] = color

        K = max(K, color)
        color += 1


print(K)
print(*ans_color, sep='\n')

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 7)

n = int(input())
ab = [tuple(map(int,input().split())) for i in range(n-1)]

es = [[] for i in range(n)]
for i, (a,b) in enumerate(ab):
    a,b = a-1,b-1
    es[a].append((b, i))
    es[b].append((a, i))

visited = [0]*n
ans_color = [0]*(n-1)

# DFS
def dfs(v, fromColor):
    color = 1
    visited[v] = 1
    for to, i in es[v]:
        if visited[to]: continue

        if color == fromColor:
            color += 1
        ans_color[i] = color
        dfs(to, color)
        color += 1

root = 0 # 頂点1が存在することが問題文中で保証されてるからここを根ノードとしよう
dfs(root, 0)

print(max(ans_color))
print(*ans_color, sep='\n')
x,a,b=map(int,input().split())
print(min(abs(x-a),abs(x-b))


### FIXED CODE ###

x,a,b=map(int,input().split())
if min(abs(x-a),abs(x-b))==abs(x-a):
    print("A")
else:
    print("B")
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

D = abs(A-B)
E = V - W
time = float(D/E)
if D == 0:
  print("YES")
elif E <= 0:
	print("NO")
else:
	if time <= T:
		print("YES")
	else:
		print("NO")

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

D = float(abs(A-B))
E = float(V - W)

if E <= 0:
	print("NO")
	exit()
time = D/E
if time <= T:
	print("YES")
else:
	print("NO")
s = input()
m = []
for i in s:
    if i == "0":
        m.append(i)
    elif i == "1":
        m.append(i)
    else:
        m.pop(-1)
answer = "".join(m)
print(answer)

### FIXED CODE ###

s = input()
m = []
for i in s:
    if i == "0":
        m.append(i)
    elif i == "1":
        m.append(i)
    else:
        try:
            m.pop(-1)
        except:
            continue
answer = "".join(m)
print(answer)
n,a,b =open(0)


c = int(int(a) * int(n))
b = int(b)

if c > b:
  print(b)
  
else:
  print(c)

### FIXED CODE ###

n, a, b = map(int, input().split())

c = a * n
if c > b:
  print(b)
  
else:
  print(c)
N,L = list(map(int,input().split()))


i = 1
taste = []

while i <= N:
        taste.append(L + i - 1)
        i += 1


if L > 0 :
        print(sum(taste[1:N]))
elif L <= 0 and N + L < 0:
        print(sum(taste[0:N-1]))
elif L <= 0 and N + L >= 0:
        print(sum(taste[0:N-1]))

### FIXED CODE ###

A = list(map(int,input()))


if A[0] == A[1] or A[1] == A[2] or A[2] == A[3]:
        print("Bad")
else:
        print("Good")
n,y = map(int,input().split())
d = 0

for a in range(n+1):#10000
    for b in range(n+1):#5000
        c = n - a - b
        x = 10000*a + 5000*b + 1000*c
        if x == y and c >=0:
            print("{} {} {}".format(a,b,c))
            d =1
            break
    else:
        continue
    break



if d == 0:
    print("-1 -1 -1")

### FIXED CODE ###

n,y = map(int,input().split())
d = 0

for a in range(n+1):#10000
    for b in range(n+1):#5000
        c = n - a - b
        x = 10000*a + 5000*b + 1000*c
        if x == y and c >=0:
            print("{} {} {}".format(a,b,c))
            d =1
            break
    else:
        continue
    break



if d == 0:
    print("-1 -1 -1")
n=int(input())
s=str(input())
if(n%2==0):
  r=s[:(n/2)]
  t=s[(n/2):]
  if(r==t):
    print("Yes")
  else:
    print("No")
    
else:
  print("No")

### FIXED CODE ###

n=int(input())
s=str(input())
r=s[:n//2]
t=s[n//2:]
if(r==t):
  print("Yes")
else:
  print("No")
# -*-coding:utf-8

import fileinput
import math

def main():

    a = int(input())
    PI = math.pi
    area =  a * a * PI
    circum = 2 * a * PI

    print('%lf %lf' % (area, circum))


if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*-coding:utf-8

import fileinput
import math

def main():

    a = float(input())
    PI = math.pi
    area =  a * a * PI
    circum = 2 * a * PI

    print('%lf %lf' % (area, circum))


if __name__ == '__main__':
    main()
import fractions

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

ans=1
if len(A)==1:
    ans=10**9
elif len(A)==2:
    ans=max(A)
else:  
    for a in A:
        A2=A-{a}
        ans=max(ans,fractions.gcd(*A2))

print(ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

import fractions
from functools import reduce

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

def mygcd(a,b):
    if a==0:
        return b
    elif b==0:
        return a
    else:
        return fractions.gcd(a,b)

L=[0]*N
for i in range(1,N):
    L[i]=mygcd(L[i-1],A[i-1])

R=[0]*N
for i in range(N-2,-1,-1):
    R[i]=mygcd(R[i+1],A[i+1])

ans=1
for i in range(N):
    c=mygcd(L[i],R[i])
    ans=max(ans,c)

print(ans)
s=input()
if s.sort()=="abc":
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s=input()
if "".join(sorted(s))=="abc":
  print("Yes")
else:
  print("No")
a = int(input())
b = int(input())
c = int(input())
x = int(input())/50
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*10+j*2+k=x:
                ans+=1
print(ans)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())/50
ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*10+j*2+k==x:
                ans+=1
print(ans)
import sys
import collections
w,h,x,y = map(int, input().split())

if (x,y) in [(w,0), (0,h), (0,0), (w,h)] or x/w+y/h==1 or y/x==h/w:
    print(w*h/2, 0)
    sys.exit()

s1 = min(x*h, (w-x)*h)
s2 = min(y*w, (h-y)*w)

if s1==s2:
    print(s1, 1)
else:
    print(max(s1,s2), 0)

### FIXED CODE ###

w,h,x,y = map(int, input().split())
print(w*h/2, int(2*x==w and 2*y==h))