Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
A = map(int, raw_input().split())
D = dict()
for a in A:
   if not a in D:
      D[a] = 0
   D[a] += 1

total = 0
for num, count in D.iteritems():
   if count > 1: total += count - 1
if total % 2 != 0: total += 1
print (N - total)

Fixed submission:
X = int(raw_input())
minZ = (X / 11)*2
remainder = X % 11
if remainder == 0:
   print minZ
elif remainder > 6:
   print minZ+2
else:
   print minZ+1

Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
A = map(int, raw_input().split())
D = dict()
for a in A:
   if a not in D:
      D[a] = 0
   D[a] += 1

total = 0
for num, count in D.iteritems():
   if count > 1: total += count - 1
if total % 2 != 0: total += 1
print N - total

Fixed submission:
X = int(raw_input())
minZ = (X / 11)*2
remainder = X % 11
if remainder == 0:
   print minZ
elif remainder > 6:
   print minZ+2
else:
   print minZ+1
Buggy python submission (verdict: Runtime Error):
R = input()

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Fixed submission:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')
Buggy python submission (verdict: Runtime Error):
n = int(input())
i = n % 2

if i == 0:
  print(n)
else
  print(n*2)

Fixed submission:
n = int(input())
i = n % 2
 
if i == 0:
  print(n)
else:
  print(n*2)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = list(map(int, input().split()))
l = a+b
r = c+d
if l > r: print('Left')
elif: l < r: print('Right')
else: print('Balanced')

Fixed submission:
a, b, c, d = list(map(int, input().split()))
l = a+b
r = c+d
if l > r: print('Left')
elif l < r: print('Right')
else: print('Balanced')

Buggy python submission (verdict: Runtime Error):
a, b, c, d = list(map(int, input().split())
l = a+b
r = c+d
if l > r: print('Left')
elif: l < r: print('Right')
else: print('Balanced')

Fixed submission:
a, b, c, d = list(map(int, input().split()))
l = a+b
r = c+d
if l > r: print('Left')
elif l < r: print('Right')
else: print('Balanced')
Buggy python submission (verdict: Runtime Error):
n = input()
if n < 1200:
    print ("ABC")
elif n < 2800:
    print ("ARC")
else:
    print ("AGC")

Fixed submission:
n = int(input())
if n < 1200:
    print ("ABC")
elif n < 2800:
    print ("ARC")
else:
    print ("AGC")

Buggy python submission (verdict: Runtime Error):
R = input()
if R < 1200:
	print('ABC')
elif R < 2800:
	print('ARC')
else:
	print('AGC')


Fixed submission:
R = int(input())
if R < 1200:
	print('ABC')
elif R < 2800:
	print('ARC')
else:
	print('AGC')
Buggy python submission (verdict: Runtime Error):
A, B = map(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: Time Limit Exceeded):
N = int(input())
S = input()

print(min([S[:i].count('W')+S[(i+1):].count('E') for i in range(N)]))

Fixed submission:
N = int(input())
S = input()
cumE = [0 for i in range(N+1)]

for i in range(N):
    if S[i] == "E":
        cumE[i+1] = cumE[i] + 1
    else:
        cumE[i+1] = cumE[i]

cumW = [i - cumE[i] for i in range(N)]
cumE2 = [cumE[N] - cumE[i+1] for i in range(N)]
print(min([cumW[i] + cumE2[i] for i in range(N)]))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
K = int(input())
M = max([A, B, C])
print(M ** K + A + B+ C - M)

Fixed submission:
a,b=map(int,input().split())
if b<a:
 print(a-1)
else:
 print(a)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
s = [['.' for i in range(H+2)] for j in range(W+2)]
f=0
for i in range(H):
 s[i+1] = ['.'] + list(input()) + ['.']
for i in range(H+2):
 if f == 0:
  for j in range(W+2):
   if s[i][j] == '#':
    if s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and s[i][j+1] == '.':
     f = 1
     print('No')
     break
if f == 0:
 print('Yes')

Fixed submission:
H,W=map(int,input().split())
s = [['.' for i in range(W+2)] for j in range(H+2)]
f=0
for i in range(H):
 s[i+1] = ['.'] + list(input()) + ['.']
for i in range(H+2):
 if f == 0:
  for j in range(W+2):
   if s[i][j] == '#':
    if s[i-1][j] == '.' and s[i+1][j] == '.' and s[i][j-1] == '.' and s[i][j+1] == '.':
     f = 1
     print('No')
     break
if f == 0:
 print('Yes')
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split(' ')]
for i in range(10**9):
 if sum([i%2 for i in A])>0:
  print(i)
  break
 else: A = [i/2 for i in A]

