Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
blue = ''.join(['b' for i in range(a)])
red = ''.join(['r' for i in range(b)])
s = str()
while len(s) < n:
    s += blue
    if len(s) >= n:
        break
    s += red
    
print(s[:n].count('b'))

Fixed submission:
n,a,b = map(int,input().split())
ans = int(n / (a + b))
rem = n % (a + b)
if rem > a:
    print(ans * a + a)
else:
    print(ans * a + rem)

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b = map(int,input().split())
blue = ''.join(['b' for i in range(a)])
red = ''.join(['r' for i in range(b)])
s = str()
while len(s) < n:
    s += blue + red
    
print(s[:n].count('b'))

Fixed submission:
n,a,b = map(int,input().split())
ans = int(n / (a + b))
rem = n % (a + b)
if rem > a:
    print(ans * a + a)
else:
    print(ans * a + rem)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
for i in range(1, 1001):
  if floor(i * 0.08) == a and floor(i * 0.1) == b:
    print(i)
else:
  print('-1')


Fixed submission:
a,b = map(int,input().split())
for i in range(1, 1001):
  if int(i * 0.08) == a and int(i * 0.1) == b:
    print(i)
    break
else:
  print('-1')
Buggy python submission (verdict: Runtime Error):
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for number in b:
    if b in a:
        a[a.index(b)] = 0
if a[0][0] == a[1][1] == a[2][2] == 0:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2] == 0:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i] == 0:
            print('Yes')
            break
    else:
        print('No')

Fixed submission:
import math
n = float(input())
print(math.ceil(float(n / 2)))

Buggy python submission (verdict: Runtime Error):
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input()) for i in range(n)]
for number in b:
    if b in a:
        a[a.index(b)] = 0
if a[0][0] == a[1][1] == a[2][2]:
    print('Yes')
else:
    for i in range(3):
        if a[i][0] == a[i][1] == a[i][2]:
            print('Yes')
            break
        elif a[0][i] == a[1][i] == a[2][i]:
            print('Yes')
            break
    else:
        print('No')

Fixed submission:
import math
n = float(input())
print(math.ceil(float(n / 2)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(input()) for _ in range(n)]
ans = list()
for p in x:
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(ans.min())


Fixed submission:
n = int(input())
x = list(map(int,input().split()))
ans = list()
for p in range(1,101):
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(min(ans))

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(input()) for _ in range(n)]
ans = list()
for p in x:
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  	ans.append(v_sum)
print(min(ans))


Fixed submission:
n = int(input())
x = list(map(int,input().split()))
ans = list()
for p in range(1,101):
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(min(ans))

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(input()) for _ in range(n)]
ans = list()
for p in x:
  v_sum = 0
  for i in x:
    v_sum += (p - x)**2
  	ans.append(v_sum)
print(min(ans))


Fixed submission:
n = int(input())
x = list(map(int,input().split()))
ans = list()
for p in range(1,101):
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(min(ans))

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = [int(input()) for _ in range(n)]
ans = list()
for p in x:
  v_sum = 0
  for i in x:
    v_sum += (p - x)**2
  	ans.append(v_sum)
print(ans.min())

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
ans = list()
for p in range(1,101):
  v_sum = 0
  for i in x:
    v_sum += (p - i)**2
  ans.append(v_sum)
print(min(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
for _ in range(n):
  a = int(input())
  if a % 2 == 0:
    if a % 5 != 0 or a % 3 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')
      

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
for a in A:
  if a % 2 == 0:
    if a % 5 != 0 and a % 3 != 0:
      print('DENIED')
      break
else:
  print('APPROVED')
Buggy python submission (verdict: Runtime Error):
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))

Buggy python submission (verdict: Runtime Error):
s,t = map(int,input().split())
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1

Fixed submission:
s,t = input().split()
a,b = map(int,input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print('{0} {1}'.format(a,b))
Buggy python submission (verdict: Runtime Error):
S = input()
T = ''
for _ in len(S):
  T += 'x'
print(T)


Fixed submission:
s = input()
print('x' * len(s))

Buggy python submission (verdict: Runtime Error):
S = input()
for _ in len(S):
  print('x')

Fixed submission:
s = input()
print('x' * len(s))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int,input().split()))
for a in A:
  if A.count(a) != 1:
    print('NO')
    break
else:
  print('YES')


Fixed submission:
n = int(input())
A = list(map(int,input().split()))
A.sort()
for i in range(n-1):
    if A[i] == A[i+1]:
        print('NO')
        break
