peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N, M = map(int, input().split())
if N == 1 and M == 1:
  print(0)
  exit()
if N>=2 and M>=2:
  print((N-2)*(M-2))
else:
  if N == 1:
    print(M-2)
  else:
    print(N-2)
# Judge status: Wrong Answer
N = int(input())
B = list(map(int,input().split()))

A = list()
A.append(B[N-2])
for i in range(N-1):
    if B[N-2-i]>=B[N-3-i]:
        A.append(B[N-3-i])
    else:
        A.append(B[N-2-i])

for t in range(1,len(A)-1):
    if A[t-1]<A[t]:
        A[t] = A[t-1]

print(sum(A))
# Judge status: Accepted
def resolve():
	c = [i for i in range(2, 14)]
	c.append(1)
	a, b = map(int, input().split())
	if c.index(a) == c.index(b):
		print("Draw")
	elif c.index(a) > c.index(b):
		print("Alice")
	else:
		print("Bob")
resolve()
# Judge status: Accepted
s = input()
if s[1] == 'B':
    print('ARC')
else:
    print('ABC')
# Judge status: Wrong Answer
import sys
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

MOD = 10**9+7
n, *a = map(int, sys.stdin.buffer.read().split())
l = a[0]
for x in a[1:]:
    l = lcm(x, l)
    l %= MOD

ans = 0
for x in a:
    ans +=  l * pow(x, MOD-2, MOD)%MOD
    ans %= MOD 
print(ans)
# Judge status: Wrong Answer
tt,ta,at,aa=map(int,input().split())
 
for i in range(100):
 if at-ta>0:
    at-=ta
 elif at-ta<=0:
    print("Yes")
 elif tt-aa>0:
     tt=-aa
 elif tt-aa<=0:
    print("No")
# Judge status: Accepted
a,b,x=map(int,input().split())
if a<=x and a+b>=x:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())

b_ = b
b -= b // c
b -= b // d

a_ = a
a -= a // c
a -= a // d

if b_ % a_ == 0:
    b += 1

print(b - a)
# Judge status: Accepted
N=int(input())
S=input()
all=S.count("R")*S.count("G")*S.count("B")

for i in range(N-1):
  for j in range(i,N):
    if 0<=2*i-j<N:
      if S[2*i-j]!=S[i]!=S[j]!=S[2*i-j]:
        all-=1
print(all)
# Judge status: Accepted
#!/usr/bin/env python

def main():
    N, Y = list(map(int, input().split()))
    for i in range(N+1):
        for j in range(N-i+1):
            tmp = 10000 * i + 5000 * j + 1000 * (N-i-j)
            if tmp == Y:
                print(i, j, N-i-j)
                exit()

    print("-1 -1 -1")

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

A.sort(reverse=True)
alip = sum(A[i] for i in range(len(A)) if i % 2 == 0)
bobp = sum(A[i] for i in range(len(A)) if i % 2 == 1)
diff = alip - bobp
print(diff)
# Judge status: Accepted
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]
for i in range(n):
    a.append(a[i] + A[i])
for i in range(m):
    b.append(b[i] + B[i])

ans = 0

for i in range(n + 1):
    if a[i] > k:
        break
    while  a[i] + b[m] > k:
        m -= 1
    ans = max(ans, i + m)

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ab = [LI() for _ in range(n)]
ab.sort(key=itemgetter(1))
time = 0
for a, b in ab:
    time += a
    if time > b:
        print('No')
        quit()
print('Yes')
# Judge status: Accepted
l,r = map(int, input().split())

q1 = l//2019
q2 = r//2019

if q1!=q2:
  print(0)
  exit()

r1 = l%2019
r2 = r%2019
ans = 2019
for i in range(r1,r2+1):
  for j in range(i+1,r2+1):
    rr = (i*j)%2019
    ans = min(ans,rr)
    if ans==0:
      print(ans)
      exit()
      
print(ans)
# Judge status: Wrong Answer
i=int(input())+1
while True:
  f=True
  for j in range(2,i):
    if i%j==0:
      f=False
      break
  if f:
    print(i)
    break
  i+=1
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
cnt1,cnt2,cnt4=0,0,0
for i in A:
  if i%2!=0:
    cnt1+=1
  elif i%2==0 and i%4!=0:
    cnt2+=1
  else:
    cnt4+=1
