Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
(h, w) = map(int, input().split(" "))

ans=[]
### case1  000
ans.append(0 if h%3==0 else w)
###case 2 tate 000
ans.append(0 if w%3==0 else h)

def getmin(h, w):
    area=9999999999999
    for i in range(1, h):
        for j in range(1, w):
            areas=[ i * w, j * (h-i), (w-j)*(h-i)]
            area = max(areas)-min(areas) if area > max(areas)-min(areas) else area
    return area

ans.append(getmin(h, w))
ans.append(getmin(w, h))

print(min(ans))


Fixed submission:
(h, w) = map(int, input().split(" "))

ans=[]
### case1  000
ans.append(0 if h%3==0 else w)
###case 2 tate 000
ans.append(0 if w%3==0 else h)

def getmin(h, w):
    area=9999999999999
    for i in range(h//3-3, h//3+2):
        for j in range(w//2 -3, w//2 +3):
            areas=[ i * w, j * (h-i), (w-j)*(h-i)]
            area = max(areas)-min(areas) if area > max(areas)-min(areas) else area
    return area

ans.append(getmin(h, w))
ans.append(getmin(w, h))

print(min(ans))

Buggy python submission (verdict: Runtime Error):
(h, w) = map(int, input().split(" "))

ans=[]
### case1  000
ans.append(0 if h%3==0 else w)
###case 2 tate 000
ans.append(0 if w%3==0 else h)

def getmin(h, w):
    area=9999999999999
    for i in range(h):
        for j in range(w):
            areas=[ i * w, j * (h-i), (w-j)*(h-i)]
            area = min(areas) if area > min(areas)
    return area

ans.append(getmin(h, w))
ans.append(getmin(w, h))

print(min(ans))


Fixed submission:
(h, w) = map(int, input().split(" "))

ans=[]
### case1  000
ans.append(0 if h%3==0 else w)
###case 2 tate 000
ans.append(0 if w%3==0 else h)

def getmin(h, w):
    area=9999999999999
    for i in range(h//3-3, h//3+2):
        for j in range(w//2 -3, w//2 +3):
            areas=[ i * w, j * (h-i), (w-j)*(h-i)]
            area = max(areas)-min(areas) if area > max(areas)-min(areas) else area
    return area

ans.append(getmin(h, w))
ans.append(getmin(w, h))

print(min(ans))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split(" "))

count = [0 for i in range(0,n)]

for i in range(0, m):
    a, b = map(int, input().split(" "))
    count[a] += 1
    count[b] += 1

for i in range(0, n):
    print(count[i])


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

count = [0 for i in range(0,n)]

for i in range(0, m):
    a, b = map(int, input().split(" "))
    count[a-1] += 1
    count[b-1] += 1

for i in range(0, n):
    print(count[i])

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split(" "))

count = [0 for i in range(0,n)]

for i in range(0, m):
    a, b = map(int, input().split(" "))
    count[a] L= 1
    count[b] += 1

for i in range(0, n):
    print(count[i])


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

count = [0 for i in range(0,n)]

for i in range(0, m):
    a, b = map(int, input().split(" "))
    count[a-1] += 1
    count[b-1] += 1

for i in range(0, n):
    print(count[i])
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split(" "))

nums=[]
for i in range(0, n):
    a, b = map(int, input().split(" "))
    nums.extend = [a for i in range(0, b)]
    nums.sort()

print(nums[k-1])


Fixed submission:
n, k = map(int, input().split(" "))
 
nums=[]
for i in range(0, n):
    a, b = map(int, input().split(" "))
    nums.append([a, b])

nums.sort(key=lambda x:x[0])
#print(nums)
sum = 0
for i in range(0, n):
    sum +=nums[i][1]
    if sum >= k:
        print(nums[i][0])
        break

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split(" "))

nums=[]
for i in range(0, n):
    a, b = map(int, input().split(" "))
    nums.extend = [a for i in range(0, b)]
    nums.sort()

