peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,m=map(int,input().split())
std = [list(map(int,input().split())) for _ in range(n)]
chk = [list(map(int,input().split())) for _ in range(m)]

for i in range(n):
    chk_id = 0
    d = float("inf")
    for j in range(m):
        d1 = abs(std[i][0] - chk[j][0]) + abs(std[i][1] - chk[j][1])
        if d1 < d:
            d = d1
            chk_id = j+1
    print(chk_id)
# Judge status: Wrong Answer
N = int(input())
count = 0

for a in range(1, N+1):
  tmp = (N-1) // a
  if a == tmp:
    count += 1
  if a < N // 2:
    count += tmp
  else:
    count += 1          

print(count-1)
# Judge status: Wrong Answer
import math

a,b = map(float, input().split())

print(math.floor(a * b))
# Judge status: Wrong Answer
import math
def lcm(x,y):
    return(x*y)//math.gcd(x,y)
n,m=map(int,input().split())
l=list(map(int,input().split()))
a=l[0]//2
for i in range(n-1):
    a=lcm(a,l[i+1]//2)
if m>=a:
  print(((m//a)+1)//2)
else:
  print(0)
# Judge status: Wrong Answer
# -*- coding: <encoding name> -*-

import math
a, b = map(int, input().split())
x = math.ceil(a * b / 2)
print(x)
# Judge status: Accepted
n,*l=map(int,open(0).read().split())
n//=2
l.sort()
print(l[n]-l[~n])
# Judge status: Wrong Answer
import datetime
s = input()
dt = datetime.datetime.strptime(s, '%Y/%m/%d')
if dt.year >= 2019 and dt.month >= 4 and dt.day >= 30:
    print('Heisei')
else:
    print('TBD')
# Judge status: Accepted
N,K=map(int,input().split())
H=list(map(int,input().split()))
DP=[0]*(N+1)
for i in range(2,N+1):
  L=[DP[i-j-1]+abs(H[i-1]-H[i-j-2])for j in range(min(K,i-1))]
  DP[i]=min(L)
print(DP[-1])
# Judge status: Accepted
import sys
k = int(input())
a,b = map(int, input().split())

for i in range(a, b+1):
    if i % k == 0:
        print('OK')
        sys.exit(0)

print('NG')
# Judge status: Accepted
n, x, y = list(map(int, input().split()))

count = [0]*n

for i in range(n-1):
    for j in range(i+1, n):
        ans_1 = j-i
        ans_2 = abs(x-(i+1))+1+abs(y-(j+1))
        
        count[min(ans_1,ans_2)] += 1

# print(count)

[print(k) for k in count[1:]]
# Judge status: Accepted
a,b,c=map(int,input().split())
print("Yes" if a<=c<=b else "No")
# Judge status: Wrong Answer
A, B, K = map(int, input().split())
if K <= A:
  print(K-A, B)
else:
  if K <= A + B:
    print(0, B-K-A)
  else:
    print(0, 0)
# Judge status: Accepted
a, b = map(int, input().split())

cnt = a - 1
ans = cnt + 1 if a <= b else cnt
print(ans)
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())
half = min(x, y) * 2 * c + (max(x, y) - min(x, y)) * min(a, b)
a_b = a * x + b * y
halfOnly = max(x, y) * 2 * c
print(min(min(half, a_b), halfOnly))
# Judge status: Accepted
N = int(input())
cnt = 0
while 2**cnt <= N:
    cnt+=1
print(2**(cnt-1))
# Judge status: Accepted
from bisect import bisect_left, bisect_right
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    b = [int(i) for i in input().split()]
    c = [int(i) for i in input().split()]
    a.sort()
    b.sort()
    c.sort()

    cnt = 0
    for i in range(n):
        v = b[i]
        idx_a = bisect_left(a, v) 
        idx_b = bisect_right(c, v)
        cnt += idx_a * (n-idx_b)     
    print(cnt)
main()
# Judge status: Accepted
N=int(input())
S=["".join(sorted(input())) for _ in range(N)]
d={}
ans=0
for s in S:
  if s in d:
    ans+=d[s]
    d[s]+=1
  else:
    d[s]=1
print(ans)
# Judge status: Accepted
from math import gcd
k = int(input())
ans = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    p = gcd(a,b)
    for c in range(1,k+1):
      ans += gcd(p,c)
print(ans)
# Judge status: Accepted
n = input()
val = 0
for i in n:
    val += int(i)
if val%9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
d, t ,s = map(int, input().split( ))
di = s*t
if di >= d:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import math
n,m = map(int, input().split())
a = math.factorial(m)
b = math.factorial(n)
if 1 < abs(n-m):
    print(0)
elif abs(n-m) == 0:
    print((a*b*2)%1000000007)
elif abs(m-n) == 1:
    print((a*b)%1000000007)
# Judge status: Wrong Answer
N, A, B = map(int, input().split())
def keta_sum(x):
    sum = 0
    while x%10 !=0:
        sum += x%10
        x = x//10
    return(sum)
res = 0
for i in range(N+1):
    if A <= keta_sum(i) <= B:
        res += i
print(res)
# Judge status: Accepted
a, b = map(int, input().split())
c = b - a
t = [1]
for i in range(1100):
    t.append(t[i]+i+2)
idx = 0
for i in range(1000):
    if t[i+1] - t[i] == c:
        idx = i + 1
        break

print(idx * (idx+1)//2-a)
# Judge status: Wrong Answer
N = int(input())
A = int(input())

N = N // 500
if N <= A:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from math import *

def gcd(x, y):
    while y != 0:
        (x, y) = (y, x % y)
    return x

def lcm(x,y):
    return x*y//gcd(x,y)
n = int(input())
a = [int(x) for x in input().split()]

mod = 1000000000+7

k = 1
for x in a:
    k = lcm(k,x)

ans = 0

for x in a:
    ans += k//x

print(ans%mod)
# Judge status: Accepted
a, b = map(int, input().split())

print((a+b) % 24)
# Judge status: Wrong Answer
# 整数の入力
import numpy as np
N = int(input())
A_list = list(map(int, input().split()))
A = np.array(A_list)
ans = np.sum(A) - np.max(A)
print(ans)
# Judge status: Accepted
import bisect

N=int(input())
L1=list(map(int,input().split()))
L2=list(map(int,input().split()))
L3=list(map(int,input().split()))

L1.sort()
L2.sort()
L3.sort()

ans=0
for l2 in L2:
    l1_idx=bisect.bisect_left(L1,l2)
    l3_idx=bisect.bisect_right(L3,l2)
    
    ans+=l1_idx*(N-l3_idx)
print(ans)
# Judge status: Accepted
import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

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

grid = np.zeros((H, W), dtype=int)
for _ in range(N):
    x, y, a = map(int, input().split())

    if a == 1:
        grid[:, :x] = 1
    elif a == 2:
        grid[:, x:] = 1
    elif a == 3:
        grid[:y, :] = 1
    else:
        grid[y:, :] = 1

ans = H * W - np.count_nonzero(grid)
print(ans)
# Judge status: Accepted
n = int(input())
p = 10**9+7
print((pow(10, n, p) - 2*pow(9, n, p) + pow(8, n, p)) % p)
# Judge status: Accepted
N, M = map(int, input().split())
print("Yes") if N == M else print("No")
# Judge status: Accepted
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
print(sum([((a[0] - b[0]) ** 2 +(a[1] - b[1]) ** 2) ** 0.5 for b in xy for a in xy]) / N)
# Judge status: Accepted
x = int(input())

if x <= 599:
  print(8,"\n")
elif x <= 799:
  print(7,"\n")
elif x <= 999:
  print(6,"\n")
elif x <= 1199:
  print(5,"\n")
elif x <= 1399:
  print(4,"\n")
elif x <= 1599:
  print(3,"\n")
elif x <= 1799:
  print(2,"\n")
elif x <= 1999:
  print(1,"\n")
# Judge status: Accepted
l,r,d = map(int,input().split())

mod = l % d
cnt = 0
for i in range(1,100//d + 1):
  if l <= i*d and r >= i*d:
    cnt += 1
  
print(cnt)
# Judge status: Wrong Answer
import bisect
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort()
c.sort()
ans = 0
print(a)
print(b)
print(c)
for i in range(n):
    ans += bisect.bisect_left(a,b[i])*(n-bisect.bisect_right(c,b[i]))
print(ans)
# Judge status: Wrong Answer
n=int(input())
bits = list(map(int,input().split()))
ans = set()
for i in reversed(range(n)):
  for j in range(i+(i+1),n,i+1):
    bits[i] ^= bits[j]
  if bits[i] == 1:
    ans.add(i+1)
print(len(ans))
print(*ans)
n= 3
for i in reversed(range(n)):
  for j in range(i+(i+1),n,i+1):
    print(i,j)
# Judge status: Accepted
N, A, B = map(int, input().split())
S = list(input())
cntA = 0; cntB = 0
for s in S:
    if s == 'a' and cntA+cntB < A+B:
        print('Yes')
        cntA += 1
    elif s == 'b' and cntA+cntB < A+B and cntB < B:
        print('Yes')
        cntB += 1
    else:
        print('No')
# Judge status: Accepted
K, A, B = map(int, input().split())

if B-1 <= A:
    print(K+1)
    exit()

count = max(0, (K - (A-1))//2)
ans = (K+1) - 2*count + (B-A)*count
print(ans)
# Judge status: Accepted
s = input()
s = list(s)
c = set(s)

if len(s) != len(c):
    print("no")
else:
    print("yes")
# Judge status: Accepted
import sys
S = list(input())
s = list(set(S))
s.sort()
alfa = list('abcdefghijklmnopqrstuvwxyz')
ans = 0
if(len(s)==len(alfa)):
  print('None')
  sys.exit()
else:
  for i in range(len(s)):
    if(s[i]!=alfa[i]):
      print(alfa[i])
      sys.exit()
  print(alfa[len(s)])
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())

ans = 1
for i in range(1, n + 1):
    ans = (ans * i) % (pow(10, 9) + 7)
print(ans)
# Judge status: Wrong Answer
import collections
n=int(input())
c=collections.Counter(list(map(int,input().split())))
p=-1
for x in sorted(c.keys())[::-1]:
    if p==-1 and c[x]>=2:p=x
    elif p!=-1 and c[x]>=2:
        print(p*x)
        break
else:print(0)
# 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()))
print(sum([b[i-1] for i in a])+sum([c[i-1] for i in range(n-1) if a[i+1]-a[i]==1]))
# Judge status: Accepted
from collections import Counter
def main():
    n = int(input())
    s = []
    for _ in range(n):
        s.append(input())
    m = int(input())
    t = []
    for _ in range(m):
        t.append(input())

    sc = Counter(s)
    tc = Counter(t)
    r = 0
    for sce in sc:
        r = max(r, sc[sce] - tc[sce])

    print(r)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
import math
n = int(input())
li = [n]
li[0] = input()
isGood=True
for i in range(n-1):
    tmp = input()
    if (not isGood):
        continue
    if (tmp not in li):
        if (li[i][-1] != tmp[0]):
            isGood = False
        else:
            li.append(tmp)
    else:
        isGood = False

if (isGood):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]
ans = -1
for i in range(1000):
	s = str(i)
	if len(s) == n:
		flag = 0
		for (x, y) in a:
			if int(s[x-1]) != y:
				flag = 1
		if flag == 0:
			ans = i
			break

print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))

ans = [0] * n

for i in range(1, n):
    l = min(i, k)
    hs = h[i]
    ans[i] = min([abs(hs - h[i - j])+ans[i-j] for j in range(1, l+1)])
    # j : 戻り幅
#print(ans)
print(ans[-1])
# Judge status: Accepted
a,b = map(int,input().split())
sumA = a
count  =1
ans = 0
while count < b:
    count -=1
    count +=a
    ans +=1
print(ans)
# Judge status: Accepted
a = input()
a1 = int(a)
b = input()
b1 = int(b)
print(6-a1-b1)
# Judge status: Wrong Answer
S = input()
Q = int(input())
Qu= [list(input().split()) for _ in range(Q)]

r = 0

B = []
A = []

for i in range(Q):
  if int(Qu[i][0]) == 1:
    r = 1 - r
  else:
    F = int(Qu[i][1])
    C = Qu[i][2]
    F -= 1
    if F == r:
      B.append(C)
    else:
      A.append(C)

if r == 0:
  B.reverse()
  print("".join(B + [S] + A))
else:
  A.reverse()
  print("".join(A + [S] + B))
# Judge status: Wrong Answer
import sys
input = lambda: sys.stdin.readline().strip("\r\n")

n, k = map(int, input().split())
mod = 10**9 + 7
ans = 0
for i in range(k, n+2):
    mini = i*(i+1)//2
    maxi = (n+1)*(n+2)//2 - (n+1-i)*(n+1-i+1)//2
    ans += maxi - mini
print(ans % mod)
# Judge status: Accepted

def resolve():
    N = int(input())
    S = list(input())
    nopen = 0
    addleft = 0
    addright = 0
    for s in S:
        if s == "(":
            nopen += 1
        else:
            if nopen == 0:
                addleft += 1
            else:
                nopen -= 1
    addright = nopen
    print("("*addleft+"".join(S)+")"*addright)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
X, Y, Z = map(int, input().split())

print(str(Z) + " " + str(X) + " " + str(Y))
# Judge status: Accepted
N,B,R = map(int,input().split())

a = N % (B + R)
b = N // (B + R) * B
if a >= B:
    b += B
else:
    b += a
print(b)
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

# In[25]:


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


# In[26]:


x1 = sorted(X)[N//2-1]
x2 = sorted(X)[N//2]
for i in range(N):
    if X[i] >= x2:
        print(x1)
    else:
        print(x2)


# In[ ]:
# Judge status: Wrong Answer
[a,v] = list(map(int, input().split()))
[b,w] = list(map(int, input().split()))
t = int(input())
nomi = a-b
denomi = w-v
if denomi != 0:
    rem = nomi % denomi
    if rem == 0:
        tRe = nomi//denomi
        if 0<=tRe<=t:
            print('YES')
        else:
            print('NO')
    else:
        tRe = nomi / denomi
        if 0 < tRe < t:
            print('YES')
        else:
            print('NO')
else:
    print('NO')
# Judge status: Accepted
a, b, c, d = input()

if a==b or b==c or c==d:
  print("Bad")
else:
  print("Good")
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())
S = input()

s = A
f = B
flag = True
if C < D:
    if '##' in S[A-1:C]:
        flag = False
    if '##' in S[B-1:D]:
        flag = False

else:
    if S[D - 2] == '#':
        if '...' not in S[B-2:D]:
            flag = False
    if '##' in S[A-1:C]:
        flag = False
ans = 'Yes' if flag else 'No'
print(ans)
# Judge status: Accepted
from sys import stdin

if __name__ == '__main__':
    N = int(stdin.readline().rstrip())
    A = [int(x) for x in stdin.readline().rstrip().split()]
    result = 'APPROVED'
    for a in A:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                pass
            else:
                result = 'DENIED'
                break
    print(result)
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))
nX = sorted(X)
left = nX[N//2-1]
right = nX[N//2]
for i in X:
    if i <= left:
        print(right)
    else:
        print(left)
# Judge status: Accepted
n = int(input())
min_time = [float('inf')] * (n+1)
min_time[0] = 0
for i in range(n):
    min_time[i+1] = min(min_time[i+1],min_time[i]+1)
    times_6 = 1
    while i+6**times_6<=n:
        min_time[i+6**times_6] = min(min_time[i+6**times_6],min_time[i]+1)
        times_6 += 1
    times_9 = 1
    while i+9**times_9<=n:
        min_time[i+9**times_9] = min(min_time[i+9**times_9],min_time[i]+1)
        times_9 += 1
print(min_time[-1])
# Judge status: Accepted
N = int(input())
P = list(map(int,input().split()))
cnt = 0
for i in range(1, N):
  if P[i-1] == i:
    tmp = P[i-1]
    P[i-1] = P[i]
    P[i] = tmp
    cnt += 1
if P[N-1] == N:
  tmp = P[N-1]
  P[N-1] = P[N-2]
  P[N-2] = tmp
  cnt += 1
print(cnt)
# Judge status: Accepted
if __name__ == "__main__":
    n, m = map(int, input().split())
    l = 1
    r = n

    for _ in range(m):
        li, ri = map(int, input().split())
        if l < li:
            l = li
        if r > ri:
            r = ri

    print(max(r-l+1,0))
# Judge status: Accepted
from fractions import gcd

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

cuml = [0]
cumr = [0]

for i in range(N):
    cuml.append(gcd(cuml[i], A[i]))
    cumr.append(gcd(cumr[i], A[N-i-1]))


maxg = 0
for i in range(N):
    # print(gcd(cuml[i], cumr[N-i-1]))
    maxg = max(maxg, gcd(cuml[i], cumr[N-i-1]))
print(maxg)
# Judge status: Wrong Answer
n = int(input())

a = 0

for i in range(1, 10):
    for j in range(1,10):
        if n/i==j:
            print("Yes")
            exit()
            a +=1
        else:
            continue

print("No")

if a == 0:
    print("No")
else:
    exit()
# Judge status: Wrong Answer
N = int(input())
s = [input() for i in range(N)]
num = 0
for i in range(N):
    for j in range(i+1, N):
        count = 0
        for k in range(10):
            if s[i][k] in s[j]:
                count += 1
        if count == 10:
            num += 1

print(num)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b, c, d = 0, 0, 0
for i in a:
    if i % 4 == 0:
        b += 1
    elif i % 2 == 0:
        c += 1
    else:
        d += 1
if c >= 1:
    d += 1
if b + 1 >= d:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
a=list(map(int, input().split()))
b=[0]*N

for i in range(N-1,-1,-1):
  if 2*(i+1)>N:
    b[i]=a[i]
  else:
    summ = sum(a[2*i+1::i+1])
    if summ%2==0:
      b[i]= 1
    else:
      b[i] = 0
#print(b)
    
ans=[]
for num in b:
  if num!=0:
    ans.append(num)
print(len(ans))
print(*ans)
# Judge status: Accepted
# coding: utf-8

def main():
    N, K, Q = map(int, input().split())
    A = [0] * N

    for _ in range(Q):
        tmp = int(input())
        A[tmp - 1] += 1

    for i in range(N):
        if A[i] + K > Q:
            print('Yes')
        else:
            print('No')

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a = int(input())
s = (input())
if a >= 3200:
    print('s')
if a < 3200:
    print('red')
# Judge status: Wrong Answer
N, M= map(int, input().split())

if N >= M * 2:
    print(M // 2)

else:
    m = M - N * 2
    s = m // 4
    print(N + s)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = 0

while all(i % 2 == 0 for i in a):
    cnt += 1
    a = [i//2 for i in a]
print(cnt)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
MOD = 10**9+7

b = [0]*60
for a in A:
    digit = 0
    while a > 0:
        if a % 2 == 1:
            b[digit] += 1
        a = a >> 1
        digit += 1

ans = 0
for i in range(60):
    ans += 2**i * b[i] * (N-b[i])
    ans %= MOD
print(ans)
# Judge status: Accepted
N=int(input())
S=input()
if S[:N//2]==S[N//2:]:
    print("Yes")
else:print("No")
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
A = Counter(map(int, input().split()))
X = 0
for x, y in A.items():
  if x <= y and X < x and N - x >= y - x:
    X = x
print(N - X)
# Judge status: Wrong Answer
K=int(input())
n=1
an=[7%K]
bn=[10%K]
while True:
    an.append(an[-1]%K+(7%K)*(bn[-1]%K))
    if an[-1]%K==0:
        print(n+1)
        break
    elif an[0]==an[-1]:
        print(-1)
        break
    bn.append((bn[-1]*10)%K)
    n+=1
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
A=list(map(int,input().split()))
ans=0
tmp=A[0]
for x in A[1:]:
    if x<tmp:
        ans+=tmp-x
    tmp=max(tmp,x)
print(ans)
# Judge status: Wrong Answer
a, b = list(map(int, input().split()))
count = 0

for i in range(a, b):
    i = str(i)
    if i[0] == i[-1] and i[1] == i[-2]:
        count += 1

print(count)
# Judge status: Accepted
X,Y=map(int,input().split())
number=0
for i in range(X+1):
    if 2*i + 4*(X-i) == Y:
        number += 1
    else:
        number += 0
if number > 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
# coding: utf-8
import sys

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

N, K = lr()
bl = N % K == 0
print(0 if bl else 1)
# Judge status: Accepted
from math import gcd
N=int(input())
ans=int(input())
for i in range(N-1):
  t=int(input())
  ans=ans*t//gcd(ans, t)
  
print(ans)
# Judge status: Accepted
from collections import deque
N, K = map(int, input().split())
p = list(map(int, input().split()))
max_ans = 0
tmp_ans = 0
queue = deque([])
for i in range(N):
    e = (p[i] + 1) / 2 
    tmp_ans += e
    queue.append(e)
    if len(queue) > K:
        tmp_ans = tmp_ans - queue.popleft()
    max_ans = max(max_ans, tmp_ans)
print(max_ans)
# Judge status: Accepted
N, M = map(int,input().split())
R = [0 for k in range(N)]
for k in range(M):
    a, b = map(int,input().split())
    R[a-1] += 1
    R[b-1] += 1
for e in R:
    print(e)
# Judge status: Accepted
s = input()

t = ''
for c in s:
  if c == '0':
    t += '0'
  elif c == '1':
    t += '1'
  elif c == 'B':
    t = t[:-1]
print(t)
# Judge status: Accepted
n,k=map(int,input().split())
p=list(map(int,input().split()))

p.sort()
sm=0
for i in range(k):
  sm+=p[i]
print(sm)
# Judge status: Wrong Answer
N = input ()
P = '1689'
H = '2457'
if N[-1] in P:
  print ('pon')
elif N[-1] in H:
  print ('hon')
else:
  print ('bon')
# Judge status: Wrong Answer

s = input()

cnt = 0
ans = 0
for i in range(len(s)):
    if s[i] == 'A' or s[i] == 'T' or s[i] == 'C' or s[i] == 'G':
        cnt += 1
    else:
        ans = max(ans, cnt)
        cnt = 0

print(ans)
# Judge status: Accepted
# coding: utf-8
# Your code here!

import itertools

N = int(input())
num1 = list(map(int,input().split()))
num2 = list(map(int,input().split()))
x, y = 0, 0
l = [_ + 1 for _ in range(N)]
A = []

for v in itertools.permutations(l, N):
    A.append(list(v))

x = A.index(num1)
y = A.index(num2)

print(abs(x - y))
# Judge status: Wrong Answer
x = int(input())
if x % 11 > 6:
    print(x//11 * 2 + 2)
else:
    print(x//11 * 2 + 1)
# Judge status: Wrong Answer
N,Q = map(int,input().rstrip().split())
S = input().rstrip()
a = [0]*N
for i in range(N):
    if i > 1:
        a[i] = a[i-1]
    if i != 0 and S[i-1]=='A' and S[i] == 'C':
        a[i] += 1
for _ in range(Q):
    l, r = map(int,input().rstrip().split())
# Judge status: Accepted
n,a,b=map(int,input().split())
s=str(input())
s=list(s)
for i in range(len(s)):
  if s[i]=="a" and a+b>0:
    print("Yes")
    if a>0:
      a=a-1
    else:
      b=b-1
  elif s[i]=="b" and b>0:
    print("Yes")
    b=b-1
  else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
ti = [int(input()) for i in range(N)]


def euc_alg(val1, val2):

    if val1 == val2:
        return val1

    mod = val2
    divided = val1
    while 1:
        tmp_mod = divided % val2

        if tmp_mod == 0:
            break
        divided = mod
        mod = tmp_mod

    ret = val1 * val2 // mod

    return ret

maxti = max(ti)
least_common_mult = max([euc_alg(maxti, t) for t in ti])

print(least_common_mult)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
b = 0
for i in range(N):
    if A[i]>B[i]:b+=(A[i]-B[i])
for i in range(N):
    if A[i]<B[i]:
        c = (B[i]-A[i])//2
        if c<=b:b-=c
        elif c>b:b=0
print("No" if b else "Yes")
# Judge status: Wrong Answer
n = int(input())
En = list(map(int, input().split()))
Pl = list(map(int, input().split()))
res = 0
for i in range(n):
    if En[i] < Pl[i]:
        res += En[i]
        Pl[i] -= En[i]
        if En[i+1] < Pl[i]:
            res += En[i+1]
        else:
            En[i+1] -= Pl[i]
            res += Pl[i]
    else:
        res += Pl[i]
print(res)
# Judge status: Accepted
n,k = map(int,input().split())
a = 1
for i in range(k,n+1):
    a += n*i - i**2 + i + 1
print(a%(10**9+7))
# Judge status: Accepted
a, b, k = map(int, input().split())
arr = []

for i in range(1, min(a,b) + 1):
    if a % i == 0 and b % i == 0:
        arr.append(i)

arr.reverse()
print(arr[k-1])
# Judge status: Accepted
n, m = map(int, input().split())

MOD = 10 ** 9 + 7

if n == m:
    ans = 1
    for i in range(2, n + 1):
        ans = ans * i % MOD
    print(ans * ans * 2 % MOD)

elif n + 1 == m:
    ans = 1
    for i in range(2, n + 1):
        ans = ans * i % MOD
    print(ans * ans * m % MOD)

elif n == m + 1:
    ans = 1
    for i in range(2, m + 1):
        ans = ans * i % MOD
    print(ans * ans * n % MOD)

else:
    print(0)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))

a.sort(reverse=True )
x=a[0]
y=a[1]
for i in range(2,n):
    if a[i]<0:
        if x>y:
            x+=a[i]
        else:
            y+=a[i]
    else:
        if x<y:
            x+=a[i]
        else:
            y+=a[i]
print(max(x,y)-min(x,y))
# Judge status: Wrong Answer
X = input()

num = X.find('S')
inv_num = X.rfind('T')

X_num = len(X)

S_num = X[num:inv_num+1].count('S')
T_num = X[num:inv_num+1].count('T')

print(X_num- min(S_num,T_num)*2)
# Judge status: Accepted
o=input()
e=input()
ans=['']*(len(o)+len(e))
flg=1
for i in range(len(o)):
	ans[i*2]=o[i]
for j in range(len(e)):
	ans[j*2+1]=e[j]
for k in range(len(ans)):
	print(ans[k],end="")
# Judge status: Wrong Answer
n=int(input())
ans=1
if n%11>6:
  ans+=1
k=n//11
if (k+1)*11<=n:
  k+=1
print(2*k+ans)