Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print((a+b)*h//2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)

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

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)
Buggy python submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())
print(K*X + (N-K)*Y)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N >= K:
    print(K*X + (N-K)*Y)
else:
    print(N*X)
Buggy python submission (verdict: Runtime Error):
N,X,T=[int(i) fir i in input().split()]
a=divmod(N,X)
x=a[0]
if a[1]<X and a[1] != 0:
  x += 1
print(x*T)

   

Fixed submission:
N,X,T=[int(i) for i in input().split()]
a=divmod(N,X)
x=a[0]
if a[1]<X and a[1] != 0:
  x += 1
print(x*T)
Buggy python submission (verdict: Runtime Error):
N=int(input())
D=int(input())
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)


Fixed submission:
N,D=[int(i) for i in input().split()]
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
D=int(input())
ans=0
for i in range(N):
  x,y=int(input()).split()
  if x*x + y*y <= D*D:
    ans +=1
print(ans)


Fixed submission:
N,D=[int(i) for i in input().split()]
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
D=int(input())
ans=0
for i in range(N):
  x,y=int(input()).split()
  if x*x + y*y <= D*D
  ans+=1
print(ans)

Fixed submission:
N,D=[int(i) for i in input().split()]
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
D=int(input())
count=0
a = list(map(int,input().strip().split()))[:N]
for i in range(len(a)):
  distance=((i[0]**2)+(i[1]**2))**0.5
  if distance>D:
    count+=1
print(count)

Fixed submission:
N,D=[int(i) for i in input().split()]
ans=0
for i in range(N):
  x,y=[int(i) for i in input().split()] 
  if x*x + y*y <= D*D:
      ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
S,T = input().split()
mm = 0
for i in range(len(S)-len(T)):
    a = S[i:i+len(T)]
    mm_now = sum([x == y for x,y in [*zip(a,T)]])
    mm = max(mm_now, mm)
print(len(T) - mm)


Fixed submission:
S = input()
T = input()
mm = 0
for i in range(len(S)-len(T)+1):
    a = S[i:i+len(T)]
    mm_now = sum([x == y for x,y in [*zip(a,T)]])
    mm = max(mm_now, mm)
print(len(T) - mm)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7

partial_sum = copy.deepcopy(A)
sum_now = A[N-1]
for j in range(N-2,-1,-1):
    sum_now = int((sum_now+A[j])%mod)
    partial_sum[j] = sum_now
res = 0
for i in range(N-1):
    res = (res + (A[i]*partial_sum[i+1])%mod) %mod
print(int(res))


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ans = 0
mod = 10**9+7
 
for i in range(n-1):
    s -= a[i]
    ans += a[i]*s
 
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [int(x)%(1e9+7) for x in input().split()]

# calculating array sum (a1 + a2 ... + an) 
array_sum = 0
for i in range(0, n, 1): 
    array_sum = (array_sum + A[i])%(1e9+7)

    # calcualting square of array sum 
    # (a1 + a2 + ... + an)^2 
    array_sum_square = (array_sum * array_sum)%(1e9+7)

# calcualting a1^2 + a2^2 + ... + an^2 
individual_square_sum = 0
for i in range(0, n, 1): 
    individual_square_sum += (A[i] * A[i])%(1e9+7)
    individual_square_sum = individual_square_sum%(1e9+7)

# required sum is (array_sum_square - individual_square_sum) / 2 
print (array_sum_square - individual_square_sum) / 2


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ans = 0
mod = 10**9+7
 
for i in range(n-1):
    s -= a[i]
    ans += a[i]*s
 
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(x) for x in input().split()]
assert(len(A) == N)
sum_now = 0
for i in range(N):
    for j in range(i+1,N):
        sum_now = (sum_now + A[i] * A[j]) % (1e9+7)
print(int(sum_now))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
ans = 0
mod = 10**9+7
 
for i in range(n-1):
    s -= a[i]
    ans += a[i]*s
 
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
x = input()
if x >= 30:
    print("Yes")
else:
    print("No")


Fixed submission:
x = input()
if int(x) >= 30:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
if S == "ABC":
    print(ARC)
else:
    print(ABC)

Fixed submission:
S = input()
if S == "ABC":
    print('ARC')
