Harryxun/stf_run huggingface dataset:
import bisect
import sys

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

a_accumulated = [0] * n
b_accumulated = [0] * m

for idx, a in enumerate(A):
    a_accumulated[idx] += a_accumulated[idx - 1] + a # idx == 0の場合はa_accumulated[-1]を参照するが、それは0初期化されているので問題ない。

for idx, b in enumerate(B):
    b_accumulated[idx] += b_accumulated[idx - 1] + b

a_limit = bisect.bisect_right(a_accumulated, k)
if a_limit == 0:
    position = bisect.bisect_right(b_accumulated, k - a_accumulated[i])
    print(position)
    sys.exit(0)

best_num = 0
for i in reversed(range(0, a_limit)):
    position = bisect.bisect_right(b_accumulated, k - a_accumulated[i])
    best_num = max(best_num, i + position + 1)
print(best_num)



### FIXED CODE ###

import bisect
import sys

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

a_accumulated = [0] * (n + 1)
b_accumulated = [0] * (m + 1)

for idx, a in enumerate(A):
    a_accumulated[idx + 1] = a_accumulated[idx] + a # idx == 0の場合はa_accumulated[-1]を参照するが、それは0初期化されているので問題ない。

for idx, b in enumerate(B):
    b_accumulated[idx + 1] = b_accumulated[idx] + b

a_limit = bisect.bisect(a_accumulated, k)
if a_limit == 0:
    position = bisect.bisect(b_accumulated, k)
    print(position - 1)
    sys.exit(0)

best_num = 0
for i in reversed(range(0, a_limit)):
    position = bisect.bisect_right(b_accumulated, k - a_accumulated[i])
    best_num = max(best_num, i + position - 1)
print(best_num)
x, y, z = map(int,input().split())

max_lines = [[int(x + y), int(z)],
			 [int(x + z), int(y)],
             [int(y + x), int(z)],
             [int(y + z), int(x)],
             [int(z + x), int(y)],
             [int(z + y), int(x)]]

max_point = 0
one_point = 0
for max_line in range(max_lines):
    if max_line[0] >= max_point:
    	max_point = max_line[0]
        one_point = max_line[1]

print(max_point + one_point)

### FIXED CODE ###

x, y, z = map(int,input().split())

max_lines = [[x * 10 + y, z],
                 [x * 10 + z, y],
                 [y * 10 + x, z],
                 [y * 10 + z, x],
                 [z * 10 + x, y],
                 [z * 10 + y, x]]

max_point = 0
one_point = 0
for max_line in max_lines:
    if max_line[0] >= max_point:
        max_point = max_line[0]
        one_point = max_line[1]

print(max_point + one_point)
n,k =int(x) for x in input().split()
s = list(int(y) for y in input().split())
def min(a):
  min = 1000000
  for i in range(len(a)):
    if min > a[i]:
      min = a[i]
      index = i
  return index
c = min(s)
num = (c-1)//k + (len(s)-c)//k +2
print(num)


      


### FIXED CODE ###

nk=list(map(int, input().split()))
a=list(map(int, input().split()))
n=nk[0]
k=nk[1]
def min(A):
  min=1000000
  for x in range(len(A)):
    if A[x]<=min:
      min=A[x]
  return min
m=0
for i in range(n):
  if a[i]==1:
    m=i
l=[]
if n<=k:
  l.append(1)
