Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int,input().split())
ans = 0

for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z == s:
        ans += 1

print(ans)

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

for x in range(k+1):
  for y in range(k+1):
    if 0 <= s-x-y <= k:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
x = int(li[0])
y = int(li[2])

if li[1] = "+" print(x+y) else print(x-y)

Fixed submission:
li = input().split()
x = int(li[0])
y = int(li[2])
print(x+y) if li[1]=="+" else print(x-y)
Buggy python submission (verdict: Runtime Error):
s = input()

print("vowel") if s == a or s == i or s == u or s == e or s == o else print("consonant")

Fixed submission:
s = input()

print("vowel") if s == "a" or s == "i" or s == "u" or s == "e" or s == "o" else print("consonant")
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))

B = [0 for _ in range(N)]
for i, a in enumerate(A):
    B[a - 1] = str(i + 1)

print(' '.join(B))

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

B = [0 for _ in range(N)]
for i, a in enumerate(A):
    B[a - 1] = str(i + 1)

print(' '.join(B))
Buggy python submission (verdict: Runtime Error):
w, h, x, y = map(int, input().split())

cnt = 0

s1 = float((abs(w - x) * abs(h)) / x)
s2 = float((abs(w - 0) * abs(h - y)) / y)

cnt = [s1,s2]
ans = cnt.count(max(cnt))
if ans > 1:
    print(max(cnt), '1')
else:
    print(max(cnt), '0')

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

area = w * h / 2

flag = 0

if x == w/2 and y == h/2:
    flag = 1

print(area, flag)

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

cnt = 0

s1 = float((abs(w - x) * abs(h)) / x)
s2 = float((abs(w - 0) * abs(h - y)) / y)

cnt = [s1,s2]
ans = cnt.count(max(cnt))
if ans > 1:
    print(max(cnt), '1')
else:
    print(max(cnt), '0')

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

area = w * h / 2

flag = 0

if x == w/2 and y == h/2:
    flag = 1

print(area, flag)
Buggy python submission (verdict: Runtime Error):
x = int(input())

if x>=30:
  print('Yes')
elif :
  print('No')

Fixed submission:
x = int(input())

if x>=30:
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
x = input()

if x>=30:
  print('Yes')
elif :
  print('No')

Fixed submission:
x = int(input())

if x>=30:
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
input(x)

if x>=30:
  print('yes')
else :
  print('No')


Fixed submission:
x = int(input())

if x>=30:
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
input(x)

if 30<=x<=40:
  print('yes')
else :
  print('No')


Fixed submission:
x = int(input())

if x>=30:
  print('Yes')
else :
  print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
cnt = 0
ans = 0
while(cnt<1000001):
  	cnt += 1
  	ans = (ans*10 + 7)%n
  	if ans == 0:
    	print(cnt)
    
   		break
else:
  
	print(-1)

Fixed submission:
n = int(input())
if n >= 30:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N,D=input().split()
N=int(N)
D=int(D)
cnt = 0
for i in range(N):
    
    p1,p2 = map(int,input().split())
    t = ((p1*p1)(p2*p2))**(0.5)
    if t <= D:
        cnt += 1
    
print(cnt)

Fixed submission:
n,d = map(int,input().split())
ans = 0
k = d**2
for i in range(n):
  
    x,y = map(int,input().split())
    if (x**2)+(y**2) <= k:
        ans += 1
    else:
        None
print(ans)

Buggy python submission (verdict: Runtime Error):
N,D=input().split()
N=int(N)
D=int(D)
cnt = 0
for i in range(N):
    
    p1,p2 = map(int,input().split())
    t = ((p1*p1)(p2*p2))**(0.5)
    if t >= D:
        cnt += 1
    
print(cnt)

Fixed submission:
n,d = map(int,input().split())
ans = 0
k = d**2
for i in range(n):
  
    x,y = map(int,input().split())
    if (x**2)+(y**2) <= k:
        ans += 1
    else:
        None
