Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02786 (python)

Fixed submission:
H = int(input())

def solve(h):
    ans = 0
    if h==1:
        ans = 1
    else:
        ans += 1
        ans += 2 * solve(h//2)
    return ans

ans = solve(H)
print(ans)

Buggy submission (verdict: Runtime Error):
H = int(input())

def solve(h):
    ans = 0
    if h==2 or h==3:
        ans = 3
    else:
        ans += 1
        ans += 2 * solve(h//2)
    return ans

ans = solve(H)
print(ans)
Problem p02899 (python)

Fixed submission:
N = int(input())
Alist = list(map(int, input().split()))
 
Alist = [[idx+1, a] for (idx, a) in enumerate(Alist)]
 
Alist.sort(key=lambda x:x[1])
 
ans = [str(a) for a, _ in Alist]
print(" ".join(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
Alist = list(map(int, input().split()))

Alist = [[idx+1, a] for (idx, a) in enumerate(Alist)]

Alist.sort(key=lambda x:x[1])

ans = [a for a, _ in Alist]
print(" ".join(ans))
Problem p02953 (python)

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

H = H[::-1]
check = 0
for i in range(1, N):
    if H[i] > H[i-1] + 1:
        check = 1
        break
    if H[i] > H[i-1]:
        H[i] -= 1

if check:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int, input().split()))

H = H[::-1]
for i in range(1, N):
    if H[i] > H[i-1] + 1:
        check = 1
        break
    if H[i] > H[i-1]:
        H[i] -= 1

if check:
    print('No')
else:
    print('Yes')
Problem p03031 (python)

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

klist = []
sdict = {}
for m in range(M):
    tmp = list(map(int, input().split()))
    klist.append(tmp[0])
    sdict[m] = tmp[1:]
plist = list(map(int, input().split()))

def solve(N, plist, switch_num):
    global M
    num = 0

    if N == 1:
        idx = []
        idx2 = []
        count = 0
        for m in range(M):
            if switch_num in sdict[m]:
                count += 1
                idx.append(plist[m])
            else:
                idx2.append(plist[m])
        if sum(idx) == len(idx) or sum(idx) == 0:
            if sum(idx2) == 0:
                if count == 0:
                    return 2
                else:
                    return 1
            else:
                return 0
        else:
            return 0

    # switch1 == OFF
    new_plist = plist
    num += solve(N-1, new_plist, switch_num+1)
    
    # switch1 == ON
    new_plist = []
    for i in range(M):
        if switch_num in sdict[i]:
            new_plist.append(1 - plist[i])
        else:
            new_plist.append(plist[i])
    num += solve(N-1, new_plist, switch_num+1)

    return num

print(solve(N, plist, 1))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())

klist = []
sdict = {}
for m in range(M):
    tmp = list(map(int, input().split()))
    klist.append(tmp[0])
    sdict[m] = tmp[1:]
plist = list(map(int, input().split()))

def solve(N, plist, switch_num):
    global M
    num = 0

    if N == 1:
        idx = []
        idx2 = []
        for m in range(M):
            if switch_num in sdict[m]:
                idx.append(plist[m])
            else:
                idx2.append(plist[m])
        if sum(idx) == len(idx):
            if sum(idx2) == 0:
                return 1
            else:
                return 0
        elif sum(idx) == 0:
            if sum(idx2) == 0:
                return 2
        else:
            return 0

    # switch1 == OFF
    new_plist = plist
    num += solve(N-1, new_plist, switch_num+1)
    
    # switch1 == ON
    new_plist = []
    for i in range(M):
        if switch_num in sdict[i]:
            new_plist.append(1 - plist[i])
        else:
            new_plist.append(plist[i])
    num += solve(N-1, new_plist, switch_num+1)

    return num

print(solve(N, plist, 1))
Problem p03047 (python)

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

print(N - K + 1)

Buggy submission (verdict: Runtime Error):
R, G, B, N = map(int, input().split())

count = 0
for i in range(N // R + 1):
    n = N - R * i
    for j in range(n // G + 1):
        if (n - G*j) >= 0 and (n - G*j) % B == 0:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
R, G, B, N = map(int, input().split())

count = 0
for i in range(N // R + 1):
    n = N - R * i
    for j in range(n // G + 1):
        if (n - G*j) >= 0 and (n - G*j) % B == 0:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
R, G, B, N = map(int, input().split())

count = 0
for i in range(N // R + 1):
    n = N - R * i
    for j in range(n // G + 1):
        if (n - G*j) >= 0 and (n - G*j) % B == 0:
            count += 1

print(count)
Problem p03048 (python)

Fixed submission:
R, G, B, N = map(int, input().split())

count = 0
for i in range(N // R + 1):
    n = N - R * i
    for j in range(n // G + 1):
        if (n - G*j) >= 0 and (n - G*j) % B == 0:
            count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np

R, G ,B, N = map(int, input().split())

tmp = [R, G, B]
tmp.sort()
R, G, B = tmp[2], tmp[1], tmp[0]


num_R = N // R + 1
num_G = N // G
RG = np.zeros((num_R, num_G+1))

RG[:, 0] = [N - R*i for i in range(num_R)]

for j in range(num_G):
    RG[:, j+1] = RG[:, j] - G

check = lambda x: 0 if x < 0 else 1 if x == 0 else 1 if x%B == 0 else 0

a = []
count = 0
for i in range(len(RG)):
    a = list(map(check, RG[i]))
    count += sum(a)

print(count)
Problem p03103 (python)

Fixed submission:
import numpy as np
N, M = map(int, input().split())
AB_list = np.zeros((N, 2))

for i in range(N):
    A, B = map(int, input().split())
    AB_list[i] = [A, B]

if N==1:
    print(int(M*AB_list[0, 0]))

elif np.sum(AB_list[:, 1]) == M:
    tmpsum = 0
    for i in range(N):
        tmpsum += AB_list[i, 0] * AB_list[i, 1]
    print(int(tmpsum))

else:
    AB_list = AB_list[np.argsort(AB_list[:, 0])]
    i = 0
    money = 0
    while(AB_list[i, 1] <= M):
        money += AB_list[i,0] * AB_list[i, 1]
        M -= AB_list[i, 1]
        i += 1

    money += AB_list[i, 0] * M
    print(int(money))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
AB_list = np.zeros((N, 2))

for i in range(N):
    A, B = map(int, input().split())
    AB_list[i] = [A, B]

if N==1:
    print(int(M*AB_list[0, 0]))
else:
    AB_list = AB_list[np.argsort(AB_list[:, 0])]
    i = 0
    money = 0
    while(AB_list[i, 1] <= M):
        money += AB_list[i,0] * AB_list[i, 1]
        M -= AB_list[i, 1]
        i += 1

    money += AB_list[i, 0] * M
    print(int(money))
Problem p03129 (python)

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

if (2*(K-1) + 1 <= N):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
N, K = map(int, input())

if (2*(K-1) + 1 <= N):
    print('YES')
else:
    print('NO')
Problem p03139 (python)

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

ab = [A, B]
max_katu = min(ab)

if A+B >= N:
    min_katu = A+B-N
else:
    min_katu = 0


ans = [str(max_katu), str(min_katu)]
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
AB = np.zeros((3, N))

for i in range(N):
    tmpA, tmpB = map(int, input().split())
    AB[0, i] = tmpA + tmpB
    AB[1, i] = tmpA
    AB[2, i] = tmpB

AB = AB[:, np.argsort(AB[0, :])][::-1]

point = 0
for i in range(N):
    if i%2==0:
        point += AB[1, i]
    else:
        point -= AB[2, i]
 
print(int(point))
Problem p03145 (python)

Fixed submission:
l = list(map(int, input().split()))
print(int(l[0] * l[1] / 2))

Buggy submission (verdict: Runtime Error):
l = map(int, raw_input().split())
print(int(l[0] * l[1] / 2)
Problem p03206 (python)

Fixed submission:
D = int(input())

ch = 'Christmas'
for _ in range(25 - D):
    ch += ' Eve'
print(ch)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h_list = []
for _ in range(N):
    h_list.append(int(input()))
h_list.sort()

err_list = [h_list[i+K-1] - h_list[i] for i in range(N-K+1)]
print(min(err_list))
Problem p03309 (python)

Fixed submission:
N = int(input())
Alist = list(map(int, input().split()))
Alist = [Alist[i] - (i+1) for i in range(N)]
Alist.sort()

b = Alist[N//2]

ans = 0
for i in range(N):
    ans += abs(Alist[i] - b)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
Alist = list(map(int, input().split()))
Alist = [Alist[i] - (i+1) for i in range(N)]
Alist.sort()

sumlist = []
for i in range(N-1):
    if i < N // 2:
        sumlist.append(- sum(Alist[:i+1]) + sum(Alist[i+1:]) - Alist[i+1] * (N - 2 * (i + 1)))
    else:
        sumlist.append(- sum(Alist[:i+1]) + sum(Alist[i+1:]) + Alist[i] * (N - 2 * (N - i - 1)))
    
print(min(sumlist))
Problem p03424 (python)

Fixed submission:
N = int(input())
Alist = input().split()
 
a = set(Alist)
if len(a) == 3:
    print('Three')
else:
    print('Four')

Buggy submission (verdict: Runtime Error):
N = int(input())
Alist = list(map(int, input().split()))
 
a = set(Alist)
if len(a) == 3:
    print('THREE')
else:
    print('FOUR')

Buggy submission (verdict: Runtime Error):
N = int(input())
Alist = list(map(int, input().split()))

a = set(Alist)
print(len(a))
Problem p02675 (python)

Fixed submission:
n = int(input()) % 10

if n in [2,4,5,7,9] :
    print("hon")
elif n in [0,1,6,8] :
    print("pon")
else  :
    print("bon")

Buggy submission (verdict: Runtime Error):
S = input()
K = int(input())

if len(S) <= K :
    print(S)
else :
    print(S[:K] + "...")
Problem p02630 (python)

Fixed submission:
class Counter(dict):
    def __missing__(self, i):
        return 0

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

total = sum(a)

bucket = Counter()

for item in a:
    bucket[item] += 1

for i in range(q):
    b, c = map(int, input().split())
    taken = bucket[b]
    total -= bucket[b]*b
    bucket[c] += bucket[b]
    bucket[b] = 0
    total += taken*c
    print(total)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
 
n = int(input())
raw_numbers = list(map(int, input().split()))
Q = int(input())
 
total = sum(raw_numbers)
 
numbers = defaultdict(int)
 
for num in raw_numbers:
    numbers[num] += 1

for i in range(q):
    b, c = map(int, input().split())
    taken = numbers[b]
    total -= numbers[b]*b
    numbers[c] += numbers[b]
    numbers[b] = 0
    total += taken*c
    print(total)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
 
n = int(input())
raw_numbers = list(map(int, input().split()))
Q = int(input())
 
total = sum(raw_numbers)
 
numbers = defaultdict(int)
 
for num in raw_numbers:
    numbers[num] += 1
 
for i in range(q):
    b, c = map(int, input().split())
    taken = numbers[b]
    total -= numbers[b]*b
    numbers[c] += numbers[b]
    numbers[b] = 0
    total += taken*c
    print(total)
Problem p02641 (python)

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

if N == 0:
    print(X)
    exit()
else:
    for i in range(200):

        if X-i not in nums:
            print(X-i)
            exit()

        if X+i not in nums:
            print(X+i)
            exit()

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
num = list(map(int, input().split()))

if N == 0:
    print(X)
else:
    num_list = [i for i in range(-100, 101) if i != 0]

    for i in range(X-1,-1,-1):
        if i in num:
            continue
        else:
            index1 = i
            break
            
    for i in range(X+1, 101):
        if i in num:
            continue
        else:
            index2 = i
            break
            
    if abs(X - index1) > abs(X - index2):
        print(index2)
    else:
        print(index1)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
X, N = map(int, input().split())
num = list(map(int, input().split()))

if N == 0:
    print(X)
else:
    num_list = [i for i in range(1, 101)]

    for i in range(X-1,-1,-1):
        if i in num:
            continue
        else:
            index1 = i
            break
            
    for i in range(X, 100):
        if i in num:
            continue
        else:
            index2 = i
            break
            
    if abs(X - index1) > abs(X - index2):
        print(index2)
    else:
        print(index1)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
num = list(map(int, input().split()))
limit = 10**18

num.sort()
result = A[0]

for i in num[1:]:
  result *= i
  if result > limit:
    exit()

print(result)
Problem p02658 (python)

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

limit = 10 ** 18
A.sort()
result = A[0]
for a in A[1:]:
    result *= a
    if result > limit:
        print(-1)
        exit()
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
num = list(map(int, input().split()))
limit = 10**18
 
num.sort()
result = A[0]
 
for i in num[1:]:
    result *= i
    if result > limit:
        exit()
        
print(result)

Buggy submission (verdict: Runtime Error):
from fractions import Fraction
import math

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = math.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

Buggy submission (verdict: Runtime Error):
from fractions import Fraction
import numpy

n = int(input())
num = list(map(int, input().split()))
num = [ Fraction(i) for i in num ]

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(int(mult))

Buggy submission (verdict: Runtime Error):
import numpy

n = int(input())
num = list(map(int, input().split()))

if 0 in num:
    print(0)
elif len([i for i in num if i >= 10**18]) != 0:
    print(-1)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(mult)

Buggy submission (verdict: Runtime Error):
import numpy

n = int(input())

num = [None] * n
num = list(map(int, input().split()))

if 0 in num:
    print(0)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(mult)

Buggy submission (verdict: Runtime Error):
import numpy

n = int(input())

num = [0] * n
num = list(map(int, input().split()))

if 0 in num:
    print(0)
else:
    mult = numpy.prod(num)
    if mult > 10**18:
        print(-1)
    else:
        print(mult)
Problem p02717 (python)

Fixed submission:
def swap(x,y,z):
  x, y = y, x
  x, z = z, x
  
  print('%d %d %d' % (x,y,z))
  
val = list(input().split(' '))
x, y, z = [ int(x) for x in val ]
swap(x,y,z)

Buggy submission (verdict: Runtime Error):
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    coef = 1.0 / (4.0 * M)
    limit = coef * total_votes
    
    cnt = 0
    for vote in votes:
        if vote > limit:
            cnt += 1
    
    if cnt >= M:
    	return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Buggy submission (verdict: Runtime Error):
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    coef = 1.0 / (4.0 * M)
    limit = coef * total_votes
    
    cnt = 0
    for vote in votes:
        if vote > limit:
            cnt += 1
        if cnt >= M:
            return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Buggy submission (verdict: Runtime Error):
def swap(x,y,z):
  x, y = y, x
  x, z = z, x
  
  print('%d %d %d' % (x,y,z))
  
 (x, y, z) = input()
 swap(x,y,z)
Problem p02718 (python)

Fixed submission:
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    
    if cnt >= M:
        return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Buggy submission (verdict: Runtime Error):
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    	if cnt >= M:
			return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))

Buggy submission (verdict: Runtime Error):
def popularity(votes, N, M):
    
    total_votes = sum(votes)
    limit = total_votes / (4.0 * M)
    
    cnt = 0
    for vote in votes:
        if vote >= limit:
            cnt += 1
    	if cnt >= M:
            return "Yes"
    
    return "No"
  
N, M = [int (x) for x in input().split()]
votes = [int (x) for x in input().split()]
print(popularity(votes, N, M))
Problem p02795 (python)

Fixed submission:
H = int(input())
W = int(input())
N = int(input())

cnt, paint = 0, 0
while paint < N:
    paint += max(H,W)
    cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
H = int(input())
W = int(input())
N = int(input())

cnt = 0
while paint >= N:
	paint += max(H,W)
	cnt += 1
    
print(cnt)
Problem p02922 (python)

Fixed submission:
import math
A,B=map(int, input().split())
print(math.ceil((B-1)/(A-1)))

Buggy submission (verdict: Runtime Error):
from math import ceil
A,B=map(int, input().split())

print(ceil( B- / (A-1)))

Buggy submission (verdict: Runtime Error):
from math import ceil
A = int(input()); B = int(input())

print(ceil(B / A))

Buggy submission (verdict: Runtime Error):
from math import ceil
A = int(input()); B = int(input())

print(ceil(B / A))
Problem p03160 (python)

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

dis = [0] * n
dis[1] = abs(height[1] - height[0])
    
for i in range(2,n):
    dis[i] = min(dis[i-2] + abs(height[i] - height[i-2]), dis[i-1] + abs(height[i] - height[i-1]))

print(dis[-1])

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(10**9)

n , m = map(int,input().split())

g = [[] for i in range(n+1)]

dp = [-1] * (n+1)
for _ in range(m):
    v1 , v2 = map(int,input().split())
    g[v1].append(v2)
    
# finding longest path for vertice i
def dfs(i):
    if dp[i]!=-1:
        return dp[i]
    temp = 0
    for nv in g[i]:
        temp = max(temp, dfs(nv)+1)

    dp[i]=temp
    return temp
  
# finding overall longest path  
res = 0  
for i in range(1,n+1):
    res = max(res, dfs(i))
print(res)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())

sys.setrecursionlimit(10**9)
 
vertices = [[] for i in range(N+1)]
dp = [-1] * (N+1)
 
for _ in range(M):
    fro, to = map(int, input().split())
    vertices[fro].append(to)

def dfs(i):
    
    if dp[i] != -1:
        return dp[i]
    
    temp = 0
    for vertex in vertices[i]:
        temp = max(temp, dfs(vertex)+1)
        
    dp[i] = temp
    return temp

for i in range(1,N+1):
    dfs(i)
    
print(max(dp))
Problem p03163 (python)

Fixed submission:
# DP
def main():
    N, W = map(int, input().split())
 
    dp = [-1] * (W + 1)
    dp[0] = 0
    for _ in range(N):
        w, v = map(int, input().split())
        for i in range(W - w, -1, -1):
            if dp[i] == -1:
                continue
            if dp[i + w] < dp[i] + v:
                dp[i + w] = dp[i] + v
    print(max(dp))
 
 
main()

Buggy submission (verdict: Runtime Error):
N, W = map(int, input().split())
    dp = [-1] * (W + 1)
    dp[0] = 0
    for _ in range(N):
        w, v = map(int, input().split())
        for i in range(W - w, -1, -1):
            if dp[i] == -1:
                continue
            if dp[i + w] < dp[i] + v:
                dp[i + w] = dp[i] + v
    print(max(dp))

Buggy submission (verdict: Runtime Error):
def knapSack(W, wt, val, n): 
    K = [[0 for x in range(W+1)] for x in range(n+1)] 
  
    # Build table K[][] in bottom up manner 
    for i in range(n+1): 
        for w in range(W+1): 
            if i==0 or w==0: 
                K[i][w] = 0
            elif wt[i-1] <= w: 
                K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]],  K[i-1][w]) 
            else: 
                K[i][w] = K[i-1][w] 
  
    return K[n][W] 
  
n, W = map(int, input().split()) 
val = [] 
wt = [] 

for _ in range(n):
	w, v = map(int, input().split()) 
    val.append(v)
    wt.append(w)

print(knapSack(W, wt, val, n)

Buggy submission (verdict: Runtime Error):
def knapSack(C, wt, val, n): 
    K = [[0 for x in range(W+1)] for x in range(n+1)] 
  
    # Build table K[][] in bottom up manner 
    for i in range(n+1): 
        for w in range(C+1): 
            if i==0 or w==0: 
                K[i][w] = 0
            elif wt[i-1] <= w: 
                K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]],  K[i-1][w]) 
            else: 
                K[i][w] = K[i-1][w] 
  
    return K[n][W] 

n,C = map(int,input().split())

wt   = [0] * (n+1)
val  = [0] * (n+1)

for i in range(1,n+1):
    wt[i], val[i] = list(map(int,input().split()))
    
knapSack(C, wt, val, n)
Problem p02640 (python)

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

if (X>=Y or Y%2 or Y>4*X or Y<2*X):
  print('No')
elif(Y<=4*X and Y>=2*X):
  print('Yes')

Buggy submission (verdict: Runtime Error):
X,Y =map(int, input().split())

if (X>=Y or Y%2 or Y>4*X or Y<2*X):
  print('No')
elif(Y<=4*X and Y>=2*X)
  print('Yes')

Buggy submission (verdict: Runtime Error):
X,Y = map(int,input().split())
c = 4*x - y
if(c>=0 and c%2==0):
  print('YES')
else:
  print('NO')
Problem p03386 (python)

Fixed submission:
a,b,k = map(int,input().split())
if (b-a+1) >= (2*k):
  for i in range(k):
    print(a+i)
  for i in reversed(range(0,k)):
    print(b-i)
else:
  for i in range(a,b+1):
    print(i)

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
L = list(range(A,B+1))
left = list(set(L[:K]))
right = list(set(L[-K:]))
N = sorted(list(set(left + right)))
for i in range(len(N)):
  print(N[i])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
L = list(range(A,B+1))
l = L[:K]
r = L[-K:]
N = sorted(set(l + r))
for i in range(len(N)):
  print(N[i])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
L = list(range(A,B+1))
l = L[:K]
r = L[-K:]
N = sorted(list(set(l + r)))
for i in range(len(N)):
  print(N[i])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int, input().split())
L = list(range(A,B+1))
left = L[:K]
right = L[-K:]
N = list(set(left + right))
N = sorted(N)
for i in range(len(N)):
  print(N[i])
Problem p03563 (python)

Fixed submission:
r = int(input())
g = int(input())
print(2*g-r)

Buggy submission (verdict: Runtime Error):
print(chr(ord(input())+1))

Buggy submission (verdict: Runtime Error):
s = input()
print(chr(ord(s)+1))
Problem p03695 (python)

Fixed submission:
N = int(input())
R = list(map(int, input().split()))
X = [0]*8
p = 0
for r in R:
  if r >= 3200:
    p += 1
  else:
    X[r//400] = 1

s = sum(X)
if s == 0:
  print(str(1) + " " + str(p))
else:
  print(str(s) + " " + str(s + p))

Buggy submission (verdict: Runtime Error):
N = int(input())
R = list(map(int, input().split()))
X = [0]*8
p = 0
for r in R:
  if r >= 3200:
    p += 1
  else:
    X[r//400] = 1

s = sum(X)
if s == 0:
  print(str(1) + " " + str(cnt))
else:
  print(str(s) + " " + str(s + cnt))
Problem p03737 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print("GREATER" if a>b else "LESS" if a<b else "EQUAL")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print('GREATER' if A > B else 'LESS' if A < B else 'EQUAL')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
print('GREATER' if A > B else 'EQUAL' if A == B else 'LESS')