Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L = [int(input()) for _ in range(N)]
ans=0
for i in set(L):
  if L.count(i)%2==1:
    ans=ans+1
print(ans)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=[]
for i in range(N):
  L.append(int(input()))
ans=0
for i in set(L):
  if L.count(i)%2==1:
    ans=ans+1
print(ans)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))

Buggy python submission (verdict: Runtime Error):
N=int(input())
L=[]
n=0
while n <N+1 :
  A=int(input())
  if A in L:
    L.remove(A)
    n=n+1
  else:
    L.append(A)
    n=n+1
print(len(L))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=[]
for i in range(N):
  A=int(input())
  if A in L:
    L.remove(A)
  else:
    L.append(A)
print(len(L))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=[]
for i in range(N):
  A=int(input())
  if A in L:
    L.remove(A)
  else:
    L.append(A)
print(len(L))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  a = input()
  if a in s:
    s.remove(a)
  else:
    s.add(a)
print(len(s))
Buggy python submission (verdict: Runtime Error):
N=int(input)
L-list(map(int,input().split()))
print(max(L)-min(L))

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
print(max(L)-min(L))
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
 
if A==B:
  print("Draw")
elif B>1 and A==1 or A>B:
  print(""Alice)
else:
  print("Bob")

Fixed submission:
A,B=map(int,input().split())
 
if A==B:
  print("Draw")
elif B==1:
  print("Bob")
elif B>1 and A==1 or A>B:
  print("Alice")
else:
  print("Bob")

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
 
if A>B or A==1 not B==1:
  print("Alice")
elif A==B:
  print("Draw")
else:    
  print("Bob")

Fixed submission:
A,B=map(int,input().split())
 
if A==B:
  print("Draw")
elif B==1:
  print("Bob")
elif B>1 and A==1 or A>B:
  print("Alice")
else:
  print("Bob")

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A>B:
  print("Alice")
elif A==B:
  print(Draw)
else:
  print("Bob")

Fixed submission:
A,B=map(int,input().split())
 
if A==B:
  print("Draw")
elif B==1:
  print("Bob")
elif B>1 and A==1 or A>B:
  print("Alice")
else:
  print("Bob")