else:
  for j in range(k):
    if j<k-1:
      l.append(100000)
    elif j>=k-1 and j%(k-1)==0 and (n-j-1)%(k-1)==0:
      l.append(j//(k-1)+(n-j-1)//(k-1))
    elif j>=k-1 and j%(k-1)!=0 and (n-j-1)%(k-1)!=0:
      l.append(j//(k-1)+1+(n-j-1)//(k-1)+1)
    elif j>=k-1 and j%(k-1)!=0 and (n-j-1)%(k-1)==0:
      l.append(j//(k-1)+1+(n-j-1)//(k-1))
    elif j>=k-1 and j%(k-1)==0 and (n-j-1)%(k-1)!=0:
      l.append(j//(k-1)+(n-j-1)//(k-1)+1)
print(min(l))
a=int(input())
b=0
while b=<a:
    b+=1000
print(b-a)


### FIXED CODE ###

a=int(input())
b=0
while b<a:
    b+=1000
print(b-a)
a=int(input())
b=int(input())
if a<=8 and b<=b:
    print('Yay!')
else:
    print(': (')

### FIXED CODE ###

a,b=map(int,input().split())
if a<=8 and b<=8:
    print('Yay!')
else:
    print(':(' )
def comb(li):
    return len(li) * (len(li) - 1) // 2


def count_small(x, li):
    cnt = 0
    j = len(li)
    for i, e in enumerate(li[1:], 1):
        while li[j-1] * e > x:
            j -= 1
        cnt += min(i - 1, j - 1)

    return cnt


n, k = map(int, input().split())
a = list(map(int, input().split()))
INF = 10 ** 20

neg = []
pos = []

for e in a:
    if e > 0:
        pos.append(e)
    elif e < 0:
        neg.append(e)

# k-th is negative
if k <= len(pos) * len(neg):
    neg.sort()
    neg.append(0)
    pos.sort()

    lb = -10 ** 18 - 1
    ub = 0
    while ub - lb > 1:
        m = (lb + ub) // 2
        j = -1
        cnt = 0
        for e in pos:
            while neg[j+1] * e <= m:
                j += 1

            cnt += j + 1

        if cnt >= k:
            ub = m
        else:
            lb = m

    print(ub)

# k-th is positive
elif k >= n - comb(pos) - comb(neg) + 1:
    raise Exception
    k -= len(pos) * len(neg)
    cnt0 = a.count(0)
    k -= cnt0 * (n - 1) - cnt0 * (cnt0 - 1) // 2
    neg = [-e for e in neg]
    neg.sort()
    neg.insert(0, 0)
    pos.sort()
    pos.insert(0, 0)

    lb = 0
    ub = 10 ** 18
    while ub - lb > 1:
        m = (lb + ub) // 2
        cnt = count_small(m, neg) + count_small(m, pos)
        if cnt >= k:
            ub = m
        else:
            lb = m

    print(ub)

# k-th is 0
else:
    print(0)


### FIXED CODE ###

def comb(li):
    return len(li) * (len(li) - 1) // 2


def count_large(x, li):
    cnt = 0
    j = 0
    for e in li:
        cnt -= e * e >= x
        while li[j-1] * e >= x:
            j -= 1

        cnt -= j

    cnt //= 2
    return cnt


n, k = map(int, input().split())
a = list(map(int, input().split()))
INF = 10 ** 20

neg = []
pos = []

for e in a:
    if e > 0:
        pos.append(e)
    elif e < 0:
        neg.append(e)

# k-th is negative
if k <= len(pos) * len(neg):
    neg.sort()
    neg.append(0)
    pos.sort()

    lb = -10 ** 18 - 1
    ub = 0
    while ub - lb > 1:
        m = (lb + ub) // 2
        j = -1
        cnt = 0
        for e in pos:
            while neg[j+1] * e <= m:
                j += 1

            cnt += j + 1

        if cnt >= k:
            ub = m
        else:
            lb = m

    print(ub)

# k-th is positive
elif k >= n * (n - 1) // 2 - comb(pos) - comb(neg) + 1:
    neg = [-e for e in neg]
    neg.append(0)
    neg.sort()
    pos.append(0)
    pos.sort()

    lb = 1
    ub = 10 ** 18 + 1
    while ub - lb > 1:
        m = (lb + ub) // 2
        cnt = count_large(m, neg) + count_large(m, pos)
        if cnt >= n * (n - 1) // 2 - k + 1:
            lb = m
        else:
            ub = m

    print(lb)


# k-th is 0
else:
    print(0)
x, y, z, k = map(int, input().split())
cs = list(map(int, input().split()))
bs = list(map(int, input().split()))
a_s = list(map(int, input().split()))
a_s.sort(reverse=True)
bs.sort(reverse=True)
cs.sort(reverse=True)

list = []
i = -1
m = int(k/4)
minlist = 0
if m < min(len(a_s), len(bs), len(cs)):
    minlist = a_s[m] + bs[m] + cs[m]
for a in a_s:
    if minlist >= (a + bs[0] + cs[0]):
        break
    for b in bs:
        if minlist >= (a + b + cs[0]):
            break
        for c in cs:
            abc = a + b +c
            if minlist >= abc:
                break
            list.append(abc)
            i += 1
list.sort(reverse=True)
for i in range(k):
    print(list[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = []
for ai in a:
  for bi in b:
    ab.append(ai + bi)
ab.sort(reverse = True)

abc = []

for abi in ab[:k]:
  for ci in c:
    abc.append(abi + ci)
abc.sort(reverse = True)

for abci in abc[:k]:
  print(abci)
import functools
import math


def solve():
    N = int(input())
    A = [int(i) for i in input().split()]
    # gcd = functools.reduce(math.gcd, A)
    max_gcd = 1
    for i in range(N):
        A_ = A.copy()
        A_.remove(A[i])
        max_gcd = max(max_gcd, functools.reduce(math.gcd, A_))
    print(max_gcd)
    

if __name__ == '__main__':
    solve()


### FIXED CODE ###

# 解説を参考に作成
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque

def gcd(a, b):
    """最大公約数"""
    a, b = (a, b) if a >= b else (b, a)
    if b == 0:
        return a
    return gcd(b, a % b)


# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N, A):
    L = [0] * N
    L[0] = A[0]
    for i in range(1, N):
        L[i] = gcd(A[i], L[i - 1])
    R = [0] * N
    R[-1] = A[-1]
    for i in range(1, N):
        R[-(i + 1)] = gcd(A[-(i + 1)], R[-i])
    ans = 0
    for i in range(N):
        if i == 0:
            ans = max(ans, R[i + 1])
        elif i == N - 1:
            ans = max(ans, L[i - 1])
        else:
            ans = max(ans, gcd(L[i - 1], R[i + 1]))
    print(ans)


if __name__ == '__main__':
    # S = input()
    N = int(input())
    # N, M = map(int, input().split())
    A = [int(i) for i in input().split()]
    # B = [int(i) for i in input().split()]
    # AB = [[int(i) for i in input().split()] for _ in range(N)]
    solve(N, A)

    # # test
    # from random import randint
    # from func import random_str
    # solve()
import sys


def kensho(x,tlist):
    for lis in tlist:
        if((x>>(lis[1]-1)) & 1 == lis[2]):
            pass
        else:
            return -1

    return bin(x).count('1')


def main():
    N = int(input())
    xy=[]
    ans=0

    for i in range(1,N+1):
        An= int(input())
        for j in range(0,An):
            x, y = map(int, input().split())
            xy.append([i,x,y])

    cnt = N

    tlist=[]
    for x in range (2 ** cnt):
        for y in range(cnt):
            if((x>>y) & 1):
                for z in xy:
                    if(z[0]==y+1):
                        tlist.append(z)

        anstack = kensho(x,tlist)
        if(ans<anstack):
            ans=anstack

        tlist.clear()

    print(ans)

main()

### FIXED CODE ###

import sys

def kensho(x,tlist):
    for lis in tlist:
        if((x>>(lis[1]-1)) & 1 == lis[2]):
            pass
        else:
            return -1

    return bin(x).count('1')


def main():
    N = int(input())
    xy=[]
    ans=0

    for i in range(1,N+1):
        An= int(input())
        for j in range(0,An):
            x, y = map(int, input().split())
            xy.append([i,x,y])

    cnt = N

    tlist=[]
    for x in range (2 ** cnt):
        for y in range(cnt):
            if((x>>y) & 1):
                for z in xy:
                    if(z[0]==y+1):
                        tlist.append(z)

        anstack = kensho(x,tlist)
        if(ans<anstack):
            ans=anstack

        del tlist[:]

    print(ans)

main()
#文字列wordの文字の種類の構成の表現のためのリストを返す関数
def connection_count(word)->list:
    i=0
    a=[]
    count=1
    while i<(len(word)-1):
        while word[i]==word[i+1]:
            count+=1
            i+=1
            if i>=(len(word)-1):
                break
        a.append(count)
        count=1
        i+=1
    if a[-1]==1:
        a.append(count)
    return a

#S:文字列、K：繰り返す回数
S=input()
K=int(input())

#Sの文字の種類の構成を表現するためのリスト
connection=connection_count(S)

#結果の表示

#すべての文字が同じ場合
if len(connection)==1:
    print(((connection[0]*K)//2))
#最初と最後の文字が異なる場合
elif S[0]!=S[-1]:
    connection2=map(lambda x:x//2,connection)
    print((sum(connection2)*K))
#最初と最後の文字が同じ場合（すべての文字が同じ場合を除く）
else:
    t=S*K
    connection3=connection_count(t)
    connection4=map(lambda x:x//2,connection3)
    print(sum(connection4))


### FIXED CODE ###

import sys

#文字列wordの文字の種類の構成の表現のためのリストを返す関数
def connection_count(word)->list:
    i=0
    a=[]
    count=1
    while i<(len(word)-1):
        while word[i]==word[i+1]:
            count+=1
            i+=1
            if i>=(len(word)-1):
                break
        a.append(count)
        count=1
        i+=1
    if a[-1]==1:
        a.append(count)
    return a

#S:文字列、K：繰り返す回数
S=input()
K=int(input())

#Sが一文字の場合(例外処理）
if len(S)==1:
    print(K//2)
    sys.exit()

#Sの文字の種類の構成を表現するためのリスト
connection=connection_count(S)

#すべての文字が同じ場合
if len(connection)==1:
    print(((connection[0]*K)//2))
#最初と最後の文字が異なる場合
elif S[0]!=S[-1]:
    connection2=list(map(lambda x:x//2,connection))
    print((sum(connection2)*K))
#最初と最後の文字が同じ場合（すべての文字が同じ場合を除く）
else:
    t=S*2
    connection2=list(map(lambda x:x//2,connection))
    connection3=list(connection_count(t))
    connection4=map(lambda x:x//2,connection3)
    a=sum(connection2)
    b=sum(connection4)
    ans=a+(b-a)*(K-1)
    print(ans)
#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline().strip()
from math import gcd
from functools import reduce

MOD = 1000000007  # type: int

def modinv(x):
    return pow(x, MOD - 2, MOD)

def solve(N: int, A: "List[int]"):
    factors = [0 for i in range(10**6 + 1)]
    for x in A:
        i = 2
        while i * i <= x:
            curr = 0
            while x % i == 0:
                curr += 1
                x //= i
            factors[i] = max(factors[i], curr)
            i += 1
        if x > 1:
            factors[x] = max(factors[x], 1)
    lcm = 1
    for i in range(10**6 + 1):
        lcm *= pow(i, factors[i], MOD)
        lcm %= MOD
    ans = 0
    for ai in A:
        ans += lcm * modinv(ai) % MOD
        ans %= MOD
    print(ans)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
input = lambda: sys.stdin.readline().strip()

MOD = 1000000007  # type: int

def modinv(x):
    return pow(x, MOD - 2, MOD)

def solve(N: int, A: "List[int]"):
    factors = [0 for i in range(10**6 + 1)]
    for x in A:
        i = 2
        while i * i <= x:
            curr = 0
            while x % i == 0:
                curr += 1
                x //= i
            factors[i] = max(factors[i], curr)
            i += 1
        if x > 1:
            factors[x] = max(factors[x], 1)
    lcm = 1
    for i in range(10**6 + 1):
        lcm *= pow(i, factors[i], MOD)
        lcm %= MOD
    ans = 0
    for ai in A:
        ans += lcm * modinv(ai) % MOD
        ans %= MOD
    print(ans)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
A,B,C = map(int,input(),split())
print(A if B == C else B if A == C else C)

### FIXED CODE ###

A, B, C = map(int, input().split())
print(A if B == C else B if A == C else C)
import fractions
N = int(input())
T = list(map(int, input().split()))
ans = T[0]
for i in range(1, N):
    ans = ans * T[i] // fractions.grid(ans, T[i])
print(ans)


### FIXED CODE ###

import fractions
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(N - 1):
	ans = ans * T[i + 1] // fractions.gcd(ans, T[i + 1])
print(ans)
n=int(input())
d=list(map(int,input().split()))
sd=sorted(d)
print(sd[(n//2)]-sd[(n//2)-1])n=int(input())
d=list(map(int,input().split()))
sd=sorted(d)
print(sd[(n//2)]-sd[(n//2)-1])

### FIXED CODE ###

n=int(input())
d=list(map(int,input().split()))
sd=sorted(d)
print(sd[(n//2)]-sd[(n//2)-1])
b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print(C)

### FIXED CODE ###

b=input()
if b == 'A':
    print('T')
elif b == 'T':
    print('A')
elif b == 'C':
    print('G')
else:
    print('C')
a,b,c=map(int,input().split())
a=10-a
b=10-b
c=10-c
s=[a,b,c]
print("".join(s))

### FIXED CODE ###

print(1110-int(input()))
n,k = map(int,input().split())
a = list(map(int, input().split()))
s = set()
for x in a:
  if x in s:
    s[x] += 1
  else:
    s[x] = 1
s_l = sorted(s.values())[0:max(0, len(s)-k)]
print(sum(s_l))

### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int, input().split()))
s = dict()
for x in a:
  if x in s:
    s[x] += 1
  else:
    s[x] = 1
s_l = sorted(s.values())[0:max(0, len(s)-k)]
print(sum(s_l))
s = input()
mod = 10**9 + 7

dp = [[0] * 13 for _ in range(len(s)+1)]
for i in range(10):
    if s[0] == "?":
        dp[1][i] += 1
    else:
        dp[1][int(s[0])] = 1
        break

for i, v in enumerate(s):
    if i == 0:
        continue
    for j in range(13):
        if v != "?":
            dp[i + 1][(10 * j + int(v))] += dp[i][j]
            dp[i + 1][(10 * j + int(v))] %= mod
            continue
        for k in range(10):
            x = (10 * j + k) % 13
            dp[i + 1][x] %= mod

print(dp[-1][5])

### FIXED CODE ###

s = input()
mod = 10**9 + 7

dp = [[0] * 13 for _ in range(len(s)+1)]
for i in range(10):
    if s[0] == "?":
        dp[1][i] += 1
    else:
        dp[1][int(s[0])] = 1
        break

for i, v in enumerate(s):
    if i == 0:
        continue
    for j in range(13):
        for k in range(10):
            x = (10 * j + k) % 13
            if v != "?":
                if int(v) == k:
                    dp[i + 1][x] += dp[i][j]
                    dp[i + 1][x] %= mod
                else:
                    dp[i + 1][x] += 0
            else:
                dp[i + 1][x] += dp[i][j]
                dp[i + 1][x] %= mod

print(dp[-1][5])
from collections import deque

N = int(input_[0])
A = list(map(int,input_[1].split()))

ans=[]

A_dict={}

for n in range(N):
    a = A.popleft()
    A_dict[a]=n+1
    
for n in range(N):
    ans.append(A_dict[n+1])

# print(*ans, sep=' ')

### FIXED CODE ###

from collections import deque

N = int(input())
A = deque(map(int,input().split()))

ans=[]

A_dict={}

for n in range(N):
    a = A.popleft()
    A_dict[a]=n+1
    
for n in range(N):
    ans.append(A_dict[n+1])

print(*ans, sep=' ')
s = input()
K = int(input())
s_list = []
for i in range(len(s)):
	for j in range(1, K + 1):
		s_list.append(s[i:j])
s_set = set(s_list)
ans = list(s_set.sort())
print(ans[K - 1])

### FIXED CODE ###

s = input()
K = int(input())
substr = set()
for i in range(len(s)):
    for j in range(i+1, i+K+1):
        substr.add(s[i:j])
print(sorted(substr)[K-1])
n = int(input())
flag = False
for x in range(100):
    for y in range(100):
        flag = (4*x+7*y==n)
if flag:
    print("Yes")
else
    print("No")

### FIXED CODE ###

n = int(input())
flag = False
for x in range(100):
    for y in range(100):
        if 4*x+7*y==n:
            flag = True
if flag:
    print("Yes")
else:
    print("No")
# -*- coding: utf-8 -*-

def countSort(A, m):
    count = [0]*(m+1)
    n = len(A)
    B = [0]*2000000
    j = 0
    for i in range(n):
        count[A[i]] += 1
    for i in range(1, m):
        count[i] += count[i-1]
    for i in range(n-1, -1, -1):
        j = count[A[i]]
        B[j] = A[i]
        count[A[i]] = j-1
    for i in range(n):
        A[i] = B[i+1]
    return A

n = int(raw_input())
A = map(int, raw_input().split())
B = countSort(A, 10000)
print " ".join(map(str, B))

### FIXED CODE ###

# -*- coding: utf-8 -*-

def countSort(A, m):
    count = [0]*(m+1)
    n = len(A)
    B = [0]*2000001
    j = 0
    for i in range(n):
        count[A[i]] += 1
    for i in range(1, m):
        count[i] += count[i-1]
    for i in range(n-1, -1, -1):
        j = count[A[i]]
        B[j] = A[i]
        count[A[i]] = j-1
    for i in range(n):
        A[i] = B[i+1]
    return A

n = int(raw_input())
A = map(int, raw_input().split())
B = countSort(A, 10000)
print " ".join(map(str, B))
A,B=int(input())
print(A*B)

### FIXED CODE ###

# 入力
a,b = map(int, input().split())

# 処理
answer = a * b

# 出力
print(answer)
N,M=map(int,input().split())
edges=[[] for _ in range(N)]
for _ in range(M):
    A,B=map(int,input().split())
    edges[A-1].append(B-1)
    edges[B-1].append(A-1)
visited=[False]*N

path=[]

def dfs(curr):
    visited[curr] = True
    path.append(curr)
    for dst in edges[curr]:
        if not visited[dst]:
            return dfs(dst)

dfs(0)
path=path[1:][::-1]
dfs(0)

print(len(path))
print(" ".join([str(v+1) for v in path]))


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N,M=map(int,input().split())
edges=[[] for _ in range(N)]
for _ in range(M):
    A,B=map(int,input().split())
    edges[A-1].append(B-1)
    edges[B-1].append(A-1)

visited=[False]*N
path=[]

def dfs(curr):
    visited[curr] = True
    path.append(curr)
    for dst in edges[curr]:
        if not visited[dst]:
            dfs(dst)
            return

dfs(0)
path=path[1:][::-1]
dfs(0)

print(len(path))
print(" ".join([str(v+1) for v in path]))
a,b = map(int,input().split())

list = []
if 100*a%8:
  x=int(a/0.08)+1
else:
  x=int(a/0.08)

for i in range(x, int((a+1)/0.08)+1):
    if b/0.1 <= i <(b+1)/0.1:
        list.append(i)

        
list = sorted(list)
if list[0]:
    print(list[0])
else:
    print('-1')



### FIXED CODE ###

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

list = []
if 100*a%8:
  x=int(a/0.08)+1
else:
  x=int(a/0.08)

if 100*(a+1)%8:
    y=int((a+1)/0.08)
else:
    y=int((a+1)/0.08)-1

    
for i in range(x, y+1):
    if b/0.1 <= i <(b+1)/0.1:
        list.append(i)

        
list = sorted(list)
if list:
    print(list[0])
else:
    print('-1')
N,Q = map(int,input().split())
S = list(input())
count = 0
ans = []
for i in range(Q):
  r,l = map(int,input().split())
  for k in range(r,l):
    if S[k] == 'A' and S[k+1] == 'C':
      count += 1
  ans.append(count)
  count = 0
for j in range(len(ans)):
  print(ans[j])


### FIXED CODE ###

N,Q = map(int,input().split())
S = list(input())
R = [0]*N
ans = []
temp = 0
for i in range(1,N):
  if S[i-1] == 'A' and S[i] == 'C':
    temp += 1
  R[i] = temp
for k in range(Q):
  l,r = map(int,input().split())
  ans.append(R[r-1]-R[l-1])
for j in range(len(ans)):
  print(ans[j])
n, m = int(input()), 0
for i in range(1, n**.5 + 1):
  if n%i == 0:
    m = max(m, i)
print(len(str(n // m)))

### FIXED CODE ###

n, m = int(input()), 0
for i in range(1, int(n**.5)+1):
    if not n%i:
        m = max(m, i)
print(len(str(n//m)))
n=input()
a=input().split()
a=[int(i) for i in a]
a=a.sorted()
count=0
ans=0
for i in a:
  if count%2==0:
    ans+=i
  count+=1

### FIXED CODE ###

n=input()
a=input().split()
a=[int(i) for i in a]
a.sort()
count=0
ans=0
for i in a:
  if count%2==0:
    ans+=i
  count+=1
print(ans)
n = int(input())
b = np.array(list(map(int, input().strip().split())))
s = sum(b)
x = []

for i in range(n):
    y = s
    k = i + 1
    for j in range(int((n-1)/2)):
        y -= 2*b[k%n]
        k += 2

    x.append(y)

s = str(x)
s = s.replace(',','')
s = s.replace('[','')
s = s.replace(']','')
print(s)

### FIXED CODE ###

import numpy as np
n = int(input())
b = list(map(int, input().strip().split()))
s = sum(b)
x = np.zeros((n))

x[0] = s
k = 1
for i in range(int((n-1)/2)):
    x[0] -= 2*b[k%n]
    k += 2

for i in range(1,n):
    x[i] = 2 * b[i-1] - x[i-1]

x = (x.astype(int)).tolist()

s = str(x)
s = s.replace(',','')
s = s.replace('[','')
s = s.replace(']','')
s = s.replace('  ',' ')

print(s)
t = input()

if t >= 30:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

t = int(input())

if t >= 30:
  print("Yes")
else:
  print("No")