Problem:


Score : 200 points

Problem Statement

Print all the integers that satisfies the following in ascending order:

Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

Constraints

1 \leq A \leq B \leq 10^9

1 \leq K \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B K

Output

Print all the integers that satisfies the condition above in ascending order.

Sample Input 1

3 8 2

Sample Output 1

3
4
7
8

3 is the first smallest integer among the integers between 3 and 8.

4 is the second smallest integer among the integers between 3 and 8.

7 is the second largest integer among the integers between 3 and 8.

8 is the first largest integer among the integers between 3 and 8.

Sample Input 2

4 8 3

Sample Output 2

4
5
6
7
8

Sample Input 3

2 9 100

Sample Output 3

2
3
4
5
6
7
8
9



Sample input:
3 8 2


Sample output:
3
4
7
8

Submission status: Runtime Error

Solution code:
A = input('Aを入力してください')
B = input('Bを入力してください')
K = input('Cを入力してください')
#print('A= ', A)
#print('B= ', B)
#print('K= ', K)

#A = 1
#B = 10
#K = 6

ANS = []

for i in range(K + 1):
    ANS.append(A + i)


for j in range(K + 1):
    if B - j not in ANS:
        ANS.append(B - j)

ANS.sort()

#print(ANS)

for i in range(len(ANS)):
#    print(ANS[i])

Submission status: Runtime Error

Solution code:
A = input('Aを入力してください')
B = input('Bを入力してください')
K = input('Cを入力してください')
#print('A= ', A)
#print('B= ', B)
#print('K= ', K)

#A = 1
#B = 10
#K = 6

ANS = []

for i in range(K + 1):
    ANS.append(A + i)


for j in range(K + 1):
    if B - j not in ANS:
        ANS.append(B - j)

ANS.sort()

print(ANS)

#for i in range(len(ANS)):
#    print(ANS[i])

Submission status: Runtime Error

Solution code:
setA = set([i for i in range(A,min(A+K,B+1))])
setB = set([i for i in range(max(A,B-K+1),B+1)])
setAB = sorted(setA | setB)
for i in list(setAB):
    print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,raw_input().split(' '))
small_arr=[int(i) for i in range(a,b+1)]
large_arr=[]
for i in range(0,len(small_arr)/2):
	large_arr.append(small_arr.pop())
large_arr=large_arr[::-1]
if len(small_arr)<=k:
	for i in small_arr:
		print i
else:
	for i in range(0,k):
		print small_arr[i]
		
if len(large_arr)<=k:
	for i in large_arr:
		print i
else:
	for i in range(0,k):
		print large_arr[i]

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

if len(C)>2*K:
    for i in range(A, A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)

else:
    for i in range(A,B+1):
        print(i)

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

if len(C)<2*K:
    for x in range(len(C)):
        print(C[x])
        
        
else:
    for y in range(K):
        print(C[y])
    for z in range(len(C)-K,len(C)):
        print(C[z])

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

if len(C)<2*K:
    for x in range(len(C)):
        print(C[x])
        
        
else:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B-2):
        print(C[z])

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

if len(C)<=K:
    for x in range(len(C)):
        print(C[x])

        
elif len(C)<2*K:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B-3):
        print(C[z])
        
        
else:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B-2):
        print(C[z])

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
Z = list(range(A, B+1))
Z = Z[:K] + Z[-K:]
A = set()
for z in Z:
    if z not in A:
        print(z)
        A.add(z)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
Z = list(range(A, B+1))
Z = Z[:K] + Z[-K:]
Z = set(Z)
Z = sorted(list(Z))
for z in Z:
    print(z)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
Z = list(range(A, B+1))
Z = Z[:K] + Z[-K:]
Z = set(Z)
Z = sorted(list(Z))
print(*Z, sep="\n")

Submission status: Runtime Error

Solution code:
A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

value = []
if A == B:
    value = A
if B <= K:
    value.extend([i for i in range(A, B+1)])

else:
    value.extend([i for i in range(A, A+K)])
    value.extend([i for i in range(B-K+1, B+1)])    


num = list(set(value))
num.sort()
for i in range(len(num)):
    print(num[i])

Submission status: Runtime Error

Solution code:
abk = list(map(int, input().split()))
a = abk[0]
b = abk[1]
k = abk[2]
num = list(range(a, b + 1))
uplist = num[:k]
downlist = num[-k:]
[print(i) for i in sorted(list(set(uplist + downlist)))]

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

if max(C)<=K:
    for x in range(B):
        print(C[x])

        
else:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B-2):
        print(C[z])

