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: Accepted

Solution code:
# your code goes here
A,B,K = map(int,input().split())

if K > (B - A)/2.0:
	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)

Submission status: Accepted

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

for i in range(K):
    n = A + i
    if A<=n and n<=B:
        print(n)
for i in range(K):
    n = B - (K-1) + i
    if A<=n and n<=B and n>A + K - 1:
        print(n)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
if a + k - 1 >= b - k + 1:
     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)

Submission status: Accepted

Solution code:
a,b,c=(map(int, input().split(" ")))
if b-a+1 < c*2:
    for i in range(a,b+1):
        print(i)
else:
    for j in range(a,a+c):
        print(j)
    for k in range(b-c+1,b+1):
        print(k)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
for i in range(k):
  if a+i <= b:
    print(a+i)

for i in range(k):
  if a+k <= b-k+1+i:
    print(b-k+1+i)

Submission status: Accepted

Solution code:
a,b,k = map(int, input().split())
ans = []
for i in range(a, min(a+k,b+1)):
    ans.append(i)
for i in range(max(a,b-k+1), b+1):
    ans.append(i)

ans = sorted(list(set(ans)))
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
a,b,k=list(map(int,input().split()))
for i in range(a,a+k):
  if i<=b:
    print(i)

for i in range(b-k+1,b+1):
  if i>=a+k:
    print(i)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
rec = []
for i in range(a, min(b, a + k)):
    print(i)
    rec.append(i)
for i in range(max(a, b - k + 1), b + 1):
    if i not in rec:
        print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
s = set()
for i in range(a, a+k):
    if i > b:
        break
    s.add(i)

for i in range(b-k+1, b+1):
    if i < a:
        continue
    s.add(i)

for i in sorted(s):
    print(i)

Submission status: Accepted

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

st = A

di = {}
o = []

for i in range(K):
    if A<=st+i and st+i<=B:
        di[st+i] = 1

st = B+1-K

for i in range(K):
    if A <= st + i and st + i <= B:
        di[st+i] = 1

for ke in di.keys():
    o.append(ke)

o.sort()

for item in o:
    print(item)

Submission status: Accepted

Solution code:
import re
import sys

if __name__ == '__main__':
    a,b,k = map(int , raw_input().split())
    l = []
    for i in range(k):
        if a + i <= b:
            print a + i
            l.append(a+i)
    for i in range(k):
        if (b - k + i + 1) not in l and (b - k + i + 1) >= a:
            print b - k + i + 1

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
for i in range(a,min(b+1,a+k)):
    print(i)
if(a+k<b-k+1):
    for i in range(b-k+1,b+1):print(i)
else:
    for i in range(a+k,b+1):print(i)

Submission status: Accepted

Solution code:
A, B, K = [int(x) for x in input().split()]

last = A+K if A+K < B else B
for i in range(A, last):
    print(i)
first = B-K+1 if B-K+1 > last else last
for i in range(first, B+1):
    print(i)

Submission status: Accepted

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

ans = []
for i in range(K):
    if A + i <= B:
        ans.append(A + i)
    else:
        break

for j in range(K):
    if B - j >= A:
        ans.append(B - j)
    else:
        break

ans2 = sorted(list(set(ans)))

for a in ans2:
    print(a)

Submission status: Accepted

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

for i in range(K):
    if A + i <= B:
        print(A + i)

for j in range(K):
    if (B - K + j + 1 > A + K - 1) and (B - K + j + 1 <= B):
        print(B - K + j + 1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# import numpy as np
# N = input()
a, b, k = map(int, raw_input().split())


if a + 2 * k - 2 >= b:
    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

Submission status: Accepted

Solution code:


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

result = []

for i in range(k):
    result.append(a + i)

for i in range(k):
    result.append(b - k + i + 1)

for c in sorted(list(set(result))):
    if a <= c <= b:
        print(c)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
count = 0
ls = []
for x in range(a, b):
    count += 1
    if count <= k and x not in ls:
        ls.append(x)
    if count > k:
        break
count = 0
for x in range(b, a-1, -1):
    count += 1
    if count <= k and x not in ls:
        ls.append(x)
    if count > k:
        break
ls.sort()
for x in range(len(ls)):
    print(ls[x])

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
ans = []
for k in range(K):
    if A+k > B-k:
        break
    else:
        ans.append(A+k)
        ans.append(B-k)
ans = set(ans)
ans = sorted(ans)
for x in ans:
    print(x)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
printed = list()
for i in range(A, min(B + 1, A + K)):
    if not i in printed:
        print(i)
        printed.append(i)
for i in range(max(A, B - K + 1), B + 1):
    if not i in printed:
        print(i)
        printed.append(i)

Submission status: Accepted

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

result = []
for i in range(A, min(A + K, B)):
    result.append(i)

for i in range(max(B - K + 1, A), B + 1):
    result.append(i)

result = list(set(result))
result.sort()
for r in result:
    print(r)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split(" "))
