Harryxun/stf_run huggingface dataset:
n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
for i in range(x+1):
    if a[0] == i:
        ans1 += 1
        a.pop(0)
for i in range(x+1, n):
    if a[0] == i:
        ans2 += 1
        a.pop(0)
ans = min(ans1,ans2)
print(ans)




### FIXED CODE ###

n, m, x = map(int,input().split())
a = list(map(int,input().split()))
ans1 = 0
ans2 = 0
if x == 1 or x == n:
    print(0)
else:
    for i in range(1, x):
        if len(a) != 0:
            if a[0] == i:
                ans1 += 1
                a.pop(0)
    if len(a) != 0:
        for i in range(x, n):
            if len(a) != 0:
                if a[0] == i:
                    ans2 += 1
                    a.pop(0)
    ans = min(ans1, ans2)
    print(ans)
import sys
sys.setrecursionlimit=10**12

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        descend[p]+=cur(x)
    return descend[p]
def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+2)]
descend=[1]*(n+2)
par=[-1]+[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)

tmp=cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

def modinv(a,m=10**9+7):
    if a==0: return 1
    else:
        b=m
        (x, lastx) = (0, 1)
        (y, lasty) = (1, 0)
        while b != 0:
            q = a // b
            (a, b) = (b, a % b)
            (x, lastx) = (lastx - q * x, x)
            (y, lasty) = (lasty - q * y, y)
        return lastx % m

def cur(p):
    if neighbor[p]==[]: return
    for x in neighbor[p]:
        par[x]=p
        neighbor[x].remove(p)
        cur(x)
    descend[par[p]]+=descend[p]

def cur2(p):
    for x in neighbor[p]:
        ans[x]=ans[p]*descend[x]*modinv(n-descend[x])
        ans[x]%=mod
        cur2(x)

mod=10**9+7
n=int(input())
neighbor=[set()  for _ in range(n+2)]
descend=[1 for i in range(n+1)]
par=[0]+[0]*(n+1)

for _ in range(n-1):
    a,b=map(int,input().split())
    neighbor[a].add(b)
    neighbor[b].add(a)

cur(1)


ans=[1]*(n+1)
ans1=1
for i in range(1,n+1):
    ans1=ans1*i*modinv(descend[i])
    ans1%=mod
ans[1]=ans1

cur2(1)

for i in range(1,n+1):
    print(ans[i])
a, b = (int()
        input().split())
print(a*b)

### FIXED CODE ###

a, b = (int(x)
        for x in input().split())
print(a*b)
N = input()

if N % 2 != 0:
    answer = N * 2
    print(answer)
else:
    print(N)


### FIXED CODE ###

N = int(input())

if N % 2 != 0:
    answer = N * 2
    print(answer)
else:
    print(N)
s = ''
while True:
    t = input()
    if len(t) == 0: break
    s += t.lower()

for c in 'abcdefghijklmnopqrstuvwxyz':
    print('{} : {}'.format(c, s.count(c)))

### FIXED CODE ###

s = ''
while True:
    try:
        s += input().lower()
    except EOFError:
        break

for c in 'abcdefghijklmnopqrstuvwxyz':
    print('{} : {}'.format(c, s.count(c)))
a, b, c = map(int, input().split())
divisores = []
for i in range(min(a,b), 1, -1):
    if len(divisores) == c:
        break
    elif a % i == 0 and b % i == 0:
        divisores.append(i)
print(divisores[c-1])

### FIXED CODE ###

li=[int(i) for i in input().split()]
a=li[0]
b=li[1]
k=li[2]
c=[]
for i in range(1,min(a,b)+1):
    if(a%i==0 and b%i==0):
        c+=[i]

print(c[-k])
from scipy.spatial import ConvexHull as CH
import numpy as np
norm=np.linalg.norm
n,*t=map(int,open(0).read().split())
a=np.reshape(t,(n,2))
h=CH(a).vertices
l=len(h)
for i in range(n):
	if i in h:
		j=np.where(h==i)[0]
		f,s,t=a[h[j-1]],a[i],a[h[(j+1)%l]]
		print(np.arccos(np.inner(t-s,s-f)/(norm(t-s)*norm(s-f)))[0,0]/(2*np.pi))
	else:
		print(0.)

### FIXED CODE ###

from scipy.spatial import ConvexHull as CH
import numpy as np
norm=np.linalg.norm
n,*t=map(int,open(0).read().split())
a=np.reshape(t,(n,2))
try:
	h = CH(a).vertices