Submission status: Runtime Error

Solution code:
a = input()
b = a.split()
c = list(map(float,b))
i = c[0]
if c[2]>=((c[1]-c[0])+1)/2-0.5:
    while i <=c[1]:
        print(int(i))
        i=i+1
        
else:
    for x in range(c[2]):
        print(int(c[0]+x))
    for y in range(c[2]):
        print(int(c[1]+y-1))

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

if max(C)<=K:
    for x in range(B):
        print(C[x])

        
else:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B):
        print(C[z])

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

E=C[B-K-2:]


if max(C)<=K:
    for x in range(B):
        print(C[x])


        
else:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B):
        print(C[z])

Submission status: Runtime Error

Solution code:
def main():
    a, b, k = (int(i) for i in input().split())
    l = list(range(a,b + 1))
    mi=0
    ma=0
    lo =[]
    while(mi<k):
        if mi < len(l):
            s = l[mi]
            lo.append(s)
            mi += 1
        else:
            break
    l.reverse()
    while(ma<k):
        if ma < len(l):
            s = l[ma]
            lo.append(s)
            ma += 1
        else:
            break
    li_uniq = list(set(lo))
    li_uniq.sort()
    for i in li_uniq:
        print(i)

main()

Submission status: Runtime Error

Solution code:
import numpy as np

A, B, K = map(int,input().split())

C = np.arange(A,B+1)

print(C)

E=C[B-K-2:]


if max(C)<=K:
    for x in range(B):
        print(C[x])


        
else:
    for y in range(K):
        print(C[y])
    for z in range(B-K-2,B):
        print(C[z])

Submission status: Runtime Error

Solution code:
from collections import deque

A, B, K = input().split()

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = deque(list(set(value)))

for i in range(len(num)):
    print(num[i])

Submission status: Runtime Error

Solution code:
A = input()
A = int(A)
B = input()
B = int(B)
K = input()
K = int(K)
for i in range(A,A+K):
    print(i)
for j in range(B-K+1,B+1):
    print(j)

Submission status: Runtime Error

Solution code:
a,b,k = list(map(int,input().split()))


import numpy as np

X = np.arange(a,b+1)
Y = (X<a+k)+(X>b-k)
count = 0

for i in a:
     if Y[count]:
         print(X[count])
     count+=1

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())

list2 = [ A + K - 1 , B - K + 1]
if min(list2) == max(list2):
    list3 = ["-1"]
else:
    list3 = list(range(min(list2)+1,max(list2)))
i = A
while i <= B:
    if i not in list3:
        print(i)
    elif A > B - K:
        print(i)
    i += 1

Submission status: Runtime Error

Solution code:
def main():
    a, b, k = (int(i) for i in input().split())
    l = list(range(a,b + 1))
    mi=0
    ma=0
    lo =[]
    while(mi<k):
        if mi < len(l):
            s = l[mi]
            lo.append(s)
            mi += 1
        else:
            break
    l.reverse()
    while(ma<k):
        if ma < len(l):
            s = l[ma]
            lo.append(s)
            ma += 1
        else:
            break
    li_uniq = list(set(lo))
    li_uniq.sort()
    for i in li_uniq:
        print(i)
            

main()

Submission status: Runtime Error

Solution code:
import numpy as np
ip=[int(x) for x in input().split()]
x=ip[1]-ip[0]+1
n=np.linspace(ip[0],ip[1],x)
xl=list(n[:ip[2]])
xh=list(n[-ip[2]:])
ans=xl+xh
anss=list(set(ans))
anss.sort()
for i in anss:
	print(int(i))

Submission status: Runtime Error

Solution code:
a,b,k = list(map(int,input().split()))

temp = []

count = a

while count < a+k:
    if count == b:
        break
    print(count)
    temp.append(count)
    count += 1

count = b-k+1

while count <= b:
    if count < temp[-1]:
        count = temp[-1]
    if count in temp:
        count += 1
        continue
    print(count)
    count += 1

Submission status: Runtime Error

Solution code:
def main():
    a, b, k = (int(i) for i in input().split())
    l = list(range(a,b + 1))
    mi=0
    ma=0
    lo =[]
    while(mi<k):
        if mi < len(l):
            s = l[mi]
            lo.append(s)
            mi += 1
        else:
            break
    l.reverse()
    while(ma<k):
        if ma < len(l):
            s = l[ma]
            lo.append(s)
            ma += 1
        else:
            break
    li_uniq = list(set(lo))
    for i in li_uniq:
        print(i)
            

main()

Submission status: Runtime Error