else:
    print('ABC')

Buggy python submission (verdict: Runtime Error):
S = input()
if S == ABC:
    print(ARC)
else:
    print(ABC)

Fixed submission:
S = input()
if S == "ABC":
    print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = 100
A = 0
While X < Y:
    Y *= 1.01
    A += 1
print(A)

Fixed submission:
x = int(input())
y = 100
a = 0
while y < x:
    y += y // 100
    a += 1
print(a)

Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = 100
A = 0
While X < Y:
    Y *= a * 1.01
    A += 1
print(A)

Fixed submission:
x = int(input())
y = 100
a = 0
while y < x:
    y += y // 100
    a += 1
print(a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t, a = int(input().split())
h = list(map(int, input().split()))

x = []

for i in h:
    b = t - 0.006 * j - a
    x.append(b)

print(x.index(min(x)))

Fixed submission:
n = int(input())
t, a = map(int, (input().split()))
h = list(map(int, input().split()))

x = []

for i in h:
    b = abs(t - 0.006 * i - a)
    x.append(b)

print(x.index(min(x)) + 1)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
count = 0

for i in a:
    if x >= a[min]:
        x -= i
        count += 1
    else:
        pass
        
print(count)

Fixed submission:
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0
for i in a:
    if x < i:
        break
    cnt += 1
    x -= i
else:
    if x > 0:
        cnt -= 1
print(cnt)

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

a.sort()
count = 0

while x > min(a):
for i in a:
    if x >= i:
        x -= i
        count += 1
    else:
        pass
        
print(count)

Fixed submission:
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0
for i in a:
    if x < i:
        break
    cnt += 1
    x -= i
else:
    if x > 0:
        cnt -= 1
print(cnt)

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

a.sort()
count = 0

while x > min(a):
    pass
for i in a:
    if x >= i:
        x -= i
        count += 1
    else:
        pass
        
print(count)

Fixed submission:
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
cnt = 0
for i in a:
    if x < i:
        break
    cnt += 1
    x -= i
else:
    if x > 0:
        cnt -= 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = n // 4
b = n // 7
count = 0

for i in range(a + 1):
    n = n - i * 4
    for j in range(b + 1):
        if 4 * i + 7 * j == n:
            print(yes)
            count += 1
            break
        else:
            pass

if count == 0:
    print("No")
else:
    pass

Fixed submission:
n = int(input())

count = 0

for i in range(26):
    for j in range(15):
        if 4 * i + 7 * j == n:
            count += 1
            break
        else:
            pass

if count == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n = int(input())
list = map(int,input().split())

list.sort()

answer = list[-1] - list[0]

print(answer)

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

x.sort()

answer = x[-1] - x[0]

print(answer)
Buggy python submission (verdict: Runtime Error):
abc = [int(input()) for i in range(3)]
x = int(input())

count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i + 100*j + 50*k == x:
                count += 1
print(count)

Fixed submission:
abc = [int(input()) for i in range(3)]
x = int(input())

count = 0

for i in range(abc[0] + 1):
    for j in range(abc[1] +1):
        for k in range(abc[2] +1):
            if 500*i + 100*j + 50*k == x:
                count += 1
print(count)
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())
if  (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = list(map(int, input().split()))

count = 0

for i in y:
    if i % 2 = 0:
        y[i] == i % 2
        count += 1
    else:
        pass
        


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

z = True
count = -1
while z == True:
    count += 1
    for i, j in enumerate(y):
        if j % 2 == 0:
            y[i] = j / 2
        else:
            z = False

print(count)
Buggy python submission (verdict: Runtime Error):
n = input()

f = False

x = sum(map(int,list(n)))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())

f = False

x = sum(list(map(int, str(n))))

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
15 14
50 26 27 21 41 7 42 35 7 5 5 36 39 1 45

Fixed submission:
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse = True)

length = sum(l[0 : k])

print(length)
Buggy python submission (verdict: Time Limit Exceeded):
c = input()
s = []
for i in c:
    s.append(i)

list_a = []
list_z = []

while "A" in s:
    list_a.append(s.index("A"))
    s[s.index("A")] = "b"