except:
	a=a-10**6
	if np.all(a[:,0]==a[0,0]):
		a=np.fliplr(a)
	b=a[:,0]
	M=np.argmax(b)
	m=np.argmin(b)
	for i in range(n):
		print(0.5*(i in (m,M)))
	exit()
l=len(h)
for i in range(n):
	if i in h:
		j=np.where(h==i)[0]
		f,s,t=a[h[j-1]],a[i],a[h[(j+1)%l]]
		print(np.arccos(np.inner(t-s,s-f)/(norm(t-s)*norm(s-f)))[0,0]/(2*np.pi))
	else:
		print(0.)
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque

INF = 1 << 50

def dfs(seq):
    if seq in ['dreamer', 'dream', 'erase', 'eraser']:
        return True

    if seq[:7] == 'dreamer':
        if dfs[5:] or dfs[7:]:
            return True
        else:
            return False

    elif seq[:5] == 'dream':
        return dfs(seq[5:])

    elif seq[:6] == 'eraser':
        return dfs(seq[6:])

    elif seq[:5] == 'erase':
        return dfs(seq[5:])
    else:
        return False


def run():
    S = input()
    if dfs(S):
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    run()

### FIXED CODE ###

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque

INF = 1 << 50

def dfs(n,seq):
    if seq[n:] in ['dreamer', 'dream', 'erase', 'eraser']:
        return True

    if seq[n:n+7] == 'dreamer':
        if dfs(n+5, seq):
            return True
        elif dfs(n+7, seq):
            return True
        else:
            return False

    elif seq[n:n+5] == 'dream':
        return dfs(n+5, seq)

    elif seq[n:n+6] == 'eraser':
        return dfs(n+6, seq)

    elif seq[n:n+5] == 'erase':
        return dfs(n+5, seq)
    else:
        return False


def run():
    S = input()
    if dfs(0,S):
        print('YES')
    else:
        print('NO')


if __name__ == "__main__":
    run()
import math
x = map(raw_input().split(' '))
a = math.log(x[0] + x[1])
print(int(a)+1)

### FIXED CODE ###

while True:
	try:
		a,b = map(int,raw_input().split(' '))
		print len(str(a+b))
	except: break
#アンバランスな文字列からアンバランスでない文字列を取り除くと、
#アンバランスな文字列が残るはず。ということは、両側から文字を削り取ることで「どの部分列をとってもアンバランスな文字列」が存在するはず
#すなわちそれは、両側に「ax」が存在しない文字列で、「axa」または「aa...aa」
#aaがある時点でアンバランス確定なので「axa」「aa」のどちらかを探せばよし
import re
s=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in alphabet:
    ba=s.find(i+i)
    if ba!=-1:
        print(str(ba+1)+str(ba+2))
        break
    A=re.compile(i+"."+i)
    axa=A.search(s,0)
    if axa:
        ba=axa.start())
        print(str(ba+1)+str(ba+3))
        break

### FIXED CODE ###

#アンバランスな文字列からアンバランスでない文字列を取り除くと、
#アンバランスな文字列が残るはず。ということは、両側から文字を削り取ることで「どの部分列をとってもアンバランスな文字列」が存在するはず
#すなわちそれは、両側に「ax」が存在しない文字列で、「axa」または「aa...aa」
#aaがある時点でアンバランス確定なので「axa」「aa」のどちらかを探せばよし
import re
s=input()
alphabet="abcdefghijklmnopqrstuvwxyz"
for i in alphabet:
    ba=s.find(i+i)
    if ba!=-1:
        print(str(ba+1)+" "+str(ba+2))
        break
    A=re.compile(i+"."+i)
    axa=A.search(s,0)
    if axa:
        ba=axa.start()
        print(str(ba+1)+" "+str(ba+3))
        break
    if i=="z":
        print("-1 -1")
N,Y = map(int,input().split())
if N*10000 == Y:
    print(N,0,0)
else:
    for a in range(N):
        for b in range (N+1-a):
            if a*10000+b*5000+1000*(N-a-b) == Y:
                print(a,b,N-a-b)
                break
        if a*10000+b*5000+1000*(N-a-b) == Y:
            break

if a == N-1 and  b == 1 and (N-1)*10000 + 5000 < Y:
    print(-1,-1,-1)

