Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):

if __name__ == "__main__":
    n, q = map(int, input().split())
    incidenceGraph = [[] for j in range(0, n)]
    for i in range(0, n - 1):
        a, b = map((lambda x: int(x) - 1), input().split())
        incidenceGraph[a].append(b)
        incidenceGraph[b].append(a)

    operationTuples = [0]*n
    ans = [0]*n
    for i in range(0, q):
        p, x = map(int, input().split())
        operationTuples[p-1] += x

    visited = [False]*n
    stack = [0]
    while stack:
        i = stack.pop(0)
        ans[i] += operationTuples[i]
        visited[i] = True
        for j in incidenceGraph[i]:
            if visited[j] is False:
                ans[j] += ans[i]
                stack.append(j)
    print(*ans)

Fixed submission:
from collections import deque

if __name__ == "__main__":
    n, q = map(int, input().split())
    incidenceGraph = [[] for j in range(0, n)]
    for i in range(0, n - 1):
        a, b = map((lambda x: int(x) - 1), input().split())
        incidenceGraph[a].append(b)
        incidenceGraph[b].append(a)

    operationTuples = [0]*n
    ans = [0]*n
    for i in range(0, q):
        p, x = map(int, input().split())
        operationTuples[p-1] += x

    visited = [False]*n
    stack = deque([0])
    while stack:
        i = stack.popleft()
        ans[i] += operationTuples[i]
        visited[i] = True
        for j in incidenceGraph[i]:
            if visited[j] is False:
                ans[j] += ans[i]
                stack.append(j)
    print(*ans)
Buggy python submission (verdict: Time Limit Exceeded):


if __name__ == "__main__":
    n = int(input())
    lst = []
    count = 0
    for i in range(n):
        lst.append(''.join(sorted(input())))
    for i in range(n):
        for j in range(i + 1, n):
            count += int(lst[i] == lst[j])
    print(count)

Fixed submission:
from collections import defaultdict
from math import factorial
if __name__ == "__main__":
    n = int(input())
    lst = []
    count = 0
    words = defaultdict(lambda: 0)
    for i in range(n):
        words[''.join(sorted(input()))] += 1
    sum = 0
    for word in words:
        sum += int(factorial(words[word]) / (factorial(2) * factorial(abs(words[word] - 2))))
    print(sum)

Buggy python submission (verdict: Time Limit Exceeded):


if __name__ == "__main__":
    n = int(input())
    lst = []
    count = 0
    for i in range(n):
        lst.append(sorted(list(input())))
    for i in range(n):
        for j in range(i + 1, n):
            count += int(len([a for a, b in zip(lst[i], lst[j]) if a == b]) == 10)
    print(count)

Fixed submission:
from collections import defaultdict
from math import factorial
if __name__ == "__main__":
    n = int(input())
    lst = []
    count = 0
    words = defaultdict(lambda: 0)
    for i in range(n):
        words[''.join(sorted(input()))] += 1
    sum = 0
    for word in words:
        sum += int(factorial(words[word]) / (factorial(2) * factorial(abs(words[word] - 2))))
    print(sum)
Buggy python submission (verdict: Runtime Error):
from sys import exit
if __name__ == "__main__":
    n, m = map(int, input().split())
    jobs = []
    for i in range(n):
        job = tuple(map(int, input().split()))
        if job[0] <= m:
            jobs.append(job)
    jobs.sort(key=lambda tup: tup[1], reverse=True)
    income = 0
    daysUsed = -1
    if m == 1:
        print(jobs[1])
        exit()

    for job in jobs:
        daysLeft = (m - daysUsed) - job[0]
        if daysLeft > 0:
            income += job[1]
            daysUsed += 1
        else:
            income += job[1]
            break
    print(income)


