Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
"""
制約
1≦N≦100
Nは整数
"""

#入力
n = int(input())

#九九リストの作成
list = []
for i in range(1, 10):
  for j in range(1, 10):
    list.append(i * j) #リストに追加　list.append()

#リスト内にNが存在するかどうかで判別＆出力
if N in list:
  print("Yes")
else:
  print("No")

Fixed submission:
N=int(input())

list=[]
for i in range(1,10):
  for j in range(1,10):
    list.append(i*j)
if N in list:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N=int(input())

while a=True:
  for i in range(10):
    for j in range(10):
      if i*j==N:
        print("Yes")
        break
  print("No")
  a=False

  
    

Fixed submission:
N=int(input())

list=[]
for i in range(1,10):
  for j in range(1,10):
    list.append(i*j)
if N in list:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
xlist=[]
for a in range(10):
    for b in range(10):
        xlist.append(a*b)

if n in xlist:
    print("Yes")
else:
    print("No")
    

Fixed submission:
N=int(input())

list=[]
for i in range(1,10):
  for j in range(1,10):
    list.append(i*j)
if N in list:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n=int(input())#入力

for a in range(10):
    for b in range(10):
        if a*b==n:
            print("Yes")
            break #Yesになった時にループを終了
    if a*b==81:
    print("No")#break(if文条件)が一度も起きなかった時のみ出力

Fixed submission:
N=int(input())

list=[]
for i in range(1,10):
  for j in range(1,10):
    list.append(i*j)
if N in list:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list
ya=make_divisor_list(N)
answer=[]
 