while "Z" in s:
    list_z.append(s.index("Z"))
    s[s.index("Z")] = "v"

answer = list_z[-1] - list_a[0] + 1
print(answer)
 

Fixed submission:
S = input()
print(S.rfind("Z") - S.find("A")+1)

Buggy python submission (verdict: Runtime Error):
c = input()
s = []
for i in c:
    s.append(i)

list_a = []
list_z = []

while "a" in s:
    list_a.append(s.index("a"))
    s[s.index("a")] = "b"

while "z" in s:
    list_z.append(s.index("z"))
    s[s.index("z")] = "v"

answer = list_z[-1] - list_a[0] + 1
print(answer)

Fixed submission:
S = input()
print(S.rfind("Z") - S.find("A")+1)
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

count = 0

for i in range(k + 1):
    for j in range(k + 1):
        for k in range(k + 1):
            if i + j + k == s:
                count += 1
            else:
                pass

print(count)

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

count = 0

for i in range(k + 1):
    for j in range(k + 1):
        if 0 <= s - i - j <= k:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
s = input()

list = ["dream", "dreamer", "erase", "eraser"]

for i in list:
    s = s.replace(i, "x")

s.sort()

if s[0] == s[-1] and s[-1] == "x":
    print("YES")
else:
    print("NO") 

Fixed submission:
s = input()
n = len(s)

list = ["dream", "dreamer", "erase", "eraser"]

s = s[::-1]

while True:
    if s.startswith(list[0][::-1]):
        n -= 5
        s = s[5:]
    elif s.startswith(list[1][::-1]):
        n -= 7
        s = s[7:]
    elif s.startswith(list[2][::-1]):
        n -= 5
        s = s[5:]
    elif s.startswith(list[3][::-1]):
        n -= 6
        s = s[6:]
    else:
        break

if s == "":
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
List = list(map(int, input().split()))
if sum(list) == 17 and List.count(5) == 2:
    print('YES')
else:
    print('NO')

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

if l == [5, 5, 7]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print(A*B/2)

Fixed submission:
A,B,C=map(int,input().split())
print(int(A*B/2))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
numbers = list(map(int, input().split()))
numbers = [i % 1000000007 for i in numbers]

sum = 0
for i in range(n):
    for j in range(i + 1, n):
        sum += numbers[i] * numbers[j]
        sum %= (1000000000 + 7)
print(sum)

Fixed submission:
n = int(input())
numbers = list(map(int, input().split()))
result = 0
sum_of_numbers = sum(numbers)
for i in range(n - 1):
    sum_of_numbers -= numbers[i]
    result += numbers[i] * sum_of_numbers
    result %= 1000000007
print(result)

Buggy python submission (verdict: Runtime Error):
# This is a sample Python script.

# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
import math
from functools import reduce

def gcd(numbers):
    return reduce(math.gcd, numbers)

n = int(input())
numbers = list(map(int, input().split())).sort()

for i in range(n):
    is_pair_wise_coprime = True
    for j in range(i + 1, n):
        if math.gcd(numbers[i], numbers[j]) != 1:
            is_pair_wise_coprime = False
            break
    if not is_pair_wise_coprime:
        break
else:
    print('pairwise coprime')
    exit(0)

if gcd(numbers) == 1:
    print('setwise coprime')
else:
    print('not coprime')

Fixed submission:
n = int(input())
numbers = list(map(int, input().split()))
result = 0
sum_of_numbers = sum(numbers)
for i in range(n - 1):
    sum_of_numbers -= numbers[i]
    result += numbers[i] * sum_of_numbers
    result %= 1000000007
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
numbers = list(map(int, input().split()))
 
sum = 0
for i in range(n):
    for j in range(i + 1, n):
        sum += numbers[i] * numbers[j]
        sum %= (1000000000 + 7)
print(sum)

Fixed submission:
n = int(input())
numbers = list(map(int, input().split()))
result = 0
sum_of_numbers = sum(numbers)
for i in range(n - 1):
    sum_of_numbers -= numbers[i]
    result += numbers[i] * sum_of_numbers
    result %= 1000000007
print(result)

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

sum = 0
for i in range(n):
    for j in range(i + 1, n):
        sum += numbers[i] * numbers[j]
        sum %= 1000000007