if b - a + 1 >= 2*k:
    for i in range(k):
        print(a+i)
    for i in range(k):
        print(b-k+i+1)
else:
    for i in range(a,b+1):
        print(i)

Submission status: Accepted

Solution code:
# coding: utf-8

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

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

    for i in range(max(A+K, B-K+1), B+1):
        print i

Submission status: Accepted

Solution code:
def inpl(): return list(map(int, input().split()))
A, B, K = inpl()
ans = []
for i in range(K):
    ans.append(A+i)
    ans.append(B-i)
for i in sorted(set(ans)):
    if A <= i and i <= B:
        print(i)

Submission status: Accepted

Solution code:
a,b,k = (int(i) for i in input().split())
x,y = set(),[]
for i in range(a,min(b+1,a+k)):
	x.add(i)
for i in range(b,max(a-1,b-k),-1):
	x.add(i)
for i in x:
	y.append(i)
y.sort()
for i in y:
	print(i)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Small and Large Integers
https://beta.atcoder.jp/contests/abc093/tasks/abc093_b

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    A, B, K = map(int, input().split())
    ans = set()

    for x in range(A, A+K):
        if x <= B:
            ans.add(x)
    for x in range(B-K+1, B+1):
        if x >= A:
            ans.add(x)

    res = list(ans)
    res.sort()
    print(*res, sep='\n')


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

tmp = []
for i in range(k):
    if a + i <= b:
        tmp.append(a + i)
    if b - i >= a:
        tmp.append(b - i)
    
for i in sorted(set(tmp)):
    print(i)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
l = list(range(a, b+1))
for i in sorted(list(set(l[:k]) | set(l[-k:]))):
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
l = list(range(a, b+1))
if k != 0:
    for i in range(len(list(set(l[:k] + l[-k:])))):
        print(sorted(list(set(l[:k] + l[-k:])))[i])
else:
    print()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
lst = input().split()
A = int(lst[0])
B = int(lst[1])
K = int(lst[2])

number = list(range(A, B+1))

if len(number) <= 2 * K:
   for n in number:
      print(n)
else:
   for n in number[:K]:
      print(n)
   for n in number[((-1) * K):]:
      print(n)

Submission status: Runtime Error

Solution code:
import numpy as np
 
def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:k])
    B=set(numbers[-k:])
    answer = A|B
    
    for i in sorted(answer):
        print("{}".format(i))
 
 
if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.readline
import numpy as np
 
def main():
    numbers=[]
    a,b,k = map(int,input().rstrip().split())
    numbers=np.arange(a,b+1)
    #A=set(numbers[:k])
    #B=set(numbers[-k:])
    #answer = A|B
    
    #for i in sorted(answer):
    #    print("{}".format(i))
 
 
if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.readline
import numpy as np
 
def main():
    numbers=[]
    a,b,k = map(int,input().rstrip().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:min(k,b+1)])
    B=set(numbers[max(b-k,a):])
    answer = A.union(B)
    
    for i in sorted(answer):
        print("{}".format(i))
 
 
if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys
input=sys.stdin.readline
import numpy as np
 
def main():
    numbers=[]
    a,b,k = map(int,input().rstrip().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:k])
    B=set(numbers[-k:])
    answers = A|B
    
    for i in sorted(answers):
        print("{}".format(i))
 
 
if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:k])
    B=set(numbers[-k:])
    answers = A|B
    
    for i in sorted(answers):
        print("{}".format(i))


if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=set(numbers[:k])
    B=set(numbers[-k:])
    answers = A|B
    
    for i in sorted(answers):
        print(i)


if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=numbers[:k]
    B=numbers[-k:]
    A = set(A)
    B = set(B)
    answers = A|B
    print(*answers,sep='\n')

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=numbers[:k]
    B=numbers[-k:]
    if set(A)==set(B):
        answers=A
    else:
        A = set(A)
        B = set(B)
        answers = A|B
    for n in sorted(answers):
        print(n)

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    a,b,k = map(int,input().split())
    numbers=np.arange(a,b+1)
    A=numbers[:k]
    B=numbers[-k:]
    if set(A)==set(B):
        answers=A
    else:
        answers=np.hstack([A,B])
    for n in sorted(set(answers)):
        print(n)