Buggy python submission (verdict: Runtime Error):
a,b=list(map(int,input().split()))
if b//a==0:
  print(b//a)
elif -(-b//a):
  print(-(-b//a))


Fixed submission:
s=list(input())
t=list(input())
ans=0
for i in range(len(s)):
  if s[i]==t[i]:
    ans+=1
    continue
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  ans+=1/a[i]
print(1/ans)


Fixed submission:
a=int(input())
s=input()
if a>=2800 and a<3200:
  print('red')
if a>=3200 and a<5000:
  print(s)

Buggy python submission (verdict: Runtime Error):
a=int(input())
s=input()
if a>3200:
  print(s)
else:
  print(red)

Fixed submission:
a=int(input())
s=input()
if a>=2800 and a<3200:
  print('red')
if a>=3200 and a<5000:
  print(s)
Buggy python submission (verdict: Runtime Error):
n= int(input())
ans = 0
for i in range(1, n+1 ):
	if len(str(i))%2 == 1:
		ans += 1
print(ans)    

Fixed submission:
a,b,c=list(map(int,input().split()))
cap=a-b
use=min(a-b,c)
ans=c-use
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
print(700+100*int(s.coount("o")))

Fixed submission:
s=input()
print(700+100*int(s.count("o")))
Buggy python submission (verdict: Runtime Error):
N=iintnt(input())
A=int(input())
black_cell=N**2-A
print(black_cell)

Fixed submission:
N=int(input())
A=int(input())
black_cell=N**2-A
print(black_cell)
Buggy python submission (verdict: Runtime Error):
from statistics import mean
def main():
    N = int(input())
    X = list(map(int, input().split()))
    P = int(mean(X) + 0.5)
    d = 0
    for n in range(N):
        d += (X[n] - P)**2
    print(d)

main()

Fixed submission:
from statistics import mean
def main():
    N = int(input())
    X = list(map(int, input().split()))
    P = int(mean(X) + 0.5)
    d = 0
    for n in range(N):
        d += (X[n] - P)**2
    print(d)
 
main()
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
p = list(map(int, input().split()))
 
max_exp = 0
ind = 0
for i in range(N - K + 1):
    exp = K + (sum(p[i:i+K]) - K) / 2
    if max_exp < exp:
        max_exp = exp
print(max_exp)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))
 
max_exp = exp = K + (sum(p[0:K]) - K) / 2
for i in range(1, N - K + 1):
    exp -= p[i-1] / 2
    exp += p[i + K - 1] / 2
    if max_exp < exp:
        max_exp = exp

print(max_exp)
Buggy python submission (verdict: Runtime Error):
H, N = map(int, input().split())
x = [list(map(int, input().split())) for n in range(N)]
x = [[tmp[i] for tmp in x] for i in range(len(x[0]))]
A = x[0]
B = x[1]

def ibis(H, A, B):
    maxA = max(A)
    HmaxA = H + maxA
    minB = min(B)
    dp = [max(B) * H] * (HmaxA + 1)
    dp[0] = 0
    for h in range(HmaxA):
        for n in range(N):
            dp[h + 1] = min(dp[h + 1], dp[h] + minB)
            hp = h + A[n]
            if hp <= HmaxA:
                dp[hp] = min(dp[hp], dp[h] + B[n])
    return min(dp[H:HmaxA+1])

print(ibis(H, A, B))

Fixed submission:
H, A = map(int, input().split())
print(H // A + (H % A > 0))
Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())
n = 0
monsters = [H]
while len(monsters) > 0:
    n += 1
    HH = monsters[0] // 2
    if HH > 0:
        monsters.extend([HH, HH])
    del monsters[0]

print(n)


Fixed submission:
H = int(input())
import math
s = 0
a = 2
for i in range(int(math.log2(H))):
    s += a
    a *= 2

print(s + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())

ef num_withdraw_ll(N):
    dp = [N] * (N + 1)
    dp[0] = 0
    for n in range(0, N):
        dp[n + 1] = min(dp[n + 1], dp[n] + 1)
        coin = 6
        while n + coin <= N:
            dp[n + coin] = min(dp[n + coin], dp[n] + 1)
            coin *= 6
        coin = 9
        while n + coin <= N:
            dp[n + coin] = min(dp[n + coin], dp[n] + 1)
            coin *= 9
    return dp[N]

print(num_withdraw_ll(N))

Fixed submission:
N = int(input())

def num_withdraw_l(N):
    dp = [N] * (N + 1)
    dp[0] = 0
    for n in range(1, N+1):
        dp[n] = min(dp[n], dp[n - 1] + 1)
        coin = 6
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 6
        coin = 9
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 9
    return dp[N]

print(num_withdraw_l(N))

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

def num_withdraw_ll(N):
    dp = [N] * (N + 1)
    dp[0] = 0
    for n in range(1, N):
        dp[n + 1] = min(dp[n + 1], dp[n] + 1)
        coin = 6
        while coin <= N:
            dp[n + coin] = min(dp[n + coin], dp[n] + 1)
            coin *= 6
        coin = 9
        while coin <= N:
            dp[n + coin] = min(dp[n + coin], dp[n] + 1)
            coin *= 9
    return dp[N]    

print(num_withdraw_ll(N))

Fixed submission:
N = int(input())

def num_withdraw_l(N):
    dp = [N] * (N + 1)
    dp[0] = 0
    for n in range(1, N+1):
        dp[n] = min(dp[n], dp[n - 1] + 1)
        coin = 6
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 6
        coin = 9
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 9
    return dp[N]

print(num_withdraw_l(N))

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

import numpy as np
def num_withdraw_dp(N):
    dp = np.full(N + 1, N, dtype='int')
    dp[0] = 0
    for n in range(1, N+1):
        dp[n] = min(dp[n], dp[n - 1] + 1)
        coin = 6
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 6
        coin = 9
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 9
    return dp[N]

print(num_withdraw_dp(N))

Fixed submission:
N = int(input())

def num_withdraw_l(N):
    dp = [N] * (N + 1)
    dp[0] = 0
    for n in range(1, N+1):
        dp[n] = min(dp[n], dp[n - 1] + 1)
        coin = 6
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 6
        coin = 9
        while coin <= N:
            dp[n] = min(dp[n], dp[n - coin] + 1)
            coin *= 9
    return dp[N]

print(num_withdraw_l(N))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

a * b = c

print(c)

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

c = a * b

print(c)
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int, input().split())
print(math.floor(a * b))

Fixed submission:
a, b = input().split()
b = b.replace('.', '')
p = str(int(a)*int(b))[:-2]
if len(p) < 1:
  p = 0
print(p)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

def ii(): return int(input())
def iis(): return input().split()
def imi(): return map(int,iis())
def iil(): return list(imi())


factmemo={0:1} #階乗
def fact(n):
    if n in factmemo:
        return factmemo[n]
    k = n*fact(n-1)
    factmemo[n]=k
    return k

def comb(a,b):
    if a-b < 0:
        return 0
    return fact(a)//(fact(a-b)*fact(b)) #組み合わせ

n = int(input())
k = int(input())
r = len(str(n))-1
st = str(n)
ans = 0
if k==1:
    ans += 9*r + int(st[0])
elif k==2:
    ans += 9**2 * comb(r, 2) + (int(st[0])-1) * 9**1 * comb(r, 1) + 9**1 * comb(r-1, 1) + int(st[1])
elif k==3:
    ans += comb(r, 3)*9**3\
           +comb(r, 2)*9**2*(int(st[0])-1)\
           +comb(r-1,2)*9**2\
           +comb(r-1, 1)*9**1*(int(st[1])-1)\
           +comb(r-2,1)*9\
           +int(st[2])




print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(100000)

def ii(): return int(input())
def iis(): return input().split()
def imi(): return map(int,iis())
def iil(): return list(imi())


factmemo={0:1} #階乗
def fact(n):
    if n in factmemo:
        return factmemo[n]
    k = n*fact(n-1)
    factmemo[n]=k
    return k

def comb(a,b):
    if a-b < 0:
        return 0
    return fact(a)//(fact(a-b)*fact(b)) #組み合わせ

def aaa(n,k):
    r = len(str(n))-1
    st = str(n)
    ans = 0
    if k==1 and r>=0:
        ans += 9*r \
               + int(st[0])
    elif k==2 and r>=1:
        ans += 9**2 * comb(r, 2) \
               + (int(st[0])-1) * 9**1 * comb(r, 1) \
               + aaa(n%(10**r), k-1)
    elif k==3 and r>=2:
        ans += comb(r, 3)*9**3\
               +comb(r, 2)*9**2*(int(st[0])-1)\
               +aaa(n%(10**r), k-1)
    return ans

n = int(input())
k = int(input())
ans = aaa(n,k)
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
t = len(s)
if s[:t//2]==s[s//2]:
  print('Yes')
else: print('No')


Fixed submission:

t = int(input())
s = input()
if s[:t//2]==s[t//2:]:
  print('Yes')
else: print('No')

Buggy python submission (verdict: Runtime Error):
s = input()
t = len(s)
if s[:t//2]=s[s//2]:
  print('Yes')
else: print('No')

Fixed submission:

t = int(input())
s = input()
if s[:t//2]==s[t//2:]:
  print('Yes')
else: print('No')
Buggy python submission (verdict: Runtime Error):
from math import atan,pi
a,b,x=map(int,input().split())
if a**2*b>=2*x:
    print(90-atan(2*x/(a*b**2))*180/pi)
else:
    print(90-atan(a**3/(2*a**2*b-2*x))*180/pi)


Fixed submission:
from math import atan,pi
a,b,x=map(int,input().split())
if a**2*b>=2*x:
    try:
        print(90-atan(2*x/(a*b**2))*180/pi)
    except: print(0)
else:
    try:
        print(90-atan(a**3/(2*a**2*b-2*x))*180/pi)
    except: print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(100000)

def ins(): return input().split()
def ii(): return int(input())
def iil(): return list(map(int,ins()))
def lin(): return list(input())
def iin(): return map(int,ins())

class heapx:
    def __init__(self, array):
        self.array = array[:]
        self.heapify()

    def _down_value(self, index):
        try:
            return self.array[2*index+1],self.array[2*index+2]
        except:
            try:
                return self.array[2*index+1],float('inf')
            except:
                return float('inf'),float('inf')

    def _up_value(self, index):
        return self.array[(index-1)//2] if index>0 else -float('inf')

    def _shift(self, i1, i2):
        self.array[i1],self.array[i2]=self.array[i2],self.array[i1]

    def _down_heap(self, index):
        if index > self.leng()-1:
            return False
        i = self.array[index]
        j,k = self._down_value(index)
        if i<j and i<k:
            return
        else:
            if j<k:
                self._shift(index,2*index+1)
                self._down_heap(2*index+1)
            else:
                self._shift(index,2*index+2)
                self._down_heap(2 * index + 2)

    def heapify(self):
        for i in range(-len(self.array)//2-1,1):
            self._down_heap(-i)

    def pop(self):
        self._shift(0,-1)
        tmp = self.array.pop()
        if self.leng() > 0:
            self._down_heap(0)
        return tmp

    def leng(self):
        return len(self.array)

    def _up_heap(self, index):
        i = self.array[index]
        j = self._up_value(index)
        if i<j:
            self._shift(index,(index-1)//2)
            self._up_heap((index-1)//2)

    def push(self, item):
        self.array.append(item)
        self._up_heap(self.leng()-1)

    def poppush(self, item):
        tmp, self.array[0] = self.array[0], item
        self._down_heap(0)
        return tmp

    def pushpop(self, item):
        self.push(item)
        return self.pop()

#t = [5645425,5631,14536,5632,564,151635,563,561415,14563,3131]
#heap = heapx(t)
import math
n,m=iin()
a=heapx(list(map(lambda x:-int(x),ins())))
tmp = a.pop()
for i in range(m):
    tmp = a.pushpop(math.ceil(tmp/2))
print(-(sum(a.array)+tmp))

Fixed submission:
import sys,heapq,math
sys.setrecursionlimit(100000)

def ins(): return input().split()
def ii(): return int(input())
def iil(): return list(map(int,ins()))
def lin(): return list(input())
def iin(): return map(int,ins())

n,m=iin()
a=list(map(lambda x:-int(x),ins()))
heapq.heapify(a)
tmp = heapq.heappop(a)
for i in range(m):
    tmp = heapq.heappushpop(a,math.ceil(tmp/2))
print(-(sum(a)+tmp))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(100000)
def intinput():return map(int,input().split())

factmemo={0:1} #階乗
def fact(n):
    if n in factmemo:
        return factmemo[n]
    k = n*fact(n-1)
    factmemo[n]=k
    return k

def comb(a,b): return fact(a)//(fact(a-b)*fact(b)) #組み合わせ

for i in range(10):
    fact(i+10000)
n=int(input())
s={}
for i in range(n):
    t=list(input())
    t.sort()
    t="".join(t)
    try:
        s[t]+=1
    except:
        s[t]=1
ans=0
for i in s.values():
    if i!=1:
        ans+=comb(i,2)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(100000)
def intinput():return map(int,input().split())

n=int(input())
s={}
for i in range(n):
    t=list(input())
    t.sort()
    t="".join(t)
    try:
        s[t]+=1
    except:
        s[t]=1
ans=0
for i in s.values():
    if i!=1:
        ans+=i*(i-1)//2
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
def intinput():return map(int,input().split())

factmemo={0:1} #階乗
def fact(n):
    if n in factmemo:
        return factmemo[n]
    k = n*fact(n-1)
    factmemo[n]=k
    return k

def comb(a,b): return fact(a)//(fact(a-b)*fact(b)) #組み合わせ


n=int(input())
s={}
for i in range(n):
    t=list(input())
    t.sort()
    t="".join(t)
    try:
        s[t]+=1
    except:
        s[t]=1
ans=0
for i in s.values():
    if i!=1:
        ans+=comb(i,2)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(100000)
def intinput():return map(int,input().split())

n=int(input())
s={}
for i in range(n):
    t=list(input())
    t.sort()
    t="".join(t)
    try:
        s[t]+=1
    except:
        s[t]=1
ans=0
for i in s.values():
    if i!=1:
        ans+=i*(i-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
for i in range(n):
  for j in range(i+1,n):
    a[i],a[j]=a[j],a[i]
    for k in range(n-1):
      if a[k]>a[k+1]:
        a[i],a[j]=a[j],a[i]
        break
    else:
      i,j=n,n
if i==n:
  print("YES")
else:
  print("NO")

Fixed submission:
import sys
sys.setrecursionlimit(100000)
input=sys.stdin.readline
def intinput():return map(int,input().split())


n=int(input())
a=list(intinput())
b=a[:]
b.sort()
if a == b:
    print("YES")
    sys.exit()
for i in range(n):
    for j in range(i+1,n):
        a[i],a[j]=a[j],a[i]
        if a==b:
            print("YES")
            sys.exit()
        a[i],a[j]=a[j],a[i]
print("NO")
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)
input=sys.stdin.readline
def intinput():return map(int,input().split())


n=int(input())
a=list(intinput())
b=list(intinput())
ans=0
print(a)
for i in range(n):
    if a[i]+a[i+1]<b[i]:
        ans+=a[i]+a[i+1]
        a[i+1]=0
        print(a,0)
    else:
        ans+=b[i]
        a[i+1]-=0 if a[i]-b[i]>0 else b[i]-a[i]
        print(a,1)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(100000)
input=sys.stdin.readline
def intinput():return map(int,input().split())


n=int(input())
a=list(intinput())
b=list(intinput())
ans=0
for i in range(n):
    if a[i]+a[i+1]<b[i]:
        ans+=a[i]+a[i+1]
        a[i+1]=0
    else:
        ans+=b[i]
        a[i+1]-=0 if a[i]-b[i]>0 else b[i]-a[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())


n=int(input())
p=[]
for _ in range(n):
    p.append(tuple(intinput()))
s={}
for x,y in p:
    for x1,y1 in p:
        if x==x1 and y==y1:
            break
        if (x-x1,y-y1) in s:
            s[(x-x1,y-y1)]+=1
        else:
            s[(x-x1,y-y1)]=1
print(n-max(s.values()))

Fixed submission:
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())


n=int(input())
p=[]
for _ in range(n):
    p.append(tuple(intinput()))
s={}
for x,y in p:
    for x1,y1 in p:
        if x==x1 and y==y1:
            continue
        if (x-x1,y-y1) in s:
            s[(x-x1,y-y1)]+=1
        else:
            s[(x-x1,y-y1)]=1
if n==1:
    print(1)
else:
    print(n-max(s.values()))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

def intinput():
    return map(int,input().split())

n,m=intinput()
x=np.arange(1,n+1)
z=np.ones(n,bool)
for i in range(m):
    a,b=intinput()
    y = np.logical_and(a<=x,x<=b)
    z = np.logical_and(y,z)
print(np.sum(z))

Fixed submission:
import sys

def intinput():
    return map(int,sys.stdin.readline().split())

n,m=intinput()
a1=0
b1=n+1
for i in range(m):
    a,b=intinput()
    a1 = max(a,a1)
    b1 = min(b,b1)
if b1>=a1:
    print(b1-a1+1)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
count = 0
for i in range(int(n/r)+1):
    for j in range(int(n/g)+1):
        if r*i+g*j>n:
            break
        elif (n-r*i-g*j)%b==0:
            count += 1
print(count)

Fixed submission:
import numpy as np

r,g,b,n=map(int,input().split())

x = np.arange(3001)
rr=x*r
f=0
for i in range(3002):
    p = ((n-rr)%b==0)
    q = n-rr>=0
    f+=np.sum(np.logical_and(p,q))
    rr+=g
print(f)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
count = 0
for i in range(int(n/r)+1):
    for j in range(int(n/g)+1):
        if r*i+g*j>n:
            break
        elif (n-r*i-g*j)%b==0:
            count += 1
print(count)

Fixed submission:
import numpy as np

r,g,b,n=map(int,input().split())

x = np.arange(3001)
rr=x*r
f=0
for i in range(3002):
    p = ((n-rr)%b==0)
    q = n-rr>=0
    f+=np.sum(np.logical_and(p,q))
    rr+=g
print(f)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n = map(int,input().split())
count = 0
for i in range(int(n/r)+1):
    for j in range(int(n/g)+1):
        if r*i+g*j>n:
            break
        elif (n-r*i-g*j)%b==0:
            count += 1
print(count)

Fixed submission:
import numpy as np

r,g,b,n=map(int,input().split())

x = np.arange(3001)
rr=x*r
f=0
for i in range(3002):
    p = ((n-rr)%b==0)
    q = n-rr>=0
    f+=np.sum(np.logical_and(p,q))
    rr+=g
print(f)
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
for i in range(q):
    f = 0
    x,y=map(int,input().split())
    for j in range(x-1,y-1):
        if s[j]+s[j+1]=="AC":
            f += 1
    print(f)

Fixed submission:
n,q = map(int,input().split())
s = input()
l = [0,0]
for i in range(0,n-1):
    l.append(l[i+1]+(s[i]+s[i+1]=="AC"))
for i in range(q):
    x,y = map(int,input().split())
    if l[x-1]+1==l[x]:
        print(l[y] - l[x - 1]-1)
    else:
        print(l[y] - l[x - 1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
values = input().split()

mult = 1
for i in range(len(values)):
  mult *= int(values[i])
  
if mult > 10**18:
  print(-1)
else:
  print(mult)


Fixed submission:
val_1 = input()
nums = val_1.split()
mult = int(nums[0]) * int(nums[1])
print(mult)