print(ans)

Buggy python submission (verdict: Runtime Error):
N,D=input().split()
N=int(N)
D=int(D)
cnt = 0
for i in range(N):
  
    
  p1,p2 = map(int,input().split())
  t = ((p1*p1)(p2*p2))**(0.5)
  if t >= D:
    
    cnt += 1
    
print(cnt)

Fixed submission:
n,d = map(int,input().split())
ans = 0
k = d**2
for i in range(n):
  
    x,y = map(int,input().split())
    if (x**2)+(y**2) <= k:
        ans += 1
    else:
        None
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
for i in range(n):
  p1,p2 = map(int,input().split())
  cnt = 0
  t = ((p1*p1)(p2*p2))**(0.5)
  if t >= m:
    cnt += 1
  print(cnt)

Fixed submission:
n,d = map(int,input().split())
ans = 0
k = d**2
for i in range(n):
  
    x,y = map(int,input().split())
    if (x**2)+(y**2) <= k:
        ans += 1
    else:
        None
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
c =0
for i in range(n):
    c+=i
print(c)

    


Fixed submission:
a = int(input())
print((a*(a-1))//2)
Buggy python submission (verdict: Runtime Error):
A, B = [int(i) for i in input()]
print(A*B)


Fixed submission:
A, B = [int(i) for i in input().split()]
print(A*B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]
answer = 1

for i in A:
    answer*=i

if answer > 10**18:
    print('-1')
else:
    print(answer)


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
K=1
if 0 in A:
    print(0)
else:
    for num in A:
        K*=num
        if K>10**18:
            print(-1)
            exit()
    print(K)
Buggy python submission (verdict: Runtime Error):
import math

A, B = [i for i in input().split()]
print(math.floor(int(A)*Decimal(B)))


Fixed submission:
from decimal import *
A,B = input().split()
print(int(int(A)*Decimal(B)))
Buggy python submission (verdict: Runtime Error):
 S = input()
 T = input()
count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1
    
 print(count)

Fixed submission:
S = input()
T = input()
count = 0

for i in range(3):
  if S[i] == T[i]:
    count += 1
    
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import collections as c
import math

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

def C(n, r):
  return P(n, r)//math.factorial(r)

N = int(input())
s = [input() for _ in range(N)]
count = []

for i in s:
  count.append(dict(c.Counter(i).most_common()))

unique_count = []
comb = []
for i in count:
  if not i in unique_count:
    unique_count.append(i)
    comb.append(count.count(i))

print(sum([C(i, 2) for i in comb if i >= 2]))
  
  

Fixed submission:
import collections as c
import math

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

def C(n, r):
  return P(n, r)//math.factorial(r)

N = int(input())
s = [input() for _ in range(N)]
count = []

for i in s:
  count.append(''.join(sorted(list(i))))

# print(count)

comb = [i[1] for i in c.Counter(count).most_common()]
print(sum([C(i, 2) for i in comb if i >= 2]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for _ in range(N)]
sorted_A = sorted(A)

for i in A:
  array = sorted_A.copy()
  array.remove(i)
  print(array[-1])

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]
sorted_A = sorted(A)

for i in A:
  if i == sorted_A[-1]:
    print(sorted_A[-2])
  else: 
    print(sorted_A[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
# Nは奇数
A = [int(i) for i in input().split()]

for i in range(A[0]+1):
  answer_list = []
  answer_list.append(i)
  answer = i
  for j in A:
    if (j - answer) < 0:
      break
    answer = j - answer
    answer_list.append(answer)
  if answer_list[0] == answer_list[-1] and len(answer_list) == N+1:
    print(' '.join([str(i*2) for i in answer_list[:N]]))
    exit()

Fixed submission:
N = int(input())
# Nは奇数
A = [int(i) for i in input().split()]

answer = (sum(A) - 2 * sum([A[i] for i in range(N) if i % 2 != 0])) // 2
answer_list = []
answer_list.append(answer)
for j in A:
  if (j - answer) < 0:
    break
  answer = j - answer
  answer_list.append(answer)
if answer_list[0] == answer_list[-1] and len(answer_list) == N+1:
  print(' '.join([str(i*2) for i in answer_list[:N]]))
  exit()
Buggy python submission (verdict: Runtime Error):
N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
count = 0
answer = 1

while D <= X:
  D += L[count]
  count += 1
  answer += 1

print(answer - 1)

Fixed submission:
# W, H, x, y = [int(i) for i in input().split()]
N, X = [int(i) for i in input().split()]
L = [int(i) for i in input().split()]
D = 0
count = 0
answer = 1

while D <= X:
  if count + 1 > len(L):
    print(N+1)
    exit()
  D += L[count]
  count += 1
  answer += 1

print(answer - 1)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
N = len(str(S))
cubes = [int(i) for i in list(S)]

first_comb = [0]
second_comb = [0]
while len(first_comb) > 0 or len(second_comb) > 0:
  length = len(cubes)
  first_comb = []
  second_comb = []
  for i in range(length - 1):
    if (cubes[i] == 0 and cubes[i + 1] == 1) or (cubes[i] == 1 and cubes[i + 1] == 0):
      if i + 2 <= length - 1 and i - 1 >= 0:
        if (cubes[i + 2] == 0 and cubes[i - 1] == 1) or (cubes[i + 2] == 1 and cubes[i - 1] == 0):
          first_comb.append([i, i + 1])
        else: 
          second_comb.append([i, i + 1])
      else: 
        second_comb.append([i, i + 1])

  if len(first_comb) > 0:
    cubes.pop(first_comb[0][0])
    cubes.pop(first_comb[0][1] - 1)
  elif len(second_comb) > 0:
    cubes.pop(second_comb[0][0])
    cubes.pop(second_comb[0][1] - 1)

print(N - len(cubes))



Fixed submission:
S = input()
N = len(str(S))
cubes = [int(i) for i in list(S)]

one_count = len([i for i in cubes if i == 1])

if one_count > N - one_count:
  print(2 * (N - one_count))
else: 
  print(2 * one_count)
Buggy python submission (verdict: Runtime Error):
import math

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
numbers = [abs(i - X) for i in x]

gcd = numbers[0]
for i in numbers:
  gcd = math.gcd(gcd, i)
print(gcd)


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

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
numbers = [abs(i - X) for i in x]

answer = numbers[0]
for i in numbers:
  answer = gcd(answer, i)
print(answer)

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

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
numbers = [abs(i - X) for i in x]

gcd = functools.reduce(math.gcd, numbers)
print(gcd)


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

N, X = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
numbers = [abs(i - X) for i in x]

answer = numbers[0]
for i in numbers:
  answer = gcd(answer, i)
print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]
a.insert(0, 0)
a.append(0)

gap = []
for i in range(n + 1):
  gap.append(a[i + 1] - a[i])

for j in range(n):
  answer = sum([abs(i) for i in gap[0:j]]) + abs(gap[j] + gap[j + 1]) + sum([abs(i) for i in gap[j + 2:]])
  print(answer)


Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
a.insert(0, 0)
a.append(0)

gap = []
for i in range(n + 1):
  gap.append(a[i + 1] - a[i])

base = sum([abs(i) for i in gap])

for j in range(n):
  answer = base - (abs(gap[j]) + abs(gap[j + 1])) + abs(gap[j] + gap[j + 1])
  print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
kinds = len(set(A))
count = []

for i in set(A):
  count.append(A.count(i))

rest = kinds - K
if rest > 0: 
  print(sum(sorted(count)[:rest]))
else: 
  print(0)





Fixed submission:
from collections import Counter
N,K = map(int,input().split())
A = Counter(list(map(int,input().split())))
V = []
for v in A.values():
    V.append(v)
V.sort(reverse = 1)
print(sum(V[K:]))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N = int(input())
T = [int(input()) for _ in range(N)]

print(lcm_list(T))

Fixed submission:
import fractions

N = int(input())
T = [int(input()) for _ in range(N)]

ans = T[0]
for i in range(1, N):
    ans = ans * T[i] // fractions.gcd(ans, T[i])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(i) for i in input().split()]

b = []
count = 0
for i in a:
  if count % 2 == 0:
    b.append(i)
  else:
    b.insert(0, i)
  count += 1

if n % 2 == 0:
  print(' '.join([str(i) for i in b]))
else: 
  b.reverse()
  print(' '.join([str(i) for i in b]))


  

Fixed submission:
n=int(input())
a=list(input().split())
b=[]
if len(a)%2==0:
  for i in range(n-1,0,-2):
    b.append(a[i])
  for i in range(0,n-1,2):
    b.append(a[i])
else:
  for i in range(n-1,-1,-2):
    b.append(a[i])
  for i in range(1,n-1,2):
    b.append(a[i])
print(' '.join(b))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

T = 0
A = 0
for _ in range(N):
  count = 1
  next_T, next_A = [int(i) for i in input().split()]
  if next_T > T and next_A > A:
    T = int(next_T)
    A = int(next_A)
  else: 
    while next_T < T or next_A < A:
      next_T /= count-1 if count > 1 else 1
      next_A /= count-1 if count > 1 else 1
      next_T *= count 
      next_A *= count
      count += 1
    T = int(next_T)
    A = int(next_A)
print(int(sum([T, A])))

Fixed submission:
import math
import sys
from decimal import Decimal


N = int(sys.stdin.readline())
TA = []
for i in range(N):
    TA.append(list(map(int, sys.stdin.readline().split())))

current_T = 1
current_A = 1
for i in range(N):
    count = max(math.ceil(Decimal(current_T)/Decimal(TA[i][0])), math.ceil(Decimal(current_A)/Decimal(TA[i][1])))
    current_T = TA[i][0] * count
    current_A = TA[i][1] * count

print(current_T + current_A)
Buggy python submission (verdict: Runtime Error):
X = int(input())
print("YNeos")[X>29::2]

Fixed submission:
X = int(input())
print("YNeos"[not(X>=30)::2])

Buggy python submission (verdict: Runtime Error):
X = int(input())
print("YNeos")[x>29::2]

Fixed submission:
X = int(input())
print("YNeos"[not(X>=30)::2])
Buggy python submission (verdict: Runtime Error):
import sys
import math
import numpy as np
import copy

def main():
    s = input()
    print "ARC" if s == "ABC" else "ABC"
    return 0

if __name__ == '__main__':
    sys.exit(main())

Fixed submission:
import sys
import math
import numpy as np
import copy

def main():
    s = input()
    print("ARC" if s == "ABC" else "ABC")
    return 0

if __name__ == '__main__':
    sys.exit(main())
Buggy python submission (verdict: Runtime Error):
import sys
import math
import numpy as np
import copy

def dfs(now, group, groups, edges):
    if groups[now] != -1:
        return 0
    groups[now] = group
    cnt = 1
    for to in edges[now]:
        cnt += dfs(to, group, groups, edges)
    return cnt

def main():
    n, m, k = map(int, input().split())
    edges = [list() for i in range(n)]
    ngs = [list() for i in range(n)]
    for i in range(m):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        edges[a].append(b)
        edges[b].append(a)
    for i in range(k):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        ngs[c].append(d)
        ngs[d].append(c)


    cnt = 0
    groups = [-1 for i in range(n)]
    nodes_cnt = list()

    ans = [0 for i in range(n)]
    
    for i in range(n):
        if groups[i] == -1:
            nodes_cnt.append(dfs(i, cnt, groups, edges))
            cnt += 1
        ans[i] = nodes_cnt[groups[i]] - len(edges[i]) - 1
        for ng in ngs[i]:
            if groups[i] == groups[ng]:
                ans[i] -= 1

    print(*ans, sep=" ")


if __name__ == '__main__':
    sys.exit(main())

Fixed submission:
import sys
import math
import numpy as np
import copy

def dfs(now, group, groups, edges):
    if groups[now] != -1:
        return 0
    groups[now] = group
    cnt = 1
    for to in edges[now]:
        cnt += dfs(to, group, groups, edges)
    return cnt

def main():
    n, m, k = map(int, input().split())
    edges = [list() for i in range(n)]
    ngs = [list() for i in range(n)]
    for i in range(m):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        edges[a].append(b)
        edges[b].append(a)
    for i in range(k):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        ngs[c].append(d)
        ngs[d].append(c)


    cnt = 0
    groups = [-1 for i in range(n)]
    nodes_cnt = list()

    ans = [0 for i in range(n)]
    
    for i in range(n):
        if groups[i] == -1:
            nodes_cnt.append(dfs(i, cnt, groups, edges))
            cnt += 1
        ans[i] = nodes_cnt[groups[i]] - len(edges[i]) - 1
        for ng in ngs[i]:
            if groups[i] == groups[ng]:
                ans[i] -= 1

    print(*ans, sep=" ")

if __name__ == '__main__':
    sys.setrecursionlimit(1000000)
    sys.exit(main())
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import numpy as np
import copy

def main():
    n = int(input())
    l = [int(t) for t in input().split()]

    # まずはLを昇順にソートする
    l.sort()
    
    count = 0
    # 1番短い棒(i)と2番目に短い棒(j)を決める
    for i in range(0, n):
        for j in range(i+1, n):
            lb, ub = j, n
            while ub - lb > 1:
                half = (lb + ub) // 2
                if l[half] < l[i] + l[j]:
                    lb = half
                else:
                    ub = half
            count += ub - (j + 1)

    print(count)

    return 0

if __name__ == '__main__':
    sys.exit(main())

Fixed submission:
import sys
import math
import copy

def main():
    n = int(input())
    l = [int(t) for t in input().split()]

    # まずはLを昇順にソートする
    l.sort()
    
    count = 0
    # 1番短い棒(i)と2番目に短い棒(j)を決める
    for i in range(0, n):
        for j in range(i+1, n):
            lb, ub = j, n
            while ub - lb > 1:
                half = (lb + ub) // 2
                if l[half] < l[i] + l[j]:
                    lb = half
                else:
                    ub = half
            count += ub - (j + 1)

    print(count)

    return 0

if __name__ == '__main__':
    sys.exit(main())
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
x, y = np.array([list(map(int, input().split())) for _ in range(n)]).T

def isin90deg(v1, v2):
    if np.dot(v1, v2) >= 0:
        return 1
    else:
        return 0

ans = []

for i in range(n):
    v1 = np.array([y[i], -x[i]])
    if i < n-1:
        v2 = np.array([(y[i]+y[i+1])/2, (x[i]+x[i+1])/2])
    else:
        v2 = v1

    total1, total2 = np.array([0, 0]), np.array([0, 0])
    tmp1, tmp2, v3 = [], [], []
    for j in range(n):
        v3.append(np.array([x[j], y[j]]))
        if isin90deg(v1, v3[j]):
            total1 += v3[j]
            tmp1.append(j)
        if isin90deg(v2, v3[j]):
            total2 += v3[j]
            tmp2.append(j)

    start1, end1 = min(tmp1), max(tmp1)
    start2, end2 = min(tmp2), max(tmp2)
    ans.append(np.linalg.norm(total1, ord=2))
    ans.append(np.linalg.norm(total1 - v3[start1], ord=2))
    ans.append(np.linalg.norm(total1 - v3[end1], ord=2))
    ans.append(np.linalg.norm(total2, ord=2))
    ans.append(np.linalg.norm(total2 - v3[start2], ord=2))
    ans.append(np.linalg.norm(total2 - v3[end2], ord=2))

print(max(ans))

Fixed submission:
import sys

import math
import numpy as np

def main():
    n = int(input())
    vec = [tuple(map(int, input().split())) for i in range(n)]
    vec.sort(key=lambda x: math.atan2(x[1], x[0]))

    maxx = 0
    for i in range(n):
        for j in range(1, n+1):
            now = [0, 0]
            for k in range(j):
                idx = (i + k) % n
                now[0] += vec[idx][0]
                now[1] += vec[idx][1]
            maxx = max(maxx, now[0]*now[0] + now[1]*now[1])

    print(math.sqrt(maxx))
    return 0

if __name__ == '__main__':
    sys.exit(main())
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
import time

if __name__ == '__main__':
    n, q = map(int, input().split())

    board = np.zeros(n+1, dtype=np.int64)

    for i in range(q):
        l, r = map(int, input().split())
        l -= 1
        r -= 1
        board[l] += 1
        board[r+1] -= 1

    cumsum = np.cumsum(board)

    for i in range(n):
        print(int(cumsum[i])%2, end="")
    print()



Fixed submission:
import sys

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))

    ans = [False for i in range(n)]

    for i in range(n-1, -1, -1):
        num = i + 1
        j = 2
        accum = 0
        while num * j <= n:
            accum = (accum + ans[num * j - 1]) % 2
            j += 1
        ans[i] = (not accum == a[i])

    out = list()
    for i in range(n):
        if ans[i]:
            out.append(i + 1)
    print(len(out))
    print(*out)
