Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
tmpMinIndex = li.index(1)
count = 1

while True:
    if tmpMinIndex == 0:
        break
    li = li[0:tmpMinIndex]
    minNum = min(li)
    tmpMinIndex = li.index(minNum)
    count += 1


print(count)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
tmpMin = li[0]
count = 0

for i in range(n):
    if li[i] <= tmpMin:
        tmpMin = li[i]
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int, input().split()))
tmpMinIndex = li.index(1)
count = 0

while True:
    count += 1
    tmpMinIndex = li[0:tmpMinIndex]
    if tmpMinIndex == 0:
        break

print(count)


Fixed submission:
n = int(input())
li = list(map(int, input().split()))
tmpMin = li[0]
count = 0

for i in range(n):
    if li[i] <= tmpMin:
        tmpMin = li[i]
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
tmpIndex = li.index(1)
count = 1

for i in range(2, n+1):
    if li.index(i) < tmpIndex:
        count += 1
        tmpIndex = li.index(i)
    else:
        pass

print(count)


Fixed submission:
n = int(input())
li = list(map(int, input().split()))
tmpMin = li[0]
count = 0

for i in range(n):
    if li[i] <= tmpMin:
        tmpMin = li[i]
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = []
seitou = 0
penalty = 0

if m == 0:
    print(0, 0)

else:
    for x in range(m):
        i, j = map(str, input().split())
        if i in li:
            pass
        else:
            if j == "WA":
                penalty += 1
            if j == "AC":
                li.append(i)
                seitou += 1

    print(seitou, penalty)

Fixed submission:
x = str(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
a = alph.find(x) + 1
b = alph[a]
print(b)

Buggy python submission (verdict: Runtime Error):
n, k, m = map(int, input().split())
li = list(map(int, input().split()))
genzai = sum(li)
mokuhyou = n*m
theta = mokuhyou-genzai
if theta > k:
    print(-1)
elif k >= theta:
    print(theta)
elif theta < 0:
    print(0)

Fixed submission:
x = str(input())
alph = 'abcdefghijklmnopqrstuvwxyz'
a = alph.find(x) + 1
b = alph[a]
print(b)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
li = []
seitou = 0
penalty = 0

if m == 0:
    print(0, 0)
else:
    for x in range(5):
        i, j = map(str, input().split())
        if i in li:
            pass
        else:
            if j == "WA":
                penalty += 1
            if j == "AC":
                li.append(i)
                seitou += 1

    print(seitou, penalty)

Fixed submission:
n, m = input().split()
a = [False] * int(n)
b = [0] * int(n)
AC = 0
WA = 0
for i in range(int(m)):
    p, s = input().split()
    if(s == "AC" and a[int(p) - 1] == False):
        a[int(p) - 1] = True
        AC += 1
        WA += b[int(p) - 1]

    if(s == "WA" and a[int(p) - 1] == False):
        b[int(p)-1] += 1

print(AC, WA)
Buggy python submission (verdict: Runtime Error):
a, b=map(int(), input().split())
if a==b:
  print("Yes")
else:
  print("No")

Fixed submission:
a, b=map(int, input().split())
if a==b:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a,b=map(int(), input().split())
if a==b:
  print("Yes")
else:
  print("No")
  

Fixed submission:
a, b=map(int, input().split())
if a==b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
r,g,b = input()
if (r*100 + g*10+b) % 4 ==0:
  print("YES")
else:
  print("NO")

Fixed submission:
r,g,b = input().split()
if int(r+g+b) % 4 ==0:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = math.ceil(N/2)/N
print(a)

Fixed submission:
import math
N = int(input())
a = math.ceil(N/2)/N
print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = ceil(N/2)/N
print(a)

Fixed submission:
import math
N = int(input())
a = math.ceil(N/2)/N
print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = roundup(N/2)/N

print(a)

Fixed submission:
import math
N = int(input())
a = math.ceil(N/2)/N
print(a)

Buggy python submission (verdict: Runtime Error):
N = int(imput())
a = round(N/2)/N
print(a)

Fixed submission:
import math
N = int(input())
a = math.ceil(N/2)/N
print(a)

Buggy python submission (verdict: Runtime Error):
N = imput()
a = round(N/2)/N
print(a)

Fixed submission:
import math
N = int(input())
a = math.ceil(N/2)/N
print(a)

Buggy python submission (verdict: Runtime Error):
a = round(N/2)/N
print(a)

Fixed submission:
import math
N = int(input())
a = math.ceil(N/2)/N
print(a)
Buggy python submission (verdict: Runtime Error):
wet = ["Sunny","Cloudy","Rainy"]

if S == wet[0]:
	ptint(wet[1])
elif S == wet[1]:
	ptint(wet[2])
else:
	ptint(wet[0])

Fixed submission:
S = input()

wet = ["Sunny","Cloudy","Rainy"]

if S == wet[0]:
        nexS = wet[1]
elif S == wet[1]:
        nexS = wet[2]
else:
        nexS = wet[0]
print(nexS)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1, n):
	ans += i