if __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
# coding: utf-8


def main():
    A, B, K = map(int, input().split())
    for i in range(A, B + 1):
        if i < A + K or B - K < i:
            print(i)

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
a,b,n=map(int,input().split())
enda = min(a+n,b)
stab = max(a,b-n)
C = sorted(set(list(range(a,enda)))|set(list(range(stab+1:b+1))))
for i in C:
  print(i)

Submission status: Runtime Error

Solution code:
a,b,n=map(int,input().split())
C = sorted(set([a:min(a+n,b)])|set([max(a,b-n):b]))
for i in C:
  print(i)

Submission status: Runtime Error

Solution code:
a,b,n=map(int,input().split())
C = set(set([a:min(a+n,b)])|set([max(a,b-n):b]))
for i in list(C):
  print(i)

Submission status: Runtime Error

Solution code:
a,b,n=map(int,input().split())
C = set(set([a:min(a+n,b)])|set([max(a,b-n):b]))
for i in C:
  print(i)

Submission status: Runtime Error

Solution code:
a,b,n=map(int,input().split())
C = set([a:min(a+n,b)])|set([max(a,b-n):b])
for i in list(C):
  print(i)

Submission status: Runtime Error

Solution code:
a,b,n=map(int,input().split())
C = [a:min(a+n,b)]|[max(a,b-n):b]
for i in C:
  print(i)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
N = B - A + 1
nums = list(range(A, B + 1))
ans = set()

for i in range(min(K, N)):
    ans.add(nums[i])

nums.reverse()
for i in range(min(K, N)):
    ans.add(nums[i])


ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Submission status: Runtime Error

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

l = B - A + 1

nums = list(range(A, B + 1))
ans = set(nums[:min(K, l + 1)]) | set(nums[-min(K, l):])
ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
if B - A + 1 <= K:
    for i in range(A, B + 1):
        print(i)
    exit()

nums = list(range(A, B + 1))
ans = set(nums[:K]) | set(nums[-K:])
ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
nums = list(range(A, B + 1))
ans = set(nums[:K]) | set(nums[-K:])
ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
2 9 100

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
li = []
[li.append(i) for i in range(a,b+1)]
ans = []
for num in range(k):
    ans.append(li[num])
    if num == 0:
        ans.append(li[num-1])
    else:
        ans.append(li[(num*-1)-1])
ans.sort()
[print(j) for j in ans]

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
x=[]
y=[]
for i in range(a,b+1):
    x.append(i)
for i in range(k):
    y.append(x[i])
for i in range(1,k+1):
    y.append(x[-i])
y.sort()
for i in range(len(y)):
    print(y[i])

Submission status: Runtime Error

Solution code:
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])

Submission status: Runtime Error

Solution code:
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])

Submission status: Runtime Error

Solution code:
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])

Submission status: Runtime Error

Solution code:
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])

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
if b-a+1>k*2:
  print([a:a+k]+[b-k:b],end="\n")
else:
  print([a:b],end="\n")

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
lis = [x for x in range(a, b+1)]
lis2 = []

if 2*k >= b-a+1:
  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)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
lis = [x for x in range(a, b+1)]
lis2 = []

if k >= len(lis):
  for i in lis:
    print(i)
else:
    for i in range(a, a + k):
        print(i)
    for i in range(b - k + 1, b + 1):
        print(i

Submission status: Runtime Error

Solution code:
a,b,k=map(int, input().split())
k=min(k,b-a)
*al,=range(a,b+1)
ans=al[:k]+al[-k:]
ans=list(set(ans))
ans.sort()
for i in ans:print(i)

Submission status: Runtime Error

Solution code:
def main():
    a,b,k=map(int,input().split())
    l=list(range(a,b+1))
    for i in sorted(set(l[:k]+l[len(l)-k:])):
        print(i)
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
def main():
    a,b,k=map(int,input().split())
    l=list(range(a,b+1))
    for i in set(l[:k]+l[len(l)-k:]):
        print(i)
    
if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
S = list(range(A, B + 1))

ans = sorted(set(S[:K] + S[-K:]))
for a in ans:
    print(a)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
S = list(range(A, B + 1))

ans = set(S[:K] + S[-K:])
for a in ans:
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
nums = list(range(a, b+1))
for i in range(a, b+1):
  if nums.index(i) <= k - 1 or nums[::-1].index(i) <= k - 1:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
w = list(range(a,b+1))
p = dict.fromkeys(w[:k] + w[len(w)-k:])
for i in p:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
ans=[]
for i in rangea(a,k+a):
  if a<=i<=b:
    ans.append(i)
    
for i in rangea(b-k+1,b+1):
  if a<=i<=b:
    ans.append(i)
ans=list(set(ans))
ans.sort()
for i in ans:
  print(i)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
l = list(range(A, B + 1))
print('\n'.join(map(str, sorted(l[:K] + l[-K:]))))

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split());n=[*range(a,b+1)]
try:
  n=sorted(set(n[:k]+n[-k:]));print(*n,sep='\n')
