Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    for j in range(k-i):
      b -= 1
      if b < 1:
        break
    break
  else:
    break
print("{} {}".format(a, b))

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

if k != 0:
    diva = a / k
    if diva >= 1:
        a -= k
    else:
        k -= a
        a = 0
        b -= k
        if b < 0:
            b = 0
print("{} {}".format(a, b))

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    for i in range(k-i)
      b -= 1
      elif b >= 1:
        break
    break
  else
    break
print("{} {}".format(a, b))

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

if k != 0:
    diva = a / k
    if diva >= 1:
        a -= k
    else:
        k -= a
        a = 0
        b -= k
        if b < 0:
            b = 0
print("{} {}".format(a, b))

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1
print("{} {}".format(a, b))

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

if k != 0:
    diva = a / k
    if diva >= 1:
        a -= k
    else:
        k -= a
        a = 0
        b -= k
        if b < 0:
            b = 0
print("{} {}".format(a, b))

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1
print("{} {}".format(a, b))

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

if k != 0:
    diva = a / k
    if diva >= 1:
        a -= k
    else:
        k -= a
        a = 0
        b -= k
        if b < 0:
            b = 0
print("{} {}".format(a, b))
Buggy python submission (verdict: Runtime Error):
x = map(int, input())

def is_sosu(num):
  st = 2
  while st <= num:
    if num % st == 0:
      print(num)
      return
    st += 1
  else:
    st += 1
    if num == st:
      is_sosu(num+1)

is_sosu(x)

Fixed submission:
x = input()

def is_sosu(num):
  st = 2
  while True:
    if num % st == 0:
      break
    st += 1
  if st == num:
    print(num)
    return
  is_sosu(num+1)

is_sosu(int(x))

Buggy python submission (verdict: Runtime Error):
x = map(int, input())

def is_sosu(num):
  st = 2
  if num % st == 0:
    print(num)
  else:
    st += 1
    if num == st:
      is_sosu(num+1)

is_sosu(x)

Fixed submission:
x = input()

def is_sosu(num):
  st = 2
  while True:
    if num % st == 0:
      break
    st += 1
  if st == num:
    print(num)
    return
  is_sosu(num+1)

is_sosu(int(x))

Buggy python submission (verdict: Runtime Error):
x = map(int, input())

def is_sosu(num):
  st = 2
  if num % st == 0:
    print(num)
  st += 1
  if num == st:
    is_sosu(num+1)

is_sosu(x)

Fixed submission:
x = input()

def is_sosu(num):
  st = 2
  while True:
    if num % st == 0:
      break
    st += 1
  if st == num:
    print(num)
    return
  is_sosu(num+1)

is_sosu(int(x))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy

def solution():
    n, m = map(int, input().split())
    a = [int(aa) for aa in input().split()]
    a.sort(reverse=True)
    for i in range(m):
        a[0] = a[0] // 2
        a = numpy.sort(a)[::-1]
    print(sum(a))

solution()