Fixed submission:
from sys import exit
from collections import deque
import heapq
if __name__ == "__main__":
    n, m = map(int, input().split())
    jobs = []
    for i in range(n):
        job = tuple(map(int, input().split()))
        if job[0] <= m:
            jobs.append(job)
    jobs.sort(key=lambda tup: tup[0])
    income = 0
    jobs = deque(jobs)
    hp = []
    for day in range(m):
        while len(jobs) != 0 and jobs[0][0] <= day + 1:
            job = jobs[0]
            heapq.heappush(hp, - job[1])
            jobs.popleft()
        if hp != []:
            income -= heapq.heappop(hp)
    
    print(income)

Buggy python submission (verdict: Runtime Error):
from sys import exit
if __name__ == "__main__":
    n, m = map(int, input().split())
    jobs = []
    for i in range(n):
        job = tuple(map(int, input().split()))
        if job[0] <= m:
            jobs.append(job)
    jobs.sort(key=lambda tup: tup[1], reverse=True)
    income = 0
    daysUsed = -1
    if m == 1:
        print(jobs[0][1])
        exit()
        
    for job in jobs:
        daysLeft = (m - daysUsed) - job[0]
        if daysLeft > 0:
            income += job[1]
            daysUsed += 1
        else:
            income += job[1]
            break
    print(income)


Fixed submission:
from sys import exit
from collections import deque
import heapq
if __name__ == "__main__":
    n, m = map(int, input().split())
    jobs = []
    for i in range(n):
        job = tuple(map(int, input().split()))
        if job[0] <= m:
            jobs.append(job)
    jobs.sort(key=lambda tup: tup[0])
    income = 0
    jobs = deque(jobs)
    hp = []
    for day in range(m):
        while len(jobs) != 0 and jobs[0][0] <= day + 1:
            job = jobs[0]
            heapq.heappush(hp, - job[1])
            jobs.popleft()
        if hp != []:
            income -= heapq.heappop(hp)
    
    print(income)
Buggy python submission (verdict: Runtime Error):
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = math.factorial(int(input()))
    prims = (n + 1) * [0]
    p = 2
    while n >= p*p:
        if n % p == 0:
            prims[p] += 1
            n = n // p
        else:
            p += 1
    prims[n] += 1
    print(functools.reduce(lambda x, y: x * (y + 1), prims, 1) % (10**9 + 7))

Fixed submission:
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = int(input())
    m = math.factorial(n)
    res = 1
    for j in range(2, n + 1):
        tmp = 1
        while m % j == 0:
            m = m//j
            tmp += 1
        res *= tmp
    print(res % (10**9 + 7))

Buggy python submission (verdict: Runtime Error):
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = math.factorial(int(input()))
    prims = (n + 1) * [0]
    p = 2
    while n >= p*p:
        if n % p == 0:
            prims[p] += 1
            n = n // p
        else:
            p += 1
    prims[n] += 1
    print(functools.reduce(lambda x, y: x * (y + 1), prims, 1) % 10**9 + 7)

Fixed submission:
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = int(input())
    m = math.factorial(n)
    res = 1
    for j in range(2, n + 1):
        tmp = 1
        while m % j == 0:
            m = m//j
            tmp += 1
        res *= tmp
    print(res % (10**9 + 7))

Buggy python submission (verdict: Runtime Error):
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = math.factorial(int(input()))
    prims = (n + 1) * [0]
    p = 2
    while n >= p*p:
        if n % p == 0:
            prims[p] += 1
            n = n // p
        else:
            p += 1
    prims[n] += 1
    print(functools.reduce(lambda x, y: x * (y + 1), prims, 1))

Fixed submission:
import collections
import itertools
import functools
import math

s = set([])
if __name__ == "__main__":
    n = int(input())
    m = math.factorial(n)
    res = 1
    for j in range(2, n + 1):
        tmp = 1
        while m % j == 0:
            m = m//j
            tmp += 1
        res *= tmp
    print(res % (10**9 + 7))
Buggy python submission (verdict: Runtime Error):
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    if x > b:
        print(0)
    else:
        found = False
        i = a
        counter = 0
        while i < b + 1:
            if not found and i % x != 0:
                i += 1
            else:
                i += x
                counter += 1
    print(counter)
    