print(sum)


Fixed submission:
n = int(input())
numbers = list(map(int, input().split()))
result = 0
sum_of_numbers = sum(numbers)
for i in range(n - 1):
    sum_of_numbers -= numbers[i]
    result += numbers[i] * sum_of_numbers
    result %= 1000000007
print(result)

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

sum = 0
for i in range(n):
    for j in range(i + 1, n):
        sum += numbers[i] * numbers[j]
        sum %= (1000000000 + 7)
print(sum)

Fixed submission:
n = int(input())
numbers = list(map(int, input().split()))
result = 0
sum_of_numbers = sum(numbers)
for i in range(n - 1):
    sum_of_numbers -= numbers[i]
    result += numbers[i] * sum_of_numbers
    result %= 1000000007
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
#python3

#cups for water, spoons for sugar
cup1, cup2, spoon1, spoon2, max_density, max_volume = (int(x) for x in input().split())

possible_water_volumes = set()

for cups1_nr in range(0, 30):
    for cups2_nr in range(0, 30):
        curr_water_volume = cups1_nr * cup1 + cups2_nr * cup2
        if curr_water_volume <= max_volume and curr_water_volume != 0:
            possible_water_volumes.add(curr_water_volume)

global_optimal_sugar = 0
global_optimal_water = 0
global_dencity = 0            
for water_volume in possible_water_volumes:
    curr_optimal_sugar = water_volume * max_density
    for spoons1_nr in range(0, 1 + curr_optimal_sugar // spoon1):
        curr_sugar = spoon1 * spoons1_nr
        spoons2_nr = ((curr_optimal_sugar - curr_sugar) // spoon2)
        curr_sugar += spoon2 * spoons2_nr
        curr_density = curr_sugar / (water_volume * 100 + curr_sugar)
        if curr_sugar + water_volume * 100 > max_volume:
            continue
        elif curr_sugar > curr_optimal_sugar:
            continue
        elif curr_density >= global_dencity:
            # print(curr_sugar, water_volume)
            global_optimal_sugar = curr_sugar
            global_optimal_water = water_volume
            global_dencity = curr_density
            
sugar_water_volume = global_optimal_water * 100 + global_optimal_sugar
print(sugar_water_volume, global_optimal_sugar)
        
        

Fixed submission:
#python3

#cups for water, spoons for sugar
cup1, cup2, spoon1, spoon2, max_density, max_volume = (int(x) for x in input().split())

possible_water_volumes = set()

for cups1_nr in range(0, 30):
    for cups2_nr in range(0, 30):
        curr_water_volume = cups1_nr * cup1 + cups2_nr * cup2
        if curr_water_volume * 100 <= max_volume and curr_water_volume != 0:
            possible_water_volumes.add(curr_water_volume)

global_optimal_sugar = 0
global_optimal_water = cup1
global_dencity = 0            
for water_volume in possible_water_volumes:
    curr_optimal_sugar = min(water_volume * max_density, max_volume - water_volume * 100)
    for spoons1_nr in range(0, 1 + curr_optimal_sugar // spoon1):
        curr_sugar = spoon1 * spoons1_nr
        spoons2_nr = ((curr_optimal_sugar - curr_sugar) // spoon2)
        curr_sugar += spoon2 * spoons2_nr
        curr_density = curr_sugar / (water_volume * 100 + curr_sugar)
        if curr_sugar + water_volume * 100 > max_volume:
            continue
        elif curr_sugar > curr_optimal_sugar:
            continue
        elif curr_density > global_dencity:
            # print(curr_sugar, water_volume)
            global_optimal_sugar = curr_sugar
            global_optimal_water = water_volume
            global_dencity = curr_density
            
sugar_water_volume = global_optimal_water * 100 + global_optimal_sugar
print(sugar_water_volume, global_optimal_sugar)
Buggy python submission (verdict: Runtime Error):
N,X,T=map(int, raw_input().split())
mod=int((N/X))*T
if N%X!=0:
  print(mod)
else:
  print(mod+T)

Fixed submission:
n,x,t= map(int, input().split())
if n%x==0:
  print( int((n/x))*t )
else:
  print(int((n/x + 1))*(t))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, raw_input().split())
print(A*B)

Fixed submission:
A, B = map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print(A*B)

Fixed submission:
A, B = map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
print(int(int(input())*int(input())))

Fixed submission:
A, B = map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
print(int(input())*int(input()))

Fixed submission:
A, B = map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
return int(input())*int(input())

Fixed submission:
A, B = map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
return int(input()) * int(input())

Fixed submission:
A, B = map(int,input().split())
print(A*B)

Buggy python submission (verdict: Runtime Error):
return input() * input()

Fixed submission:
A, B = map(int,input().split())
print(A*B)
Buggy python submission (verdict: Runtime Error):
import numpy
N = int(input())
ls = input().split()
Mul = numpy.prod(ls)
if Mul < 10**18:
  print(Mul)
else:
  print("-1")

Fixed submission:
N = int(input())
ls = list(map(int,input().split()))
mul = 1
if 0 in ls:
    print(0)
else:
    for i in range(N):
        mul *= ls[i]
        if mul > 10**18:
            print(-1)
            quit()
    print(mul)
Buggy python submission (verdict: Runtime Error):
num = int(raw_input())
n = num % int(len(str(num)))
s1 = [2,4,5,7,9]
s2 = [0,1,6,8]
if n in s1:
  print("hon")
elif n in s2:
  print("pon")
else:
  print("bon")

Fixed submission:
num = input()
s1 = [2,4,5,7,9]
s2 = [0,1,6,8]
if int(num[int(len(str(num)))-1]) in s1:
  print("hon")
elif int(num[int(len(str(num)))-1]) in s2:
  print("pon")
else:
  print("bon")
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S))
  	if i <= K:
      print(S[i],end="")
    else:
      print("...")
      break

Fixed submission:
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S)):
    if i < K:
      print(S[i],end="")
    else:
      print("...")
      break

Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if int(len(S)) == K:
  print(S)