Fixed submission:
import heapq as hp
def solution():
    n, m = map(int, input().split())
    a = [int(aa) * -1 for aa in input().split()]
    hp.heapify(a)
    for i in range(m):
        hp.heappush(a, (hp.heappop(a)*-1 // 2) * -1)
    print(abs(sum(a)))

solution()

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

def solution():
    n, m = map(int, input().split())
    a = [int(aa) for aa in input().split()]
    a.sort(reverse=True)
    for i in range(m):
        a[0] = a[0] // 2
        numpy.np.sort(a)[::-1]
    print(sum(a))

solution()


Fixed submission:
import heapq as hp
def solution():
    n, m = map(int, input().split())
    a = [int(aa) * -1 for aa in input().split()]
    hp.heapify(a)
    for i in range(m):
        hp.heappush(a, (hp.heappop(a)*-1 // 2) * -1)
    print(abs(sum(a)))

solution()

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

def solution():
    n, m = map(int, input().split())
    a = [int(aa) for aa in input().split()]
    a.sort(reverse=True)
    for i in range(m):
        a[0] = a[0] // 2
        numpy.np.sort(a)[::-1]
    print(sum(a))

solution()


Fixed submission:
import heapq as hp
def solution():
    n, m = map(int, input().split())
    a = [int(aa) * -1 for aa in input().split()]
    hp.heapify(a)
    for i in range(m):
        hp.heappush(a, (hp.heappop(a)*-1 // 2) * -1)
    print(abs(sum(a)))

solution()

Buggy python submission (verdict: Time Limit Exceeded):
def solution():
    n, m = map(int, input().split())
    a = [int(aa) for aa in input().split()]
    a.sort(reverse=True)
    for i in range(m):
        a[0] = a[0] // 2
        a.sort(reverse=True)
    print(sum(a))

solution()


Fixed submission:
import heapq as hp
def solution():
    n, m = map(int, input().split())
    a = [int(aa) * -1 for aa in input().split()]
    hp.heapify(a)
    for i in range(m):
        hp.heappush(a, (hp.heappop(a)*-1 // 2) * -1)
    print(abs(sum(a)))

solution()
Buggy python submission (verdict: Runtime Error):
s = input()
T = ['dream', 'dreamer', 'erase', 'eraser']

def solution():
    while True:
        match = False
        for ss in T:
            if s.startswith(ss):
                s = s.lstrip(ss)
                if not s:
                    print('YES')
                    return
                match = True
                break
        if not match:
            print('NO')
            return

solution()

Fixed submission:
def solution():
    s = input()
    T = ['dreamer', 'dream', 'eraser', 'erase']

    while True:
        match = False
        for ss in T:
            if s.endswith(ss) :
                s = s[:-1*len(ss)]
                if not s:
                    print('YES')
                    return
                match = True
                break
        if not match:
            print('NO')
            return

solution()
Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
if(k<=a):
    print(k)
elif(k<=(a+b)):
    print(a)
else:
    x=k-(a+b)
    print(z-x)



Fixed submission:
a,b,c,k=map(int,input().split())
if(k<=a):
    print(k)
elif(k<=(a+b)):
    print(a)
else:
    x=k-(a+b)
    print(a-x)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter as co
n,m=map(int,input().split())
a=[]
for i in range(m):
    l,r=map(int,input().split())
    
    a.extend(list(range(l,r+1)))
d=co(a)
x,y=zip(*d.items())
print(y.count(m))


Fixed submission:
from collections import Counter as co
n,m=map(int,input().split())
a=[]
x=0
y=10**6
for i in range(m):
    l,r=map(int,input().split())
    if(l>x):
        x=l
    if(r<y):
        y=r
if(y>=x):
    print(y-x+1)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
a=[]
for i in range(m):
    l,r=map(int,input().split())
    
    if(i==0):
        x=set(range(l,r+1))
    else:
        y=set(range(l,r+1))
        x=x.intersection(y)
print(len(x))


Fixed submission:
from collections import Counter as co
n,m=map(int,input().split())
a=[]
x=0
y=10**6
for i in range(m):
    l,r=map(int,input().split())
    if(l>x):
        x=l
    if(r<y):
        y=r
if(y>=x):
    print(y-x+1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    scanf("%d",&n);
    vector<int> h(n);
    for(int &x:h)
    {
        scanf("%d",&x);
    }
    vector<int> dp(n);
    dp[0]=0;
    dp[1]=abs(h[1]-h[0]);
    for(int i=2;i<n;i++)
    {
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));

    }

   cout<<dp[n-1];

    return 0;
}


Fixed submission:
n=int(input())
a= list(map(int,input().split()))
from collections import defaultdict as dd
dp=dd(int)

dp[1]=0
dp[2]=abs(a[0]-a[1])

for i in range(3,n+1):
    dp[i]=min(abs(a[i-1]-a[i-2])+dp[i-1],abs(a[i-1]-a[i-3])+dp[i-2])
print(dp[n])
Buggy python submission (verdict: Time Limit Exceeded):
n, x, y = map(int, input().split())
kyori = []

def clc(i1, i2):
    return min(1 + abs(i2 - y) + abs(i1 - x), i2 - i1)

for k in range(1, n+1):
    for l in range(k+1, n+1):
        tmp = clc(k, l)
        kyori.append(tmp)

for i in range(n-1):
    cnt = 0
    for k in kyori:
        if k == i + 1:
            cnt += 1
    print(cnt)

Fixed submission:
n, x, y = map(int, input().split())
kyori = []

def clc(i1, i2):
    if (i1 < x and i2 <= x) or (y <= i1 and y < i2):
        return i2 - i1
    else:
        return min(1 + abs(i2 - y) + abs(i1 - x), i2 - i1)

for k in range(1, n+1):
    for l in range(k+1, n+1):
        tmp = clc(k, l)
        kyori.append(tmp)
outs = [0 for _ in range(n-1)]
for k in kyori:
    outs[k-1] += 1
for i in range(n-1):
    print(outs[i])
Buggy python submission (verdict: Runtime Error):
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

pp = p[:x]
qq = q[:y]
rr = []
for k in r:
    if pp[-1] < qq[-1]:
        if pp[-1] < k:
            pp.pop()
            rr.append(k)
        else:
            break
    else:
        if qq[-1] < k:
            qq.pop()
            rr.append(k)
        else:
            break

print(sum(pp)+sum(qq)+sum(rr))

Fixed submission:
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse=True)
q = sorted(list(map(int, input().split())), reverse=True)
r = sorted(list(map(int, input().split())), reverse=True)

if x <= len(p):
    pp = p[:x]
else:
    pp = p + r[:x-len(p)]

if y <= len(q):
    qq = q[:y]
else:
    qq = q + r[:y-len(q)]
    
rr = []
for k in r:
    if len(pp) >= 1 and len(qq) >= 1:
        if pp[-1] < qq[-1]:
            if pp[-1] < k:
                pp.pop()
                rr.append(k)
            else:
                break
        else:
            if qq[-1] < k:
                qq.pop()
                rr.append(k)
            else:
                break
    elif len(pp) >= 1:
        if pp[-1] < k:
            pp.pop()
            rr.append(k)
        else:
            break
    elif len(qq) >= 1:
        if qq[-1] < k:
            qq.pop()
            rr.append(l)
        else:
            break
    else:
        break

print(sum(pp)+sum(qq)+sum(rr))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
box = list(map(int, input().split()))
c = Counter(box)

for b in box:
    c[b] -= 1
    cnt = 0
    for k in c.keys():
        #print('k, c[k]: ',k ,c[k])
        if c[k] != 1:
            cnt += int(1/2 * c[k] * (c[k] - 1))
    print(cnt)
    c[b] += 1


Fixed submission:
from collections import defaultdict

n = int(input())
box = list(map(int, input().split()))
c = defaultdict(int)
for b in box:
    c[b] += 1
    
anss = sum([int(1/2 * c[k] * (c[k] - 1)) for k in c.keys()])
for b in box:
    fi = anss - int(1/2 * c[b] * (c[b] - 1)) + int(1/2 * (c[b]-1) * (c[b] - 2)) 
    print(fi)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

n = int(input())
box = list(map(int, input().split()))

for i in range(len(box)):
    tmp = box.copy()
    tmp.pop(i)
    c = Counter(tmp)
    keys = c.keys()
    cnt = 0
    for k in keys:
        #print('k, c[k]: ',k ,c[k])
        if c[k] != 1:
            cnt += int(1/2 * c[k] * (c[k] - 1))
    print(cnt)
    
    


Fixed submission:
from collections import defaultdict

n = int(input())
box = list(map(int, input().split()))
c = defaultdict(int)
for b in box:
    c[b] += 1
    
anss = sum([int(1/2 * c[k] * (c[k] - 1)) for k in c.keys()])
for b in box:
    fi = anss - int(1/2 * c[b] * (c[b] - 1)) + int(1/2 * (c[b]-1) * (c[b] - 2)) 
    print(fi)
Buggy python submission (verdict: Runtime Error):
2 3 10

Fixed submission:
a, b, c = map(int, input().split())
aa = (a+b-c)**2
bb = 4*a*b
if a + b <= c:
    if aa > bb:
        print("Yes")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
N, K = [int(_) for _ in input().split()]
S = str(input())

Nums = []
now, cnt = 1, 0
for i in range(N):
    if S[i] == str(now): cnt += 1
    else:
        Nums.append(cnt)
        now = 1 - now
        cnt = 1
if cnt != 0: Nums.append(cnt)
# print(Nums)

if len(Nums) % 2 == 0: Nums.append(0)

add = 2 * K + 1
ans = 0
for i in range(0, len(Nums), 2):
    tmp = 0
    left = i
    right = min(i+add, len(Nums))
    j = left
    while j < right:
        tmp += Nums[j]
        j += 1
    ans = max(tmp, ans)
print(ans)
        



Fixed submission:
# coding: utf-8
# Your code here!
N, K = [int(_) for _ in input().split()]
S = str(input())

Nums = []
now, cnt = 1, 0
for i in range(N):
    if S[i] == str(now): cnt += 1
    else:
        Nums.append(cnt)
        now = 1 - now
        cnt = 1
if cnt != 0: Nums.append(cnt)
if len(Nums) % 2 == 0: Nums.append(0)


# add = 2 * K + 1
# ans = 0
# for i in range(0, len(Nums), 2):
#     tmp = 0
#     left = i
#     right = min(i+add, len(Nums))
#     j = left
#     while j < right:
#         tmp += Nums[j]
#         j += 1
#     ans = max(tmp, ans)
# print(ans)

#------------------------
add = 2 * K + 1
ans = 0
left = 0
right = 0
tmp = 0
for i in range(0, len(Nums), 2):
    nextLeft = i 
    nextRight = min(i + add, len(Nums))
    while nextLeft > left:
        tmp -= Nums[left]
        left += 1
    while nextRight > right:
        tmp += Nums[right]
        right += 1
    #print('left, right:   ', left, right)
    ans = max(tmp, ans)
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
    for j in range(K+1):
        if i + j > S:
            break
        for k in range(K+1):
            if i + j + k == S:
                cnt += 1
print(cnt)


Fixed submission:
K, S = map(int, input().split())
cnt = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - i - j <= K:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
2
1 2
3
1 100
2 100
100 1000

Fixed submission:
a = input()
print('A' if 'A' <= a <= 'Z' else 'a')
Buggy python submission (verdict: Runtime Error):
N = int(input())

def amari(x):
    if x == 1:
        return 'a'
    elif x == 2:
        return 'b'
    elif x == 3:
        return 'c'
    elif x == 4:
        return 'd'
    elif x == 5:
        return 'e'
    elif x == 6:
        return 'f'
    elif x == 7:
        return 'g'
    elif x == 8:
        return 'h'
    elif x == 9:
        return 'i'
    elif x == 10:
        return 'j'
    elif x == 11:
        return 'k'
    elif x == 12:
        return 'l'
    elif x == 13:
        return 'm'
    elif x == 14:
        return 'n'
    elif x == 15:
        return 'o'
    elif x == 16:
        return 'p'
    elif x == 17:
        return 'q'
    elif x == 18:
        return 'r'
    elif x == 19:
        return 's'
    elif x == 20:
        return 't'
    elif x == 21:
        return 'u'
    elif x == 22:
        return 'v'
    elif x == 23:
        return 'w'
    elif x == 24:
        return 'x'
    elif x == 25:
        return 'y'
    elif x == 26:
        return 'z'

i = 1
my_str = []
while True:
    if 26 ** i > N:
        if i == 1:
            print(amari(N))
            exit()
        for j in range(i - 2 + 2):
            t = amari(N // (26 ** (1 + i - 2 - j)))
            my_str.append(t)
            N -= ((26 ** (1 + i - 2 - j) *  (N // (26 ** (1 + i - 2 - j)))))
        strA = "".join(my_str)
        print (strA)
        exit()
    i += 1

Fixed submission:
def amari(x):
    if x == 0:
        return 'a'
    elif x == 1:
        return 'b'
    elif x == 2:
        return 'c'
    elif x == 3:
        return 'd'
    elif x == 4:
        return 'e'
    elif x == 5:
        return 'f'
    elif x == 6:
        return 'g'
    elif x == 7:
        return 'h'
    elif x == 8:
        return 'i'
    elif x == 9:
        return 'j'
    elif x == 10:
        return 'k'
    elif x == 11:
        return 'l'
    elif x == 12:
        return 'm'
    elif x == 13:
        return 'n'
    elif x == 14:
        return 'o'
    elif x == 15:
        return 'p'
    elif x == 16:
        return 'q'
    elif x == 17:
        return 'r'
    elif x == 18:
        return 's'
    elif x == 19:
        return 't'
    elif x == 20:
        return 'u'
    elif x == 21:
        return 'v'
    elif x == 22:
        return 'w'
    elif x == 23:
        return 'x'
    elif x == 24:
        return 'y'
    elif x == 25:
        return 'z'
    
N = int(input())
K = 0
k = 0
i = 0
my_str = []
while True:
    if  k <= N <= K:
        N = N - k #number in the floor
        for j in range(i): # i=length of the coded name
            my_str.append(amari(N % 26))
            N = N // 26
        strA = ''.join(my_str[::-1])
        print(strA)
        exit()
    else:
        i += 1
        k = K + 1
        K += 26 ** i
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A_set = set(A)
Q = int(input())
dis_list = []
count = {}
temp_sum = 0
for a in A_set:
    count[a] = A.count(a)
    temp_sum += a * count[a]
for i in range(Q):
    s = list(map(int, input().split()))
    dis_list.append(s)
for j in dis_list:
    if j[0] in count:
        temp_sum += (j[1] - j[0])* count[j[0]]
        if j[1]in count:
            count[j[1]] += count[j[0]]
        else:
            count[j[1]] = count[j[0]]
        count[j[0]] = 0
    print(temp_sum)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
count = Counter(A) #not dict!!
temp_sum = sum(A)
for _ in range(Q):
    before, after = map(int, input().split())
    temp_sum += (after - before) * count[before]
    count[after] += count[before]
    count[before] = 0
    print(temp_sum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
dis_list = []
for i in range(Q):
    s = list(map(int, input().split()))
    dis_list.append(s)
for j in range(len(dis_list)):
    for k in range(len(A)):
        if A[k] == dis_list[j][0]:
            A[k] = dis_list[j][1]
    print(sum(A))

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
count = Counter(A) #not dict!!
temp_sum = sum(A)
for _ in range(Q):
    before, after = map(int, input().split())
    temp_sum += (after - before) * count[before]
    count[after] += count[before]
    count[before] = 0
    print(temp_sum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
dis_list = []
for i in range(Q):
    s = list(map(int, input().split()))
    dis_list.append(s)
for j in range(len(dis_list)):
    for k in range(len(A)):
        if A[k] == dis_list[j][0]:
            A[k] = dis_list[j][1]
    print(sum(A))

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
count = Counter(A) #not dict!!
temp_sum = sum(A)
for _ in range(Q):
    before, after = map(int, input().split())
    temp_sum += (after - before) * count[before]
    count[after] += count[before]
    count[before] = 0
    print(temp_sum)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
dis_list = []
for i in range(Q):
    s = list(map(int, input().split()))
    dis_list.append(s)
for j in dis_list:

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
count = Counter(A) #not dict!!
temp_sum = sum(A)
for _ in range(Q):
    before, after = map(int, input().split())
    temp_sum += (after - before) * count[before]
    count[after] += count[before]
    count[before] = 0
    print(temp_sum)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
l = list(map(int, input().split()))
x = 

Fixed submission:
N, K = map(int, input().split())
l = list(map(int, input().split()))
x = sorted(l)[::-1]
print(sum(x[:K]))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(M):
    a, b = map(int, input().split())
    my_count[a] += 1
    my_count[b] += 1
my_count = sorted(my_count.items())
for i in range(N):
    print(my_count[i][1])

Fixed submission:
from collections import Counter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(1, N + 1):
    my_count[i] = 0
for i in range(M):
    a, b = map(int, input().split())
    my_count[a] += 1
    my_count[b] += 1
my_count = sorted(my_count.items())
for i in range(N):
    print(my_count[i][1])

Buggy python submission (verdict: Runtime Error):
from collections import Counter
from operator import itemgetter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(M):
    a, b = map(int, input().split())
    my_count[a] += 1
    my_count[b] += 1
my_count = sorted(my_count.items())
for i in N:
    print(i[1])

Fixed submission:
from collections import Counter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(1, N + 1):
    my_count[i] = 0
for i in range(M):
    a, b = map(int, input().split())
    my_count[a] += 1
    my_count[b] += 1
my_count = sorted(my_count.items())
for i in range(N):
    print(my_count[i][1])
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
print(sum(X + Y + Z == S for X in range(K + 1) for Y in range(K + 1) for Z in range(K + 1)))

Fixed submission:
K, S = map(int, input().split())
print(sum(S - K <= X + Y <= S for X in range(K + 1) for Y in range(K + 1)))

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
print(sum(X + Y + Z == S for X in range(K + 1) for Y in range(K + 1) for Z in range(K + 1)))

Fixed submission:
K, S = map(int, input().split())
print(sum(S - K <= X + Y <= S for X in range(K + 1) for Y in range(K + 1)))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A.sort()
total = 1
for i in range(N):
    total *= A[i]
    if 10 ** 18 < total:
        break

if 10**18 < total:
    print("-1")
else:

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
total = 1
if 0 < A.count(0):
    print(0)
else:
    for i in range(N):
        total *= A[i]
        if 10 ** 18 < total:
            break
    if 10**18 < total:
        print("-1")
    else:
        print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
total = 1
for i in range(N):
    total *= A[i]

if 10**18 < total:
    print("-1")
else:
    print(total)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
total = 1
if 0 < A.count(0):
    print(0)
else:
    for i in range(N):
        total *= A[i]
        if 10 ** 18 < total:
            break
    if 10**18 < total:
        print("-1")
    else:
        print(total)
Buggy python submission (verdict: Runtime Error):
import numpy as np 
A,B = map(str,input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
print(int(A*C//100))

Fixed submission:
import numpy as np 
A,B = map(str,input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
print(int(A*B//100))

Buggy python submission (verdict: Runtime Error):
import numpy as np 
A,B = map(float,input().split())
print(numpy.trunc(A*B))

Fixed submission:
import numpy as np 
A,B = map(str,input().split())
A = int(A)
B = int(B[0]+B[2]+B[3])
print(int(A*B//100))