### FIXED CODE ###

N,Y = map(int,input().split())
for a in range(N+1):
    for b in range (N+1-a):
        if a*10000+b*5000+1000*(N-a-b) == Y:
            print(a,b,N-a-b)
            exit()
print(-1,-1,-1)
n=int(input())
ans=:(
for i in range(1,n):
  if int((i*1.08)//1)==n:
    ans=i
    break
print(ans)

### FIXED CODE ###

n=int(input())
ans=':('
for i in range(1,n+1):
  if int((i*1.08)//1)==n:
    ans=i
    break
print(ans)
n,m = map(int,input().split())
ahoge = []
hanege = []
for i in range(m):
    ai,bi = map(int,input().split())
    if ai == 1:
        ahoge.append(bi)
    if bi == n:
        hanege.append(ai)
ahoge.sort()
hanege.sort()
def bis(i):
    under = 0
    upper = len(hanege)
    l = (under+upper)//2
    while under <= upper:
        if i == hanege[l]:
            return 1
        elif i < hanege[l]:
            upper = l-1
        elif i > hanege[l]:
            under = l+1
    return 0
flag = 0
for i in ahoge:
    if bis(i) == 1:
        print("POSSIBLE")
        flag = 1
        break
if flag == 0:
    print("IMPOSSIBLE")

### FIXED CODE ###

n,m = map(int,input().split())
ahoge = []
hanege = []
for i in range(m):
    ai,bi = map(int,input().split())
    if ai == 1:
        ahoge.append(bi)
    if bi == n:
        hanege.append(ai)
ahoge.sort()
hanege.sort()
def bis(i):
    under = 0
    upper = len(hanege)-1
    while under <= upper:
        l = (under+upper)//2
        if i == hanege[l]:
            return 1
        elif i < hanege[l]:
            upper = l-1
        elif i > hanege[l]:
            under = l+1
    return 0
flag = 0
for i in ahoge:
    if bis(i) == 1:
        print("POSSIBLE")
        flag = 1
        break
if flag == 0:
    print("IMPOSSIBLE")
import sys
sys.setrecursionlimit(100000000)
N, Y = map(int, input().split())
y = Y//1000
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == y]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print(f'{x[1]} {x[2]} {x[3]}')

### FIXED CODE ###

N, Y = map(int, input().split())
li = [[10*a+5*b+(N - a - b), a, b, N- a-b] for a in range(N+1) for b in range(N+1-a) if 10*a+5*b+(N - a - b) == Y//1000]
if len(li) == 0:
    print('-1 -1 -1')
else:
    x = li[0]
    print('{} {} {}'.format(x[1], x[2], x[3]))
x, n = map(int, input().split())
try:
  p = list(map(int, input().split()))
except EOFError:
  print(100)
  exit()
old_diff = 100
for i in range(1, 101):
  if i in p:
    continue
  else:
    diff = abs(x-i)
    if diff < old_diff:
      ans = i
      old_diff = abs(x-i)
print(ans)

### FIXED CODE ###

x, n = map(int, input().split())
try:
  p = list(map(int, input().split()))
except EOFError:
  print(100)
  exit()
old_diff = 10000
for i in range(-110, 110):
  if i in p:
    continue
  else:
    diff = abs(x-i)
    if diff < old_diff:
      ans = i
      old_diff = abs(x-i)

try:
  print(ans)
except:
  print()
def dp(a, b):
    if a == 1:
        if 1 <= b <= 4:
            return b-1
        else:
            return 3
    elif b == 1:
        return 0
    elif 1 < b < 2**(a+1)-1:
        return dp(a-1, b-1)
    elif b == 2**(a+1)-1:
        return dp(a-1, 2**(a+1)-3) + 1
    elif 2**(a+1)-1 < b < a:
        return dp(a-1, 2**(a+1)-3) + 1 + dp(a-1, b+1-2**(a+1))
    elif b == 2**(a+2)-3:
        return dp(a-1, 2**(a+1)-3) * 2 + 1
    
print(dp(n, x))

### FIXED CODE ###

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

def dp(a, b):
    if a == 1:
        if 1 <= b <= 4:
            return b-1
        else:
            return 3
    elif b == 1:
        return 0
    elif 1 < b < 2**(a+1)-1:
        return dp(a-1, b-1)
    elif b == 2**(a+1)-1:
        return dp(a-1, 2**(a+1)-3) + 1
    elif 2**(a+1)-1 < b < 2**(a+2)-3:
        return dp(a-1, 2**(a+1)-3) + 1 + dp(a-1, b+1-2**(a+1))
    elif b == 2**(a+2)-3:
        return dp(a-1, 2**(a+1)-3) * 2 + 1
    
print(dp(n, x))
S = input()
L = sorted(S)
if L[0]==L[1] and L[1]!=L[2] and L[2]==L[3]:
  print('Yes')
else:
  prin('No')

### FIXED CODE ###

S = input()
S1 = []
for i in S:
  if i not in S1:
    S1.append(i)
if len(S1) == 2:
  print('Yes')
else:
  print('No')
N = int(input())
for n in range(1, 3501):
    for w in range(n, 3501):
        t = (N*n*w) % (4*n*w - N*w - N*w)
        if t == 0:
            print(t,n,w)
            exit()


### FIXED CODE ###

N = int(input())
for n in range(1, 3501):
    for w in range(n, 3501):

        try:
            t = (N*n*w) % (4*n*w - N*w - N*n)
        except:
            continue

        if t == 0 and 4*n*w - N*w - N*n>=0:
            print((N*n*w) // (4*n*w - N*w - N*n), n, w)
            exit()
import math
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = math.gcd(ans, a[i])
print(ans)


### FIXED CODE ###

def gcd(m, n):
    return m if n == 0 else gcd(n, m % n)


n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = gcd(ans, a[i])
print(ans)
N=int(input())
A=list(map(int, input().split()))
A=list(map(lambda x:-x if x < 0 else x, A))
A.sort()
print(sum(A[1:]-A[0]))

### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))
cnt=0
for i in range(N):
  if A[i]<0:
    A[i]*=-1
    cnt+=1
A=list(map(abs, A))
A.sort()
if cnt&1==0:
  print(sum(A))
else:
  print(sum(A[1:])-A[0])
fin = open('sample.txt')
input = fin.readline


def main():
    N = int(input())
    A = [0] * N
    node_info = [[-1, 0, 'internal node', None] for _ in range(int(1E5 + 1))]
    for i in range(N):
        A[i] = [int(i) for i in input().strip().split()]
    for line in A:
        if line[1] != 0:
            node_info[line[0]][3] = line[2:]
            for c in line[2:]:
                node_info[c][0] = line[0]

    for line in A:
        pid = node_info[line[0]][0]
        if pid == -1:
            node_info[line[0]][2] = 'root'
        else:
            if node_info[line[0]][3] is None:
                node_info[line[0]][2] = 'leaf'
        if node_info[line[0]][3] is None:
            node_info[line[0]][3] = ['']

        depth = 0
        while pid != -1:
            depth += 1
            pid = node_info[pid][0]
        node_info[line[0]][1] = depth

    for line in sorted(A, key=lambda a: a[0]):
        print('node {}: parent = {}, depth = {}, {}, [{}]'.format(
            line[0], node_info[line[0]][0],
            node_info[line[0]][1], node_info[line[0]][2], ', '.join([str(i) for i in node_info[line[0]][3]]))
        )


if __name__ == '__main__':
    main()

### FIXED CODE ###

N = int(input())

tree = [{'p': -1, 'c': list(), 'd': 0} for _ in range(N)]

for _ in range(N):
    l = list(map(int, input().split()))
    tree[l[0]]['c'] = l[2:]
    for i in l[2:]:
        tree[i]['p'] = l[0]


def calcDepth(tree, root, curDepth=0):
    tree[root]['d'] = curDepth
    [calcDepth(tree, c, curDepth + 1) for c in tree[root]['c']]


r = 0
for i, t in enumerate(tree):
    if t['p'] == -1:
        r = i
        break
calcDepth(tree, r)

for i in range(N):
    state = 'leaf'
    if tree[i]['p'] == -1:
        state = 'root'
    elif len(tree[i]['c']):
        state = 'internal node'
    print('node {i}: parent = {p}, depth = {d}, {state}, {ch}'.format(
        i=i, p=tree[i]['p'], d=tree[i]['d'], state=state, ch=tree[i]['c']
    ))
n = int(input())
c = []
not_c = []
chosen = set()
ans = 0
for i in range(n):
	a, b = map(int, input().split())
	not_c.append([max(a, b), i])
	c.append([min(a, b), i])
	ans += min(a, b)
	if a < b:
		chosen.add("a")
	elif a > b:
		chosen.add("b")

if len(chosen) < 2:
	print(ans)
else:
	c = sorted(c, reverse=True)
	not_c = sorted(not_c)
	#print(c, not_c)
	#used_c = [False] * n
	#used_n = [False] * n

	if c[0][1] != not_c[0][1]:
		ans = ans - c[0][0] + not_c[0][0]
		c_cur = 1
		not_cur = 1
	else:
		ans = min(ans - c[1][0] + not_c[0][0], ans - c[0][0] + not_c[1][0])
		if ans - c[1][0] + not_c[0][0] <= ans - c[0][0] + not_c[1][0]:
			c_cur = 2
			not_cur = 1
		else:
			c_cur = 1
			not_c = 2
	if c_cur < n and not_cur < n:
		while c[c_cur][0] > not_c[not_cur][0]:
			if c[c_cur][1] != not_c[not_cur][1]:
				ans = ans - c[c_cur][0] + not_c[not_cur][0]
				c_cur += 1
				not_cur += 1
			else:
				ans = min(ans - c[c_cur+1][0] + not_c[not_cur][0], ans - c[c_cur][0] + not_c[not_cur+1][0])
				if ans - c[c_cur+1][0] + not_c[not_cur][0] <= ans - c[c_cur][0] + not_c[not_cur+1][0]:
					c_cur += 2
					not_cur += 1
				else:
					c_cur += 1
					not_c += 2
			if c_cur >= n or not_cur >= n:
				break
	print(ans)


### FIXED CODE ###

n = int(input())
c = []
not_c = []
chosen = set()
ans = 0
for i in range(n):
	a, b = map(int, input().split())
	not_c.append([max(a, b), i])
	c.append([min(a, b), i])
	ans += min(a, b)
	if a < b:
		chosen.add("a")
	elif a > b:
		chosen.add("b")

if len(chosen) < 2:
	print(ans)
else:
	c = sorted(c, reverse=True)
	not_c = sorted(not_c)
	#print(c, not_c)
	#used_c = [False] * n
	#used_n = [False] * n

	if c[0][1] != not_c[0][1]:
		ans = ans - c[0][0] + not_c[0][0]
		c_cur = 1
		not_cur = 1
	else:
		ans = min(ans - c[1][0] + not_c[0][0], ans - c[0][0] + not_c[1][0])
		if ans - c[1][0] + not_c[0][0] <= ans - c[0][0] + not_c[1][0]:
			c_cur = 2
			not_cur = 1
		else:
			c_cur = 1
			not_cur = 2
	if c_cur < n and not_cur < n:
		while c[c_cur][0] > not_c[not_cur][0]:
			if c[c_cur][1] != not_c[not_cur][1]:
				ans = ans - c[c_cur][0] + not_c[not_cur][0]
				c_cur += 1
				not_cur += 1
			elif c_cur == n - 1 or not_cur == n - 1:
				break
			else:
				ans = min(ans - c[c_cur+1][0] + not_c[not_cur][0], ans - c[c_cur][0] + not_c[not_cur+1][0])
				if ans - c[c_cur+1][0] + not_c[not_cur][0] <= ans - c[c_cur][0] + not_c[not_cur+1][0]:
					c_cur += 2
					not_cur += 1
				else:
					c_cur += 1
					not_cur += 2
			if c_cur >= n or not_cur >= n:
				break
	print(ans)
input = int(raw_input())
print (input + input ** 2 + input ** 3)

### FIXED CODE ###

input = int(input())
print (input + input ** 2 + input ** 3)
#入力
N = int(input())
a_list = []
a_list = list(map(int,input().split()))

#変数を用意
g_list = [0]*9

#グループ1の要素があるか確認
for i in range(N):
    if 1 <= a_list[i] <= 399:
        g_list[0] = 1
        break

#グループ2から8の要素があるか確認
for j in range(1,8):
    for k in range(N):
        if 400*j <= a_list[k] <= (400*(j+1)-1):
            g_list[j] = 1
            break

#グループ1から8の要素数をgに代入
g = 0
for m in range(8):
    g += g_list[m] 

#グループ9の要素がいくつあるか数える
g_list[8] = 0
for l in range(N):
    if a_list[l] >= 3200:
        g_list[8] += 1

#条件分岐して数える
if g_list[8]==0:
    print(g,g)

elif g==0:
    if g_list[8] >= 8:
        print(1,8)
    else:
        print(1,g_list[8])

elif g==8:
    print(8,8)
    
else:
    if g + g_list[8] >=8:
        print(g,8)
    else:
        print(g,g+g_list[8])


### FIXED CODE ###

r,g,b = map(int,input().split())
x = r*100 + g*10 + b
if x%4 == 0:
    print('YES')
else:
    print('NO')
n = int(input)
xy = [list(map(int,input().split())) for _ in range(n)]

ans = 0
for i in range(n-1):
  for j in range(i+1,n):
    ans += ((xy[i][0] - xy[i][1])**2 + (xy[j][0] - xy[j][1])**2)**0.5
print(ans*2/n)


### FIXED CODE ###

n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

ans = 0
for i in range(n-1):
  for j in range(i+1,n):
    ans += ((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5
print(ans*2/n)
import java.util.Scanner;

class Main {

  static boolean RS(String S, int n) {
    
    if (n%2 == 1) return false;
      
    for(int i = 0; i < n/2; i++)
      if(S.charAt(i)) != S.charAt(i+n/2))
        return false;
      
    return true;
  }
  
  public static void main(String[] args) {
    Scanner stdIn = new Scanner(System.in);
    
    int n = stdIn.nextInt();
    String S = stdIn.next();
     
    switch(RS(S, n)) {
     case true: System.out.println("Yes"); break;
     case false: System.out.println("No"); break;
    }
  }
}


### FIXED CODE ###

n = int(input())
S = input()
b = 0
if n % 2 == 0:
  h = int(n/2)
  b = 1
  for i in range(h):
    if S[i] != S[i+h]:
      b = 0
print("Yes" if b == 1 else "No")
a,b = str(int,input().split())#整数を文字列として入力
S = a+b
P = S.count("-")
if P == 1:
  print("0")
elif P == 2:
  print("Negative")
else:
  print("Positive")

### FIXED CODE ###

a,b = map(str,input().split())#整数を文字列として入力
S = a+b
P = S.count("-")
if P == 1:
  print("Zero")
elif P == 2:
  if (int(b) - int(a)) % 2 ==0:
    print("Negative")
  else:
    print("Positive")
else:
  print("Positive")
#C
import sys
sys.setrecursionlimit(1000000)
mod=10**9+7
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
def f(x):
    if x==1 or x==0:
        return 1
    else:
        return (f(x-1)+f(x-2))%mod
s=f(a[0]-1)
for i in range(1,m):
    if a[i]-a[i-1]==1:
        print(0)
        break
    s=(s*f(a[i]-a[i-1]-2))%mod
else:
    s=(s*f(n-a[m-1]-1))%mod
    print(s)

### FIXED CODE ###

#C
mod=10**9+7
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
def f(x):
    b=1
    c=1
    if x==1 or x==0:
        return 1
    else:
        for i in range(x-1):
            b,c=(b+c)%mod,b
        return b
if m>=1:
    s=f(a[0]-1)
    for i in range(1,m):
        if a[i]-a[i-1]==1:
            print(0)
            break
        s=(s*f(a[i]-a[i-1]-2))%mod
    else:
        s=(s*f(n-a[m-1]-1))%mod
        print(s)
else:
    print(f(n))
n, k, price, special = map(int, input().split())
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
 

### FIXED CODE ###

def iroha():
    n, k, price, special = [int(input()) for i in range(4)]
    result = 0
    for i in range(n):
        if i < k:
            result += price
        else:
            result += special
    print(result)

if __name__ == "__main__":
    iroha()
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


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

result = 0
for i in range(n):
    withoutI = a[:i]+a[i+1:]
    tmp = gcd_list(withoutI)
    if tmp > result:
        result = tmp

print(result)

### FIXED CODE ###

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


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

l = [0]*(n+2)
r = [0]*(n+2)
m = [0]*(n+2)

for i in range(n+1):
    j = n-i
    if i == 0:  # j = n
        l[i] = 0
        r[j+1] = 0
    else:
        l[i] = gcd(l[i-1], a[i-1])
        r[j] = gcd(r[j+1], a[j])

m = [gcd(l[i], r[i+1]) for i in range(n+1)]

print(max(m))
n=int(input())
import math
print((2*n)//math.gcd(2,n))


### FIXED CODE ###

n=int(input())
print(2*n) if n%2 != 0 else print(n)