if cnt2==0:
  if cnt4+1>=cnt1:
    print('Yes')
    exit()    
else:
  if cnt4>=cnt1:
    print('Yes')
    exit() 
print('No')
# Judge status: Accepted
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

def ceil(a, b):
    return (a + b - 1) // b

n, k = inm()
a = inl()
start = a.index(1)
ans = 10**9
for i in range(max(0, start-k+1), min(n-1, start+k)):
    ans = min(ans, ceil(i, k-1) + ceil(n-i-1, k-1))
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

tax1 = int(a/0.08)
tax2 = int(b/0.1)
en = 0
l = sorted([tax1,tax2])
for i in range(l[0]-1,l[1]+2):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        en = 1
        break
if en == 0:
    print(-1)
# Judge status: Accepted
n = int(input())
k = int(input())
x = int(input())
y = int(input())
ans = 0
if n <= k:
    ans = x * n
else:
    ans = x * k + (n-k) * y
print(ans)
# Judge status: Wrong Answer
n = int(input())
A = tuple(map(int, input().split()))
c4 = 0
c2 = 0
cn = 0
for a in A:
    if a%4==0:
        c4 += 1
    elif a%2==0:
        c2 += 1
    else:
        cn += 1

if (c4*2 + 1 if c4 > 0 else 0) + ((c2-1) if c2 > 1 else 0) >= n:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s=raw_input()
s=s.split()
if s[1]<=s[0]*500:
 a="Yes"
else:
 a="No"
print(a)
# Judge status: Wrong Answer
import numpy as np
N = int(input())
S = input()

l_r = [i for i, s in enumerate(S) if s=='R']
l_g = [i for i, s in enumerate(S) if s=='G']
l_b = [i for i, s in enumerate(S) if s=='B']

ans = len(l_r)*len(l_g)*len(l_b)