except:
  print(*n,sep='\n')

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split());
try:
  n=[*range(a,b+1)]
  n=sorted(set(n[:k]+n[-k:]));print(*n,sep='\n')
except:
  print(*n,sep='\n')

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split());n=[*range(a,b+1)]
n=sorted(set(n[:k]+n[-k:]));print(*n,sep='\n')

Submission status: Runtime Error

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

r = list(range(A, B+1))
for i in sorted(set(r[:K]) | set(r[-K:])):
    print(i)

Submission status: Runtime Error

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

r = list(range(A, B+1))
for i in sorted(set(r[:K] + r[-K:])):
    print(i)

Submission status: Runtime Error

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, K = map(int, input().split())
l = list(range(A, B+1))
# if K >= len(l):
#     print(*l, sep="\n")
#     quit()
# ans = list(set(l[:K] + l[-K:]))
# ans.sort()
# 
# print(*ans, sep="\n")

Submission status: Runtime Error

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, K = map(int, input().split())
l = list(range(A, B+1))
if K >= len(l):
    print(*l, sep="\n")
    quit()
# ans = list(set(l[:K] + l[-K:]))
# ans.sort()
# 
# print(*ans, sep="\n")

Submission status: Runtime Error

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, K = map(int, input().split())
l = list(range(A, B+1))
if K >= len(l):
    print(*l, sep="\n")
    quit()
ans = list(set(l[:K] + l[-K:]))
ans.sort()

print(*ans, sep="\n")

Submission status: Runtime Error

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

A, B, K = map(int, input().split())
l = list(range(A, B+1))
ans = list(set(l[:K] + l[-K:]))
ans.sort()

print(*ans, sep="\n")

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if a+k-1<b-k+1:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in sorted(set(ans)):
	print(i)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
ans = tmp[:k] + tmp[-k:]
for i in sorted(set(ans)):
	print(i)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 > k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 >= k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
ans = tmp[:k] + tmp[-k:]
for i in set(ans):
	print(i)

Submission status: Runtime Error

Solution code:
a, b, k = list(map(int, input().split()))
al, bl = [], []
for i in range(min(b-a,k)):
    al.append(a+i)
    bl.append(b-i)
    ans = list(set(al) | set(bl))
ans.sort()
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted({*(r[:k]+r[-k:])}))

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted({*r[:k]+r[-k:]}))

Submission status: Runtime Error

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

X = list(range(A,B+1,1))
ans = X[0:K]+X[len(X)-K:len(X)]
ans = list(set(ans))
for i in range(len(ans)):
    print(ans[i])

Submission status: Runtime Error

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

L = list(range(A, B+1))
ans = set(L[:K] + L[-K:])
print(*sorted(ans), sep="\n")

Submission status: Runtime Error

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

L = list(range(A, B+1))
ans = L[:K] or L[-K:]
print(*ans, sep="\n")

Submission status: Runtime Error

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

L = list(range(A, B+1))
ans = L[:K] + L[-K:]
print(*ans, sep="\n")

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n)  FOR(i, 0, n)
#define ASC(c) sort((c).begin(), (c).end())
#define DESC(c) sort((c).begin(), (c).end(), greater<int>())

#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
  int A, B, K;
  cin >> A >> B >> K;
  for (int i = A; i <= B; i++) {
    if (i >= A + K && i <= B - K) continue;
    cout << i << endl;
  }
}

Submission status: Runtime Error

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

if (b-a+1) <= 2 *k :
    for i in range(b-a+1) :
        print(num_list[i])
else :
    smaller = num_list[:k]
    larger = num_list[-k:]
    ans = smaller + larger
    for i in range(k*2) :
        print(ans[i])

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
num_list = list(range(a,b+1))
smaller = num_list[:k]
larger = num_list[-k:]
ans = smaller + larger
for i in range(k*2) :
    print(ans[i])

Submission status: Runtime Error