Solution code:
#coding utf-8
A,B,K= map(int,input().split())
y = list(range(A,B + 1))
for i in y[0:K]:
    print(i)

for i in y[-K-1:-1]:
    print(i)

Submission status: Runtime Error

Solution code:
A,B,K=map(int, raw_input().split())
l=range(A,B+1)
d=len(l)

if d/2>=K:
	for i in l[:K]:
		print i
	for i in l[-1*K:]:
		print i
elif d/2<K and K<d:
	for i in l[:K]:
		print i
	for i in l[ K-d:]:
		print i
else:
	for i in l:
		print i

Submission status: Runtime Error

Solution code:
def main():
    a, b, k = (int(i) for i in input().split())
    l = list(range(a,b + 1))
    mi=0
    ma=0
    lo =[]
    while(mi<k):
        if not l:
            break
        else:
            s = l.pop(0)
            lo.append(s)
            mi += 1
    if l==[]:
        lo.sort()
        for i in lo:
            print(i)
    else: 
        l.reverse()
        while(ma<k):
            if not l:
                break
            else:
                s = l.pop(0)
                lo.append(s)
                ma += 1
        lo.sort()
        for i in lo:
            print(i)
            

main()

Submission status: Runtime Error

Solution code:
#coding utf-8
A,B,K= map(int,input().split())
y = list(range(A,B + 1))
for i in y[0:K]:
    print(i)

for i in y[-1:-K-1:-1]:
    print(i)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())

list2 = [ A + K , B - K]
list3 = list(range(min(list2),max(list2)+1))
i = A
while i <= B:
    if i not in list3:
        print(i)
    elif A > B - K:
        print(i)
    i += 1

Submission status: Runtime Error

Solution code:
#coding utf-8
A,B,K= map(int,input().split())
y = list(range(A,B + 1))
#for i in y[0:K]:
  #  print(i)

print(y[-1:-K-1:-1])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
inputs = input().split()
A = int(inputs[0])
B = int(inputs[1])
K = int(inputs[2])


if A + K < B - K:
    candidates = np.concatenate(np.arange(A, A + K + 1), np.arange(B - K, B + 1))
else:
    candidates = np.arange(A, B + 1)
    candidates = candidates[np.logical_or(candidates < A + K, candidates > B - K)]

for s in np.sort(candidates):
    print(s)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
inputs = input().split()
A = int(inputs[0])
B = int(inputs[1])
K = int(inputs[2])


if A + K < B - K:
    candidates = np.concatenate(np.arange(A, A + K), np.arange(B - K, B))
else:
    candidates = np.arange(A, B + 1)
    candidates = candidates[np.logical_or(candidates < A + K, candidates > B - K)]

for s in np.sort(candidates):
    print(s)

Submission status: Runtime Error

Solution code:
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = list(set(value)).sort()

for i in range(len(num)):
    print(num[i])

Submission status: Runtime Error

Solution code:
a, b, k = map(int, raw_input().split())
for x in range(a,b):
  if x < a + k  or x > b - k:
    print(x)
  else:
    continue

Submission status: Runtime Error

Solution code:
def main():
    a, b, k = (int(i) for i in input().split())
    l = list(range(a,b + 1))
    mi=0
    ma=0
    lo =[]
    while(mi<k):
        if not l:
            break
        else:
            s = l.pop(0)
            lo.append(s)
            mi += 1
    l.reverse()
    while(ma<k):
        if not l:
            break
        else:
            s = l.pop(0)
            lo.append(s)
            ma += 1
    lo.sort()
    for i in lo:
        print(i)

main()

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())

nums = list(range(a,b+1))
n = len(nums)


if (k-1>=n-k):
    for ele in nums: print(ele)

else:
    for i in range(0,k): print(nums[i])
    for i in range(n-k,n): print(nums[i])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

A,B,K = map(int, input().split())

ns = list(range(A, B+1))
first =  ns[:K]
last  = ns[-K:]

u = list(set().union(first, last))

for n in u:
  print(n)

Submission status: Runtime Error

Solution code:
A,B,K=map(int, raw_input().split())
l=range(A,B+1)

if len(l)/2>=K:
	for i in l[:K]:
		print i
	for i in l[-1*K:]:
		print i
elif len(l)/2<K and K<len(l):
	for i in l[:K]:
		print i
	for i in l[ K-len(l):]:
		print i
else:
	for i in l:
		print i

Submission status: Runtime Error

Solution code:
A,B,K=map(int, raw_input().split())
l=range(A,B+1)