for dis in range(1, N//2):
  for i in range(1, N-2*dis+1):
    j = i+dis
    k = j+dis
    if len(set([S[i-1], S[j-1], S[k-1]]))==3:
      ans -= 1
      
print(ans)
# Judge status: Accepted
import statistics

n = int(input())
a = list(map(int,input().split()))
s = [a[i] - i - 1 for i in range(n)]
ans = 0
b = statistics.median(s)

for i in range(n):
    ans += abs(s[i] - b)
    
print(int(ans))
# Judge status: Wrong Answer
a,b,m = list(map(int, input().split()))
a1 = list(map(int, input().split()))
b1 = list(map(int, input().split()))
xyc = [ list(map(int, input().split())) for _ in range(m)]

ans = []
for x,y,c in xyc:
    ans.append(a1[x-1] + b1[y-1] - c)
print(min(ans))
# Judge status: Accepted
X=int(input())
n=100
y=0
while n<X:
    y+=1
    n+=int((n*0.01))
print(y)
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

def main():
    s,c = map(int,input().split())

    if c//2 <= s:
        print(c//2)
    else:
        rest = c-2*s
        print(s+rest//4)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import itertools
n,m=map(int,input().split())
a=[]
for i in range(0,n):
  a.append(list(map(int,input().split())))
  del a[i][0]
a=list(itertools.chain.from_iterable(a))
count=0
for i in range(0,m):
  if a.count(i)==n:
    count=count+1
print(count)
# Judge status: Accepted
s = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())

num = 0
cnt = 1
while((num+pow(26,cnt)) < n):
    num += pow(26,cnt)
    cnt += 1

n -= num
n -= 1

ans = ""
while(cnt > 0):
    a = n // pow(26,cnt-1)
    n -= (pow(26,cnt-1)*a)
    cnt -= 1
    ans = ans + s[a]
print(ans)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def main():
    a, b, c = map(int, input().split())
    if b - a == c - a:
        print("YES")
    else:
        print("NO")
    

if __name__ == "__main__":
    main()
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U==S:
    A = A - 1
else:
    B = B - 1

print("%d %d"%(A,B))
# Judge status: Wrong Answer
import numpy
a,b = map(int,input().split())

ans=1
c=a
while c<=b:
  ans = ans * c
  c = c + 1
pm = numpy.sign(ans)
if pm==0:
  print('zero')
elif pm==1:
  print('Positive')
else:
  print('Negative')
# Judge status: Accepted
def main():
    n,a,b,c,d=map(int, input().split())
    s = input()

    if("##" in s[a-1:c] or "##" in s[b-1:d]):return 0
    if(d>c):
        return 1
    else:
        if("..." in s[b-2:d+1]):
            return 1
        else:
            return 0

if __name__ == '__main__':
    k=main()
    if(k):
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
a,k = map(int, input().split())

for i in range(a - k + 1, a + k):
  print(i,end=" ")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
A.append(0)
vermax = [1]
for i in range(N):
  vermax.append((vermax[i]-A[i])*2)
ver = [0]
ans = 0
for i in range(N+1):
  if vermax[i] <= 0:
    ans = -1
    break    
  else:
    ver.append(min(vermax[N-i], ver[i]+A[N-i]))
    ans += ver[i+1]
print(ans)
# Judge status: Wrong Answer
s = input()
print("2018" + s[3:])
# Judge status: Wrong Answer
N, M = map(int, input().split())
H = list(map(int, input().split()))

r = [1] * len(H)
a = []
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        r[B - 1] = 0
    if H[B - 1] > H[A - 1]:
        r[A - 1] = 0

print(r.count(1))
# Judge status: Wrong Answer
A = list(map(int, input().split()))
K = int(input())

print((sum(A) - max(A)) + max(A) * 2 * K)
# Judge status: Accepted
# -*- coding: utf-8 -*-

def main():
# 整数の入力
    
    s1 = input()
    s2 = input()
    # 出力
    if s2[:-1] == s1:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
s = "".join([ i for i in reversed(s)]) + "0"

INF = 10 ** 32
n = len(s)
dp = [ [INF]*2 for _ in range(n)]

dp[0][0] = 0

for i in range(n-1):
    x = int(s[i])
    dp[i+1][0] = min( dp[i][0]+x, dp[i][1]+x )
    # i番目で繰り上がっていたら、(10-1)-x
    dp[i+1][1] = min( dp[i][0]+1+(10-x), dp[i][1]+(9-x) )

print(min(dp[n-1][0], dp[n-1][1]))
# Judge status: Accepted
import math
n,d = map(int,input().split())
x = [0] * n
for i in range(n):
     x[i] = list(map(int,input().split()))

ans = 0
for i in range(n-1):
     for j in range(i+1,n):
          f = 0
          for k in range(d):
               f += (x[i][k] - x[j][k])**2
          if math.sqrt(f).is_integer():
               ans += 1
               
print(ans)
# Judge status: Wrong Answer
S=input()
T=input()
ans=0
for i in range(len(S)):
    if S[i]==T[i]:
        ans+=1
print(ans)
# Judge status: Wrong Answer
N = int(input()) 
x = N * 800 
y = N / 15 * 200 

print(x-y)
# Judge status: Wrong Answer
n,k = map(int,input().split())
d = {}
for _ in range(n):
    a,b = map(int,input().split())
    d[str(a)] = d.get(str(a),0) +b
d2 = sorted(d.items(), key=lambda x: x[0])
cnt=0
for i in d2:
    cnt+=i[1]
    if cnt >= k:
        print(int(i[0]))
        exit(0)
# Judge status: Accepted
from collections import defaultdict
n, k = map(int, input().split())
r, s, p = map(int, input().split())
point = defaultdict(int)
point["r"] = p
point["p"] = s
point["s"] = r
t = input()
ans = 0
hand = [-1] * k
for i in range(n):
    if i < k:
        ans += point[t[i]]
        hand[i] = 1
    elif t[i] != t[i - k] or hand[i % k] != 1:
        ans += point[t[i]]
        hand[i % k] = 1
    elif hand[i % k] == 1:
        hand[i % k] = -1
print(ans)
# Judge status: Accepted
A, B, C, D = map(int, input().split())
if B < C or D < A:
  print(0)
else:
  print(min(B, D) - max(A, C))
# Judge status: Accepted
s, t =  input().split()
a, b = map(int, input().split())
u = input()

if s == u:
  a-=1
elif u==t:
  b -=1
print(a, b)
# Judge status: Wrong Answer
k,x=[int(_) for _ in input().split()]
print('Yes' if k*500>x else 'No')
# Judge status: Wrong Answer
N = int(input())

print(len([i for i in range(N) if i%2==1])/N)
# Judge status: Accepted
S=input()
if 'a' in S and 'b' in S and 'c' in S:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n=int(input())
a=int(input())
print("Yes" if n%500 <= a else "No")
# Judge status: Accepted
n = int(input())
list = list(map(int,input().split()))

list2 = []

o= len(list)
new_list = sorted(list)
max = new_list[o-1]

for i in range(max+1):
    t = sum((i-k)**2 for k in list)
    list2.append(t)

list3 = sorted(list2)

print(list3[0])
# Judge status: Accepted
from sys import stdin
N = int(stdin.readline().rstrip())
A = []
for i in range(N):
    A.append(int(input()))
    
ans = 0
for i in range(N-1):
    ans += (A[i]//2)
    A[i+1] -= min(A[i+1],A[i]%2)
    ans += min(A[i+1],A[i]%2)
ans += (A[-1]//2)
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int ,input().split())

if a+b == c :
  print("YES")
elif a+c == b:
  print("YES")
elif b+c == a:
  print("YES")
else :
  print("NO")
# Judge status: Wrong Answer
s=input()
k=int(input())
m=len(s)

word={j:26-i for i,j in enumerate([chr(_) for _ in range(97,97+26)])}
number={i:j for i,j in enumerate(chr(_) for _ in range(97,97+26))}
ans=""

for i,j in enumerate(s):
    if word[j]<=k:
        k -=word[j]
        ans +="a"
    elif i==m-1 and k>0:
        k %=26
        if word[j]>k:ans +=number[26-word[j]+k]
        else:ans +=number[k-word[j]]
    else:ans +=j

print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif a >= 6:
    print(b//2)
else:
    print(0)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
r=set()
free=0
for x in a:
    y=x//400
    if y>=8:
        free+=1
        y=8
    r.add(y)
len_r=len(r)
if len_r==1 and free>0:
    print(1,free)
elif len_r>1 and free>0:
    print(len_r-1,len_r-1+free)
else:
    print(len_r,len_r)
# Judge status: Accepted
d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
    t=list(map(int,input().split()))
    s.append(t)

fuman=[]
for i in range(26):
    fuman.append(c[i]*66795)


for i in range(d):
    p=fuman.index(max(fuman))
    print(p+1)
    q=364-i
    fuman[p]=(q**2+q)*c[p]//2
# Judge status: Accepted
x = int(input())
if x==5 or x==7 or x==3:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import itertools


X = int(input())
ans_A = 0
ans_B = 0
for i, j in itertools.combinations(range(-120, 120), 2):
    j *= -1
    if i**5 - j**5 == X:
        ans_A = i
        ans_B = j
        break
print(ans_A, ans_B)
# Judge status: Accepted
n = int(input())
cnt = 0
for i in range(1,n+1):
  if i%2==1:
    cnt += 1
print(cnt/n)
# Judge status: Wrong Answer
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = a //500

    if c <= b:
        print("Yes")
    else:
        print("N0")
# Judge status: Accepted
c = input()

if c == "a" or c == "e" or c == "i" or c == "o" or c == "u":
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
N, M = map(int,input().split())
maxL = 0
minR = 10 ** 9
for i in range(M):
  L, R = map(int,input().split())
  maxL = max(maxL,L)
  minR = min(minR,R)
print(max(0,minR - maxL + 1))
# Judge status: Accepted
n = int(input())
ab = []
for i in range(n):
    ab.append(list(map(int, input().split())))
ans = 0
for i in range(n-1,-1,-1):
    x = (ab[i][1] - (ab[i][0]+ans)%ab[i][1])%ab[i][1]
    #print(x)
    ans += x

print(ans)
# Judge status: Wrong Answer
A = int(input())
B = int(input())
for i in range(1,3):
  if i != A and i != B:
    print(i)
    exit(0)
# Judge status: Accepted
A, B = map(int, input().split())
if int(A+B)/2 == (A+B)//2:
  print(int((A+B)/2))
else:
  print(1+(A+B)//2)
# Judge status: Accepted
import numpy as np
mod=10**9+7
n=int(input())
A=list(map(int,input().split()))
A=np.array(A)

ans=0
for i in range(60):
    cnt=np.count_nonzero(A&1)
    ans +=2**i*cnt*(n-cnt)
    A >>=1

print(ans%mod)
# Judge status: Accepted
print("Yes" if 2 == len(set(list(map(int, input().split())))) else "No")
# Judge status: Accepted
N = int(input())

# 1から始まるNまでの連続数を生成して配列に入れる
L = []
for i in range(N):
    L.append(i + 1)

cntArray = []
maxNum = 0
i_when_max = 0
for i in range(len(L)):
    cnt = 0
    while L[i] % 2 == 0:
        cnt += 1
        L[i] = L[i] / 2
    cntArray.append(cnt)
    if cntArray[i] > maxNum:
        maxNum = cntArray[i]
        i_when_max = i

L = []
for i in range(N):
    L.append(i + 1)
print(L[i_when_max])
# Judge status: Accepted

a,b,c=map(int,input().split())
if c-a > 0 and c-b < 0:
    print('Yes')
elif c-a < 0 and c-b > 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

count = 0
for j in A:
    count += B[j-1]

#print(count)

for z in range(N-1):
    if A[z+1]- A[z] == 1:
        zz = A[z]
        count += C[zz-1]

#print(count)
# Judge status: Accepted
#C
import itertools
N,M,Q=map(int,input().split())
X=[[int(x) for x in input().split()] for i in range(Q)]
IN=[int(i) for i in range(1,M+1)]
Max=0
for com in itertools.combinations_with_replacement(IN, N):
    Sum=0
    for i in range(Q):
        a=int(X[i][0])-1
        b=int(X[i][1])-1
        c=int(X[i][2])
        d=int(X[i][3])
        if com[b]-com[a]==c:
            Sum+=d
    Max=max(Max,Sum)
print(Max)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(max((b//a),c))
# Judge status: Wrong Answer
N = int(input())
S = input()
x = 0
l = []
for s in S:
  if s == 'I':
    x += 1
  elif s == 'D':
    x -= 1
  l.append(x)
l.sort()
print(l[-1])
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1):
  if i % 3 != 0 and i % 5 != 0:
    ans += i
print(ans)
# Judge status: Wrong Answer
S = str(input())
if S =="ABC":
    print("ARC")
else:
    print(S)
# Judge status: Accepted
c = input()
p = "aeiou"
if c in p:
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
A, B = map(int, input().split())

count = 0

for i in range(A, B+1):
    # print(list(str(i)), reversed(list(str(i))))
    if list(str(i)) == list(reversed(list(str(i)))):
        count += 1
    # break
print(count)
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))
M = int(1e+9)
for i in range(max(X) + 1):
  S = 0
  for j in X:
    S += (j - i)*(j - i)
  if M > S:
    M = S
print(M)
# Judge status: Accepted
X = int(input())
a = [100, 101, 102, 103, 104, 105]
dp = [[False]*100010 for _ in range(10)]
dp[0][0] = True

for j in range(X+1):
    for i in range(6):
        dp[i+1][j] |= dp[i][j]
        if j >= a[i]:
            dp[i+1][j] |= dp[i][j-a[i]]
            dp[i+1][j] |= dp[i+1][j-a[i]]
if dp[6][X]:
    print(1)
else:
    print(0)
# Judge status: Accepted
N = int(input())  # nは入力回数
S = [input() for _ in range(N)]

print("AC x "+str(S.count('AC')))
print("WA x "+str(S.count('WA')))
print("TLE x "+str(S.count('TLE')))
print("RE x "+str(S.count('RE')))
# Judge status: Accepted
A,B,C = [int(s) for s in input().split()]
 
print(C) if B//A >= C else print(B//A)
# Judge status: Accepted
s = input()
even, odd = [], []
for i in range(len(s)):
    if i%2:
        odd.append(s[i])
    else:
        even.append(s[i])
e = list(set(odd))
o = list(set(even))
if('L' in o or 'R' in e):
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print(max(a+b,b+c,a+c))
# Judge status: Wrong Answer
import numpy as np
def LI():
  return [int(s) for s in input().split()]

correct_answers = []
warning_count = 0
import numpy
N,M = LI()

correct_answers = np.zeros(N,dtype = 'int')

for i in range(M):
  p_num, answer = [s for s in input().split()]
  p_num = int(p_num)
  include_answers = True if correct_answers[p_num-1] == 1 else False
  
  if answer == 'AC' and not include_answers:
    correct_answers[p_num-1] = 1
  elif answer == 'WA' and not include_answers:
    warning_count+=1
    
print(sum(correct_answers),warning_count)
# Judge status: Wrong Answer
S=input()
T=input()

Sc=[[] for i in range(26)]
Tc=[[] for i in range(26)]

for i in range(len(S)):
    Sc[ord(S[i])-97].append(i)
for i in range(len(S)):
    Tc[ord(T[i])-97].append(i)
print(Sc)
print(Tc)

for i in range(len(S)):
    if(Sc[ord(S[i])-97]!=Tc[ord(T[i])-97]):
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
N, M = map(int, input().split())

ans = abs((N - 2)*(M - 2))
print(ans)
# Judge status: Accepted
def decode(x):
    return ord(x) - 97


def encode(x):
    return chr(x + 97)


S = list(map(decode, input()))
K = int(input())
for i in range(len(S) - 1):
    if S[i] == 0:
        continue
    if 26 - S[i] <= K:
        K -= 26 - S[i]
        S[i] = 0
S[-1] = (S[-1] + K) % 26
print("".join(map(encode, S)))
# Judge status: Accepted
k, x = [int(x) for x in input().split()]
rl = max(-1000000, x - k + 1)
rr = min(+1000000, x + k - 1)
print(*(range(rl, rr + 1)))
# Judge status: Accepted
s = int(input())
mod = 10**9+7
table = [0,0,1]
if s<=3:
  print(table[s-1])
else:
  for i in range(s-3):
    table.append(table[i]+table[i+2])
  print(table[-1]%mod)
# Judge status: Wrong Answer
#!/usr/bin/env python3
import sys
import math

def main():
    N = int(input())
    T = math.ceil((2*N)**0.5)
    rem = T*(T+1)//2 - N
    for i in range(T):
        if i+1 != rem:
            print(i+1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
s = input()
if n % 2 == 0 and s[:n//2] == s[n//2:]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import heapq
import math
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
logof2=[0]*N
mi=0
buf=0
#print(A)
for i in range(N):
    logof2[i]=-math.log(A[i],2)
#print(logof2)
heapq.heapify(logof2)
for i in range(M):
    buf=heapq.heappop(logof2)
    buf=buf+1
    heapq.heappush(logof2,buf)
    #print(logof2)
for i in range(N):
    mi=mi+math.floor(pow(2,-logof2[i]))

print(mi)
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict


def main():
    n_in = int(input().strip())

    n_to_xyz = defaultdict(set)
    for x in range(1, 59):
        for y in range(1, 59):
            for z in range(1, 59):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                n_to_xyz[n].add((x, y, z))

    for i in range(1, n_in + 1):
        print(len(n_to_xyz[i]))


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
s = input()


ans = 0
for i in range(n-1):
    x = s[:i+1];y = s[i+1:]
    xs = set();ys = set()
    for v in x:
        xs.add(v)
    for v in y:
        ys.add(v)
    ans = max(len(xs & ys),ans)
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
if 0 < a and 0 < b:
    print('Positive')
elif a < 0 and 0 < b:
    print('Zero')
else:
    if (b - a + 1) % 2 == 0:
        print('Positive')
    else:
        print('Negative')
# Judge status: Wrong Answer
def main():
    X = int(input())
    ans = 0
    ans += X//11
    X %= 11
    if 6 < X:
        ans += 2
    else:
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N=int(input())
A=[int(input()) for _ in range(N)]
cnt=0
buf=0
#print(A)
for i in range(N-1):
    su=A[i]+A[i+1]
    cnt=cnt+su//2
    buf=(su//2)*2
    if buf>A[i]:
        A[i+1]=A[i+1]-(buf-A[i])
        A[i]=0
    else:
        A[i]=A[i]-buf
    #print(A,cnt)
print(cnt)
# Judge status: Wrong Answer
N = int(input())

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

dp = []
for i in range(N+1):
    dp.append([])
    for j in range(3):
        dp[i].append(0)

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

res = 0
for i in range(3):
    res = max(res, dp[N][i])

print(res)

#print(happy)
# Judge status: Wrong Answer
N,M=map(int,input().split())
A=list(map(int,input().split()))
L=sum(A)/(4*M)
j=0
A1=sorted(A,reverse=True)
for i in range(M):
    if A1[i]>L:
        j+=0
    else:
        j+=1
if j==0:
    print("Yes")
else:
    print("No")