Buggy python submission (verdict: Runtime Error):
import math
import functools
n = int(input())

a = [int(t) for t in input().split()]

g = functools.reduce(math.gcd, a)

print(g)

Fixed submission:
import math
import functools


def gcd(a, b):
    if b == 0:
        return a

    return gcd(b, a%b)
n = int(input())

a = [int(t) for t in input().split()]

g = functools.reduce(gcd, a)

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

if b - a <= 2*k - 1:
  print(*range(a, b+1))
else:
  print(*range(a, a+k))
  print(*range(b-k+1, b+1)

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

if b - a <= 2*k - 1:
  print(*range(a, b+1), sep="\n")
else:
  print(*range(a, a+k), sep="\n")
  print(*range(b-k+1, b+1), sep="\n")
Buggy python submission (verdict: Runtime Error):
n = int(input())

s = [input() for i in range(n)]

order = "MARCH"

initial_arary = [name[0] for name in s]
nums = [initial_array.count(order[i]) for i in range(len(order))]

ans = 0
for i in range(0, 5):
    for j in range(i+1, 5):
        for k in range(j+1, 5):
            ans += nums[i] * nums[j] * nums[k]
            
print(ans)



Fixed submission:
n = int(input())

s = [input() for i in range(n)]

order = "MARCH"

nums = [[name[0] for name in s].count(order[i]) for i in range(len(order))]

ans = 0
for i in range(0, 5):
    for j in range(i+1, 5):
        for k in range(j+1, 5):
            ans += nums[i] * nums[j] * nums[k]
            
print(ans)
Buggy python submission (verdict: Runtime Error):
from functools import reduce

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

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

n = int(input())
t = [int(input()) for i in range(n)]

x = reduce(t, lcm)

print(x)



Fixed submission:
from functools import reduce

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

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

n = int(input())
t = [int(input()) for i in range(n)]

ans = reduce(lcm, t)
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
ans = 0

if k - a >= 0:
  k -= a
  if k - b >= 0:
    k -= b:
    if k - c >= 0:
      ans = a - c
    else:
      ans = a - k
  else:
    ans = a
else:
  ans = k
  
print(ans)

Fixed submission:
a, b, c, k = map(int, input().split())
ans = 0
 
if k - a >= 0:
  k -= a
  if k - b >= 0:
    k -= b
    if k - c >= 0:
      ans = a - c
    else:
      ans = a - k
  else:
    ans = a
else:
  ans = k
  
print(ans)