lenarray=len(ya)
if lenarray%2==0:
  for i in range(lenarray//2):
    x=ya.pop(0)+ya.pop(-1)
    answer.append(x)
else:
  for i in range((lenarray-1)//2):
    x=ya.pop(0)+ya.pop(-1)
    answer.append(x)
 
 
  y=ya[0]
  answer.append(y*2)
  
print(min(answer)-2)
N=int(input())

ya = []

for i in range(1,N+1):
    if N % i == 0:
        ya.append(i)
answer=[]

lenarray=len(ya)
if lenarray%2==0:
  for i in range(lenarray//2):
    x=ya.pop(0)+ya.pop(-1)
    answer.append(x)
else:
  for i in range((lenarray-1)//2):
    x=ya.pop(0)+ya.pop(-1)
    answer.append(x)


  y=ya[0]
  answer.append(y*2)
  
print(min(answer)-2)

Fixed submission:
n=int(input())
xlist=[]
 
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        xlist.append(i)
 
ans=max(xlist)
print(int(ans+n/ans-2))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

ya = []

for i in range(1,N+1):
    if N % i == 0:
        ya.append(i)
answer=[]

lenarray=len(ya)
if lenarray%2==0:
  for i in range(lenarray//2):
    x=ya.pop(0)+ya.pop(-1)
    answer.append(x)
else:
  for i in range((lenarray-1)//2):
    x=ya.pop(0)+ya.pop(-1)
    answer.append(x)


  y=ya[0]
  answer.append(y*2)
  
print(min(answer)-2)


Fixed submission:
n=int(input())
xlist=[]
 
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        xlist.append(i)
 
ans=max(xlist)
print(int(ans+n/ans-2))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
 
a=list(map(int,input().split()))
f=list(map(int,input().split()))
a=sorted(a)
f=sorted(f,reverse=True)
 
l=-1
r=max(a)*max(f)
def ok():
    s=0
    for i in range(n):
        s+=max(0,int(int(a[i])-int(c/f[i])))
    return s<=k
 
while(l+1<r):
    c=int((l+r)/2)
    ok=lambda :
    	s=0
    	for i in range(n):
    	    s+=max(0,int(int(a[i])-int(c/f[i])))
    	return s<=k
    if ok:
        r=c
    else:
        l=c
print(r)

Fixed submission:
import math
a,b,x=map(int,input().split())
if (a*a*b)/2>x:
  print(math.degrees(math.atan(a*b*b/(2*x))))
else:
  print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))

Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a*a*b/2>x:
  print(math.degrees(math.atan(a*a*b/2*x)))
else:
  print(math.degrees(math.atan(2-2*x/a*a*b))

Fixed submission:
import math
a,b,x=map(int,input().split())
if (a*a*b)/2>x:
  print(math.degrees(math.atan(a*b*b/(2*x))))
else:
  print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))

Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a*a*b/2>x:
  print(math.degrees(math.atan(a*a*b/2*x))
else   
  print(math.degrees(math.atan(2-2*x/a*a*b))

Fixed submission:
import math
a,b,x=map(int,input().split())
if (a*a*b)/2>x:
  print(math.degrees(math.atan(a*b*b/(2*x))))
else:
  print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))

Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if a*a*b/2>x:
  print(math.degrees(math.atan(a*a*b/2*x))
else:
        print(math.degrees(math.atan(2-2*x/a*a*b))
        

Fixed submission:
import math
a,b,x=map(int,input().split())
if (a*a*b)/2>x:
  print(math.degrees(math.atan(a*b*b/(2*x))))
else:
  print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())

answer=a-2*B

if answer<0:
  print(0)
else:
  print(answer)

Fixed submission:
A,B=map(int,input().split())
 
answer=A-2*B
 
if answer<0:
  print(0)
else:
  print(answer)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
reversed(check)
for i in check:
  S.pop(i)
print(len(S))

Fixed submission:
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
check=reversed(check)
for i in check:
  S.pop(i)
print(len(S))

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
reversed(check)
for i in check:
  S.pop(i)


Fixed submission:
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
check=reversed(check)
for i in check:
  S.pop(i)
print(len(S))

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
for i in check:
  S.pop(i)


Fixed submission:
N=int(input())
S=list(input())
check=[]
for i in range(N-1):
  if S[i]==S[i+1]:
    check.append(i)
check=reversed(check)
for i in check:
  S.pop(i)
print(len(S))
Buggy python submission (verdict: Runtime Error):
c=0
n=int(input())
A_list=input().split()
B_list=input().split()
C_list=input().split()
for i in range(0,n):
  c+=B_list[A_list[i]-1]
  if i==n:
    break
  if A_list[i]==(A_list[i+1]-1):
    c+=C_list[A_list[i+1]-1]
print(c)    
  

Fixed submission:
c=0
n=int(input())
A_list=list(map(int,input().split()))
B_list=list(map(int,input().split()))
C_list=list(map(int,input().split()))
for i in range(0,n):
  c+=B_list[A_list[i]-1]
  if i==n-1:
    break
  if A_list[i]==(A_list[i+1]-1):
    c+=C_list[A_list[i]-1]
print(c)
Buggy python submission (verdict: Runtime Error):
ソースコード 

Copy
Copy
A=list(map(int,input().split()))
S=input()
S=S[0:(A[1]-1)]+S[A[1]-1].lower()+S[(A[1]+1):A[0]]
print(S)

Fixed submission:
A=list(map(int,input().split()))
S=input()
S=S[0:(A[1]-1)]+S[A[1]-1].lower()+S[A[1]:A[0]]
print(S)

Buggy python submission (verdict: Runtime Error):
A=list(map(int,input().split()))
S=input()
 
S(A(1)-1).lower()
print(S)

Fixed submission:
A=list(map(int,input().split()))
S=input()
S=S[0:(A[1]-1)]+S[A[1]-1].lower()+S[A[1]:A[0]]
print(S)

Buggy python submission (verdict: Runtime Error):
A=list(map(int,input().split()))
S=input().split('')

S(A(1)-1).lower()
print(''.join(S))


Fixed submission:
A=list(map(int,input().split()))
S=input()
S=S[0:(A[1]-1)]+S[A[1]-1].lower()+S[A[1]:A[0]]
print(S)
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
int(a)
int(b)
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:
  print(2*a-1)
else if a=b:
  print(2*a)
else:
  print(2*b-1)

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if a>b:
  print(2*a-1)
elif a=b:
  print(2*a)
else:
  print(2*b-1

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>b):
  print(2*a-1)
elif(a=b):
  print(2*a)
else:
  print(2*b-1)


Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>b):
  print(2*a-1)
elif(a=b):
  print(2*a)
else:
  print(2*b-1)

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>b):
  print(2*a-1)
else if(a=b):
  print(2*a)
else:
  print(2*b-1)

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
else if(a=b):
  print(2a)
else:
  print(2b-1)


Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
else if(a=b):
  print(2a)
else:
  print(2b-1)

Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if(a>b):
  print(2a-1)
elif(a=b):
  print(2a)
else:
  print(2b-1)


Fixed submission:
a,b=map(int, input().split())
if a>b:
  print(2*a-1)
elif a==b:
  print(2*a)
else:
  print(2*b-1)
Buggy python submission (verdict: Runtime Error):
rgb=list(map(str,input().split()))
X=int(join(rgb))
ans = "Yes" if X%4==0 else "No"
print(ans)

Fixed submission:
r,g,b=map(str,input().split())
X=int(r+g+b)
ans = "YES" if X%4==0 else "NO"
print(ans)

Buggy python submission (verdict: Runtime Error):
rgb=list(map(int,input().split()))
rgb.sorted()
X=int(join(rgb))
ans = "Yes" if X%4==0 else "No"
print(ans)

Fixed submission:
r,g,b=map(str,input().split())
X=int(r+g+b)
ans = "YES" if X%4==0 else "NO"
print(ans)
Buggy python submission (verdict: Runtime Error):
linea = int(input())
lineb = int(input())
if (linea%2)*(lineb%2)==0
	print("Even")
else 
	print("Odd")

Fixed submission:
linea,lineb = map(int,input().split())
if (linea%2)*(lineb%2)==0:
	print("Even")
else :
	print("Odd")
Buggy python submission (verdict: Runtime Error):
line = int(intput())
print(line.count('1'))

Fixed submission:
line = input()
print(line.count("1"))
Buggy python submission (verdict: Runtime Error):
n=int(input())
ac=0
wa=0
tle=0
re=0
for _ in range(n):
    s=input()
    if s=="AC":
        a+=1
    elif s=="WA":
        wa+=1
    elif s=="TLE":
        tle+=1
    else:
        re+=1
print("AC x ",ac)
print("WA x ",wa)
print("TLE x ",tle)
print("RE x ",re)

Fixed submission:
n=int(input())
ac=0
wa=0
tle=0
re=0
for _ in range(n):
    s=input()
    if s=="AC":
        ac+=1
    elif s=="WA":
        wa+=1
    elif s=="TLE":
        tle+=1
    else:
        re+=1
print("AC x ",ac)
print("WA x ",wa)
print("TLE x ",tle)
print("RE x ",re)
Buggy python submission (verdict: Runtime Error):
if(a.isupper()==True):
        print("A")
    else:
        print("a")

Fixed submission:
a=input()
if(a.isupper()):
    print("A")
else:
    print("a")

Buggy python submission (verdict: Runtime Error):
 a = input()
    if(a.isupper()):
        print("A")
    else:
        print("a")

Fixed submission:
a=input()
if(a.isupper()):
    print("A")
else:
    print("a")

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# ---------------------------------------------------------------------------------------!
import os
import sys
from io import BytesIO, IOBase
# from bisect import bisect_left as bl                #c++ lowerbound bl(array,element)
# from bisect import bisect_right as br               #c++ upperbound br(array,element)


# ---------------------------------------MAIN()-----------------------------------------------!
def main():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
    a = input()
    if(a.isupper()):
        print("A")
    else:
        print("a")


# -----------------------------------------------------------------------------------------!
# region fastio
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def _init_(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def _init_(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
def input(): return sys.stdin.readline().rstrip("\r\n")

# endregion


if __name__ == "__main__":
    main()


Fixed submission:
a=input()
if(a.isupper()):
    print("A")
else:
    print("a")
Buggy python submission (verdict: Runtime Error):
n,k = map(int, input().split())
 
ans = 0
while 1 <= n:
  n = n / k
  ans += 1
 
print(ans)

Fixed submission:
N,R=list(map(int,input().split()))
 
if N>=10:
  print(R)
else:
  print(R+100*(10-N))

Buggy python submission (verdict: Runtime Error):
N,R=list(map(int,input().split()))

if N>=10:
  print(R)
else:
  print(A+100*(10-N))
 
              

Fixed submission:
N,R=list(map(int,input().split()))
 
if N>=10:
  print(R)
else:
  print(R+100*(10-N))
Buggy python submission (verdict: Runtime Error):
n=int(input())

ans="no"

for i in range(9):
  if n%(9-i)==0:
    if n/(9-i)<10:
      ans="yes"
print(ans)

Fixed submission:
a,b=map(int,input().split())

if 1<=a<=9 and 1<=b<=9:
    print(a*b)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
a, b=map(int, input().split())
if a-2*b>=0:
    print(a-2b)
else:
    print(0)

Fixed submission:
a, b=map(int, input().split())
if a-2*b>=0:
    print(a-2*b)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
a, b=map(int, input().split())
if a-2*b>=0:
    print(a-2b)
else:
  print(0)

Fixed submission:
a, b=map(int, input().split())
if a-2*b>=0:
    print(a-2*b)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=int(input())

if a>=3200:
  print(S)
else:
  print("red")

Fixed submission:
a=int(input())
s=str(input())

if a>=3200:
  print(s)
else:
  print("red")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int.input().split())
ans = 1/sum(1/x for x in A)
print(ans)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))

num=0
for i in A:
   num+=1/i
    
print(1/num)
Buggy python submission (verdict: Runtime Error):
N,D=list(map(int, input().split()))

print(N//(2*D+1)+1)

Fixed submission:
a = int(input())
s = 3 * a **2
print(s)
Buggy python submission (verdict: Runtime Error):
n=int(input())
V=list(map(int, input().split()))
C=list(map(int, input().split()))

sum=0
for i in range(n):
  if V[i]>C[i]:
      sum+=V[i]-C[i]
print(sum)    

Fixed submission:
a,b,t=list(map(int, input().split()))
print((t//a)*b)
Buggy python submission (verdict: Runtime Error):
L, R, D = map(int, input().split())
ANS = 0
if L % d == 0:
  ANS = 1

ANS += (R-L)//d
print(ANS)
  

Fixed submission:
L, R, D = map(int, input().split())
ANS = 0
if L % D == 0:
  ANS = 1
elif R % D == 0:
  ANS += 1
 
ANS += (R-L)//D
print(ANS)
Buggy python submission (verdict: Runtime Error):
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
  S = input()
  if S == "AC
   AC += 1
  if S == "WA":
    WA+= 1
  if S == "TLE":
    TLE += 1
  if S == "RE":
    RE+= 1

print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))

Fixed submission:
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
  S = input()
  if S == "AC":
   	AC += 1
  if S == "WA":
    WA+= 1
  if S == "TLE":
    TLE += 1
  if S == "RE":
    RE+= 1
print("AC x " + str(AC))
print("WA x " + str(WA))
print("TLE x " + str(TLE))
print("RE x " + str(RE))
Buggy python submission (verdict: Runtime Error):
S = input()
if S[1] == B:
  print("ARC")
else:
  print('ABC')

Fixed submission:
S = input()

if S[1] == 'B':
  print('ARC')
else:
  print('ABC')
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ANSlist = [1]*(N)

for i in range(K):
    I = input() #
    S = list(input())
    for j in range(len(S)):
        if S[j] != " ":
            ANSlist[int(S[j])-1] = 0

ANS = 0

for i in range(len(ANSlist[i])):
    if ANSlist[i] != 0:
        ANS += 1

print(ANS)

Fixed submission:
N, K = map(int, input().split())
#ANSlist = [1]*(N)
ANSlist = []
ANS = 0

for i in range(K):
    I = input() #
    S = input().split()
    #print(ANSlist)
    for j in range(len(S)):
        if S[j] != " ":
            #ANSlist[int(S[j])-1] = 0
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            


'''for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1'''
ANS = N - len(ANSlist)
print(ANS)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())

ANSlist = []

for i in range(1,K):
    inportant = int(input())
    trash = input()
    ANSlist.append(inportant)

ANS = N - max(ANSlist)

print(ANS)

Fixed submission:
N, K = map(int, input().split())
#ANSlist = [1]*(N)
ANSlist = []
ANS = 0

for i in range(K):
    I = input() #
    S = input().split()
    #print(ANSlist)
    for j in range(len(S)):
        if S[j] != " ":
            #ANSlist[int(S[j])-1] = 0
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            


'''for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1'''
ANS = N - len(ANSlist)
print(ANS)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
D = int(input())

ANSlist = []

for i in range(1,K):
    inportant = int(input())
    trash = input()
    ANSlist.append(inportant)

ANS = N - max(ANSlist)

print(ANS)

Fixed submission:
N, K = map(int, input().split())
#ANSlist = [1]*(N)
ANSlist = []
ANS = 0

for i in range(K):
    I = input() #
    S = input().split()
    #print(ANSlist)
    for j in range(len(S)):
        if S[j] != " ":
            #ANSlist[int(S[j])-1] = 0
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            


'''for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1'''
ANS = N - len(ANSlist)
print(ANS)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
print("ok")
D = int(input)

ANSlist = [1]*(N -1)

for i in range(1,K):
    S = map(int, input().split())
    for j in range(S):
        ANSlist[S[j]] = 0

ANS = 0

for i in range(N-1):
    if ANSlist[i] != 0:
        ANS += 1

print(ANS)

Fixed submission:
N, K = map(int, input().split())
#ANSlist = [1]*(N)
ANSlist = []
ANS = 0

for i in range(K):
    I = input() #
    S = input().split()
    #print(ANSlist)
    for j in range(len(S)):
        if S[j] != " ":
            #ANSlist[int(S[j])-1] = 0
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            


'''for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1'''
ANS = N - len(ANSlist)
print(ANS)
Buggy python submission (verdict: Runtime Error):
import copy

N, Q = map(int, input().split())
S = input()
t = [0]*N
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])




