Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())	
li = tuple(map(int,input().split()))
dp = [0] + [float("inf")]*(n-1)
for i in range(1,n):
    for j in range(max(0, i-k),i):
        dp[i] = min(dp[i], dp[j] + abs(li[i] - li[j]))
print(dp[-1])


Fixed submission:
n,k = map(int,input().split())	
li = tuple(map(int,input().split()))
dp = [0] + [float("inf")]*(n-1)
for i in range(1,n):
    for j in range(max(0, i-k),i):
        dp[i] = min(dp[i], dp[j] + abs(li[i] - li[j]))
print(dp[-1])

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())	
li = list(map(int,input().split()))
dp = [0] + [float("inf")]*(n-1)
for i in range(1,n):
    for j in range(max(0, i-k),i):
        dp[i] = min(dp[i], dp[j] + abs(li[i-k] - li[i]))
print(dp[-1])

Fixed submission:
n,k = map(int,input().split())	
li = tuple(map(int,input().split()))
dp = [0] + [float("inf")]*(n-1)
for i in range(1,n):
    for j in range(max(0, i-k),i):
        dp[i] = min(dp[i], dp[j] + abs(li[i] - li[j]))
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
x = []
y = []
sum = 0
for i in range(n):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
for i in range(3):
    for j in  range(3):
        sum += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)
average  = 2*sum/(math.factorial(n))
print(average)


Fixed submission:
import math
n = int(input())
x = []
y = []
sum = 0
for i in range(n):
    x1,y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
for i in range(n):
    for j in  range(n):
        sum += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)
average  = (math.factorial(n)/n)*sum/(math.factorial(n))
print(average)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
s_list = list(s)
count = 0
for i in range(n):
    while s_list[i] != s_list[i+1]:
        count += 1
output = count+1
print(output)

Fixed submission:
n = int(input())
s_list = list(input())
count = 0
for i in range(n-1):
    if s_list[i] != s_list[i+1]:
        count += 1
output = count+1
print(output)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
l = sorted(([int(x) for x in input().split()]))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l[i+1::],l[i]+l[j])
        count += k
print(count)

Fixed submission:
import bisect
n = int(input())
l = sorted(([int(x) for x in input().split()]))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l,l[i]+l[j])
        count += k-(i+1)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
l = sorted(list(map(int, input().split())))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l[i+1::],l[i]+l[j])
        count += k
print(count)

Fixed submission:
import bisect
n = int(input())
l = sorted(([int(x) for x in input().split()]))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l,l[i]+l[j])
        count += k-(i+1)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
l = list(map(int, input().split()))
l_new = sorted(l)
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l_new[i+1::],l_new[i]+l_new[j])
        count += k
print(count)
        


Fixed submission:
import bisect
n = int(input())
l = sorted(([int(x) for x in input().split()]))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l,l[i]+l[j])
        count += k-(i+1)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools 
n = int(input())
l = list(map(int, input().split()))
l_group = list(itertools.combinations(l,3))
count = 0
for i in range(len(l_group)):
        if l_group[i][0]<l_group[i][1]+l_group[i][2] and l_group[i][1]<l_group[i][0]+l_group[i][2] and l_group[i][2]<l_group[i][0]+l_group[i][1]:
            count += 1
print(count)


Fixed submission:
import bisect
n = int(input())
l = sorted(([int(x) for x in input().split()]))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l,l[i]+l[j])
        count += k-(i+1)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools 
n = int(input())
l = list(map(int, input().split()))
l_group = list(itertools.combinations(l,3))
count = 0
for i in range(len(l_group)):
        if l_group[i][0]<l_group[i][1]+l_group[i][2] and l_group[i][1]<l_group[i][0]+l_group[i][2] and l_group[i][2]<l_group[i][0]+l_group[i][1]:
            count += 1
print(count)


Fixed submission:
import bisect
n = int(input())
l = sorted(([int(x) for x in input().split()]))
count = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_left(l,l[i]+l[j])
        count += k-(i+1)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a_new = sorted(a)
answer = []
for j in range(1,n+1):
  answer.append(a.index(j)+1)
print(*answer)


