Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N=input()
A = list(map(int, input().split()))
T=True
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        break
        
  if T==True:
    sucl.append(i)
print(len(sucl))
    

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


for i in range(1,6):
  if list1[i-1] != i:
    print(i)

Buggy python submission (verdict: Runtime Error):
X, N = map(int,input().split())
plist = list(map(int, input().split()))
if len(plist)==0:
  print(X)
  break
abst1 = []
abst2 = []
suci = []
for i in range(1,101):
  if i in plist:
    pass
  else:
    abst1.append(abs(X-i))
    abst2.append([i,abs(X-i)])
A = min(abst1)
for j in range(0,len(abst1)):
  if abst2[j][1] == A:
    print(abst2[j][0])
    break
  


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


for i in range(1,6):
  if list1[i-1] != i:
    print(i)

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


for i in range(1,5):
  if list1[i-1] != i:
    return(i)


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


for i in range(1,6):
  if list1[i-1] != i:
    print(i)

Buggy python submission (verdict: Runtime Error):
list = []
list.append(input())



for i in range(1,5):
  if list[i-1] != i:
    return(i)

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


for i in range(1,6):
  if list1[i-1] != i:
    print(i)
Buggy python submission (verdict: Runtime Error):
X = input()
Y = input()
T = false
for i in range(1,X+1):
  p = X-i
  J= 2*i + 4*p
  if J =Y:
    T = true
if T == true:
  print("Yes")
  else print("No")

Fixed submission:
X,Y = map(int,input().split())
T = False
for i in range(0,X+1):
  p = X-i
  J= 2*i + 4*p
  if J ==Y:
    T = True
if T == True:
  print("Yes")
else: print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N =input()
A = list(map(int, input().split()))
MA =max(A)
N=int(N)
s=0
A2 = [-1] 
B =[-1]#重複
LS =[-1]
for i in range(0,N):
  k=1
  P =A[i]
  if P in A2:
    B.append(P)
    pass
  else:
    while P*k<=MA:
      LS.append(P*k)
      k+=1
    A2.append(P)
for j in range(0,N):
  if A[j] in B:
    pass
  else:
    if LS.count(A[j]) ==1:
      s=s+1

print(s)
    


Fixed submission:
N = input()
A = list(map(int, input().split()))
N = int(N)
MA = max(A)
s=0
LS = [0 for i in range(0,MA)]
for i in range(0,N):
  k=1
  while A[i]*k<=MA:
    LS[A[i]*k-1] +=1
    k +=1
for j in range(0,N):
  if LS[A[j]-1]==1:
    s+=1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N=input()
A = list(map(int, input().split()))
T=True
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    if T== False:
      break
    if A[i]>=A[j]:
      if A[i] % A[j]==0:
        if i==j:
          pass
        else:
          T=False
  if T==True:
    sucl.append(i)
print(len(sucl))


Fixed submission:
N = input()
A = list(map(int, input().split()))
N = int(N)
MA = max(A)
s=0
LS = [0 for i in range(0,MA)]
for i in range(0,N):
  k=1
  while A[i]*k<=MA:
    LS[A[i]*k-1] +=1
    k +=1
for j in range(0,N):
  if LS[A[j]-1]==1:
    s+=1
print(s)

Buggy python submission (verdict: Runtime Error):
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    if T== False:
      break
    if A[i]<A[j]:
      break
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        
  if T==True:
    sucl.append(i)
print(len(sucl))
    

Fixed submission:
N = input()
A = list(map(int, input().split()))
N = int(N)
MA = max(A)
s=0
LS = [0 for i in range(0,MA)]
for i in range(0,N):
  k=1
  while A[i]*k<=MA:
    LS[A[i]*k-1] +=1
    k +=1
for j in range(0,N):
  if LS[A[j]-1]==1:
    s+=1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N=input()
A = list(map(int, input().split()))
T=True
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    if T== False:
      break
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        
  if T==True:
    sucl.append(i)
print(len(sucl))
    

Fixed submission:
N = input()
A = list(map(int, input().split()))
N = int(N)
MA = max(A)
s=0
LS = [0 for i in range(0,MA)]
for i in range(0,N):
  k=1
  while A[i]*k<=MA:
    LS[A[i]*k-1] +=1
    k +=1
for j in range(0,N):
  if LS[A[j]-1]==1:
    s+=1
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N=input()
A = list(map(int, input().split()))
T=True
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        
  if T==True:
    sucl.append(i)