Fixed submission:
import copy

N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
import copy

N, Q = map(int, input().split())
S = input()
ANSlist = [0]*Q
for i in range(Q):
    l ,r = map(int, input().split())
    SS = copy.deepcopy(S)
    SS = SS[l-1:r]
    for j in range(1,len(SS)):
        if SS[j] == "C" and SS[j-1] == "A":
            ANSlist[i] += 1
    
for i in range(len(ANSlist)):
    print(ANSlist[i])






Fixed submission:
import copy

N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])

Buggy python submission (verdict: Runtime Error):
import copy

N, Q = map(int, input().split())
S = input()
ANSlist = [0]*Q
for i in range(Q):
    l ,r = map(int, input().split())
    SS = copy.copy(S)
    SS[l:r]
    for j in range(len(SS)):
        if SS[j] == "A" and SS[j+1] == "C":
            ANSlist[i] += 1
    
for i in range(len(ANSlist)):
    print(ANSlist[i])






Fixed submission:
import copy

N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])

Buggy python submission (verdict: Runtime Error):
import copy

N, Q = map(int, input().split())
S = input()
for i in range(Q):
    l ,r = map(int, input().split())
    SS = copy.copy(S)
    SS[l:r]
    ANS = 0
    for j in range(len(SS)):
        if SS[j] == "A" and SS[j+1] == "C":
            ANS += 1
    
    print(ANS)





Fixed submission:
import copy

N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])

Buggy python submission (verdict: Runtime Error):
import copy

N, Q = map(int, input().split())
S = int(input())
for i in range(Q):
    l ,r = map(int, input().split())
    SS = copy.copy(S)
    SS[l:r]
    ANS = 0
    for j in range(len(SS)):
        if SS[j] == "A" and SS[j+1] == "C":
            ANS += 1
    
    print(ANS)





Fixed submission:
import copy

N, Q = map(int, input().split())
S = input()
t = [0]*(N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2] == "AC" else 0)

for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1]-t[l-1])