Fixed submission:
import numpy
S = input()
print(numpy.array([i=='1' for i in S]).sum())

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split(' ')]
for i in range(N):
 if sum([i%2 for i in A])>0:
  print(i)
  break
 else: A = [i//2 for i in A]

Fixed submission:
import numpy
S = input()
print(numpy.array([i=='1' for i in S]).sum())

Buggy python submission (verdict: Runtime Error):
S = raw_input()
(S == '1').sum()

Fixed submission:
import numpy
S = input()
print(numpy.array([i=='1' for i in S]).sum())
Buggy python submission (verdict: Runtime Error):
ia = input()
a = int(ia)
ib = input()
b = int(ib)

ansP = a+b
ansS = a-b
ansM = a*b

max1 = max(ansP,ansS)
max2 = max(max1, ansM)
print(max2)

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

print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b, c = map(int, input().split())
s = input()
print("{} {}".format(a+b+c, s))

Fixed submission:
a, b = map(int, input().split())
if a*b % 2:
  print("Odd")
else:
  print("Even")
Buggy python submission (verdict: Runtime Error):
import math

n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Fixed submission:
print(input().count("1"))
Buggy python submission (verdict: Runtime Error):
c = a * b
if c % 2 == 0:
    print("Even")
else:
    print("odd")

Fixed submission:
#入力を受け取る
a,b = map(int, input().split())

c = a*b

if c % 2 == 0:
    print("Even")
else:
    print("Odd")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split(" ")))
#n=6
#a=[1,3,-4,2,2,-2]
c=0
s=[0 for i in range(n+1)]
for i in range(1,n+1):
  s[i]=s[i-1]+a[i-1]
for i in range(n):
  for j in range(i+1,n+1):
    if (s[j]-s[i])==0:
      c+=1
print(c)

Fixed submission:
import collections

n=int(input())
a=list(map(int,input().split(" ")))
#n=5
#a=[1,-2,3,-4,5]
s=[0 for i in range(n+1)]
for i in range(1,n+1):
  s[i]=s[i-1]+a[i-1]
c=collections.Counter(s).most_common()
d=0
for i in c:
  if i[1]<2:
    break
  d+=i[1]*(i[1]-1)//2
print(d)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split(" ")))
#n=7
#a=[1,-1,1,-1,1,-1,1]
c=0
for i in range(n):
  for j in range(i+1,n+1):
    if sum(a[i:j])==0:
      c+=1
print(c)

Fixed submission:
import collections

n=int(input())
a=list(map(int,input().split(" ")))
#n=5
#a=[1,-2,3,-4,5]
s=[0 for i in range(n+1)]
for i in range(1,n+1):
  s[i]=s[i-1]+a[i-1]
c=collections.Counter(s).most_common()
d=0
for i in c:
  if i[1]<2:
    break
  d+=i[1]*(i[1]-1)//2
print(d)
Buggy python submission (verdict: Runtime Error):
import copy