print(len(sucl))
    

Fixed submission:
N = input()
A = list(map(int, input().split()))
N = int(N)
MA = max(A)
s=0
LS = [0 for i in range(0,MA)]
for i in range(0,N):
  k=1
  while A[i]*k<=MA:
    LS[A[i]*k-1] +=1
    k +=1
for j in range(0,N):
  if LS[A[j]-1]==1:
    s+=1
print(s)
Buggy python submission (verdict: Runtime Error):
pyenv shell 3.8.0
dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.1.6.dylib
  Referenced from: /usr/local/bin/tmux
  Reason: image not found
[2]    51266 abort      tmux
% pyenv shell 3.8.0                                                   ~/Documents/sub-programming/atcoder
pyenv: shell integration not enabled. Run `pyenv init' for instructions.
% python 170a.py                                                      ~/Documents/sub-programming/atcoder
0 2 3 4 5
Traceback (most recent call last):
  File "170a.py", line 3, in <module>
    if h[i] == 0:
IndexError: list index out of range
% python 170a.py                                                      ~/Documents/sub-programming/atcoder
0 2 3 4 5
1
% python                                                              ~/Documents/sub-programming/atcoder
Python 3.8.0 (default, Dec  6 2019, 13:22:27) 
[Clang 8.0.0 (tags/RELEASE_800/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> int(2,1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: int() base must be >= 2 and <= 36, or 0
>>> int(2.1)
2
>>> int(2.4)
2
>>> type(2.1)
<class 'float'>
>>> math.ceil(2.1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'math' is not defined
>>> 1.ceil()
  File "<stdin>", line 1
    1.ceil()
      ^
SyntaxError: invalid syntax
>>> 
KeyboardInterrupt
>>> eix
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'eix' is not defined
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> 
% python 170b.py                                                      ~/Documents/sub-programming/atcoder
  File "170b.py", line 5
    print('Yes'):
                ^
SyntaxError: invalid syntax
% python 170b.py                                                      ~/Documents/sub-programming/atcoder
3 8
Yes
%                                                                     ~/Documents/sub-programming/atcoder

Fixed submission:
import math
x, y = map(int, input().split())
a = (4 * x - y) / 2
if a >= 0 and a <= x and a == math.ceil(a):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = input().split()
flag = False
for i in range(n):
    for j in range(i + 1, n):
        if a[i] == a[j]:
            flag = True
            break
    if flag:
        break

if flag:
    print("NO")
else:
    print("YES")


Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
if len(a) != len(set(a)):
    print("NO")
else:
    print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
flag = False
for i in range(n):
    for j in range(i + 1, n):
        if a[i] == a[j]:
            flag = True
            break

if flag:
    print("NO")
else:
    print("YES")

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
if len(a) != len(set(a)):
    print("NO")
else:
    print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
p = [(int(i) + 1) / 2 for i in input().split()]
m = 0
for i in range(n - k + 1):
    a = 0
    for j in range(k):
        a += p[i+j]
    if m < a:
        m = a
print(m)


Fixed submission:
n, k = map(int, input().split())
p = [(int(i) + 1) / 2 for i in input().split()]
a = 0
for j in range(k):
    a += p[j]
m = a
for i in range(1, n - k + 1):
    a += p[i + k-1] - p[i-1]
    if m < a:
        m = a
print(m)
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print((a*b)//math.gcd(a,b))

Fixed submission:
import math

def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
      a, b = b, a % b
    return b


def lcm(a, b):
    return (a * b) // gcd(a, b)

a, b = map(int, input().split())
print(lcm(a, b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
cnt = 0
i = 1

while a:
    # print(a)
    for _ in range(len(a)):
        # print(i, a, cnt, a[0] != i)
        if a[0] != i:
            cnt += 1
            a.pop(0)
        else:
            a.pop(0)
            i += 1
            break
if cnt == n:
    print(-1)
else:
    print(cnt)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
num = 1
for i in range(n):
    if a[i] == num:
        num += 1

if num == 1:
    print(-1)
else:
    print(n-num+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [0 for _ in range(n)]
xy = [[] for _ in range(n)]
for i in range(n):
  a[i] = int(input())
  for j in range(a[i]):
    xy[i].append(list(map(int, input().split())))
#print(xy)

for i in range(2**n-1, -1, -1):
  num = format(i, '03b')
  #print(num)
  flag = False
  for j in range(n):
    #print(num[j])
    if int(num[j]) == 1:
      for k in range(a[j]):
        #print(xy[j][k])
        if int(num[xy[j][k][0]-1]) != xy[j][k][1]:
          flag = True
          break
      if flag:
        break
  if not flag:
    cnt = 0
    for l in range(n):
      if int(num[l]):
        cnt += 1
    break
print(cnt)
          
      
  
  

Fixed submission:
n = int(input())
a = [0 for _ in range(n)]
xy = [[] for _ in range(n)]
for i in range(n):
  a[i] = int(input())
  for j in range(a[i]):
    xy[i].append(list(map(int, input().split())))
#print(xy)

for i in range(2**n-1, -1, -1):
  #print('0%db' % n)
  num = format(i, '0%db' % n)
  #print(num)
  flag = False
  for j in range(n):
    #print(num[j])
    if int(num[j]) == 1:
      for k in range(a[j]):
        #print(xy[j][k])
        if int(num[xy[j][k][0]-1]) != xy[j][k][1]:
          flag = True
          break
      if flag:
        break
  if not flag:
    cnt = 0
    for l in range(n):
      if int(num[l]):
        cnt += 1
    break
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())


def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1


list = [1]
if a % 2 == 0 and b % 2 == 0:
    list.append(2)

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


for i in list:
    if is_prime(i):
        cnt += 1
print(cnt + 1)



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


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


if a > b:
    num = gcd(a, b)
else:
    num = gcd(b, a)


def prime(n):
    i = 2
    table = set([])
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.add(i)
        i += 1
    if n > 1:
        table.add(n)
    return len(table)


print(prime(num)+1)
Buggy python submission (verdict: Runtime Error):
import numpy as np

s = input().split()
N = int(s[0])
M = int(s[1])
A = np.array(list(map(int, input().split())))
for i in range(M):
    A[A.argmax()] //= 2
print(np.sum(A))


Fixed submission:
wea = input()
if wea == "Sunny":
    print("Cloudy")
elif wea == "Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Time Limit Exceeded):
s = input().split()
N = int(s[0])
K = int(s[1])
Q = int(s[2])

point = [K for i in range(N)]


for i in range(Q):
    k = int(input())
    for j in range(N):
        if j == k-1:
            continue
        else:
            point[j] -= 1

for i in range(N):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
s = input().split()
N = int(s[0])
K = int(s[1])
Q = int(s[2])

point = [K-Q for i in range(N)]


for i in range(Q):
    k = int(input())
    point[k-1] += 1

for i in range(N):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
s = input().split()
N = int(s[0])
K = int(s[1])
Q = int(s[2])

point = [K for i in range(N)]

A = [0 for i in range(Q)]

for i in range(Q):
    A[i] = int(input())
    for j in range(N):
        if j == A[i]-1:
            continue
        else:
            point[j] -= 1

for i in range(N):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
s = input().split()
N = int(s[0])
K = int(s[1])
Q = int(s[2])

point = [K-Q for i in range(N)]


for i in range(Q):
    k = int(input())
    point[k-1] += 1

for i in range(N):
    if point[i] > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

sum = 0
for i in range(N):
    sum += i
print(sum)


Fixed submission:
N = int(input())

if(N%2==1):
    print(N*(N-1)//2)
else:
    print(N*(N//2-1)+N//2)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

n, m = map(int, input().split())
baitos = []
for _ in range(n):
    baitos.append(list(map(int, input().split())))

baitos = sorted(baitos)
# print(sorted(baitos))
# print(baitos)

money = 0
avail = []
heapq.heapify(avail)
for day in range(m):
    while baitos:
        if baitos[0][0] > day + 1:
            break
        else:
            heapq.heappush(avail, -baitos[0][1])
            baitos.remove(baitos[0])
    # for baito in baitos:
    #     print(baito)
    #     if baito[0] > day + 1:
    #         print("break")
    #         break
    #     else:
    #         heapq.heappush(avail, -baito[1])
    #         baitos.remove(baito)
    # print("baitos", baitos)
    # print("avail", avail)
    if avail:

        money += -heapq.heappop(avail)
        # print(day, money)
    # money += max[1]
    # baitos.remove(max)

print(money)


Fixed submission:
import heapq

n, m = map(int, input().split())
baitos = [list(map(int, input().split())) for _ in range(n)]

baitos = sorted(baitos)
# print(sorted(baitos))
# print(baitos)

money = 0
avail = []
# heapq.heapify(avail)
index = 0
for day in range(m):
    while index < n and baitos[index][0] <= day + 1:
        heapq.heappush(avail, -baitos[index][1])
        index += 1
        # baitos.remove(baitos[0])
    # for baito in baitos:
    #     print(baito)
    #     if baito[0] > day + 1:
    #         print("break")
    #         break
    #     else:
    #         heapq.heappush(avail, -baito[1])
    #         baitos.remove(baito)
    # print("baitos", baitos)
    # print("avail", avail)
    if avail:

        money += -heapq.heappop(avail)
        # print(day, money)
    # money += max[1]
    # baitos.remove(max)

print(money)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
baitos = []
for _ in range(n):
    baitos.append(list(map(int, input().split())))

baitos = sorted(baitos)
# print(sorted(baitos))
# print(baitos)

money = 0
for i in range(m):
    max = [0, 0]
    for baito in baitos:
        if baito[0] > i + 1:
            break
        elif max[1] < baito[1]:
            max = baito
    if max != [0, 0]:
        # print(max[1])
        money += max[1]
        baitos.remove(max)

print(money)


Fixed submission:
import heapq

n, m = map(int, input().split())
baitos = [list(map(int, input().split())) for _ in range(n)]

baitos = sorted(baitos)
# print(sorted(baitos))
# print(baitos)

money = 0
avail = []
# heapq.heapify(avail)
index = 0
for day in range(m):
    while index < n and baitos[index][0] <= day + 1:
        heapq.heappush(avail, -baitos[index][1])
        index += 1
        # baitos.remove(baitos[0])
    # for baito in baitos:
    #     print(baito)
    #     if baito[0] > day + 1:
    #         print("break")
    #         break
    #     else:
    #         heapq.heappush(avail, -baito[1])
    #         baitos.remove(baito)
    # print("baitos", baitos)
    # print("avail", avail)
    if avail:

        money += -heapq.heappop(avail)
        # print(day, money)
    # money += max[1]
    # baitos.remove(max)

print(money)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
n = len(s)

square = [0 for _ in range(n)]
for i in range(n):
    if s[i] == "L":
        add_num = -1
    else:
        add_num = 1
    j = i + add_num
    char = s[i]
    while j > -1 and j < n and char == s[j]:
        j += add_num
    if (i - j) % 2 == 0:
        square[j] += 1
    else:
        square[j - add_num] += 1

print(square[0], end="")
for i in range(1, n):
    print(" ", end="")
    print(square[i], end="")


Fixed submission:
s = input()
n = len(s)

square = [0 for _ in range(n)]
i = 0
while i < n:
    start = i
    char = s[i]
    i += 1
    while i < n and char == s[i]:
        i += 1

    if char == "L":
        num = i - start
        if num % 2 == 0:
            square[start - 1] += num // 2
            square[start] += num // 2
        else:
            square[start] += num // 2 + 1
            square[start - 1] += num // 2
    else:  # R
        num = i - start
        if num % 2 == 0:
            square[i] += num // 2
            square[i - 1] += num // 2
        else:
            square[i] += num // 2
            square[i - 1] += num // 2 + 1
    # if i == n - 1:
    #     i += 1


print(square[0], end="")
for i in range(1, n):
    print(" ", end="")
    print(square[i], end="")
Buggy python submission (verdict: Time Limit Exceeded):
list = input().split()
l = int(list[0])
r = int(list[1])
# print(l, r)
 
min = (l*(l+1))%2019
for i in range(l,r):
  for j in range(i+1,r+1):
    k = (i*j)%2019
    # print(i,j,k)
    if k < min:
      min = k
print(min)

Fixed submission:
list = input().split()
l = int(list[0])
r = int(list[1])
# print(l, r)
ans=2018
if r-l > 2019:
	min = 2019
else:
  min = r-l
for i in range(l,l+min):
  for j in range(l+1,l+min+1):
    if (i*j)%2019 < ans:
      ans = (i*j)%2019
      
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ary = [0 for _ in range(10**5)]
​
for i in range(n):
    if a[i] > 1:
        ary[a[i]-2] += 1
        ary[a[i]-1] += 1
    ary[a[i]] += 1
​
print(max(ary))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ary = [0 for _ in range(10**5)]

for i in range(n):
    if a[i] > 1:
        ary[a[i]-2] += 1
        ary[a[i]-1] += 1
    ary[a[i]] += 1

print(max(ary))

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

k = []

for i in range(N):
    k.append(a[i])
    k.append(a[i]-1)
    k.append(a[i] + 1)

max = 0
for i in range(N):
    cnt = k.count(a[i])
    if cnt > max:
        max = cnt
    
    cnt = k.count(a[i]-1)
    if cnt > max:
        max = cnt

    cnt = k.count(a[i]+1)
    if cnt > max:
        max = cnt

print(max)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ary = [0 for _ in range(10**5)]

for i in range(n):
    if a[i] > 1:
        ary[a[i]-2] += 1
        ary[a[i]-1] += 1
    ary[a[i]] += 1

print(max(ary))
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))

cnt = 0
for i in range(n):
    if p[i] == i + 1:
        if p[i - 1] == i + 1:
            p[i], p[i - 1] = p[i - 1], p[i]
        else:
            p[i], p[i + 1] = p[i + 1], p[i]
        cnt += 1

print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))

cnt = 0
for i in range(n):
    if p[i] == i + 1:
        if i == 0:
            p[i], p[i + 1] = p[i + 1], p[i]
        elif i == n-1:
            p[i], p[i - 1] = p[i - 1], p[i]
        else:
            if p[i - 1] == i + 1:
                p[i], p[i - 1] = p[i - 1], p[i]
            else:
                p[i], p[i + 1] = p[i + 1], p[i]
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
k = a[0]
s = a[1]
num=0
for l in range(k+1):
    for m in range(l,k+1):
        n = s-l-m
        if(n <= k & n >= 0):
            if(l!=m and l!= n and m!=n):
                num+=3
            else if (l==m and m==n):
                num+=1
            else:
                num+=2
                
print(num)


Fixed submission:
inputs= list(map(int,input().split()))
k = inputs[0]
s = inputs[1]
answer = 0
for i in range(k+1):
  x = i
  for l in range(k+1):
    y = l
    z = s-x-y
    if z >= 0 and z <= k :
      answer += 1
print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
num=0
for l in range(a[0]+1):
    for m in range(a[0]+1):
        if(a[1]-l-m <= a[0] and a[1]-l-m >= 0):
            num+=1
print(num)

Fixed submission:
inputs= list(map(int,input().split()))
k = inputs[0]
s = inputs[1]
answer = 0
for i in range(k+1):
  x = i
  for l in range(k+1):
    y = l
    z = s-x-y
    if z >= 0 and z <= k :
      answer += 1
print(answer)

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
num=0
for l in range(a[0]+1):
    for m in range(a[0]+1):
        if(a[1]-l-m <= k):
            num+=1


Fixed submission:
inputs= list(map(int,input().split()))
k = inputs[0]
s = inputs[1]
answer = 0
for i in range(k+1):
  x = i
  for l in range(k+1):
    y = l
    z = s-x-y
    if z >= 0 and z <= k :
      answer += 1
print(answer)

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
num=0
for l in range(a[0]+1):
    for m in range(a[0]+1):
        if(a[1]-l-m <= k):
            num++

Fixed submission:
inputs= list(map(int,input().split()))
k = inputs[0]
s = inputs[1]
answer = 0
for i in range(k+1):
  x = i
  for l in range(k+1):
    y = l
    z = s-x-y
    if z >= 0 and z <= k :
      answer += 1
print(answer)

Buggy python submission (verdict: Runtime Error):
k,s = input().split()
for l in range(k):
    for m in range(k):
        if(s-l-m <= k):
            print(l,m,s-l-m)


Fixed submission:
inputs= list(map(int,input().split()))
k = inputs[0]
s = inputs[1]
answer = 0
for i in range(k+1):
  x = i
  for l in range(k+1):
    y = l
    z = s-x-y
    if z >= 0 and z <= k :
      answer += 1
print(answer)
Buggy python submission (verdict: Runtime Error):
_,*p=map(int,open(0).read().split())
i=0
p.sort()
while(len(p)!=0):
  t=p[0]
  p=[m if m!=t else 0 for m in p[1:] if m%t!=0 or m==t ]
  if 0 in p:p=[i for i in p if i!=0]
  else:i+=1
print(i)

Fixed submission:
[ print(i+1) for i,x in enumerate(map(int, input().split())) if x == 0]