print(ans)


Fixed submission:
n = int(input())
print((n-1)*n//2)
Buggy python submission (verdict: Runtime Error):
#include <iostream>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	int a = 0;
	int b = n;
	for (int i = 0; i < m; i++){
		int l, r;
		cin >> l >> r;
		a = max(a, l);
		b = min(b, r);
	}

	cout << (a <= b ? b-a+1 : 0) << endl;
}


Fixed submission:
n, m = map(int, input().split())
a, b = 0, n;
for i in range(m):
	l, r = map(int, input().split())
	a, b = max(a, l), min(b, r)

print(b-a+1 if a <= b else 0)
Buggy python submission (verdict: Runtime Error):
b = input()
X = ['A', 'T']
Y = ['G', 'C']
print(str(X - b) if b in X else str(Y - b))

Fixed submission:
b = input()
X = {'A', 'T'}
Y = {'G', 'C'}
print(''.join(X - {b}) if b in X else ''.join(Y - {b}))
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split)
if (a*b)%2 = 0:
	print('Even')
Else:
    print('Odd')

Fixed submission:
a, b = map(int, input().split())
c = (a*b)%2
if c ==0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
a[]=input()
count = 0
fot i in range(3)
	if a[i] = 1:
  		count = count + 1
print(count)

Fixed submission:
a = str(input())
count = 0
for i in range(3):
  if int(a[i]) == 1:
    count = count + 1
print(count)
Buggy python submission (verdict: Runtime Error):
// Author - Sumit 

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

const int mod = 1e9+7;

using ll = long long;

const int N=1e5+5;
vector<int> v[N];

pair<int,int> dfs(int a,int p){
	int w=1,b=1;
	for(int i:v[a]){
		if(i != p){
			pair<int,int> p = dfs(i,a);
			w *= p.first + p.second;
			b *= p.first;
			w %= mod;
			b %=mod;
		}
	}
	return make_pair(w,b);
} 

int main(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n-1;++i){
		int x,y;
		scanf("%d%d",&x,&y);
		v[x].push_back(y);
		v[y].push_back(x);
	}
	pair<int,int> p = dfs(1,-1);
	int ans = (p.first + p.second)%mod;
	printf("%d",ans);
    return 0;
}


Fixed submission:
# cook your dish here
import sys
 
sys.setrecursionlimit(100005)
MOD = 1000000007
 
 
def dfs(v, a):
    w, b = 1, 1
    # print(w,b,v);
    for u in links[v]:
        if u == a:
            continue
        cw, cb = dfs(u, v)
        w *= cw + cb
        b *= cw
        w %= MOD
        b %= MOD
        # print(w,b,u,cw,cb);
    return w, b
 
 
n = int(input())
links = [set() for _ in range(n)]
for line in sys.stdin.readlines():
    x, y = map(int, line.split())
    x -= 1
    y -= 1
    links[x].add(y)
    links[y].add(x)
 
print(sum(dfs(0, None)) % MOD)
Buggy python submission (verdict: Runtime Error):
n, k = tuple(map(int, input().split(' ')))
hs = list(map(int, input().split(' ')))
if k>=n:
    print(0)
    return