print(nums[k-1])


Fixed submission:
n, k = map(int, input().split(" "))
 
nums=[]
for i in range(0, n):
    a, b = map(int, input().split(" "))
    nums.append([a, b])

nums.sort(key=lambda x:x[0])
#print(nums)
sum = 0
for i in range(0, n):
    sum +=nums[i][1]
    if sum >= k:
        print(nums[i][0])
        break
Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(1, N+1):
    if t[i] >= T:
        shower += T
    else:
        shower += t[i]

print(shower)


Fixed submission:
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(0, N-1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

shower += T
print(shower)

Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().filter(" "))
t = list(map(int, input().filter(" ")))

shower = 0

for i in range(1, N):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

print(shower)


Fixed submission:
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(0, N-1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

shower += T
print(shower)

Buggy python submission (verdict: Runtime Error):
N, T = map(int, input().filter(" "))
t = list(map(int, input().filter(" ")))

shower = 0

for i in range(1, N+1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

print(shower)


Fixed submission:
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(0, N-1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

shower += T
print(shower)

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


for i in range(1, c):
    if (a * i) % b == c:
        print("YES")
        break
else:
    print("NO")

a* (任意の整数) % b = cとできるか？


Fixed submission:
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(0, N-1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

shower += T
print(shower)
Buggy python submission (verdict: Runtime Error):
    s1, s2, s3 = input().split(" ")
     
    print(s1[0].upper()+s2[0].upper()+s3[0].upper())

Fixed submission:
s1, s2, s3 = input().split(" ")
    
print(s1[0].upper()+s2[0].upper()+s3[0].upper())

Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split(" ")

print(s1[0].upper()+s2[0].upper()s3[0].upper())

Fixed submission:
s1, s2, s3 = input().split(" ")
    
print(s1[0].upper()+s2[0].upper()+s3[0].upper())

Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split(" ")

print(s1[0].upper+s1[1:]+s2[0].upper+s2[1:]+s3[0].upper+s3[1:])


Fixed submission:
s1, s2, s3 = input().split(" ")
    
print(s1[0].upper()+s2[0].upper()+s3[0].upper())
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int(input().split(" ")));

if b-a == c-b:
    print("YES");
else:
    print("NO");


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

if b-a == c-b:
    print("YES");
else:
    print("NO");
Buggy python submission (verdict: Runtime Error):
from math import factorial

n, a, b = map(int, input().split(" "));
v = list(map(int, input().split(" ")))


def product(iterable):
    prod = 1
    for n in iterable:
        prod *= n
    return prod

def npr(n, r):
    return product(range(n - r + 1, n + 1))

def ncr(n, r):
    if r > n // 2:
        r = n - r
    return npr(n, r) // factorial(r)

v.sort();
revv=list(reversed(v))
print(sum(v[-a:])/a)

revpos=revv.index(v[-a]);
num=v.count(v[-a]);
ans=0;
for i in range(a-revpos, b-revpos+1):
    ans+=ncr(num, i);
print(ans);


Fixed submission:
a, b = map(int, input().split(" "));
print( (a+b) % 24);

Buggy python submission (verdict: Runtime Error):
import math;

n, m = map(int, input().split(" "));
ab = [];
for i in range(0, n):
    ab.append(input().split(" "));

cd = [];
for i in range(0, m):
    cd.append(input().split(" "));

for i in range(0, n):
    dist=9999999999999
    nearm=0;
    for j in range(0, m):
         dist2 = math.fabs(int(ab[i][0]) - int(cd[j][0])) + math.fabs(int(ab[i][1]) - int(cd[j][1]));
         if dist2 < dist:
            dist = dist2;
            nearm=j;
    print(nearm + 1);




Fixed submission:
a, b = map(int, input().split(" "));
print( (a+b) % 24);

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(" ");
print( (a+b) % 24)

Fixed submission:
a, b = map(int, input().split(" "));
print( (a+b) % 24);
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split(" "))

def abs(n):
    return n if n>0 else -n


for i in range(1, n+1):
    ab = list(map(int, input().split(" ")))
for j in range(1, m+1):
    cd = list(map(int, input().split(" ")))

for i in range(0, n):
    delta = 999999999999
    ans=0
    for j in range(0, m):
        newdelta = abs(ab[i][0]-cd[j][0]) + abs(ab[i][1]-cd[j][1])
        if delta>newdelta:
            delta=newdelta
            ans=j+1
    print(ans)



Fixed submission:
import math;

n, m = map(int, input().split(" "));
ab = [];
for i in range(0, n):
    ab.append(input().split(" "));

cd = [];
for i in range(0, m):
    cd.append(input().split(" "));

for i in range(0, n):
    dist=9999999999999
    nearm=0;
    for j in range(0, m):
         dist2 = math.fabs(int(ab[i][0]) - int(cd[j][0])) + math.fabs(int(ab[i][1]) - int(cd[j][1]));
         if dist2 < dist:
            dist = dist2;
            nearm=j;
    print(nearm+1);
Buggy python submission (verdict: Runtime Error):
nums = map(int, input().split())
if nums[0] * nums[1] % 2:
  return "Yes"
return "No"

Fixed submission:
numbers = input()
num_a = int(numbers.split()[0])
num_b = int(numbers.split()[1])
if (num_a * num_b) % 2 == 0:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
if a * b % 2:
  return "Yes"
return "No"

Fixed submission:
numbers = input()
num_a = int(numbers.split()[0])
num_b = int(numbers.split()[1])
if (num_a * num_b) % 2 == 0:
  print("No")
else:
  print("Yes")

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

Fixed submission:
numbers = input()
num_a = int(numbers.split()[0])
num_b = int(numbers.split()[1])
if (num_a * num_b) % 2 == 0:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
c = int(input())
w = []
for i in range(c):
  w.append(input())
if len(set(w)) != len(w):
  print("No")
  return
for i in range(len(w) - 1):
  if w[i][-1] != w[i+1][0]:
    print("No")
    return
print("Yes")

Fixed submission:
falsify = "Yes"
c = int(input())
w = []
for i in range(c):
  w.append(input())
if len(set(w)) != len(w):
  falsify = "No"
for i in range(len(w) - 1):
  if w[i][-1] != w[i+1][0]:
    falsify = "No"
print(falsify)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input()split())
A=abs(a-b)
B=abs(b-c)
C=abs(c-a)
if (C<=d) or (A<=d and B<=d):
  print("Yes")
else:
  print("No")

Fixed submission:
a,b,c,d=map(int,input().split())
A=abs(a-b)
B=abs(b-c)
C=abs(c-a)
if (C<=d) or (A<=d and B<=d):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=[int(i) for i in input().split()]
for i in range(N):
  x=X.copy()
  del x[i]
  x.sort()
  print(x[N//2-1])

Fixed submission:
A, B, X=map(int,input().split())
if A<=X<=(A+B):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=[int(i) for i in input().split()]
for i in range(N):
  x=X.copy()
  del x[i]
  x.sort()
  print(x[N//2-1])

Fixed submission:
N=int(input())
X=[int(i) for i in input().split()]
x=X.copy()
x.sort()
mina=x[N//2-1]
minb=x[N//2]
for i in range(N):
  if mina<X[i]:
    print(mina)
  else :
    print(minb)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=[int(i) for i in input().split()]
for i in range(N):
  x=X.copy()
  del x[i]
  x.sort()
  print(x[N//2-1])
  

Fixed submission:
N=int(input())
X=[int(i) for i in input().split()]
x=X.copy()
x.sort()
mina=x[N//2-1]
minb=x[N//2]
for i in range(N):
  if mina<X[i]:
    print(mina)
  else :
    print(minb)
Buggy python submission (verdict: Runtime Error):
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
money=0
for i in range(N+1):
  money+=abs(list_A[i+1]-list_B[i])
for i in range(1,N+1):
  Money=money-abs(list_A[i]-list_A[i-1])-abs(list_A[i+1]-list_A[i])+abs(list_A[i+1]-list_A[i-1])
  print(Money)
    

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
if A<=B:
  min1=A
else:
  min1=B
if C<=D:
  min2=C
else:
  min2=D
  
print(min1+min2)

Buggy python submission (verdict: Runtime Error):
N=int(input())
D=int(input())
X=int(input())
S=0
for i in range(1,N):
  A=int(input())
  A_=(D//A)+1
  S+=A_
print(S+X) 


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
if A<=B:
  min1=A
else:
  min1=B
if C<=D:
  min2=C
else:
  min2=D
  
print(min1+min2)

Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
D=input()
if A<=B:
  min1=int(A)
else:
  min1=int(B)
if C<=D:
  min2=int(C)
else:
  min2=int(D)
  
print(min1+min2+"\n")


Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
if A<=B:
  min1=A
else:
  min1=B
if C<=D:
  min2=C
else:
  min2=D
  
print(min1+min2)

Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
D=input()
if A<=B:
  min1=int(A)
else:
  min1=int(B)
if C<=D:
  min2=int(C)
else:
  min2=int(D)
min_=min1+min2
print(int(min)_)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())
if A<=B:
  min1=A
else:
  min1=B
if C<=D:
  min2=C
else:
  min2=D
  
print(min1+min2)
Buggy python submission (verdict: Runtime Error):
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
money=0
for i in range(N+1):
  money+=abs(list_A[i+1]-list_B[i])
for i in range(1,N+1):
  Money=money-abs(list_A[i]-list_A[i-1])-abs(list_A[i+1]-list_A[i])+abs(list_A[i+1]-list_A[i-1])
  print(Money)
    

Fixed submission:
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
money=0
for i in range(N+1):
  money+=abs(list_A[i+1]-list_A[i])
for i in range(1,N+1):
  Money=money-abs(list_A[i]-list_A[i-1])-abs(list_A[i+1]-list_A[i])+abs(list_A[i+1]-list_A[i-1])
  print(Money)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.append(0)
for i in range(1,N+1):
  money=0
  list_B=list_A.copy()
  del list_B[i]
  for k in range(1,N+1):
    money+=abs(list_B[k]-list_B[k-1])
  print(money)
    

Fixed submission:
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
money=0
for i in range(N+1):
  money+=abs(list_A[i+1]-list_A[i])
for i in range(1,N+1):
  Money=money-abs(list_A[i]-list_A[i-1])-abs(list_A[i+1]-list_A[i])+abs(list_A[i+1]-list_A[i-1])
  print(Money)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
for i in range(1,N+1):
  money=0
  list_B=list_A.copy()
  del list_B[i]
  for k in range(1,N+1):
    money+=abs(list_B[k]-list_B[k-1])
  print(money)
    

Fixed submission:
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
money=0
for i in range(N+1):
  money+=abs(list_A[i+1]-list_A[i])
for i in range(1,N+1):
  Money=money-abs(list_A[i]-list_A[i-1])-abs(list_A[i+1]-list_A[i])+abs(list_A[i+1]-list_A[i-1])
  print(Money)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
for i in range(1,N+1):
  money=0
  list_B=list_A.copy()
  del list_B[i]
  for k in range(1,N+1):
    money+=abs(list_B[k]-list_B[k-1])
  print(money)
    

Fixed submission:
N=int(input())
list_A=[int(A) for A in input().split()]
list_A.insert(0,0)
list_A.insert(N+1,0)
money=0
for i in range(N+1):
  money+=abs(list_A[i+1]-list_A[i])
for i in range(1,N+1):
  Money=money-abs(list_A[i]-list_A[i-1])-abs(list_A[i+1]-list_A[i])+abs(list_A[i+1]-list_A[i-1])
  print(Money)
Buggy python submission (verdict: Runtime Error):
N=int(input())
r=0
W=[]
for i in range(N):
    W.append(input())

for i in range(N-1):
    if W[i+1][0]!=W[i][-1]:
        r = r+1
for i in range(N):
    for p in range(N):
        if W[i]==W[p]:
            r = r+1
if r == N:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b=list(map(int,input().split()))
if a%2==1 and b%2==1:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
S=input()
K=int(input())
l=len(S)
r=0
q=0
if l==1:
    print(int(S))
else:
    for i in range(0,l-1):
        if int(S[i]) != 1:
            r=int(S[i])
            q=i
            break
    if q>K:
        print(1) 
    else:
        print(r)

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

Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
if a>1 and b>1:
  C=(a-1)*(b-1)
else:
  break
print(C)

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

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())
if A>1 and B>1:
  C=(A-1)*(B-1)
else:
  break
print(C)

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

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A=int(input())
B=int(input())
C=(A-1)*(B-1)
print("{}".format(C))

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

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
A=int(input())
B=int(input())
C=(A-1)*(B-1)
print(C)

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

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

Fixed submission:
A,B=list(map(int,input().split()))
C=(A-1)*(B-1)
print(C)
Buggy python submission (verdict: Runtime Error):
a, b = (int(i) for i in input().split())  
if a%2 and b%2:
  	print("Yes")
  else:
    print("No")

Fixed submission:
a, b = (int(i) for i in input().split())
if a % 2 and b % 2:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
l = map(int, input().split())
a = l[0] * l[1]
if a % 2 == 0:
    print("No")
else:
    print("Yes")

Fixed submission:
import sys
l = list(map(int, input().split()))
if (l[0] * l[1]) % 2 == 0:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
import sys
l = map(int, raw_input().split())
if (l[0] * l[1]) % 2 == 0:
    print("No")
else:
    print("Yes")

Fixed submission:
import sys
l = list(map(int, input().split()))
if (l[0] * l[1]) % 2 == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
def is_even(a):
    return [ai%2 == 0 for ai in a]

N = int(raw_input())
a = [int(s) for s in raw_input().split()]

counter = 0
any_even = is_even(a)

while sum(any_even) > 0:
    even_min_idx, eve_min = min([(i, a[i]) for i in range(N) if any_even[i]])

    for i in range(N):
        if a[i] % 2 == 1:
            a[i] = 3*a[i]
        elif i == even_min_idx:
            a[i] /= 2
        else:
            a[i] *= 3
    counter += 1
    any_even = is_even(a)

print counter

Fixed submission:
def is_even(a):
    return [ai%2 == 0 for ai in a]

def extract_2(ai):
    n = 0
    while ai % 2 == 0:
        ai /= 2
        n += 1
    return n

N = int(raw_input())
a = [int(s) for s in raw_input().split()]

any_even = is_even(a)

evens = [extract_2(a[i]) for i in range(N) if any_even[i]]
print sum(evens)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = [int(i) for i in raw_input()]
if abs(c-a) <= d or (abs(b-a) <= d and abs(c-b) <= d):
    print "Yes"
else:
    print "No"

Fixed submission:
a, b, c, d = [int(i) for i in raw_input().split()]
if abs(c-a) <= d or (abs(b-a) <= d and abs(c-b) <= d):
    print "Yes"
else:
    print "No"
Buggy python submission (verdict: Runtime Error):
a, b, k = [int(c) for c in raw_input().split()]
data = []

for i in range(k):
    data.append(a+i)
for i in range(k-1, -1, -1):
    if b-i <= data[-1]: continue
    data.append(b-i)
print " ".join(str(d) for d in data)

Fixed submission:
inp = raw_input()

c = set([i for i in inp])
if len(c) == 3:
    print "Yes"
else:
    print "No"

Buggy python submission (verdict: Runtime Error):
a, b, k = [int(c) for c in raw_input().split()]
data = []

for i in range(k):
    data.append(a+i)
for i in range(k-1, -1, -1):
    if b-i <= data[-1]: continue
    data.append(b-i)
print " ".join(str(d) for d in data)

Fixed submission:
inp = raw_input()

c = set([i for i in inp])
if len(c) == 3:
    print "Yes"
else:
    print "No"

Buggy python submission (verdict: Runtime Error):
inp = raw_input()

c = set([i for i in c])
if len(c) == 3:
    print "Yes"
else:
    print "No"

Fixed submission:
inp = raw_input()

c = set([i for i in inp])
if len(c) == 3:
    print "Yes"
else:
    print "No"
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))

s = 0
while True:
    divided = False
    for i in range(n):
        if a[i] % 2 == 0:
            a[i] //= 2
            divided = True
            break
    if divided:
        s += 1
    else:
        break
print(s)


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

s = 0
for i in range(n):
    while a[i] % 2 == 0:
        a[i] //= 2
        s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]

d = [
        [
            [
                [
                    [None] * 2 for _ in range(2)
                ] for _ in range(2)
            ] for _ in range(m+1)
        ] for _ in range(n)
    ]

def rec(i, j, p):
    if i >= n or j <= 0:
        return 0

    if d[i][j][p[0]][p[1]][p[2]]:
        return d[i][j][p[0]][p[1]][p[2]]

    res1 = rec(i+1, j, p)
    res2 = rec(i+1, j-1, p)
    res2 += a[i][0] * (-1 if p[0] else 1)
    res2 += a[i][1] * (-1 if p[1] else 1)
    res2 += a[i][2] * (-1 if p[2] else 1)

    res = max(res1, res2)
    d[i][j][p[0]][p[1]][p[2]] = res
    return res

res = 0
for p0 in range(2):
    for p1 in range(2):
        for p2 in range(2):
            t = rec(0, m, [p0, p1, p2])
            if t > res:
                res = t
print(res)


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

r = [[0]*n for _ in range(8)]
for i in range(n):
    x, y, z = map(int, input().split())
    r[0][i] = x+y+z
    r[1][i] = x+y-z
    r[2][i] = x-y+z
    r[3][i] = x-y-z
    r[4][i] = -x+y+z
    r[5][i] = -x+y-z
    r[6][i] = -x-y+z
    r[7][i] = -x-y-z

print(max(sum(sorted(r[i])[-m:]) for i in range(8)) if m != 0 else 0)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]

d = [
        [
            [
                [
                    [None] * 2 for _ in range(2)
                ] for _ in range(2)
            ] for _ in range(m+1)
        ] for _ in range(n)
    ]

def rec(i, j, p):
    if i >= n or j <= 0:
        return 0

    if d[i][j][p[0]][p[1]][p[2]]:
        return d[i][j][p[0]][p[1]][p[2]]

    res1 = rec(i+1, j, p)
    res2 = rec(i+1, j-1, p)
    res2 += a[i][0] * (-1 if p[0] else 1)
    res2 += a[i][1] * (-1 if p[1] else 1)
    res2 += a[i][2] * (-1 if p[2] else 1)

    res = max(res1, res2)
    d[i][j][p[0]][p[1]][p[2]] = res
    return res

results = []

for p0 in range(2):
    for p1 in range(2):
        for p2 in range(2):
            results.append(rec(0, m, [p0, p1, p2]))
print(max(results))


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

r = [[0]*n for _ in range(8)]
for i in range(n):
    x, y, z = map(int, input().split())
    r[0][i] = x+y+z
    r[1][i] = x+y-z
    r[2][i] = x-y+z
    r[3][i] = x-y-z
    r[4][i] = -x+y+z
    r[5][i] = -x+y-z
    r[6][i] = -x-y+z
    r[7][i] = -x-y-z

print(max(sum(sorted(r[i])[-m:]) for i in range(8)) if m != 0 else 0)