Solution code:
def solve():
    A, B, K = map(int, input().split())
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:min(B-A, K)] + ans[min(0, -K):])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
def solve():
    A, B, K = map(int, input().split())
    if A == B:
        print(A)
        exit()
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
def solve():
    A, B, K = map(int, input().split())
    ans = list(range(A, B + 1))
    if B - A >= K * 2:
        ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
def solve():
    A, B, K = map(int, input().split())
    ans = list(range(A,B+1))
    ans = sorted((set(ans[:K] + ans[-K:])), key=ans.index)

    for a in ans:
        print(a)


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

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

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

lst = list(range(A, B+1))
x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Submission status: Runtime Error

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

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

lst = list(range(A, B+1))
x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Submission status: Runtime Error

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

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

lst = list(range(A, B+1))
lst.sort()

x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:

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

lst = list(range(A, B+1))
lst.sort()

x = [lst[i] for i in range(0, K)]
y = [lst[i] for i in range(-1, -K-1, -1)]

ans = list(set(x) | set(y))
ans.sort()

for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define RNG(i,from,to) for(ll i=(from); i<(ll)(to); i++)
#define gcd(i,j) __gcd((i), (j))
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vecll;
template<typename S, typename T> string to_string(pair<S, T> p) { return "("+to_string(p.first)+","+to_string(p.second)+")"; }
template<typename T> void println(T e){ cout << to_string(e) << endl; }
template<typename T> void println(const vector<T>& v){ cout << "[";for(const auto& e : v){ cout << to_string(e) << ","; }cout << "]";cout << endl; }
template<typename T> void println(const vector<vector<T>>& vv){ for(const auto& v : vv){ println(v); } }
template<typename Iter> void println(Iter first, Iter last){ for(auto it=first; it != last; it++){ cout << *it << " "; }; cout << endl; }
template<typename T> T mod_pow(T x, T n, const T &p) { T ret = 1; while(n > 0) { if(n & 1) (ret *= x) %= p; (x *= x) %= p; n >>= 1; } return ret; }
template<typename T> T mod_inv(T x, const T &p) { return mod_pow(x, p-2, p); }
const ll DVSR = 1e9+7;

int main(int argc, char const *argv[])
{
  ll A, B, K;
  cin >> A >> B >> K;
  auto a = A;
  auto b = B;
  set<ll> st;
  REP(i, K) {
    st.insert(A);
    A++;
    if (A > b) break;
  }
  REP(i, K) {
    st.insert(B);
    B--;
    if (B < a) break;
  }
  for (const auto i : st) {
    cout << i << endl;
  }
  return 0;
}

Submission status: Runtime Error

Solution code:
import collections

a, b, k = map(int, input().split())
numbers = list(range(a, b + 1))
ans = []
ans.extend(numbers[:k])
ans.extend(numbers[len(numbers) - k:])
ans_count = collections.Counter(ans)
for out in ans_count.keys():
    print(out)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
numbers = list(range(a, b + 1))
ans = []
ans.extend(numbers[:k])
ans.extend(numbers[len(numbers) - k:])
for out in ans:
    print(out)

Submission status: Runtime Error

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

result = list(range(A,B+1))[0:K] + list(range(A,B+1))[-K:]
result = list(set(result))
result.sort()
for I in result:
    print(I)

Submission status: Runtime Error

Solution code:
import sys
A,B,K = map(int,input().split())
if not (1 <= A <= B <= 10 ** 9):
    sys.exit()
if not (1 <= K <= 100):
    sys.exit()

result = list(range(A,B+1))[0:K] + list(range(A,B+1))[-K:]
result = list(set(result))
result.sort()
for I in result:
    print(I)

Submission status: Runtime Error

Solution code:
import sys
A,B,K = map(int,input().split())
if not (1 <= A <= B <= 10 ** 9):
    sys.exit()
if not (1 <= K <= 100):
    sys.exit()

array_head = list(range(A,B+1))[0:K]
array_tail = list(range(A,B+1))[-K:]
array_result = array_head + array_tail
for I in set(array_result):
    print(I)

Submission status: Runtime Error

Solution code:
import sys
A,B,K = map(int,input().split())
if not (1 <= A <= B <= 10 ** 9):
    sys.exit()
if not (1 <= K <= 100):
    sys.exit()

array_base = []
array_base = list(range(A,B+1))

array_result = []
array_result = array_base[0:K] + array_base[-K:]
for I in set(array_result):
    print(I)

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
ans = list(range(a, b+1))
ans_1 = a[0:k]
ans_2 = a[k-1]
print(ans_1+ans_2)