Fixed submission:
import numpy as np
n = int(input())
a = list(map(int,input().split()))
answer = np.argsort(a) +1
print(*answer)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a_new = sorted(a)
answer = []
for j in a_new:
  answer.append(a.index(j)+1)
print(*answer)

Fixed submission:
import numpy as np
n = int(input())
a = list(map(int,input().split()))
answer = np.argsort(a) +1
print(*answer)
Buggy python submission (verdict: Runtime Error):
s,w = int(input()),int(input())

if s <= w:
    print("unsafe")

else:
    print("safe")


Fixed submission:
data = []
while len(data) < 2:
    val = input()
    data = data + val.split(" ")
    #print(data)

for i,val in enumerate(data):
    data[i] = int(val)

s,w = data[0],data[1]

if s <= w:
    print("unsafe")

else:
    print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
order = int(input())
data = []
ans = 0

for i in range(order):
    val = input()
    if val not in data:
        data.append(val)
        ans += 1

print(ans)

Fixed submission:
order = int(input())
data = set([])

for i in range(order):
    data.add(input())

print(len(data))
Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(1,10):
  if n%i==0:
    if n/i <=9:
      f=1
      break
if f==0:
  print('No')
else:
  print('YES')

Fixed submission:
n=int(input())
f=0
for i in range(1,10,1):
  if n%i==0:
    if (n//i)<=9:
      f=1
      break
if f==1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print((n//2)/n)
else:
  print(((n//2)+1)/n)

Fixed submission:
n=int(input())
if n%2==0:
  print((n//2)/n)
else:
  print(((n//2)+1)/n)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


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


n = int(input())
a = list(map(int, input().split()))
lcm_a = a[0]

for i in range(1, n):
    lcm_a = lcm(lcm_a, a[i])

ans = 0

for i in a:
    ans += lcm_a // i

print(ans%1000000007)


Fixed submission:
n, m = map(int,input().split())
print("Yes") if n == m else print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


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


n = int(input())
a = list(map(int, input().split()))
lcm_a = a[0]

for i in range(1, n):
    lcm_a = lcm(lcm_a, a[i])

ans = 0

for i in a:
    ans += lcm_a // i

print(ans%1000000007)


Fixed submission:
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


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


n = int(input())
a = list(map(int, input().split()))
lcm_a = a[0]

for i in range(1, n):
    lcm_a = lcm(lcm_a, a[i])

ans = 0

for i in a:
    ans += lcm_a // i

print(ans%1000000007)
Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())

list = []

for i in range(X-K+1,X+K):
    list.append(i)

print(" ".join(map(str,list))


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

print(max(a+b,a-b,a*b))

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())

print(max(a+b,a-b,a*b))


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

print(max(a+b,a-b,a*b))

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

print(max(a+b,a-b,a*b))


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

print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())

list = []

for i in range(X-K+1,X+K):
    list.append(i)

print(" ".join(map(int,list))


Fixed submission:
K,X = map(int,input().split())

list = []

for i in range(X-K+1,X+K):
    list.append(i)

print(" ".join(map(str,list)))
Buggy python submission (verdict: Runtime Error):
a,b = input().split()

if (a+b)%2 == 0:
    print((a+b)/2)
else:
    print("IMPOSSIBLE")


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

if (a+b)%2 == 0:
    print(int((a+b)/2))
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
S = input()
K = int(input())

def check_one(sgn,arr):
    cnt = 0
    for i in range(sgn):
        if S[i] == '1':
            cnt += 1
    if cnt == sgn:
        return True

def first_num(arr):
    list = []
    for i in range(len(arr)):
        if arr[i] != '1':
            list.append(int(arr[i]))
    return list[0]
            

if len(S) > K:
    if check_one(K,S):
        print(1)
else:
    print(first_num(S))
    

Fixed submission:
S = input()
K = int(input())

def check_one(sgn,arr):
    cnt = 0
    for i in range(sgn):
        if S[i] == '1':
            cnt += 1
    if cnt == sgn:
        return True

def first_num(arr):
    list = []
    for i in range(len(arr)):
        if arr[i] != '1':
            list.append(int(arr[i]))
    return list[0]
            

if len(S) >= K and check_one(K,S):
        print(1)
else:
    print(first_num(S))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(n):
        if a[j] == (i+1):
            if (i+1) != n:
                print(j+1, end = " ")
            else:
                print(j+1)


Fixed submission:
n = int(input())
if n == 1:
    print(1)
elif n % 2 == 0:
    print(0.5)
else:
    print((n+1)/(2*n))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = [i+1 for i in range(n-1)]
print(sum(lis))

Fixed submission:
n = int(input())
print(n*(n-1) // 2)
Buggy python submission (verdict: Runtime Error):
input_a=input("a:")
input_aa=input("aa:")
input_aaa=input("aaa:")

a=int(input_a)
aa=int(input_aa)
aaa=int(input_aaa)

if a+aa+aaa>=22: print("bust")
else: print("win")

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

if a+b+c>=22: print("bust")
else: print("win")

Buggy python submission (verdict: Runtime Error):
input_a=input()
input_aa=input()
input_aaa=input()

a=int(input_a)
aa=int(input_aa)
aaa=int(input_aaa)

if a+aa+aaa>=22: print("bust")
else: print("win")

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

if a+b+c>=22: print("bust")
else: print("win")
Buggy python submission (verdict: Runtime Error):
S, W = map(int,input.split())
if S <= W:
  print("unsafe")
else:print("safe")

Fixed submission:
S, W = map(int,input().split())
if S <= W:
  print("unsafe")
else:print("safe")

Buggy python submission (verdict: Runtime Error):
S, W = map(int,input.split())
if S <= W:
  print("unsafe")
else:print("safe")

Fixed submission:
S, W = map(int,input().split())
if S <= W:
  print("unsafe")
else:print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
A = [0]*(N+1)
count = 0
for i in range(1,N):
    A[1] = int(S[-1])
    A[i+1] = (int(A[i])+int(S[-i-1])*10**i%2019)%2019  
    if A[i+1] in A[0:i+1]:
        a = A[0:i+1].count(A[i+1])
        count += a    
        
print(count)

Fixed submission:
#数字列の逆順をSにいれる
S = input()[::-1]
#各modの値を数えるためのリスト
counts = [0]*2019
#mod==0になったら1つだけでも2019の倍数になっているので初めから＋１しておく
counts[0] = 1
#numはSの各桁の数字、dは桁数（1の位、10の位、、）
num,d = 0,1
for i in S:
    num += int(i)*d
    num %= 2019
    d *= 10
    #ここがポイント。かける桁数の値も先にmodを計算してからかけると計算量が減らせる。
    d %= 2019
    counts[num] += 1

ans = 0
for i in counts:
    ans += i*(i-1)//2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(S)
count = 0
for i in range(5,N):
    for j in range(0,N-i+1):
        if int(S[j:j+i])%2019 == 0:
            count += 1
print(count)

Fixed submission:
#数字列の逆順をSにいれる
S = input()[::-1]
#各modの値を数えるためのリスト
counts = [0]*2019
#mod==0になったら1つだけでも2019の倍数になっているので初めから＋１しておく
counts[0] = 1
#numはSの各桁の数字、dは桁数（1の位、10の位、、）
num,d = 0,1
for i in S:
    num += int(i)*d
    num %= 2019
    d *= 10
    #ここがポイント。かける桁数の値も先にmodを計算してからかけると計算量が減らせる。
    d %= 2019
    counts[num] += 1

ans = 0
for i in counts:
    ans += i*(i-1)//2

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
for i in range(N):
    print(A.count(i+1))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = [0]*N
for i in range(N-1):
    B[A.pop()-1]+=1
for i in range(N):
    print(B[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A = sorted([(a, p) for p, a in enumerate(A)], reverse=True)
dp = [[0]*(i+1) for i in range(N+1)]
for z in range(N):
    for y in range(z+1):
        dp[z+1][y] = max(A[z][0]*(A[z][1]-(z-y))+dp[z][y],dp[z+1][y])
        dp[z+1][y+1]= A[z][0]*((N-y-1)-A[z][1])+dp[z][y]
print(max(dp[-1]))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A = sorted([(a, p) for p, a in enumerate(A)], reverse=True)
dp = [[0]*(i+1) for i in range(N+1)]
for z in range(N):
    for y in range(z+1):
        dp[z+1][y] = max(A[z][0]*(A[z][1]-(z-y))+dp[z][y],dp[z+1][y])
        dp[z+1][y+1]= A[z][0]*((N-y-1)-A[z][1])+dp[z][y]
print(max(dp[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d=map(int,input().split())
r1=a
r2=c
while r1!=0 and r2!=0:
  r2-=b
  r1-=d
if r2==0:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c,d=map(int,input().split())
r1=a
r2=c
while r1>0 and r2>0:
  r2-=b
  r1-=d
if r2<=0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
  print(i)
  l.append(input())
print(len(s))

Fixed submission:
n=int(input())
l=[]
for i in range(n):
  l.append(input())
s=set(l)
print(len(s))
Buggy python submission (verdict: Runtime Error):
r=int(input())
print(2r*3.14)

Fixed submission:
r=int(input())
print(2*r*3.14)
Buggy python submission (verdict: Runtime Error):
s_1 = 0
s_2 = 0
s_3 = 0
mod = 1000000007
ans = 0
for i in range(k, n + 2):
    s_1 = (n + n + 1 - i) * i / 2
    s_2 = (0 + i - 1) * i / 2
    s_3 += s_1 + 1 - s_2
ans = s_3 % 1000000007
print('{:g}'.format(ans))


Fixed submission:
n, k = map(int, input().split())
s_1 = 0
s_2 = 0
s_3 = 0
mod = 1000000007
ans = 0
for i in range(k, n + 2):
    s_1 = (n + n + 1 - i) * i // 2
    s_2 = (0 + i - 1) * i // 2
    s_3 += s_1 + 1 - s_2
ans = s_3 % 1000000007
print(ans)
Buggy python submission (verdict: Runtime Error):
if S <= W:
  return "unsafe"
else:
  return "safe"


Fixed submission:
s, w = map(int, input().split()) 
if w>=s:
	print("unsafe") 
else:
	print("safe")

Buggy python submission (verdict: Runtime Error):
if S<= W:
  print("unsafe")
 else:
  print("safe)
        

Fixed submission:
s, w = map(int, input().split()) 
if w>=s:
	print("unsafe") 
else:
	print("safe")

Buggy python submission (verdict: Runtime Error):
x,y,z,w=map(int,input().split())

while True:
    z=z-y
    if z<=0:
        print("Yes")
        break
    x=x-w
    if x<=0:
        print("No")
        break

Fixed submission:
S,W=map(int,input().split())
 
if S>W:
	print("safe")
else:
	print("unsafe")
Buggy python submission (verdict: Time Limit Exceeded):
import math

import sys
k = sys.stdin.readline()
k = int(k)
sum = 0
for x in range(1,k+1):
    for y in range(1,k+1):
        for z in range(1,k+1):
            sum = sum +math.gcd(math.gcd(x, y), math.gcd(y, z))

print(sum)

Fixed submission:
import math

import sys
k = sys.stdin.readline()
k = int(k)
sum = 0
for x in range(1,k+1):
    for y in range(x,k+1):
        for z in range(y,k+1):
            if len(set([x,y,z])) is 1:
                sum = sum +math.gcd(math.gcd(x, y), math.gcd(y, z))
            elif len(set([x,y,z])) is 2:
                sum = sum + 3 * math.gcd(math.gcd(x, y), math.gcd(y, z))
            elif len(set([x,y,z])) is 3:
                sum = sum + 6* math.gcd(math.gcd(x, y), math.gcd(y, z))
print(sum)
Buggy python submission (verdict: Runtime Error):
a, b = raw_input()
if a < b:
  print(unsafe)
else:
  print(safe)

Fixed submission:
s = input()
l = [int(item) for item in s.split()]
if l[0] <= l[1]:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
a, b = input()
if a < b:
  print(unsafe)
else:
  print(safe)

Fixed submission:
s = input()
l = [int(item) for item in s.split()]
if l[0] <= l[1]:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    if p not in M:
        M.append(p)
        n += 1

print(n)


Fixed submission:
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    M.append(p)

Mm = list(set(M))

print(len(Mm))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input(""))
M = []

for i in range(N):
    p = input("")
    if p not in M:
        M.append(p)

print(len(M))



Fixed submission:
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    M.append(p)

Mm = list(set(M))

print(len(Mm))

Buggy python submission (verdict: Runtime Error):
I = input("")
i = I.split(" ")
print(i)

N = int(i[0])
l = []
t = 0

for k in range(N):
    if i[k+1] not in l:
        l.append(i[k+1])
        t = t+1
print(len(l))


Fixed submission:
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    M.append(p)

Mm = list(set(M))

print(len(Mm))

Buggy python submission (verdict: Runtime Error):
I = input("")
i = I.split("\n")

N = int(i[0])
l = []
t = 0

for k in range(N):
    if i[k+1] not in l:
        l.append(i[k+1])
        t = t+1
print(len(l))


Fixed submission:
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    M.append(p)

Mm = list(set(M))

print(len(Mm))
Buggy python submission (verdict: Runtime Error):
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
    print(maximum_hangout_days)
else:
    print(-1)

Fixed submission:
import math
r = int(input())
print(2 * r * math.pi)
Buggy python submission (verdict: Runtime Error):
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
  	print(maximum_hangout_days)
  else:
    print(-1)

Fixed submission:
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
    print(maximum_hangout_days)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
  print(maximum_hangout_days)
  else:
    print(-1)

Fixed submission:
# summer vacations, number of assignments
N, M = list(map(int, input().split()))
# each entry in A represents number of days to do the assignment
A = list(map(int, input().split()))

number_of_days_required = sum(A)
maximum_hangout_days = N - number_of_days_required
if maximum_hangout_days >= 0:
    print(maximum_hangout_days)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
T

Fixed submission:

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

if (a == b == c):
    print(str(a) + ' ' + str(b) + ' ' + str(c))
else:
    a, b = b, a
    a, c = c, a
    print(str(a) + ' ' + str(b) + ' ' + str(c))

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

if (a == b == c):
    print(f'{a} {b} {c}')
else:
    a, b = b, a
    a, c = c, a
    print(f'{a} {b} {c}')

Fixed submission:

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

if (a == b == c):
    print(str(a) + ' ' + str(b) + ' ' + str(c))
else:
    a, b = b, a
    a, c = c, a
    print(str(a) + ' ' + str(b) + ' ' + str(c))
Buggy python submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))

item_votes = list(map(int, input().split()))

total_item_votes = sum(item_votes)

item_vote_percentages = [item_votes/total_item_votes for item_votes in item_votes]

required_vote_percentage = 1/(4*m)

can_select = 0
for vote_percentage in item_vote_percentages:
  if vote_percentage > required_vote_percentage:
    can_select += 1

    if can_select >= m:
      print('Yes')
      else:
        print('No')

Fixed submission:
# number of items, number of popular items to select
n, m = list(map(int, input().split()))

item_votes = list(map(int, input().split()))

total_item_votes = sum(item_votes)

item_vote_percentages = [item_votes/total_item_votes for item_votes in item_votes]

required_vote_percentage = 1/(4*m)

can_select = 0
for vote_percentage in item_vote_percentages:
    if vote_percentage >= required_vote_percentage:
        can_select += 1

if can_select >= m:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
# number of balls
N = input()
# ball values
K = list(map(int, input().split()))

# get ball counts
ball_counts = {}
for i in range(len(K)):
    ball_value = K[i]
    if ball_value in ball_counts:
        ball_counts[ball_value] += 1
    else:
        ball_counts[ball_value] = 1

# get sums
total_sum = 0
for value, count in ball_counts.items():
    total_sum += (count * (count - 1)) / 2

# remove extra
for i in range(len(K)):
    ball_value = K[i]
    print(int(total_sum - (ball_counts[ball_value] - 1)))

Fixed submission:
# number of even balls, number of odd balls
N, M = list(map(int, input().split()))

total_choice = 0

if N > 1:
    total_choice += N*(N-1)/2

if M > 1:
    total_choice += M*(M-1)/2

print(int(total_choice))