else:
    print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(n):
    if P[i] == min(P[0:i+1]):
        ans += 1
print(ans)

Fixed submission:
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(n):
    m == min(P[0:i+1])
    if P[i] == m:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(n):
    P1 = P[0:i+1]
    m = min(P1)
    if P[i] == m:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(n):
    P2 = P[0:i+1]
    m = min(P2)
    if P[i] <= m:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
P = list(map(int,input().split()))
ans = 0
for i in range(n):
    for j in range(0,i+1):
        if P[i] > P[j]:
            break
    else:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
P = [int(input()) for _ in range(n)]
c = 0 
for i in range(n):
  for j in range(0,i):
    if P[i] ＞ P[j]:
      break
  else:
    c += 1
print(c)

Fixed submission:
n = int(input())
P = list(map(int,input().split()))
ans = 0
mi = P[0]
for i in range(n):
    if P[i] <= mi:
        mi = P[i]
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1,N/2+1):
  if i != N-i:
    ans += 1
print(ans)

Fixed submission:
N = int(input())
ans = 0
for i in range(1,N//2+1):
  if i != N-i:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
S=input()
cnt=0
for c in S:
   cnt+=c=='o'
if cnt＞=8:
   print('YES')
else:
  print('NO')

Fixed submission:
S=input()
cnt=0
for c in S:
   cnt+=c=='o'
if cnt+15-len(S)>=8:
   print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
ans = 0
if N == K:
  print(1)
  exit()
for _ in range(N-K):
  ans++
print(ans)

Fixed submission:
N,K=map(int,input().split())
print(N-K+1)
Buggy python submission (verdict: Runtime Error):
X,Y = map(int.input().split())
if X%Y == 0:
  print(-1)
else:
  print(X*Y-1)

Fixed submission:
X,Y = map(int,input().split())
if X%Y == 0:
  print(-1)
else:
  print(X*(Y-1))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i in range(0,a+1):
    for j in range(0,b+1):
        for k in range(0,c+1):
            if 500 * i + 100 * j + 50 * k == x:
                count += 1
print(count)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [map(int,input().split()) for i in range(n)]
t,x,y = (0,0,0)
for next_pos in s:
    t_next,x_next,y_next = next_pos
    dist = abs(x_next - x) + abs(y_next - y)
    dt = t_next - t
    if dist > t_next - t:
        print('No')
        break
    elif dt % 2 == dist % 2:
        t,x,y = t_next,x_next,y_next
    else:
        print('No')
        break
else:
    print('Yes')

Fixed submission:
a,b = map(int,input().split())
if (a*b) % 2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
def somesum(n):
    sum = 0
    x = n
    while int(x / 10) > 0:
        sum += x % 10
        x = int(x / 10)
    sum += x % 10
    return sum
    
n,a,b = map(int,input().split())
sum = 0
for val in range(1,n+1):
    if somesum(val) >= a and somesum(val) <= b:
        sum += val
print(sum)

Fixed submission:
a,b,c,d = map(int,input().split())
L = a+b
R = c+d
if L > R:
  print('Left')
elif L < R:
  print('Right')
else:
  print('Balanced')
Buggy python submission (verdict: Runtime Error):
m = int(input())
number_list = list(map(int,input().split()))
n = 0
while 1:
    f = False
    for i in range(0,m):
        if number_list[i] % 2 != 0:
            f = True
    if f == True:
        break
    for i in range(0,m):
        number_list[i] = number_list[i] / 2
    n += 1
print(n)

Fixed submission:
s = input()
n = 0
for a in s:
    if a == '1':
        n += 1
print(n)

Buggy python submission (verdict: Runtime Error):
m = int(input())
number_list = list(map(int,input().split()))
n = 0
while 1:
    f = False
    for i in range(0,m):
        if number_list[i] % 2 != 0:
            f = True
    if f == True:
        break
    for i in range(0,m):
        number_list[i] = number_list[i] / 2
    n += 1
print(n)

Fixed submission:
s = input()
n = 0
for a in s:
    if a == '1':
        n += 1
print(n)
Buggy python submission (verdict: Runtime Error):
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    e = ""
    for j in range(l):
        if ((i >> j) & 1):
            e += s[j] + "+"
        else:
            e += s[j] + "-"
    if eval(e) == 7:
        print('{}=7'.format(e))
        break

Fixed submission:
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    e = ""
    for j in range(l):
        if ((i >> j) & 1):
            e += s[j] + "+"
        else:
            e += s[j] + "-"
    if eval(e[:-1]) == 7:
        print(e[:-1]+'=7')
        break

Buggy python submission (verdict: Runtime Error):
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    e = ""
    for j in range(l):
        if ((i >> j) & 1):
            e += s[j] + "+"
        else:
            e += s[j] + "-"
    if eval(e) == 7:
        print(e)
        break

Fixed submission:
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    e = ""
    for j in range(l):
        if ((i >> j) & 1):
            e += s[j] + "+"
        else:
            e += s[j] + "-"
    if eval(e[:-1]) == 7:
        print(e[:-1]+'=7')
        break
Buggy python submission (verdict: Runtime Error):
S = input()
T = 'CODEFESTIVAL2016'
ans = 0
for _ in range(16):
  ans += S[i] != T[i]
print(ans)
  

Fixed submission:
S = input()
T = 'CODEFESTIVAL2016'
ans = 0
for i in range(16):
  ans += S[i] != T[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    eval = ''
    for j in range(l):
        if ((i >> j) & 1):
            eval += s[j] + '+'
        else:
            eval += s[j]
    ans += eval(eval)

Fixed submission:
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    e = ""
    for j in range(l):
        if ((i >> j) & 1):
            e += s[j] + "+"
        else:
            e += s[j]
    ans += eval(e)
print(ans)

Buggy python submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range(s):
  ans += int(s[0:i]) + int(s[i:len(s)])
ans += int(s)
print(ans)

Fixed submission:
s = input()
l = len(s)
ans = 0
for i in range(2**(l-1)):
    e = ""
    for j in range(l):
        if ((i >> j) & 1):
            e += s[j] + "+"
        else:
            e += s[j]
    ans += eval(e)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math as m

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


D=[0]*(10**6+1)
for i in range(2,int(m.sqrt(10**6))+2):
    if D[i]!=0:
        continue
    j=2*i
    while j < 10**6+1:
        D[j]=i
        j+=i

P=[0]*10**6
pc=True
g=As[0]
for n in range(N):
    A=As[n]
    g=m.gcd(g,A)
    if A==1:
        continue
    ppre=1
    while True:
        p=D[A] if D[A]!=0 else A
        if ppre != p:
            if P[p] > 0:
                pc=False
            P[p]+=1
            ppre=p
        A=A//p
        if A==1:
            break

if pc:
    print('pairwise coprime')
elif g==1:
    print('setwise coprime')
else:
    print('not coprime')


Fixed submission:
import math as m

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


D=[0]*(10**6+1)
for i in range(2,int(m.sqrt(10**6))+2):
    if D[i]!=0:
        continue
    j=2*i
    while j < 10**6+1:
        D[j]=i
        j+=i

P=[0]*10**6
pc=True
g=As[0]
for n in range(N):
    A=As[n]
    g=m.gcd(g,A)
    if A==1:
        continue
    ppre=1
    while True:
        p=D[A] if D[A]!=0 else A
        if ppre != p:
            if P[p] > 0:
                pc=False
            P[p]+=1
            ppre=p
        A=A//p
        if A==1:
            break

if pc:
    print('pairwise coprime')
elif g==1:
    print('setwise coprime')
else:
    print('not coprime')

Buggy python submission (verdict: Runtime Error):
import math as m

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


D=[0]*(10**6+1)
D[1]=1
for i in range(2,int(m.sqrt(10**6))+2):
    if D[i]!=0:
        continue
    j=i
    while j < 10**6+1:
        D[j]=i
        j+=i

P=[0]*10**6
pc=True
g=As[0]
for n in range(N):
    A=As[n]
    ppre=1
    while True:
        p=D[A]
        if ppre != p:
            if P[p] > 0:
                pc=False
            P[p]+=1
            ppre=p
        A=A//p
        if A==1:
            break
    g=m.gcd(g,A)

if pc:
    print('pairwise coprime')
elif g==1:
    print('setwise coprime')
else:
    print('not coprime')


Fixed submission:
import math as m

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


D=[0]*(10**6+1)
for i in range(2,int(m.sqrt(10**6))+2):
    if D[i]!=0:
        continue
    j=2*i
    while j < 10**6+1:
        D[j]=i
        j+=i

P=[0]*10**6
pc=True
g=As[0]
for n in range(N):
    A=As[n]
    g=m.gcd(g,A)
    if A==1:
        continue
    ppre=1
    while True:
        p=D[A] if D[A]!=0 else A
        if ppre != p:
            if P[p] > 0:
                pc=False
            P[p]+=1
            ppre=p
        A=A//p
        if A==1:
            break

if pc:
    print('pairwise coprime')
elif g==1:
    print('setwise coprime')
else:
    print('not coprime')
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

H,W,M=map(int,input().split())
l=[]
nh=[0]*H
nw=[0]*W
for _ in range(M):
    h,w=map(int,input().split())
    h-=1
    w-=1
    l.append((h,w))
    nh[h]+=1
    nw[w]+=1
hmax=max(nh)
wmax=max(nw)
is_h=[i for i in range(H) if nh[i]==hmax]
is_w=[i for i in range(W) if nw[i]==wmax]

for i_h,i_w in itertools.product(is_h,is_w):
    if not ((i_h,i_w) in l):
        print(hmax+wmax)
        break
else:
    print(hmax+wmax-1)

Fixed submission:
import itertools

H,W,M=map(int,input().split())
d={}
nh=[0]*H
nw=[0]*W
for _ in range(M):
    h,w=map(int,input().split())
    h-=1
    w-=1
    d[(h,w)]=1
    nh[h]+=1
    nw[w]+=1
hmax=max(nh)
wmax=max(nw)
is_h=[i for i in range(H) if nh[i]==hmax]
is_w=[i for i in range(W) if nw[i]==wmax]

for i_h,i_w in itertools.product(is_h,is_w):
    if (i_h,i_w) not in d:
        print(hmax+wmax)
        break
else:
    print(hmax+wmax-1)

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

H,W,M=map(int,input().split())
l=[]
nh=[0]*H
nw=[0]*W
for _ in range(M):
    h,w=map(int,input().split())
    h-=1
    w-=1
    l.append((h,w))
    nh[h]+=1
    nw[w]+=1
hmax=max(nh)
wmax=max(nw)
is_h=[i for i in range(H) if nh[i]==hmax]
is_w=[i for i in range(W) if nw[i]==wmax]

for i_h,i_w in itertools.product(is_h,is_w):
    if not ((i_h,i_w) in l):
        print(hmax+wmax)
        break
else:
    print(hmax+wmax-1)

Fixed submission:
import itertools

H,W,M=map(int,input().split())
d={}
nh=[0]*H
nw=[0]*W
for _ in range(M):
    h,w=map(int,input().split())
    h-=1
    w-=1
    d[(h,w)]=1
    nh[h]+=1
    nw[w]+=1
hmax=max(nh)
wmax=max(nw)
is_h=[i for i in range(H) if nh[i]==hmax]
is_w=[i for i in range(W) if nw[i]==wmax]

for i_h,i_w in itertools.product(is_h,is_w):
    if (i_h,i_w) not in d:
        print(hmax+wmax)
        break
else:
    print(hmax+wmax-1)
Buggy python submission (verdict: Runtime Error):
import math as m

def isltK(K,X):
    ccut=0
    for Ai in As:
        ccut += m.ceil(Ai/X)-1
    if ccut <=K:
        return True
    else:
        return False


N,K=map(int,input().split())
As=list(map(int,input().split()))

l=0
h=max(As)
while l < h:
    mid = (l+h)//2
    if isltK(K,mid):
        h=mid
    else:
        l=mid+1
print(l)

Fixed submission:
import math as m

def isltK(K,X):
    ccut=0
    for Ai in As:
        ccut += m.ceil(Ai/X)-1
    if ccut <=K:
        return True
    else:
        return False


N,K=map(int,input().split())
As=list(map(int,input().split()))

l=1
h=max(As)
while l < h:
    mid = (l+h)//2
    if isltK(K,mid):
        h=mid
    else:
        l=mid+1
print(l)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

sys.setrecursionlimit(10 ** 9)
N,M,K=map(int,input().split())
As=list(map(int,input().split()))
Bs=list(map(int,input().split()))

def f(nb,s,ia,ib):
    #print(nb,s,ia,ib)
    if s > K:
        return nb-1
    if ia==N and ib==M:
        return nb
    
    nb_max=0
    for nxt in ['a','b']:
        if nxt == 'a':
            if ia==N:
                continue
            nb_max=f(nb+1,s+As[ia],ia+1,ib)
        if nxt == 'b':
            if ib==M:
                continue
            nb_tmp=f(nb+1,s+Bs[ib],ia,ib+1)
            if nb_max < nb_tmp:
                nb_max = nb_tmp
    return nb_max



ans = f(0,0,0,0)
print(ans)



Fixed submission:
N,M,K=map(int,input().split())
As=list(map(int,input().split()))
Bs=list(map(int,input().split()))

a_sum=[0]
for i in range(N):
    a_sum.append(a_sum[-1]+As[i])

b_sum=[0]
for i in range(M):
    b_sum.append(b_sum[-1]+Bs[i])

j=M
ans=0
for i in range(N+1):
    if a_sum[i] > K:
        break

    while b_sum[j] > K - a_sum[i]:
        j-=1
    ans = max(ans, i+j)
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import deque as q
import bisect

N,M,K=map(int,input().split())
As=list(map(int,input().split()))
Bs=list(map(int,input().split()))

def f(nb,s,ia,ib):
    #print(nb,s,ia,ib)
    if s > K:
        return nb-1
    if ia==N and ib==M:
        return nb
    
    nb_max=0
    for nxt in ['a','b']:
        if nxt == 'a':
            if ia==N:
                continue
            nb_max=f(nb+1,s+As[ia],ia+1,ib)
        if nxt == 'b':
            if ib==M:
                continue
            nb_tmp=f(nb+1,s+Bs[ib],ia,ib+1)
            if nb_max < nb_tmp:
                nb_max = nb_tmp
    return nb_max



ans = f(0,0,0,0)
print(ans)

Fixed submission:
N,M,K=map(int,input().split())
As=list(map(int,input().split()))
Bs=list(map(int,input().split()))

a_sum=[0]
for i in range(N):
    a_sum.append(a_sum[-1]+As[i])

b_sum=[0]
for i in range(M):
    b_sum.append(b_sum[-1]+Bs[i])

j=M
ans=0
for i in range(N+1):
    if a_sum[i] > K:
        break

    while b_sum[j] > K - a_sum[i]:
        j-=1
    ans = max(ans, i+j)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=0
for i in range(1,N+1):
    for j in range(i,N+1,i):
        ans += j
print(ans)

Fixed submission:
N=int(input())
ans=0
for i in range(1,N+1):
    for j in range(i,N+1,i):
        ans += j
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
As = list(map(int,input().split()))

MAX=10**18
ans = 1
fover=False
for A in As:
    ans *= A
    if ans > MAX:
        fover=True

if ans == 0 or fover==False:
    print(ans)
else:
    print(-1)

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

MAX=10**18
ans = 1
fover=False
fzero=False
for A in As:
    if A==0:
        fzero=True
        break
    if not fover:
        ans *= A
        if ans > MAX:
            fover=True

if fzero:
    print(0)
elif fover:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,S=map(int,input().split())
As=list(map(int,input().split()))

MOD=998244353

#d = [[0]*3001 for _ in range(3001)]
d=np.zeros((3001,3001))
d[0][0]=1

for i in range(1,N+1):
    Ai=As[i-1]
    for j in range(S+1):
        d[i][j] += 2*d[i-1][j]
        if Ai <= j:
            d[i][j] += d[i-1][j-Ai]
        d[i][j] %= MOD
print(int(d[N][S]))


Fixed submission:
import numpy as np
N,S=map(int,input().split())
As=list(map(int,input().split()))

MOD=998244353

#d = [[0]*3001 for _ in range(3001)]
d=np.zeros((3001,3001))
d[0,0]=1

for i in range(1,N+1):
    Ai=As[i-1]
    d[i] += 2*d[i-1]
    d[i,Ai:] += d[i-1][:-Ai]
    d[i] %= MOD
print(int(d[N][S]))

Buggy python submission (verdict: Time Limit Exceeded):
N,S=map(int,input().split())
As=list(map(int,input().split()))

MOD=998244353

d = [[0]*3001 for _ in range(3001)]
d[0][0]=1

for i in range(1,N+1):
    Ai=As[i-1]
    for j in range(S+1):
        d[i][j] += 2*d[i-1][j]
        if Ai <= j:
            d[i][j] += d[i-1][j-Ai]
        d[i][j] %= MOD
print(d[N][S])

Fixed submission:
import numpy as np
N,S=map(int,input().split())
As=list(map(int,input().split()))

MOD=998244353

#d = [[0]*3001 for _ in range(3001)]
d=np.zeros((3001,3001))
d[0,0]=1

for i in range(1,N+1):
    Ai=As[i-1]
    d[i] += 2*d[i-1]
    d[i,Ai:] += d[i-1][:-Ai]
    d[i] %= MOD
print(int(d[N][S]))