else:
  sth = S.split(S[K])
  print(sth[0]+"...")

Fixed submission:
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S)):
    if i < K:
      print(S[i],end="")
    else:
      print("...")
      break

Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
sth = S.split(S[K])
print(sth[0]+"...")

Fixed submission:
K = int(input())
S = input()
if int(len(S)) <= K:
  print(S)
else:
  for i in range(len(S)):
    if i < K:
      print(S[i],end="")
    else:
      print("...")
      break
Buggy python submission (verdict: Runtime Error):
x = int(input())
y = int(input())
z = int(input())

def swap(a,b):
  temp = a
  a = b
  b = temp
  return(a,b)

x,y = swap(x,y)
x,z = swap(x,z)
print(x,y,z)

Fixed submission:
x,y,z = list(map(int,input().split()))
 
def swap(a,b):
    temp = a
    a = b
    b = temp
    return (a,b)
 
x,y = swap(x,y)
x,z = swap(x,z)
print(x,y,z)
Buggy python submission (verdict: Runtime Error):
if S[0] != S[1] and S[0] != S[2]:
    print("Yes")
elif S[0] != S[1] and S[1] != S[2]:
    print("Yes")
else:
    print("No")


Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
S=input()
if S[1]!= S[2] and S[1]!=S[3]:
    print("Yes")
else:
    print("No")

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
if S[1]!= S[2] and S[1]!=S[3]:
    print("Yes")
else:
    print("No")

Fixed submission:
S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
def input_from_console():
    a, b, c, k = map(int, input().split())
    return a, b, c, k


def solve(a, b, c, k):
    all_list = [1] * a + [0] * b + [-1] * c
    return sum(all_list[0:k])


def main():
    a, b, c, k = input_from_console()
    print(solve(a, b, c, k))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()


Fixed submission:

def input_from_console():
    a, b, c, k = map(int, input().split())
    return a, b, c, k


def solve(a, b, c, k):
    sum = 0
    if k < a:
        return k
    else:
        k = k - a
        sum = a
    if k < b:
        return sum
    else:
        k = k - b
    sum -= k
    return sum

def main():
    a, b, c, k = input_from_console()
    print(solve(a, b, c, k))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  # Check if the python interpreter is in debug mode or not.
        check_cases()
    else:
        main()