hs = sorted(hs)
print(sum(hs[:n-k]))


Fixed submission:
n, k = tuple(map(int, input().split(' ')))
hs = list(map(int, input().split(' ')))
if k>=n:
    print(0)
    exit()
hs = sorted(hs)
print(sum(hs[:n-k]))
Buggy python submission (verdict: Runtime Error):
n, k = tuple(map(int, input().split(' ')))
r, s, p = tuple(map(int, input().split(' ')))
t = (input())
point = {'r':p, 's':r, 'p':s, 'any':0}
st = {i:t[i] for i in range(k)}
ans1 = sum(map(lambda x: point[x], t[:k]))
ans2 = 0
for i in range(k, n):
    h = t[i]
    m = i%k
    if st[m] != h:
        ans2 += point[h]
        st[m] = h
    else:
        st[m] = 'any' 
print(ans1 + ans2)
return

Fixed submission:
n, k = tuple(map(int, input().split(' ')))
r, s, p = tuple(map(int, input().split(' ')))
t = (input())
def char2int(c):
    if c == 'r':
        return p
    elif c == 's':
        return r
    else:
        return s
st = {i:t[i] for i in range(k)}
ans1 = sum(map(char2int, t[:k]))
ans2 = 0
for i in range(k, n):
    h = t[i]
    m = i%k
    if st[m] != h:
        ans2 += char2int(h)
        st[m] = h
    else:
        st[m] = 'any' 
print(ans1 + ans2)
Buggy python submission (verdict: Runtime Error):
n = int(input())-65
s = input()
ans = ''
for x in s:
    ans += chr((ord(x)+n)%26 + 65)
print(ans

Fixed submission:
n = int(input())-65
s = input()
ans = ''
for x in s:
    ans += chr((ord(x)+n)%26 + 65)
print(ans)
Buggy python submission (verdict: Runtime Error):
    N,T=map(int,input().split())
    root=[tuple(map(int,input().split())) for i in range(N)]
     
    minc=1000
    for cand in root:
        if cand[1]<=T:
            if cand[0]<minc:
                minc=cand[0]
    if minc==1000:
        print("TLE")
    else:
        print(minc)

Fixed submission:
N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]

minc=1001
for cand in root:
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1001:
    print("TLE")
else:
    print(minc)

Buggy python submission (verdict: Runtime Error):
    N,T=map(int,input().split())
    root=[tuple(map(int,input().split())) for i in range(N)]
     
    minc=1000
    for cand in root(N):
        if cand[1]<=T:
            if cand[0]<minc:
                minc=cand[0]
    if minc==1000:
        print("TLE")
    else:
        print(minc)

Fixed submission:
N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]

minc=1001
for cand in root:
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1001:
    print("TLE")
else:
    print(minc)

Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]

minc=1000
for cand in range(N):
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1000:
    print("TLE")
else:
    print(minc)

Fixed submission:
N,T=map(int,input().split())
root=[tuple(map(int,input().split())) for i in range(N)]

minc=1001
for cand in root:
    if cand[1]<=T:
        if cand[0]<minc:
            minc=cand[0]
if minc==1001:
    print("TLE")
else:
    print(minc)
Buggy python submission (verdict: Runtime Error):
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymax:
    print('War')
else:
    print('No War')

Fixed submission:
ipt=list(map(int,input().split()))
imax=max(ipt)
ipt.remove(imax)
print(10*imax+sum(ipt))

Buggy python submission (verdict: Runtime Error):
iptA=list(map(int,input().split()))
X=list(map(int,input().split())).append(iptA[2])
Y=list(map(int,input().split())).append(iptA[3])

xmax,ymax=max(X),max(Y)
if xmax>=ymax:
    print('War')
 else:
     print('No War')

Fixed submission:
ipt=list(map(int,input().split()))
imax=max(ipt)
ipt.remove(imax)
print(10*imax+sum(ipt))
Buggy python submission (verdict: Runtime Error):
iptA=list(map(int,input().split()))
X=list(map(int,input().split())).append(iptA[2])
Y=list(map(int,input().split())).append(iptA[3])
     
