Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X_raw=list(map(int,input().split()))

for i in range(N):
    X=X_raw[:]
#    X.pop(i)
    del X[i]
    X.sort()
    print(X[int(N/2-1)])




Fixed submission:
N=int(input())
X=list(map(int,input().split()))
sX=sorted(X)
for i in X:
    if i<=sX[int(N/2-1)]:
        print(sX[int(N/2)])
    else:
        print(sX[int(N/2-1)])

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

for i in range(N):
    X=X_raw[:]
    X.pop(i)
    X.sort()
    print(X[int(N/2-1)])




Fixed submission:
N=int(input())
X=list(map(int,input().split()))
sX=sorted(X)
for i in X:
    if i<=sX[int(N/2-1)]:
        print(sX[int(N/2)])
    else:
        print(sX[int(N/2-1)])
Buggy python submission (verdict: Runtime Error):
from math import sqrt

Q = int(input())

for i in range(Q):
    A,B = map(int, input().split())
    m=A*B
    if A==B or B==A+1:
        ans = 2*A-2
    elif A==B+1
        ans = 2*B-2

    C = int(sqrt(m))
    if C*C==m:
        C=C-1

    if C*(C+1)<m:
        ans = 2*C-1
    else:
            ans = 2*C-2
    print(ans)

Fixed submission:
from math import sqrt

Q = int(input())

for i in range(Q):
    A,B = map(int, input().split())
    m=A*B

    C = int(sqrt(m))
    if C*C==m:
        C=C-1

    if A==B or B==A+1:
        ans = 2*A-2
    elif A==B+1:
        ans = 2*B-2
    elif C*(C+1)<m:
        ans = 2*C-1
    else:
        ans = 2*C-2
    print(ans)

Buggy python submission (verdict: Runtime Error):
from math import sqrt

Q = int(input())

for i in range(Q):
    A,B = map(int, input().split())
    m=A*B
    if A==B or B=A+1:
        ans = 2*A-2
    elif A=B+1
        ans = 2*B-2

    C = int(sqrt(m))
    if C*C==m:
        C=C-1

    if C*(C+1)<m:
        ans = 2*C-1
    else:
            ans = 2*C-2
    print(ans)

Fixed submission:
from math import sqrt

Q = int(input())

for i in range(Q):
    A,B = map(int, input().split())
    m=A*B

    C = int(sqrt(m))
    if C*C==m:
        C=C-1

    if A==B or B==A+1:
        ans = 2*A-2
    elif A==B+1:
        ans = 2*B-2
    elif C*(C+1)<m:
        ans = 2*C-1
    else:
        ans = 2*C-2
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))

A.insert(0,0)
sum=0


for i in range(N):
    sum=0
    tmp = A.pop(i+1)
#    print('tmp',tmp)

    for j in range(1,N):
        sum+=abs(A[j]-A[j-1])
#        print('sum',sum)
    sum+=abs(A[N-1])
    print(sum)
    A.insert(i+1,tmp)

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

A.insert(0,0)
A.insert(N+1,0)
sum=0


for i in range(N+1):
    sum+=abs(A[i]-A[i+1])


for j in range(1,N+1):
    tmp=0
    tmp=abs(A[j-1]-A[j+1])-abs(A[j-1]-A[j])-abs(A[j]-A[j+1])
    print(sum+tmp)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int,input().split()))
A=list(set(a))
ans=0

for i in A:
    num = a.count(i)
    if num>i:
        ans+=num-i
    elif num<i:
        ans+=num

print(ans)

Fixed submission:
from collections import Counter

N=int(input())
a=list(map(int,input().split()))
A=list(set(a))
ans=0
count = Counter(a)

for i in A:
    if count[i]>i:
        ans+=count[i]-i
    elif count[i]<i:
        ans+=count[i]

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

N,K = map(int,input().split())
A=list(map(int,input().split()))
count = Counter(A)
diff = len(count)-K

ans=0

if diff<=0:
    print(0)
else:
    for i in range(diff):
        ans+=count.most_common()[len(count)-i-1][1]
    print(ans)

Fixed submission:
from collections import Counter

N,K = map(int,input().split())
A=list(map(int,input().split()))
count = Counter(A)
count = count.most_common()
diff = len(count)-K
ans=0
if diff>0:
    for i in range(diff):
        ans+=count[len(count)-i-1][1]

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

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

a_raw=Counter(A)
b_raw=Counter(B)
c_raw=Counter(C)

a=sorted(a_raw.items(), key=lambda x: x[0])
c=sorted(c_raw.items(), key=lambda x: x[0])