if len(l)/2>=K:
	for i in l[:K]:
		print i
	for i in l[-K:]:
		print i
#elif len(l)/2<K and K<len(l):
#	for i in l[:K]:
#		print i
#	for i in l[ K-len(l):]:
#		print i
else:
	for i in l:
		print i

Submission status: Runtime Error

Solution code:
def main():
    a, b, k = (int(i) for i in input().split())
    l = list(range(a,b + 1))
    mi=0
    ma=0
    while(mi<k):
        if not l:
            break
        else:
            s = l.pop(0)
            print(s)
            mi += 1
    l.reverse()
    while(ma<k):
        if not l:
            break
        else:
            s = l.pop(0)
            print(s)
            ma += 1
    

main()

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())

nums = list(range(a,b+1))
n = len(nums)
if k>n: k=n

for i in range(0,k): print(nums[i])
if (k-1<n-k):
    for i in range(n-k,n): print(nums[i])
else:
    for i in range(k,n): print(nums[i])

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

A,B,K = map(int, input().split())

ns = list(range(A, B+1))
first =  ns[:K]
last  = ns[-K:]

for n in first + last:
  print(n)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
inputs = input().split()
A = int(inputs[0])
B = int(inputs[1])
K = int(inputs[2])

candidates = np.arange(A, B + 1)
candidates = candidates[np.logical_or(candidates < A + K, candidates > B - K)]

for s in np.sort(candidates):
    print(s)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())

nums = list(range(a,b+1))
n = len(nums)

for i in range(0,k): print(nums[i])
if (k-1<n-k):
    for i in range(n-k,n): print(nums[i])
else:
    for i in range(k,n): print(nums[i])

Submission status: Runtime Error

Solution code:
import numpy as np
a, b, k = map(int, input().split())
x = np.arange(a, b + 1)
m = x[0:k]
n = x[-k:]
for i in np.unique(np.hstack((m, n))):
    print(i)

Submission status: Runtime Error

Solution code:

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

l = list(range(a,b+1))

x = list()
for i in range(0, min([k,len(l)])):
  x.append(l[i])
  x.append(l[-i-1])

for xx in sorted(set(x)):
  print(xx)

Submission status: Runtime Error

Solution code:
A,B,K=map(int, raw_input().split())
l=range(A,B+1)

if len(l)/2>=K:
	for i in l[:K]:
		print i
	for i in l[-K:]:
		print i
elif len(l)/2<K and K<len(l):
	for i in l[:K]:
		print i
	for i in l[ K-len(l):]:
		print i
else:
	for i in l:
		print i

Submission status: Runtime Error

Solution code:
A,B,K=map(int,input().split())
nums = list(range(A,B+1))
result = []
L = min(B-A+1,K)
for i in range(L):
    if nums[i] not in result:
        result.append(nums[i])
nums.sort(reverse=True)
for j in range(L):
    if nums[j] not in result:
        result.append(nums[j])
result.sort()
for x in result:
    print(x)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
A = input();
B = input();
K = input();

for lop in range(int(A),int(A)+int(K)):
    if lop > int(B):
        break;
    print(lop);
    fg = lop;
        
if int(B)-int(K)+1 >= int(A):
    if fg+1 < int(B)-int(K)+1:
        fg = int(B)-int(K)+1;
    else:
        fg+=1
    for lop in range(fg,int(B)):
        print(lop);
    print(B);

Submission status: Runtime Error

Solution code:
A,B,K=map(int,input().split())
nums = list(range(A,B+1))
result = set()
L = min(B-A+1,K)
for i in range(L):
    result.add(nums[i])
nums.sort(reverse=True)
for j in range(L):
    result.add(nums[j])
for x in result:
    print(x)

Submission status: Runtime Error

Solution code:
A, B, K = [int(i) for i in input().split()]
ra = list(range(A, B+1))
for i in ra:
    if i < A + K or B - K < i:
        print(i)

Submission status: Runtime Error

Solution code:
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

value = deque([])
s = deque([i for i in range(A, B+1)])

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = deque()

for i in range(len(value)):
    if value[i] not in num:
        num.append(value[i])
        print(value[i])

Submission status: Runtime Error

Solution code:
ip=[int(x) for x in input().split()]
n=list(range(ip[0],ip[1]+1))
xl=n[:ip[2]]
xh=n[-ip[2]:]
ans=xl+xh
anset=list(set(ans))
anset.sort()
for i in anset:
	print(i)

Submission status: Runtime Error

Solution code:
A,B,K=map(int,input().split())
nums = list(range(A,B+1))
result = set()
L = min(B-A+1,K)
for i in range(L):
    result.add(nums[i])