xmax,ymax=max(X),max(Y)
if xmax>=ymax:
    print('War')
else:
    print('No War')

Fixed submission:
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymin:
    print('War')
else:
    print('No War')

Buggy python submission (verdict: Runtime Error):
iptA=list(map(int,input().split()))
X=list(map(int,input().split())).append(iptA[2])
Y=list(map(int,input().split())).append(iptA[3])
  
xmax,ymax=max(X),max(Y)
if xmax>=ymax:
    print('War')
 else:
     print('No War')

Fixed submission:
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymin:
    print('War')
else:
    print('No War')
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce
N,X=map(int,input().split(" "))
x=np.array(list(map(int, input().split(' '))))
y=abs(x-X)
print(reduce(math.gcd,y))

Fixed submission:
import numpy as np
from functools import reduce

def euclid(m,n):
    while n:
        m,n=n,m%n
    return m

N,X=map(int,input().split(" "))
x=np.array(list(map(int, input().split(' '))))
y=abs(x-X)
print(reduce(euclid,y))

Buggy python submission (verdict: Runtime Error):
import math
N,X=map(int,input().split(" "))
x=np.array(list(map(int,input().split(' '))))
y=abs(x-X)
print(reduce(math.gcd,y))


Fixed submission:
import numpy as np
from functools import reduce

def euclid(m,n):
    while n:
        m,n=n,m%n
    return m

N,X=map(int,input().split(" "))
x=np.array(list(map(int, input().split(' '))))
y=abs(x-X)
print(reduce(euclid,y))
Buggy python submission (verdict: Runtime Error):
inputStr = input()

if inputStr == 'ABC':
	print('ARC')
else if inputStr == 'ARC':
    print('ABC')
else:
	print('')

Fixed submission:
inputStr = input()

if inputStr == 'ABC':
 	print('ARC')
else:
	print('ABC')

Buggy python submission (verdict: Runtime Error):
inputStr = input()

if inputStr == 'ABC':
  print('ARC')
else if inputStr == 'ARC':
  print('ABC')
else:
  print('')

Fixed submission:
inputStr = input()

if inputStr == 'ABC':
 	print('ARC')
else:
	print('ABC')

Buggy python submission (verdict: Runtime Error):
inputStr = input()

if inputStr == 'ABC':
  return 'ARC'
else if inputStr == 'ARC':
  return 'ABC'
else:
  return null


Fixed submission:
inputStr = input()

if inputStr == 'ABC':
 	print('ARC')
else:
	print('ABC')

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

if input = 'ABC':
  return 'ARC'
else:
  return 'ABC'

Fixed submission:
inputStr = input()

if inputStr == 'ABC':
 	print('ARC')
else:
	print('ABC')
Buggy python submission (verdict: Runtime Error):
K =input()
A,B = map(int,input().split())	
 
cnt = 0
for i in range(A, B+1):
    if(i % K == 0):
        print("OK")
        cnt += 1
        break
if(cnt == 0):
    print("NG")

Fixed submission:
K = int(input())
A,B = map(int,input().split())
cnt = 0
for i in range(A, B+1):
    if(i % K == 0):
        print("OK")
        cnt += 1
        break
if(cnt == 0):
    print("NG")

Buggy python submission (verdict: Runtime Error):
K =input()
A,B = map(int,input().split())	

cnt = 0
for i in range(A, B+1):
    if(i % K == 0):
        print("OK")
        cnt += 1
        break
if(cnt == 0):
    print("NG")

Fixed submission:
K = int(input())
A,B = map(int,input().split())
cnt = 0
for i in range(A, B+1):
    if(i % K == 0):
        print("OK")
        cnt += 1
        break
if(cnt == 0):
    print("NG")
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int,input().split())
score = 0
for i in range(N):
    x = i+1
    val = int(A*x/B) - A * int(x/B)
    #print( int(A*x/B) , A * int(x/B))
    if(val >= score):
        score = val
    else:
        break
print(score)