ans=0
for i in b_raw:
    insert_index_a = bisect.bisect_left([a[x][0] for x in range(len(a))],i)
    insert_index_c = bisect.bisect_right([c[y][0] for y in range(len(c))],i)
    if insert_index_a>0 and insert_index_c !=len(c):
        sum_a=sum(a[m][1] for m in range(insert_index_a))
        sum_c=sum(c[n][1] for n in range(insert_index_c,len(c)))
        ans+=sum_a * b_raw[i] * sum_c

print(ans)



Fixed submission:
import bisect

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort()
B.sort()
C.sort()

ans = 0
for i in B:
    ins_a = bisect.bisect_left(A,i)
    ins_c = bisect.bisect_right(C,i)
    ans+=ins_a*(N-ins_c)

print(ans)

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

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

a_raw=Counter(A)
b_raw=Counter(B)
c_raw=Counter(C)

a=sorted(a_raw.items(), key=lambda x: x[0])
c=sorted(c_raw.items(), key=lambda x: x[0])

ans=0
for i in b_raw:
    insert_index_a = bisect.bisect_left([a[x][0] for x in range(len(a))],i)
    insert_index_c = bisect.bisect_right([c[y][0] for y in range(len(c))],i)
    sum_a=sum(a[m][1] for m in range(insert_index_a))
    sum_c=sum(c[n][1] for n in range(insert_index_c,len(c)))
    ans+=sum_a * b_raw[i] * sum_c

print(ans)

Fixed submission:
import bisect

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort()
B.sort()
C.sort()

ans = 0
for i in B:
    ins_a = bisect.bisect_left(A,i)
    ins_c = bisect.bisect_right(C,i)
    ans+=ins_a*(N-ins_c)

print(ans)

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

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

a=Counter(A)
b=Counter(B)
c=Counter(C)

ans=0

for i in a:
    for j in [x for x in b if x > i]:
        for k in [y for y in c if y > j]:
            ans += a[i]*b[j]*c[k]

print(ans)

Fixed submission:
import bisect

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

A.sort()
B.sort()
C.sort()

ans = 0
for i in B:
    ins_a = bisect.bisect_left(A,i)
    ins_c = bisect.bisect_right(C,i)
    ans+=ins_a*(N-ins_c)

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


num =0
for i in range(max(l)+1):
    s =0
    u =0
    for j in l:
        if j <i:
            s +=1
        else:
            u +=1
    if s ==u:
        num +=1
print(num)

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


m = sorted(l)
if len(m)%2!=0:
    print(0)
else:
    i = len(m)//2 -1
    ans = m[i+1]-m[i]
    print(ans)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d/gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d/gcd(c,d))



if a%c == 0 or a%d == 0:
    print(int(to_b - to_a))
else:
    print(int(to_b-to_a+1))


Fixed submission:
s = input()
count= 0

for i in range(3):
    if s[i] == s[i+1]:
        count += 1
    else:
        pass
if count>0:
    print("Bad")
else:
    print("Good")

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d/gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d/gcd(c,d))


if a%c == 0 or a%d == 0:
    print(int(to_b - to_a))
else:
    print(int(to_b-to_a+1))

Fixed submission:
s = input()
count= 0

for i in range(3):
    if s[i] == s[i+1]:
        count += 1
    else:
        pass
if count>0:
    print("Bad")
else:
    print("Good")

Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    if x%a ==0:
        return int(x//a)
    else:
        x -=1
        return baisu(x,a)

a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d/gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d/gcd(c,d))


print(int(to_b-to_a+1))


Fixed submission:
s = input()
count= 0

for i in range(3):
    if s[i] == s[i+1]:
        count += 1
    else:
        pass
if count>0:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    if x%a ==0:
        return int(x//a)
    else:
        x -=1
        return baisu(x,a)

a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d/gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d/gcd(c,d))

if a%c == 0 or a%d == 0:
    print(int(to_b - to_a))