Fixed submission:
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    z = (b) // x
    z -= (a - 1) // x
    print(z)

Buggy python submission (verdict: Runtime Error):
from math import ceil
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    if x > b:
        print(0)
    else:
        found = False
        i = a
        counter = 0
        while i < b + 1:
            if not found and i % x != 0:
                i += 1
            else:
                break
    print(ceil((b  + 1 - i)/x))
    


Fixed submission:
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    z = (b) // x
    z -= (a - 1) // x
    print(z)

Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    counter = 0
    for i in range(a, b + 1):
        counter += int(i % x == 0)
    print(counter)

Fixed submission:
if __name__ == "__main__":
    a, b, x = map(int, input().split())
    z = (b) // x
    z -= (a - 1) // x
    print(z)
Buggy python submission (verdict: Runtime Error):
hi = list(map(int, input().split()))
hi.sort(reverse=True)
del hi[:k]

num = 0
if hi == []:
    print(0)
else:
    for i in hi:
        num += i
    print(num)


Fixed submission:
import sys

sys.setrecursionlimit(10**9)

h, k = map(int, input().split())
hi = list(map(int, input().split()))
hi.sort(reverse=True)
del hi[:k]

num = 0
if hi == []:
    print(0)
else:
    for i in hi:
        num += i
    print(num)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split)
num = a + b + c
if (num >= 22):
  print('bust')
else:
  print('win')
  

Fixed submission:
a, b, c = map(int, input().split())
num = a + b + c
if (num >= 22):
  print('bust')
else:
  print('win')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = set()
while n:
    x = int(input())
    if x in m:
        m.remove(x)
    else:
        m.add(x)
print(len(m))


Fixed submission:
n = int(input())
m = set()
while n:
    x = int(input())
    if x in m:
        m.remove(x)
    else:
        m.add(x)
    n -= 1
print(len(m))
Buggy python submission (verdict: Runtime Error):
if h == 1 or w == 1:
    print(1)
elif h % 2 == 0:
    print(int(h*w/2))
elif h % 2 == 1 and w % 2 == 0:
    print(int(h*w/2))