for j in range(1,L+1):
    result.add(nums[-j])
for x in result:
    print(x)

Submission status: Runtime Error

Solution code:
ip=[int(x) for x in input().split()]
n=list(range(ip[0],ip[1]+1))
print(n)
xl=n[:ip[2]]
xh=n[-ip[2]:]
ans=xl+xh
anset=list(set(ans))
anset.sort()
for i in anset:
	print(i)

Submission status: Runtime Error

Solution code:
A,B,K=map(int, raw_input().split())
l=range(A,B+1)

if len(l)/2>=K:
	for i in l[:K]:
		print i
	for i in l[-K:]:
		print i
elif len(l)/2<K and K<len(l):
	for i in l[:K]:
		print i
	for i in l[ ( K-(2*K-len(l)) )*-1:]:
		print i
else:
	for i in l:
		print i

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
d=c+1
e=b-a
f=0
g=0
if d==e:
  while e>f:
    print(a)
    a+=1
    f+=1
else:
  while c>f:
    print(a)
    a+=1
    f+=1
  while c>g:
    print(b-1)
      b+=1
      g+=1

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
inputs = input().split()
A = int(inputs[0])
B = int(inputs[1])
K = int(inputs[2])

candidates = np.arange(A, B + 1)
candidates = candidates[np.logical_or(candidates < A + K, candidates > B - K)]

for s in candidates:
    print(s)

Submission status: Runtime Error

Solution code:
A,B,K=map(int, raw_input().split())
l=range(A,B+1)

if len(l)/2>=K:
	for i in l[:K]:
		print i
	for i in l[-K:]:
		print i
elif len(l)/2<K and K<len(l):
	for i in l[:K]:
		print i
	for i in l[ ( K-(2*K-len(l)) )*-1:]:
		print i
elif len(l)/2<K and K>=len(l):
	for i in l:
		print i

Submission status: Runtime Error

Solution code:
a = input()
b = input()
k = input()

a = int(a)
b = int(b)
k = int(k)
print("ans")
if b - a >= k*2:
    for i in range(a,a+k):
        print(i)
    print("ss")
    for i in range(b-k+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)

Submission status: Runtime Error

Solution code:
def main():
    A, B, K = map(int, input().split())
    r = set()
    for i in range(A, A + K):
        r.add(i)

    for i in range(B, B - K, -1):
        r.add(i)
    O = list(r).sort()
    for o in O:
        print(o)


main()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
inputs = input().split()
A = int(inputs[0])
B = int(inputs[1])
K = int(inputs[2])

candidates = np.arange(A, B + 1)
candidates = candidates[np.logical_or(candidates < A + K, candidates > B - K)]

print(candidates)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())

nums = list(range(a,b+1))
rev = list(reversed(list(range(a,b+1))))

n = len(nums)
if k>n: k=n

ans = nums[0:k]+list(reversed(rev[0:k]))
for ele in list(set(ans)): print(ele)

Submission status: Runtime Error

Solution code:
#-*- coding:utf-8 -*-

if __name__ == "__main__":
    A, B, K = list(map(int, input().split()))
    end = A + K
    if end >= B+1:
        end = B
    for i in range(A, end):
        print(i)

    start = B - K + 1
    if start <= i:
        start = i + 1
    for j in range(start, B+1):
        print(j)

Submission status: Runtime Error

Solution code:
A,B,K = map(int, input().split())
X = []
L = B-A+1
if 2*K>=L:
    for i in range(L):
        print(A+i)
else:
    for j in range(K):
        print(A+i)
    for k in range(K):
        print(A-K+k)

Submission status: Runtime Error

Solution code:
from collections import deque

A, B, K = input().split()

A = int(A)
B = int(B)
K = int(K)

s = [i for i in range(A, B+1)]
value = deque()

for i in range(K):
    if s[i] not in value:
        value.append(s[i])

for i in range(len(s)-K, len(s)):
    if s[i] not in value:
        value.append(s[i])

for i in range(len(value)):
    print(value[i])

Submission status: Runtime Error

Solution code:
from sys import stdin


def main():
    A, B, K = [int(x) for x in stdin.readline().rstrip().split()]
    tmp = list(range(A, B + 1))
    a = tmp[:K]
    b = tmp[-K:]
    c = sorted(list(set(a + b)))
    for x in c:
        print(x)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
n = list(range(a,b+1))
nf=n[:k]
nb=n[len(n)-k:]
n=list(set(nf+nb))
n.sort()
for i in n:
    print(i)