N=int(input())
X=list(map(int,input().split(" ")))
Y=copy.deepcopy(X)
Y.sort()
Y1=Y[:N//2]
Y2=Y[N//2:]
a=Y[N//2]
b=Y[N//2-1]
for i in X:
  if i in Y1:
    print(a)
  else:
    print(b)

Fixed submission:
A,B,X=list(map(int,input().split(" ")))
if A<=X and X<=A+B:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
A,B,C=list(map(int,input().split(" ")))
if B>=X:
  print("YES")
else:
  print("NO")

Fixed submission:
A,B,X=list(map(int,input().split(" ")))
if A<=X and X<=A+B:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import copy

N=int(input())
X=list(map(int,input().split(" ")))
Y=copy.deepcopy(X)
Y.sort()
Y1=Y[:N//2]
Y2=Y[N//2:]
a=Y[N//2]
b=Y[N//2-1]
for i in X:
  if i in Y1:
    print(a)
  else:
    print(b)

Fixed submission:
import copy

N=int(input())
X=list(map(int,input().split(" ")))
Y=copy.deepcopy(X)
Y.sort()
a=Y[N//2]
b=Y[N//2-1]
for i in X:
  if i<=b:
    print(a)
  else:
    print(b)

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

N=int(input())
X=list(map(int,input().split(" ")))
for i in range(N):
  Y=copy.deepcopy(X)
  Y.pop(i)
  Y.sort()
  print(Y[(N-1)//2])

Fixed submission:
import copy

N=int(input())
X=list(map(int,input().split(" ")))
Y=copy.deepcopy(X)
Y.sort()
a=Y[N//2]
b=Y[N//2-1]
for i in X:
  if i<=b:
    print(a)
  else:
    print(b)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math

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

#n=5
#a=[6,9,4,2,11]

b=list(itertools.combinations(a,2))
c=[]
for bi in b:
  bl=list(bi)
  bl.sort()
  c1=[0 for i in range(bl[1])] 
  c4=len(list(itertools.combinations(c1,bl[0])))
  c.append([c4,bl[1],bl[0]])
c.sort()
print(c[len(c)-1][1],c[len(c)-1][2])

Fixed submission:
import itertools
import math

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

#n=5
#a=[6,9,4,2,11]

a1=max(a)
a.remove(a1)
a2=a1/2
b=[]
for i in a:
  b.append(abs(i-a2))

print(a1,a[b.index(min(b))])

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import math

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

#n=5
#a=[6,9,4,2,11]

b=list(itertools.combinations(a,2))
c=[]
for bi in b:
  bl=list(bi)
  bl.sort()
  c1=math.factorial(bl[1])
  c2=math.factorial(bl[0])
  c3=math.factorial(bl[1]-bl[0])
  c4=c1//c3//c2
  c.append([c4,bl[1],bl[0]])
c.sort()
print(c[len(c)-1][1],c[len(c)-1][2])
  

Fixed submission:
import itertools
import math

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

#n=5
#a=[6,9,4,2,11]

a1=max(a)
a.remove(a1)
a2=a1/2
b=[]
for i in a:
  b.append(abs(i-a2))

print(a1,a[b.index(min(b))])
Buggy python submission (verdict: Runtime Error):
N=int(input())
D,X=list(map(int,input().split(" ")))
A=[]

for i in range(N):
  A.append(int(input()))

S=0
  
for i in range(N):
  for j in range(100):
    if (1+j*A[i])>D:
      S+=j
      break
  
print(S+X)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())

S=0

if A>=B:
  S+=B
else:
  S+=A

if C>=D:
  S+=D
else:
  S+=C

print(S)

Buggy python submission (verdict: Runtime Error):
N=int(input())
D,X=list(map(int,input().split(" ")))
A=[]

for i in range(N):
  A.append(int(input()))

S=0
  
for i in range(N):
  for j in range(1000):
    if (1+j*A[i])>D:
      S+=j
      break
  
print(S+X)

Fixed submission:
A=int(input())
B=int(input())
C=int(input())
D=int(input())

S=0

if A>=B:
  S+=B
else:
  S+=A

if C>=D:
  S+=D
else:
  S+=C

print(S)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from queue import *


class Edge(object):
    def __init__(self, dst, len_):
        self.dst = dst
        self.len = len_


MAX_K = int(1e5 + 5)
INF = int(1e9)

K = 0
dis = [INF for i in range(0, MAX_K)]
vis = [False for i in range(0, MAX_K)]
edge = [[] for i in range(0, MAX_K)]
q = Queue()


def add(s, t, d):
    edge[s].append(Edge(t, d))


def build():
    for i in range(1, K):
        add(i, i * 10 % K, 0)
        add(i, (i + 1) % K, 1)


def spfa(s):
    dis[s] = 0
    q.put(s)
    while not q.empty():
        x = q.get()
        vis[x] = False
        for e in edge[x]:
            if dis[e.dst] > dis[x] + e.len:
                dis[e.dst] = dis[x] + e.len
                if not vis[e.dst]:
                    q.put(e.dst)
                    vis[e.dst] = True


if __name__ == "__main__":
    K = int(input())
    build()
    spfa(1)
    print(dis[0] + 1)


Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

from queue import *


class Edge(object):
    def __init__(self, dst, len_):
        self.dst = dst
        self.len = len_


MAX_K = int(1e5 + 5)
INF = int(1e9)

K = 0
dis = [INF for i in range(0, MAX_K)]
vis = [False for i in range(0, MAX_K)]
edge = [[] for i in range(0, MAX_K)]
q = PriorityQueue()


def add(s, t, d):
    edge[s].append(Edge(t, d))


def build():
    for i in range(1, K):
        add(i, i * 10 % K, 0)
        add(i, (i + 1) % K, 1)


def dij(s):
    dis[s] = 0
    q.put((0, s))
    while not q.empty():
        x = q.get()[1]
        if vis[x]:
            continue
        vis[x] = True
        for e in edge[x]:
            if dis[e.dst] > dis[x] + e.len:
                dis[e.dst] = dis[x] + e.len
                q.put((dis[e.dst], e.dst))


if __name__ == "__main__":
    K = int(input())
    build()
    dij(1)
    print(dis[0] + 1)
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
l=list(map(lambda x:int(x),input().split(' ')))
l=[l[i]-(i+1) for i in range(N)]
dl=collections.Counter(l)
ans=[0]*(len(dl)//2)
for i in range(len(dl)//2):
    k=dl.most_common()[i][0] 
    k*=-1
    ans[i]=sum([abs(l[j]+k) for j in range(N)])
print(min(ans))

Fixed submission:
d=int(input())
if d%2==0:
    print(d)
else:
    print(2*d)
Buggy python submission (verdict: Runtime Error):
data = list(map(lambda x :int(x), input().strip().split())
res = data[0]*data[1]%2
if res ==0:
	print("Even")
else:
   print("Odd")

Fixed submission:
data = list(map(lambda x:int(x),input().strip().split()))
res = data[0]*data[1]%2
if res ==0:
  print("Even")
else:
  print("Odd")

Buggy python submission (verdict: Runtime Error):
in = map(int(),input().strip().split(" "))
res = in[0] * in [1] %2
if res ==0:
  print("Even")
else:
  print("Odd")
 

Fixed submission:
data = list(map(lambda x:int(x),input().strip().split()))
res = data[0]*data[1]%2
if res ==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[]
for i in range(n):
  li[i]=int(input())
print(len(list(set(li))))

Fixed submission:
n=int(input())
li=[0]*n
for i in range(n):
  li[i]=int(input())
print(len(list(set(li))))
Buggy python submission (verdict: Runtime Error):
data = list(lambda x:int(x),input().strip().split())
print(sum(data))

Fixed submission:
print(sum(list(map(lambda x:int(x),list(input().strip())))))
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
data = list(map(lambda x :int(x)%2,input().strip().split()))
res = sum(data)
if res >=1:
  print(0)
else:
  data.sort()
  tmp = data[0]
  cnt = 0
  while tmp!=1:
    tmp/=2
    cnt+=1
  print(cnt)

Fixed submission:
N = input()
data = list(map(lambda x :int(x),input().strip().split()))
data.sort()
tmp = data[0]
cnt =0
while tmp >1:
    if sum(list(map(lambda x:x%(2**(cnt+1)), data))) >= 1:break
    tmp//=2
    cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = input()
data = list(map(lambda x :int(x)%2,input().strip().split()))
res = sum(data)
if res ==1:
  print(0)
else:
  data.sort()
  tmp = data[0]
  cnt = 0
  while tmp!=1:
    tmp/=2
    cnt+=1
  print(cnt)

Fixed submission:
N = input()
data = list(map(lambda x :int(x),input().strip().split()))
data.sort()
tmp = data[0]
cnt =0
while tmp >1:
    if sum(list(map(lambda x:x%(2**(cnt+1)), data))) >= 1:break
    tmp//=2
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N = input()
data = list(map(lambda x :int(x)%2,input().strip().split("")))
res = sum(data)
if res ==1:
  print(0)
else:
  data.sort()
  tmp = data[0]
  cnt = 0
  while tmp!=1:
    tmp/=2
    cnt+=1
  print(cnt)

Fixed submission:
N = input()
data = list(map(lambda x :int(x),input().strip().split()))
data.sort()
tmp = data[0]
cnt =0
while tmp >1:
    if sum(list(map(lambda x:x%(2**(cnt+1)), data))) >= 1:break
    tmp//=2
    cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

def main(N, a):
    m = getlcm(N, a) - 1
    f = 0
    for i in range(N):
        f += m % a[i]
    print(f)

def getlcm(N, a):
    l = 1
    for i in range(N):
        l = l * a[i] // math.gcd(l, a[i])
    return l
    
if __name__ == '__main__':
    N = int(input())
    a = [int(i) for i in input().split()]

    main(N, a)


Fixed submission:
def main(N, a):
    m = getlcm(N, a) - 1
    f = 0
    for i in range(N):
        f += m % a[i]
    print(f)

def getlcm(N, a):
    l = 1
    for i in range(N):
        l = l * a[i] // gcd_(l, a[i])
    return l

def gcd_(a, b):
    if b == 0:
        return a
    else:
        a %= b
        a, b = b, a
        return gcd_(a, b)

if __name__ == '__main__':
    N = int(input())
    a = [int(i) for i in input().split()]

    main(N, a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))


for i in range(N):
    A[i] -= i + 1
    
A.sort()

min = A[int(N/2)]
max = A[int(N/2)+1]+1
sad = 2e15
for b in range(min, max):
    s = 0
    for i in range(N):
        s += abs(A[i] - b)

    if s < sad:
        sad = s

print("{}".format(sad))    


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

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

b = int(statistics.median(A))
sad = 0
for i in A:
    sad += abs(i - b)
print(sad)
Buggy python submission (verdict: Runtime Error):
def sum_axis(input_list):
    x_sum, y_sum, z_sum = 0, 0, 0
    for i in input_list:
        x_sum += i[0]
        y_sum += i[1]
        z_sum += i[2]

    return x_sum, y_sum, z_sum

N, M = map(int, input().split(' '))

if M == 0:
    print(0)
    exit()

xyz = []
for i in range(N):
    xyz.append(list(map(int, input().split(' '))))

signs = [[1, 1, 1], [1, 1, -1], [1, -1, 1], [1, -1, -1],
        [-1, 1, 1], [-1, 1, -1], [-1, -1, 1], [-1, -1, -1]]
results = []

for sign in signs:
    sorted_list = sorted(xyz, key = lambda x: sign[0] * x[0] + sign[1] * x[1] + sign[2] * x[2])

    tmp = sum_axis(sorted_list[-M:])
    results.append(tmp[0] * sign[0] + tmp[1] * sign[1] + tmp[2] * sign[2])

print(max(results))

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

if A > 8:
    print(":(");
    exit()
if B > 8:
    print(":(");
    exit()
print("Yay!")
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
K = int(input())

substr_map = {}

for i in range(len(s) + 1):
    for j in range(i + 1, len(s) + 1):
        substr_map[s[i:j]] = 1

print(list(sorted(substr_map.items(), key = lambda x: x[0]))[K - 1][0])

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

substr_set = set()

for i in range(len(s)):
    for j in range(1, K + 1):
        substr_set.add(s[i:i+j])

print(sorted(substr_set)[K - 1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A_list = list(map(int, input().split(' ')))
A_len = len(A_list)

result = 0
for i in range(A_len):
    tmp = 0
    for j in range(i, A_len):
        tmp += A_list[j]
        if tmp == 0:
            result += 1

print(result)

Fixed submission:
import math

def calc_combination(n):
    combination = math.factorial(n) / (math.factorial(2) * math.factorial(n - 2))

    return combination


N = int(input())

list_A = list(map(int, input().split(' ')))

tmp_sum = 0
sum_map = {}
for A in list_A:
    tmp_sum += A
    sum_map[tmp_sum] = sum_map.get(tmp_sum, 0) + 1

result = sum_map.get(0, 0)
for value in sum_map.values():
    if value >= 2:
        result += calc_combination(value)

print(int(result))
Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split(' '))

tmp_list = [i for i in range(A, B + 1)]

if (B - A + 1) / 2 < K:
    print('\n'.join(str(i)for i in tmp_list))
else:
    for i in tmp_list[0 : K]:
        print(i)
    for i in tmp_list[len(tmp_list) - K:]:
        print(i)


Fixed submission:
A, B, K = map(int, input().split(' '))

if (B - A + 1) / 2 < K:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)
    for i in range(B - K + 1, B + 1):
        print(i)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split(' '))

tmp_list = [i for i in range(A, B + 1)]
tmp_list2 = []

for i in tmp_list[0 : K]:
    tmp_list2.append(i)
    print(i)

for i in tmp_list[len(tmp_list) - K:]:
    if i not in tmp_list2:
        print(i)

Fixed submission:
A, B, K = map(int, input().split(' '))

if (B - A + 1) / 2 < K:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)
    for i in range(B - K + 1, B + 1):
        print(i)

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int, input().split(' '))

tmp_list = [i for i in range(A, B + 1)]
tmp_list2 = []

for i in tmp_list[0 : K]:
    tmp_list2.append(i)

for i in tmp_list[len(tmp_list) - K:]:
    if i not in tmp_list2:
        tmp_list2.append(i)

for i in tmp_list2:
    print(i)

Fixed submission:
A, B, K = map(int, input().split(' '))

if (B - A + 1) / 2 < K:
    for i in range(A, B + 1):
        print(i)
else:
    for i in range(A, A + K):
        print(i)
    for i in range(B - K + 1, B + 1):
        print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
points = list(map(int, input().split(' ')))
points.insert(0, 0)
points.insert(len(points), 0)

results = []
for i in range(1, len(points) - 1):
    sum, prev = 0, 0
    for point in range(1, len(points)):
        if point == i:
            continue
        sum += abs(prev - points[point])
        prev = points[point]

    print(sum)


Fixed submission:
N = int(input())
points = list(map(int, input().split(' ')))
points.insert(0, 0)
points.insert(len(points), 0)

sum = 0
for i in range(1, len(points)):
    sum += abs(points[i - 1] - points[i])


for i in range(1, len(points) - 1):
    tmp_sum = 0
    if points[i - 1] <= points[i] <= points[i + 1]:
        print(sum)
        continue

    if points[i - 1] <= points[i + 1] <= points[i]:
        print(sum - 2 * abs(points[i] - points[i + 1]))
        continue

    if points[i] <= points[i - 1] <= points[i + 1]:
        print(sum - 2 * abs(points[i] - points[i - 1]))
        continue

    if points[i] <= points[i + 1] <= points[i - 1]:
        print(sum - 2 * abs(points[i] - points[i + 1]))

        continue
    if points[i + 1] <= points[i - 1] <= points[i]:
        print(sum - 2 * abs(points[i] - points[i - 1]))

        continue
    if points[i + 1] <= points[i] <= points[i - 1]:
        print(sum)

        continue