Fixed submission:
A, B, N = map(int,input().split())
x = min(N,B-1)
val = int(A*x/B) - A * int(x/B)
print(val)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int,input().split())
score = 0
for i in range(int(N//1.1) ,N):
    x = i+1
    val = int(A*x/B) - A * int(x/B)
    #print( int(A*x/B) , A * int(x/B))
    if(val > score):
        score = val
print(score)


Fixed submission:
A, B, N = map(int,input().split())
x = min(N,B-1)
val = int(A*x/B) - A * int(x/B)
print(val)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int,input().split())
score = 0
for i in range(int(N//1.5) ,N):
    x = i+1
    val = int(A*x/B) - A * int(x/B)
    #print( int(A*x/B) , A * int(x/B))
    if(val > score):
        score = val
print(score)


Fixed submission:
A, B, N = map(int,input().split())
x = min(N,B-1)
val = int(A*x/B) - A * int(x/B)
print(val)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int,input().split())
score = 0
for i in range(N//2,N):
    x = i+1
    val = int(A*x/B) - A * int(x/B)
    #print( int(A*x/B) , A * int(x/B))
    if(val > score):
        score = val
print(score)


Fixed submission:
A, B, N = map(int,input().split())
x = min(N,B-1)
val = int(A*x/B) - A * int(x/B)
print(val)
Buggy python submission (verdict: Runtime Error):
import numpy as np
R = input()
print(2*R*np.pi)

Fixed submission:
import numpy as np
R = np.double(input())
print(2*R*np.pi)

Buggy python submission (verdict: Runtime Error):
import numpy as np
input = sys.stdin.readline
R = int(input())
pi = np.pi

print(2*R*pi)

Fixed submission:
import numpy as np
R = np.double(input())
print(2*R*np.pi)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


def resolve():
    N = int(input())
    A = [int(input()) for i in range(N)]
    A = np.array(A)
    idx = np.argsort(A)[::-1]
    A = A[idx]
    for i in range(N):
        print(A[np.where(idx != i)[0][0]])
        
resolve()

Fixed submission:
import copy
def resolve():
    N = int(input())
    A = [int(input()) for i in range(N)]
    B = copy.copy(A)
    B.sort()
    A_max = B[-1]
    A_sec = B[-2]
    for i in range(N):
        if (A[i] == A_max):
            print(A_sec)
        else:
            print(A_max)
resolve()

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


def resolve():
    N = int(input())
    A = [int(input()) for i in range(N)]
    for i in range(N):
        B = copy.copy(A)
        B[i] = 0
        B.sort()
        print(B[-1])
        
        
resolve()

Fixed submission:
import copy
def resolve():
    N = int(input())
    A = [int(input()) for i in range(N)]
    B = copy.copy(A)
    B.sort()
    A_max = B[-1]
    A_sec = B[-2]
    for i in range(N):
        if (A[i] == A_max):
            print(A_sec)
        else:
            print(A_max)
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np


def resolve():
    N = int(input())
    d = [int(i) for i in input().split()]
    d = np.array(d)
    d = np.sort(d)
    count = 0
    for i in range(100000):
        if (np.nonzero(d >= i)[0].size == np.nonzero(d < i)[0].size):
            count += 1
    print(count)
    
resolve()

Fixed submission:
import numpy as np
def resolve():
    N = int(input())
    d = [int(i) for i in input().split()]
    d = np.array(d)
    d = np.sort(d)
    print(d[N // 2] - d[N // 2 - 1])
resolve()

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


def resolve():
    N = int(input())
    d = [int(i) for i in input().split()]
    d = np.array(d)
    count = 0
    for i in range(100000):
        if (np.where(d >= i)[0].size == np.where(d < i)[0].size):
            count += 1
    print(count)
    
resolve()

Fixed submission:
import numpy as np
def resolve():
    N = int(input())
    d = [int(i) for i in input().split()]
    d = np.array(d)
    d = np.sort(d)
    print(d[N // 2] - d[N // 2 - 1])
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
def resolve():
    N = int(input())
    d = [int(i) for i in input().split()]
    d = np.array(d)
    count = 0
    for i in range(100000):
        if (np.where(d >= i)[0].size == np.where(d < i)[0].size):
            count += 1
    print(count)
resolve()

Fixed submission:
import numpy as np
def resolve():
    N = int(input())
    d = [int(i) for i in input().split()]
    d = np.array(d)
    d = np.sort(d)
    print(d[N // 2] - d[N // 2 - 1])
resolve()
Buggy python submission (verdict: Runtime Error):
import sys
from io import StringIO
import unittest
def resolve():
    S = input()
    a = 0
    for i in range(len(S) - 1):
        if (S[i] == S[i + 1]):
            a = 1
    if (a == 0):
        print("Good")
    else:
        print("Bad")
resoluve()

Fixed submission:
import sys
from io import StringIO
import unittest
def resolve():
    S = input()
    a = 0
    for i in range(len(S) - 1):
        if (S[i] == S[i + 1]):
            a = 1
    if (a == 0):
        print("Good")
    else:
        print("Bad")
resolve()

Buggy python submission (verdict: Runtime Error):
def resolve():
    S = input()
    a = 0
    for i in range(len(S) - 1):
        if (S[i] == S[i + 1]):
            a = 1
    if (a == 0):
        print("Good")
    else:
        print("Bad")
resoluve()

Fixed submission:
import sys
from io import StringIO
import unittest
def resolve():
    S = input()
    a = 0
    for i in range(len(S) - 1):
        if (S[i] == S[i + 1]):
            a = 1
    if (a == 0):
        print("Good")
    else:
        print("Bad")
resolve()
Buggy python submission (verdict: Runtime Error):
import sys
from io import StringIO
import unittest
import numpy as np


def resolve():
    N, L = map(int, input().split())
    taste = np.zeros(N)
    for i in range(N):
        taste[i] = L + i
    min_idx = np.argsort(np.abs(taste))[0]
    sum_taste = np.sum(taste) - taste[min_idx]
    print(np.int(sum_taste))
resolve()

Fixed submission:
import sys
from io import StringIO
import unittest
import numpy as np


def resolve():
    N, L = map(int, input().split())
    taste = np.zeros(N)
    for i in range(N):
        taste[i] = L + i
    min_idx = np.argsort(np.abs(taste))[0]
    sum_taste = np.sum(taste) - taste[min_idx]
    print(np.int(sum_taste))

resolve()
Buggy python submission (verdict: Runtime Error):
import sys
from io import StringIO
import unittest
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def resolve():
    A, B, C, D = map(int, input().split())
    size = B - A + 1
    C_warikire = math.ceil(size / C)
    D_warikire = math.ceil(size / D)
    C_and_D_warikire = math.ceil(size / (lcm(C, D)))
    print(size - C_warikire - D_warikire + C_and_D_warikire)
    
resolve()

Fixed submission:
import sys
from io import StringIO
import unittest
import fractions
import math


#from numba import jit
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def resolve():
    A, B, C, D = map(int, input().split())
    size = B - A + 1
    C_warikire = B // C - (A - 1) // C
    D_warikire = B // D - (A - 1) // D
    C_and_D_warikire = B // lcm(C, D) - (A - 1) // lcm(C, D)
    print(size - C_warikire - D_warikire + C_and_D_warikire)
resolve()

Buggy python submission (verdict: Runtime Error):
import sys
from io import StringIO
import unittest
import math


#from numba import jit
def lcm(x, y):
    return (x * y) // math.gcd(x, y)


def resolve():
    A, B, C, D = map(int, input().split())
    size = B - A + 1
    C_warikire = math.ceil(size / C)
    D_warikire = math.ceil(size / D)
    C_and_D_warikire = math.ceil(size / (lcm(C, D)))
    print(size - C_warikire - D_warikire + C_and_D_warikire)
resolve()

Fixed submission:
import sys
from io import StringIO
import unittest
import fractions
import math


#from numba import jit
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


def resolve():
    A, B, C, D = map(int, input().split())
    size = B - A + 1
    C_warikire = B // C - (A - 1) // C
    D_warikire = B // D - (A - 1) // D
    C_and_D_warikire = B // lcm(C, D) - (A - 1) // lcm(C, D)
    print(size - C_warikire - D_warikire + C_and_D_warikire)
resolve()