else:
    print(int(to_b-to_a+1))

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a-1 - baisu(a-1,c) - baisu(a-1,d) + baisu(a-1,c*d//gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d//gcd(c,d))

print(to_b - to_a)

Buggy python submission (verdict: Runtime Error):
import math
def baisu(x,a):
    if x%a ==0:
        return int(x//a)
    else:
        x -=1
        return baisu(x,a)

a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d/math.gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d/math.gcd(c,d))

if a%c == 0 or a%d == 0:
    print(int(to_b - to_a))
else:
    print(int(to_b-to_a+1))

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a-1 - baisu(a-1,c) - baisu(a-1,d) + baisu(a-1,c*d//gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d//gcd(c,d))

print(to_b - to_a)

Buggy python submission (verdict: Runtime Error):
def baisu(x,a):
    if x%a ==0:
        return int(x//a)
    else:
        x -=1
        return baisu(x,a)

a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d)
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d)

if a%c == 0 or a%d == 0:
    print(int(to_b - to_a))
else:
    print(int(to_b-to_a+1))



Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a-1 - baisu(a-1,c) - baisu(a-1,d) + baisu(a-1,c*d//gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d//gcd(c,d))

print(to_b - to_a)

Buggy python submission (verdict: Runtime Error):
def baisu(x,a):
    if x%a ==0:
        return int(x//a)
    else:
        x -=1
        return baisu(x,a)

a,b,c,d = map(int,input().split())

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d)
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d)

print(int(to_b -to_a))


Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a-1 - baisu(a-1,c) - baisu(a-1,d) + baisu(a-1,c*d//gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d//gcd(c,d))

print(to_b - to_a)
Buggy python submission (verdict: Runtime Error):
N,X = map(int,input().split(" "))
l_list = input().split()

count = 1
d = 0
for i in range(N):
        da = d + int(l_list[i])
        d = da
        if da <= X:
                count +=1
        else:
                print(count)
                break


Fixed submission:
lists = []
lists = input().split(" ")
if int(lists[0])<int(lists[1]):
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
d_list = [0]
N,X = input().split(" ")
l_list = input().split(" ")

for i in range(int(len(l_list))):
    num = int(d_list[i]) + int(l_list[i])
    d_list.append(num)
    

for i in range(int(len(d_list)-1)):
    if d_list[i]<=int(X)< d_list[i+1]:
        print(i+1)

    elif int(X)>d_list[-1]:
            print(int(d_list))

Fixed submission:
lists = []
lists = input().split(" ")
if int(lists[0])<int(lists[1]):
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
lists = []
lists = input.split(" ")
if int(lists[0])<int(lists[1]):
  print(0)
else:
  print(10)


Fixed submission:
lists = []
lists = input().split(" ")
if int(lists[0])<int(lists[1]):
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
lists = []
lsits = input.split(" ")
if lists[0]<lists[1]:
  print(0)
else:
  print(10)


Fixed submission:
lists = []
lists = input().split(" ")
if int(lists[0])<int(lists[1]):
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
if X<A:
  print(0)
else:
  print(10)

Fixed submission:
lists = []
lists = input().split(" ")
if int(lists[0])<int(lists[1]):
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
N,X = map(int,input().split(" "))
l_list = input().split()

count = 1
d = 0
for i in range(N):
        d_a = d + int(l_list[i])
        d = d_a
        if d_a <= X:
                count +=1
        else:
                print(count)
            　　break

Fixed submission:
N,X = map(int,input().split(" "))
l_list = input().split()

count = 1
d = 0
for i in range(N):
        da = d + int(l_list[i])
        d = da
        if da <= X:
                count +=1
        else:

                print(count)
                break
        if count == int(N) + 1:
                print(count)
Buggy python submission (verdict: Runtime Error):
lists = [P+Q,Q+R,R+P]
print(min(lists))

Fixed submission:
lists = list(map(int,input().split(" ")))
lists.sort()
print(lists[0] + lists[1])
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
info_list=[]
for i in range(m):
    info_list.append(list(map(int,input().split())))
p_list = list(map(int,input().split()))

count= 0

for i in range((n)**2):
    swith = str(bin(i))[2:]
    swith_num = swith.zfill(m) 
    for j in info_list:
        flag = 0
        swith_sum = 0
        for k in j[1:]:
            swith_sum += int(swith_num[int(k)-1])
        if swith_sum%2 == p_list[info_list.index(j)]:
            pass
        else:
            flag = 1
            break
    if flag == 0:        
        count += 1

print(count)

Fixed submission:
n,m = map(int,input().split())
info_list=[]
for i in range(m):
    info_list.append(list(map(int,input().split())))
p_list = list(map(int,input().split()))

count= 0

for i in range(2**n):
    swith = str(bin(i))[2:]
    swith_num = swith.zfill(n) 
    for j in info_list:
        flag = 0
        swith_sum = 0
        for k in j[1:]:
            swith_sum += int(swith_num[int(k)-1])
        if swith_sum%2 == p_list[info_list.index(j)]:
            pass
        else:
            flag = 1
            break
    if flag == 0:        
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
B*((T+0.5)//A)

Fixed submission:
a,b,t = map(int,input().split())
print((t//a)*b)
Buggy python submission (verdict: Runtime Error):
lis 

Fixed submission:
lists = [0,0,0,0,0,0]
for i in range(len(lists)):
        lists[i] = int(input())

if lists[4]-lists[0]<=lists[5]:
        print("Yay!")
else:
        print(":(")

Buggy python submission (verdict: Runtime Error):
lis = [a,b,c,d,e,k] 
for i in lis:
  i = input()
if e-a<=k:
  print('Yay!')
else:
  print(':(')

Fixed submission:
lists = [0,0,0,0,0,0]
for i in range(len(lists)):
        lists[i] = int(input())

if lists[4]-lists[0]<=lists[5]:
        print("Yay!")
else:
        print(":(")
Buggy python submission (verdict: Runtime Error):
lists = []
for i in range(5):
	lists.append(input())

f_list = []
for i in lists:
	f_list.append(i[-1])

mins = 0
if not "0" in f_list:
    mins = int(min(f_list))
else:
    mins = int(sorted(set(f_list))[1])
sums = 0
for i in lists:
	sums += int((int(i)+9)/10)*10


print(sums-10+mins)

Fixed submission:
lists = []
for i in range(5):
	lists.append(input())

f_list = []
for i in lists:
	f_list.append(i[-1])

mins = 10
if not "0" in f_list:
    mins = int(min(f_list))
elif len(set(f_list)) == 1:
    pass
else:
    mins = int(sorted(set(f_list))[1])
sums = 0
for i in lists:
	sums += int((int(i)+9)/10)*10


print(sums-10+mins)
Buggy python submission (verdict: Runtime Error):
s = input()
num = []
lists = ["A","c","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
print(max(num))
 

Fixed submission:
s = input()
num = []
lists = ["A","C","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
        count = 0
else:
    num.append(count)
print(max(num))

Buggy python submission (verdict: Runtime Error):
s = input()
num = []
lists = ["A","c","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
print(max(num))
 

Fixed submission:
s = input()
num = []
lists = ["A","C","G","T"]
count = 0

for i in range(len(s)):
    if s[i] in lists:
        count +=1
    else:
        num.append(count)
        count = 0
else:
    num.append(count)
print(max(num))
Buggy python submission (verdict: Runtime Error):
n = int(input())
lists = list(map(int,input().split())

ma = max(lists)
if sum(lists) - ma >ma:
    print("YES")
else:
    print("NO")


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

ma = max(lists)
if sum(lists) - ma >ma:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(.split()))
print(a*b/2)


Fixed submission:
a,b,c = map(int,input().split())
print(a*b//2)

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(.split()))
print(a*B/2)


Fixed submission:
a,b,c = map(int,input().split())
print(a*b//2)

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(.split()))
print(a/(b*2))


Fixed submission:
a,b,c = map(int,input().split())
print(a*b//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
lists =[int(input()) for i in range(n)]
sums = sum(lists)
maxs = max(lists)
print(sums-max//2)


Fixed submission:
n = int(input())
lists =[int(input()) for i in range(n)]
sums = sum(lists)
maxs = max(lists)
print(sums-maxs//2)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1:
    print("Hello World")
elif n ==2:
    a,b = map(int,input().split())
    print(a+b)

Fixed submission:
n = int(input())
if n ==1:
    print("Hello World")
elif n ==2:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1:
    print("Hello World")
else:
    a,b = map(int,input().split())
    print(a+b)

Fixed submission:
n = int(input())
if n ==1:
    print("Hello World")
elif n ==2:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n ==1:
    print("Hello World")
else:
    a,b = map(int,input().split())
    print(a+b)

Fixed submission:
n = int(input())
if n ==1:
    print("Hello World")
elif n ==2:
    a = int(input())
    b = int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
i = a[0]

lst = []
while i > 0:
    lst.append(i%10)
    i //= 10 # 必須
lst.reverse()

flag = 0;
for k in range(3):
  if lst[k] == lst[k+1]:
    flag = 1
    
if flag == 1:
  print("Bad")
else:
  print("Good")
    

Fixed submission:
a = list(map(str,input().split()))
i = a[0]

lst = list(i)

flag = 0;
for k in range(3):
  if lst[k] == lst[k+1]:
    flag = 1
    
if flag == 1:
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
N = a[0]
L = a[1]

taste = 0

def if_test(N,L):
    if L > 0:
     for i in range(N):
      taste = taste + L + i
       
     taste = taste - L
     print(taste)
      
    elif L+N-1 < 0:
     for i in range(N):
      taste = taste + L + i 
          
     taste = taste - (L + N - 1)   
     print(taste)
        
    else:
     for i in range(N):
      taste = taste + L + i
      
     print(taste)
    
if_test(L,N)


Fixed submission:
a = list(map(int,input().split()))
N = a[0]
L = a[1]
  

 
def if_test(N,L):
  taste = 0
  if L > 0:
     for i in range(N):
      taste += (L + i)
#      print("L>0"+str(taste))
       
     taste = taste - L
     print(taste)
      
  elif (L+N-1) < 0:
     for i in range(N):
      taste = taste + L + i 
#      print("<0"+str(taste))
          
     taste = taste - (L + N - 1)   
     print(taste)
        
  else:
     for i in range(N):
      taste = taste + L + i
#      print(taste)
     print(taste)
    
if_test(N,L)
Buggy python submission (verdict: Runtime Error):
import math
n,k=map(int,input().split()) 
lst=list()

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1, k+1):
    if n-k>i:
        lst.append(combinations_count(n-k+1, i) * combinations_count(k-i+(i-1), i-1))  
    elif n-k==i:
        lst.append(combinations_count(K-1,i-1))
    else:
        lst.append(int(0))

for i in range(k):
    print(lst[i]%(10**9+7))

Fixed submission:
s=str(input())
lst=list(s)
lst.sort()
result = False

if lst[0] == lst[1]:
    if lst[1] != lst[2]:
        if lst[2] == lst[3]:
            result = True

if result:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import fractions
a,b,c,d=map(int, input().split()) 

i = b//c- (a-1)//c
j = b//d- (a-1)//d

f=fractions.gcd(c,d)
f2= c * d / f
k = b//f2 - (a-1)//f2

pot = i + j - k

print(b-(a-1)-pot)

Fixed submission:
s=input()
result = True

for i in range(3):
    if s[i]==s[i+1]:
        result = False
if result:
    print('Good')
else:
    print('Bad')
Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int, input().split()) 

i = (b//c- a//c)
j = (b//d- a//d)

f=math.gcd(c,d)
f2= c * d / math.gcd(c, d)
k = b//f2 - a//f2

count = int(i + j - k)

print(b-a+1-count)

Fixed submission:
import fractions
a,b,c,d=map(int, input().split()) 

i = b//c- (a-1)//c
j = b//d- (a-1)//d

f=fractions.gcd(c,d)
f2= int(c * d / f)
k = b//f2 - (a-1)//f2

pot = i + j - k

print(b-(a-1)-pot)

Buggy python submission (verdict: Runtime Error):
import math
a,b,c,d=map(int, input().split()) 
count =0

i = ((b- a)//c)+1
j = ((b- a)//d)+1

f=math.gcd(c,d)
k = c*d//f

count = i + j - f

print(b-a+1-count)

Fixed submission:
import fractions
a,b,c,d=map(int, input().split()) 

i = b//c- (a-1)//c
j = b//d- (a-1)//d

f=fractions.gcd(c,d)
f2= int(c * d / f)
k = b//f2 - (a-1)//f2

pot = i + j - k

print(b-(a-1)-pot)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int, input().split()) 
count =0

for i in range(a,b+1):
    if i%c==0 or i%d==0:
            count = count +1

print(b-a+1-count)

Fixed submission:
import fractions
a,b,c,d=map(int, input().split()) 

i = b//c- (a-1)//c
j = b//d- (a-1)//d

f=fractions.gcd(c,d)
f2= int(c * d / f)
k = b//f2 - (a-1)//f2

pot = i + j - k

print(b-(a-1)-pot)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

li = []
for i in range(5):
    li.append(int(input()))

s = 0
for f in li:
    s += (f//10)*10 + 10*(int(bool(f%10)))

li2 = []
for f in li:
    if f%10 != 0:
        li2.append(f%10)

print(s + min(li2) - 10)

Fixed submission:
# -*- coding: utf-8 -*-

import math

li = []
for i in range(5):
    li.append(int(input()))

s = 0
for f in li:
    s += (f//10)*10 + 10*(int(bool(f%10)))

li2 = []
for f in li:
    if f%10 != 0:
        li2.append(f%10)
if len(li2) == 0:
    li2.append(10)
print(s + min(li2) - 10)
Buggy python submission (verdict: Runtime Error):
n = input()
x = 800 * n
y = n / 15 * 200

print(x - y)

Fixed submission:
n = int(input())
x = 800 * n
y = n / 15 * 200

print(x - y)