else:
    print(int(h*(w//2)+h//2+1))

Fixed submission:
h,w = map(int,input().split())
 
if h == 1 or w == 1:
    print(1)
elif h % 2 == 0:
    print(int(h*w/2))
elif h % 2 == 1 and w % 2 == 0:
    print(int(h*w/2))
else:
    print(int(h*(w//2)+h//2+1))
Buggy python submission (verdict: Runtime Error):
import itertools
import sys
input = sys.stdin.readline
 
n,t = map(int,input().split())
l_a0 = []
l_a1 = []
 
for i in range(n):
    tmp = list(map(int,input().split()))
    if tmp[0] == 0:
        l_a0.append(tmp[1]+1)
    else:
        l_a1.append(tmp)
 
l_a0.sort()
l_a1.sort(reverse=True, key=lambda x: x[0]/(x[1]+1))

dp = [t*10] * 30 
dp[0] = 0

for a, b in l_a1:
        for num in range(28, -1, -1):
            candidate = (dp[num]+1) * (a+1) + b
            if candidate < dp[num+1]:
                dp[num+1] = candidate
dp = [i for i in dp if i <= t]

ans = [0]
for i in range(len(dp)):
    spendtime = dp[i]
    tmp = i
    for j in range(len(l_a0)):
        if spendtime + l_a0[j] <= t:
            spendtime += l_a0[j]
            tmp += 1
        else:
            break
    ans.append(tmp)
    
print(max(ans))  

Fixed submission:
w = input()
 
if w == 'hi' or w == 'hihi' or w == 'hihihi' or w == 'hihihihi'or w == 'hihihihihi':
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import collections as col

n = int(input())
L_W = []
for i in range(0,n):
    L_W.append(input())
 
dic = col.Counter(L_W)
dic_values_max = max(list(dic.values()))

ans = []
for i in range(len(list(dic.items()))):
    if list(dic.items())[i][1] == dic_values_max:
        ans.append(list(dic.items())[i][0])

ans.sort()
for i in ans:
    print(i)

Fixed submission:
import collections as col

n = int(input())
L_W = []
for i in range(0,n):
    L_W.append(input())
 
dic = col.Counter(L_W)

dic_values_max = max(list(dic.values()))
 
max_key = [i for i, j in dic.items() if j == dic_values_max]
 
max_key.sort()
 
for k in max_key:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
L_W = []

for i in range(0,n):
    L_W.append(input())
L_nat = set(L_W)
L_nat = sorted(L_nat)
max = 0
ans = []
for i in range(0,len(L_nat)):
    tmp = L_W.count(L_nat[i])
    if max < tmp:
        max = tmp
        ans = []
        ans.append(L_nat[i])
    elif max == tmp:
        ans.append(L_nat[i])

for i in range(0,len(ans)):
    print(ans[i])

Fixed submission:
import collections as col

n = int(input())
L_W = []
for i in range(0,n):
    L_W.append(input())
 
dic = col.Counter(L_W)

dic_values_max = max(list(dic.values()))
 
max_key = [i for i, j in dic.items() if j == dic_values_max]
 
max_key.sort()
 
for k in max_key:
    print(k)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
list = list(map(int,input().split()))
 
aaa = 0
i = 0
while i < n-k+1:
    a = sum(list[i:i+k])
    if aaa <= a:
        aaa = a
    i += 1 
 

 
print((aaa+k)/2) 

Fixed submission:
n,k = map(int,input().split())
L = list(map(int,input().split()))
 
aaa = sum(L[0:k])
ans = aaa
for i in range(k,n):
    aaa += L[i]
    aaa -= L[i-k]
    if ans <= aaa:
        ans = aaa
    i += 1    
     
print((ans+k)/2)

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

aaa = 0
list_ans = []
i = 0
while i < n-k+1:
    a = sum(list[i:i+k])
    if aaa <= a:
        aaa = a
        list_ans = list[i:i+k]
    i += 1 

ans = 0
i = 0
while i < len(list_ans):
    ans += (list_ans[i]+1)/2
    i += 1

print(ans)  

Fixed submission:
n,k = map(int,input().split())
L = list(map(int,input().split()))
 
aaa = sum(L[0:k])
ans = aaa
for i in range(k,n):
    aaa += L[i]
    aaa -= L[i-k]
    if ans <= aaa:
        ans = aaa
    i += 1    
     
print((ans+k)/2)

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

aaa = 0
list_ans = []
i = 0
while i < n-k+1:
    a = sum(list[i:i+k])
    if aaa <= a:
        aaa = a
        list_ans = list[i:i+k]
    i += 1 

ans = 0
i = 0
while i < len(list_ans):
    ans += (list_ans[i]+1)/2
    i += 1

print(ans)  

Fixed submission:
n,k = map(int,input().split())
L = list(map(int,input().split()))
 
aaa = sum(L[0:k])
ans = aaa
for i in range(k,n):
    aaa += L[i]
    aaa -= L[i-k]
    if ans <= aaa:
        ans = aaa
    i += 1    
     
print((ans+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
list = list(map(int,input().split()))
list.extend([0]*(k-1))

ans = 0
i = 0 
while i < n:
    list_internal = list[i:k+i]
    e = 0
    j = 0
    while j < len(list_internal):
        e += (list_internal[j]+1)/2
        if ans <= e:
            ans = e
        j += 1
    i += 1
print(ans)  

Fixed submission:
n,k = map(int,input().split())
L = list(map(int,input().split()))
 
aaa = sum(L[0:k])
ans = aaa
for i in range(k,n):
    aaa += L[i]
    aaa -= L[i-k]
    if ans <= aaa:
        ans = aaa
    i += 1    
     
print((ans+k)/2)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())

l,r = map(int,input().split())
ans = set(range(l,r+1))

for i in range(m-1):
    tmp_l,tmp_r = map(int,input().split())
    tmp = set(range(tmp_l,tmp_r+1))
    ans = ans&tmp

print(len(ans))  

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

ans_l = 0
ans_r = 100001

for i in range(m):
    tmp_l,tmp_r = map(int,input().split())
    if ans_l < tmp_l:
        ans_l = tmp_l
    if tmp_r < ans_r:
        ans_r = tmp_r
        
if ans_l <= ans_r:
    print(ans_r-ans_l+1)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import lru_cache
import sys

n,y = map(int,input().split())

sys.setrecursionlimit(2000**2 +1)
@lru_cache(maxsize = 2000)
def depth(a,b):
    if a+b <= n:
        if (y-10000*a-5000*b)/1000 == n-a-b:
            print(a,b,n-a-b)
            exit()
        else:
            depth(a+1,b)
            depth(a,b+1)
   

if depth(0,0) ==None:
    print(-1,-1,-1)
else:
    print(depth(0,0))

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

a,b,c = (-1,-1,-1)
for i in range(n+1):
    for j in range(n+1-i):
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            a,b,c = (i,j,n-i-j)
            break

print(a,b,c)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import lru_cache
import sys

n,y = map(int,input().split())

sys.setrecursionlimit(2000**2 +1)
@lru_cache(maxsize = 2000)
def depth(a,b):
    if a+b <= n:
        if (y-10000*a-5000*b)/1000 == n-a-b:
            print(a,b,n-a-b)
            exit()
        else:
            depth(a+1,b)
            depth(a,b+1)
   

if depth(0,0) ==None:
    print(-1,-1,-1)
else:
    print(depth(0,0))

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

a,b,c = (-1,-1,-1)
for i in range(n+1):
    for j in range(n+1-i):
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            a,b,c = (i,j,n-i-j)
            break

print(a,b,c)

Buggy python submission (verdict: Runtime Error):
from functools import lru_cache
import sys

n,y = map(int,input().split())

sys.setrecursionlimit(n**2 +1)
@lru_cache(maxsize = n +1)
def depth(a,b):
    if a+b <= n:
        if (y-10000*a-5000*b)/1000 == n-a-b:
            print(a,b,n-a-b)
            exit()
        else:
            depth(a+1,b)
            depth(a,b+1)
   

if depth(0,0) ==None:
    print(-1,-1,-1)
else:
    print(depth(0,0))

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

a,b,c = (-1,-1,-1)
for i in range(n+1):
    for j in range(n+1-i):
        if 10000*i + 5000*j + 1000*(n-i-j) == y:
            a,b,c = (i,j,n-i-j)
            break

print(a,b,c)
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
#左右に'.'を余分に付けて標準入力からリストを作成
grid = [list('.'+input()+'.') for i in range(H)]
#上下にも付けてやる
grid.insert(0, list('.' * (W + 2)))　#上
grid.append(list('.' * (W + 2)))　#下
#答えを入れるリスト
ans = []

#付け足した行列はカウントしない
for i in range(1, H + 1):
  for j in range(1, W + 1):
    if grid[i][j] == '#':
      ans.append('#')
    else:
      #8方向にある'#'の数をカウント
      #付け足したのは'.'なので条件分岐は不要
      #str型で出力しなければjoinできない
      ans.append(str((grid[i-1][j-1:j+2]+grid[i][j-1:j+2]+grid[i+1][j-1:j+2]).count('#')))
  #一行終わったので改行を入れる
  ans.append('\n')
print(''.join(ans)) #リストをつないで出力

Fixed submission:
H, W = map(int, input().split())
#左右に'.'を余分に付けて標準入力からリストを作成
grid = [list('.'+input()+'.') for i in range(H)]
#上下にも付けてやる
grid.insert(0, list('.' * (W + 2)))
grid.append(list('.' * (W + 2)))
#答えを入れるリスト
ans = []
 
#付け足した行列はカウントしない
for i in range(1, H + 1):
  for j in range(1, W + 1):
    if grid[i][j] == '#':
      ans.append('#')
    else:
      #8方向にある'#'の数をカウント
      #付け足したのは'.'なので条件分岐は不要
      #str型で出力しなければjoinできない
      ans.append(str((grid[i-1][j-1:j+2]+grid[i][j-1:j+2]+grid[i+1][j-1:j+2]).count('#')))
  #一行終わったので改行を入れる
  ans.append('\n')
print(''.join(ans)) #リストをつないで出力
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

L = []
ans = 0
for i in range(n):
    tmp = int(input())
    if tmp in set(L):
        L = [i for i in L if i != tmp]
    else:
        L.append(tmp)

print(len(L)) 

Fixed submission:
n = int(input())

L = set([])

for i in range(n):
    tmp = int(input())
    if tmp in L:
        L.remove(tmp)
    else:
        L.add(tmp)

print(len(L))

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

L = []
for i in range(n):
    tmp = int(input())
    if tmp in L:
        L = [i for i in L if i != tmp]
    else:
        L.append(tmp)

print(len(L))   

Fixed submission:
n = int(input())

L = set([])

for i in range(n):
    tmp = int(input())
    if tmp in L:
        L.remove(tmp)
    else:
        L.add(tmp)

print(len(L))
Buggy python submission (verdict: Runtime Error):
m = input()
a = input()
x = int(0)
y1, y2 = int(0)

n, m = m.spilit()

for i in range(0, len(a), 2):
    x += int(a[i])
    y2 = y1 if y1 < int(a[i]) else y2
    y1 = int(a[i]) if y1 < int(a[i]) else y1

if not y1 // 4 * m or y2 // 4 * m:
    print('Yes')

else:
    print('No')


Fixed submission:
m = input()
b = input()
x = int(0)
a = list()

n, m = m.split(' ')
n = int(n)
m = int(m)

b = b.split(' ')
for i in range(len(b)):
    a.append(int(b[i]))

list.sort(a, reverse = True)

for i in range(len(a)):
    x += int(a[i])

for i in range(m):
    if int(a[i]) < x / (4 * m):
        print('No')
        exit()

print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
a = input()
a, b = a.split(' ')
a = int(a)
b = int(b)

while a >= b:
    a -= b

if a < 0:
    a *= -1

b -= a

print(a if a < b else b)


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

a = a % b

print(a if a < b - a else b - a)
Buggy python submission (verdict: Runtime Error):

l=input()
print((l/3)^3)

Fixed submission:
l=float(input())
print((l/3)**3)
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
ans=1
for i in reversed(range(2,int(math.sqrt(n)))):
    if n%i==0 and abs(n/ans-ans)>abs(n/i-i):
        ans=n/i
            
print(int(ans-1+n/ans-1))

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

if a<10 and b<10:
    print(a*b)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int, input().split()))
l=sorted([x for x in set(l) if l.count(x)<4])
ans=0
x=[]
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,(n-sum((x>l[j]+l[i]) for x in l))):
            if (l[i]<(l[j]+l[k])and l[j]<(l[i]+l[k]) and x.count([l[i],l[j],l[k]])==0):
                x.append([l[i],l[j],l[k]])
                ans+=1

print(ans)


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

c=a-2*b
if c<0:
    c=0
    
print(c)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int, input().split()))
l=sorted([x for x in set(l) if l.count(x)<4])
ans=0
x=[]
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,(n-sum((x>l[j]+l[i]) for x in l))):
            if (l[i]<(l[j]+l[k])and l[j]<(l[i]+l[k]) and x.count([l[i],l[j],l[k]])==0):
                x.append([l[i],l[j],l[k]])
                ans+=1

print(ans)

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

c=a-2*b
if c<0:
    c=0
    
print(c)