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:
a, b, k = list(map(int, input().split()))

s = []

if b - k + 1 > a + k - 1:
    for i in range(k):
        s.append(a + i)
    for i in reversed(range(k)):
        s.append(b - i)
else:
    for i in range(a, b+1):
        s.append(i)

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

Submission status: Accepted

Solution code:
A, B, K = list(map(int, input().split()))
x = [A+i for i in range(K) if A+i <= B]
y = [B-i for i in range(K) if B-i >= A]
z = sorted(list(set(x + y)))
for a in z:
    print(a)

Submission status: Accepted

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

if k > b - a:
    k = b - a + 1

nums = list(range(a, a + k)) + list(range(b - k + 1, b + 1))

nums = sorted(list(set(nums)))

for num in nums:
    print(num)

Submission status: Accepted

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

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

out = [i for i in range(A, min(A + K, B + 1))]
out += [i for i in range(max(B - K + 1, A + K), B + 1)]

print(*out, sep='\n')

Submission status: Accepted

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

if (B - A) < 2*K-1:
    for i in range(A, B+1):
        print(i)
else:
    C = set(range(A, A+K))
    for i in range(B-K+1, B+1):
        C.add(i)
    C = list(C)
    C.sort()
    for i in C:
        print(i)

Submission status: Accepted

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

for i in range(a, a + k):
    if i <= b and ret.count(i) == 0:
        ret.append(i)

for i in range(b - k + 1, b + 1):
    if i >= a and ret.count(i) == 0:
        ret.append(i)

for i in ret:
    print(i)

Submission status: Accepted

Solution code:
a,b,k =map(int, input().split())
c=list(range(a,a+k))
d=list(range(b-k+1,b+1))
e=list(set(c+d))
e.sort()
for i in e:
    if a<=i<=b:
        print(i)

Submission status: Accepted

Solution code:
def extract_num(n):
    n_set.add(n)


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

cnt = 0
for n in range(A, B+1):

    extract_num(n)

    cnt += 1
    if cnt >= K:
        break

cnt = 0
for n in range(B, A-1, -1):

    extract_num(n)

    cnt += 1
    if cnt >= K:
        break

n_set = sorted(n_set)

for n in n_set:
    print(n)

Submission status: Accepted

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

out = set()
for i, j in enumerate(range(A, B + 1)):
    if i + 1 > K:
        break
    out.add(j)
for i, j in enumerate(range(B, A, -1)):
    if i + 1 > K:
        break
    out.add(j)

for i in sorted(list(out)):
    print(i)

Submission status: Accepted

Solution code:
#abc093b

a,b,k=map(int,raw_input().split())
for i in xrange(a,min(b,a+k-1)+1):
 print i
for i in xrange(max(b-k+1,a+k),b+1):
 print i

Submission status: Accepted

Solution code:
a, b, k = map(int, raw_input().split())
print '\n'.join(map(str, sorted(list(set(range(a, min(b + 1, a + k))) | set(range(b, max(b - k, a - 1), -1))))))

Submission status: Accepted

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

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

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

ret = set()
for i in range(A, A + K):
    if i <=B:
        ret.add(i)

for j in range(B - K + 1, B + 1):
    if j >= A:
        ret.add(j)

for n in sorted(list(ret)):
    print(n)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
if __name__ == "__main__":
    a,b,k = map(int, input().split())
    ans = []
    if b-a+1 >= 2*k:
        for tmp in range(a, a+k):
            ans.append(tmp)
        for tmp in range(b-k+1,b+1):
            ans.append(tmp)
    else:
        for tmp in range(a, b+1):
            ans.append(tmp)
    ans.sort()
    for tmp in ans:
        print(tmp)

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-1, -1, -1):
        print(b-i)

else:
    for i in range(a, b+1):
        print(i)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
*p, = range(A, min(B+1, A+K))
*q, = range(max(A, B-K+1),B+1)
print(*sorted(set(p+q)), sep='\n')

Submission status: Accepted

Solution code:
a, b, k = [int(i) for i in input().split()]
s = set()
for i in range(a, a+k):
    if i in range(a, b+1):
        s.add(i)

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

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

Submission status: Accepted

Solution code:
inpt = map(int, raw_input().split())

for i in range(inpt[0], inpt[0]+inpt[2]):
	if i > inpt[1]: break
	print i
for i in range(inpt[1]-inpt[2]+1, inpt[1]+1):
	if i >= inpt[0]+inpt[2]:
		print i

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
a_upper = min(b, a+k-1)
b_lower = max(a, b-k+1)
u = set(range(a, a_upper+1))
v = set(range(b_lower, b+1))
for i in sorted(list(u|v)):
  print(i)

Submission status: Accepted

Solution code:
def solve(a, b, c):
    if (b - a + 1 < c):
        c = b - a + 1
    d = list(range(a, a+c))
    e = list(range(b-c+1,b+1))
    f = d+e
    g = list(set(f))
    g.sort()
    h = list(map(str, g))
    return h

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

ans = solve(a, b, c)

print("\n".join(ans) + "\n")

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
print(*sorted(list(set([A+i for i in range(K) if A+i <= B]) | set([B-i for i in range(K) if B-i >= A]))), sep='\n')

Submission status: Accepted

Solution code:
import sys

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

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

#S = input('ABKを入力してください')
S = input()
S = S.split(' ')

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

#sys.exit()

A = int(S[0])
B = int(S[1])
K = int(S[2])

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


for j in range(K):
    if B - j not in ANS and B - j >= A:
        ANS.append(B - j)

ANS.sort()

#print(ANS)

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
x = A
while x < A+K and x <= B:
    print(x)
    x += 1
for y in range(max(x, B-K+1), B+1):
    print(y)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a, b, n = map(int,input().split())
for i in range(a, a + n + 1):
    if i > b - n:
        break
    if i <= a + n - 1:
        print(i)
    
for j in range(b - n, b + 1):
    if i > b:
        break
    if j >= b - n + 1 and a <= j:
        print(j)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
K2=B-A+1
K3=K2-K*2
if K3 > 0:
    for i in range (K):
        print ('%d'%(A+i))
    for i in range (K):
        print ('%d'%(B-K+i+1))
if K3 <= 0:
    for i in range (B-A+1):
        print ('%d'%(A+i))

Submission status: Accepted

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

st = set()

for i in range(0, k):
    if a+i <= b:
        st.add(a+i)
    else:
        break

for i in range(0, k):
    if b-i >= a:
        st.add(b-i)
    else:
        break

ls = list(sorted(st))

for i in ls:
    print(i)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
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: Accepted

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

if b - a + 1 > 2 * k:
    l = [int(i) for i in range(a, a + k)] + [int(j) for j in range(b - k + 1, b + 1)]
    #print([a : a + k + 1] + [b - k: b + 1]) ?
else:
    l = [int(i) for i in range(a, b + 1)]

for i in l:
    print(i)

Submission status: Accepted

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

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

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []    
    data = input()
    array_result.append(data.split(" "))

    flg = True

    try:
        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
k = int(arr_data[0][2])

#print(a,b,k)

s1=set()

cnt=0

for i in range(a,b+1):
    
#    print(i)

    if cnt<k:
        
        s1.add(i)
        cnt+=1
    else:
        break
        
cnt=0
for i in range(b,a-1,-1):
    
    if cnt<k:
        
        s1.add(i)
        cnt+=1
    else:
        
        break
        
#print(s1)
list01=sorted(list(s1),reverse=False)
#print(list01)
#print(list(map(str, list01)))
print("\n".join(list(map(str, list01))))

Submission status: Accepted

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

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

ans = set()

for i in range(A, A+K):
    if i > B:
        break
    ans.add(i)

for i in range(B, B-K, -1):
    if i < A:
        break
    ans.add(i)
for i in sorted(list(ans)):
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

L = B - A + 1

if L >= 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: Accepted

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

Solution code:
a, b, k = list(map(int, input().split()))
ans = set()
for i in range(a, a + k):
    if i <= b:
        ans.add(i)
for i in range(b - k + 1, b + 1):
    if i >= a:
        ans.add(i)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
ans = []
for a in range(A, min(A+K, B+1)):
    ans.append(a)
for b in range(max(A+K, B-K+1), B+1):
    ans.append(b)
print(*ans, sep="\n")

Submission status: Accepted

Solution code:
ip=[int(x) for x in input().split()]
a=ip[0];b=ip[1];k=ip[2]
ans=list()
for i in range(0,k):
    ans.append(a)
    ans.append(b)
    a=a+1
    b=b-1
    if((a>ip[1])|(b<ip[0])):
        break
res=list(set(ans))
res.sort()
for i in res:
    print(i)

Submission status: Accepted

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

value = []

if B - A < K or 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: Accepted

Solution code:
A,B,K=map(int,input().split())
S=set()
for i in range(A,min([A+K,B+1])):
  S.add(i)
for i in range(max([B-K+1,A]),B+1):
  S.add(i)
T=list(S)
T.sort()
for i in T:
  print(i)

Submission status: Accepted

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

if (b-a)//2 >= k:
	for i in range(a,a+k):
		ans.append(i)
	for i in range(b-k+1,b+1):
		ans.append(i)
	ans.sort()
	for i in range(len(ans)):
		print(ans[i])
else:
	for i in range(a,b+1):
		print(i)

Submission status: Accepted

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

# 3つの数字をリストから数値の変数に
input_list = input().split()
start_num = int(input_list[0])
end_num = int(input_list[1])
range_num = int(input_list[2])

result_list = []
for i in range(start_num, end_num + 1):
	# 前半の条件に当てはまるものを抽出
	if i < start_num + range_num:
		result_list.append(i)
	else:
		break

for i in range(end_num, start_num -1, -1):
	# 後半の条件に当てはまるものを抽出
	if i > end_num - range_num:
		result_list.append(i)
	else:
		break

# 重複削除
result_list = list(set(result_list))
# 昇順ソート
result_list.sort()

for num in result_list:
	print(num)

Submission status: Accepted

Solution code:
lst=[]
a,b,k=map(int,input().split())
x=a
for i in range(k):
    if x<=b:
        if x not in lst:
            lst.append(x)
            x+=1
    else:
        break
x=b-k+1
for i in range(k):
    if a<x<=b and x not in lst:
        lst.append(x)
        x+=1
    else:
        x+=1

for num in lst:
    print(num)

Submission status: Accepted

Solution code:
data = list(map(int,input().split()))
a = range(data[0],data[1]+1)
if data[2] > ((data[1] - data[0] + 1)//2):
  for i in range(data[1] - data[0] + 1):
  	print(a[i])
else:
  for i in range(data[2]):
  	print(a[i])
  for j in range(data[1] - data[0] - data[2]+1, data[1]- data[0]+1):
  	print(a[j])

Submission status: Accepted

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


temp = []

for i in range(a,a+k):
    temp.append(i)
    if i== b:
        break

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

for i in temp:
    print(i)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
if B - A + 1 >= K:
	for a in range(A-1,A+K-1):
		a += 1
		print(a)
	for b in range(B-K,B):
		b += 1
		if b > A + K - 1:
			print(b)
else:
	for x in range(A-1,B):
		x += 1
		print(x)

Submission status: Accepted

Solution code:
s = input().split()
s = list(map(int,s))
ans = []

i = 0
while i<s[2]:
   if (i+s[0])>s[1]:
      i += 1
   elif (i+s[0])<=s[1]:
      ans.append(int(i + s[0]))
      i += 1

i = 0
while  i<s[2]:
   if (s[1]-i)>=s[0]:
       ans.append(int(s[1]-i))
       i += 1
   elif (s[1]-i)<s[0]:
       i += 1

ans = list(set(ans))
ans.sort()

for a in ans:
   print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/bin/python

a, b, k = map(int, input().split())
for i in range(a, min(a + k, b + 1)):
    print(i)

for i in range(max(a + k, b - k + 1), b + 1):
    print(i)

Submission status: Accepted

Solution code:
A,B,K=map(int, raw_input().split())
c=set()
for i in range(A,min(B+1,A+K)):
	c.add(i)

for i in range(B,max(A-1,B-K),-1):
	c.add(i)


a=list(c)
a.sort()
for i in a:
	print i

Submission status: Accepted

Solution code:
ip=[int(x) for x in input().split()]
a=ip[0]
b=ip[1]
k=ip[2]
if k>=(b-a+1):
  for i in range(a,b+1):
    print(i)
else:
	lw=list(range(a,a+k))
	hg=list(range(b-k+1,b+1))
	res=list(set(lw+hg))
	res.sort()
	for i in res:
  		print(i)

Submission status: Accepted

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

list2 = [ A + K - 1 , B - K + 1]
if A + K - 1 >= B - K +1 or A > B - K:
    i = A
    while i <= B:
        print(i)
        i += 1
else:
    i = A
    while i <= A + K - 1:
        print(i)
        i += 1
    i = B - K + 1
    while i <= B:
        print(i)
        i += 1

Submission status: Accepted

Solution code:
import math

A,B,K=map(int,input().split())
length=B-A+1
 
if math.ceil(length/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: Accepted

Solution code:
C = list(int(i) for i in input().split())
A = []
B = []
for i in range(C[0], C[0]+C[2]):
    if i in range(C[0], C[1]+1):
        A.append(i)
for i in range(C[1]-C[2]+1, C[1]+1):
    if i in range(C[0], C[1]+1):
        if i not in A:
            A.append(i)
A.sort
for i in range(len(A)):
    print(A[i])

Submission status: Accepted

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

s = set()
i = a
while i < b and i < a + k:
    s.add(i)
    i += 1

i = b
while i >= a and i > b - k:
    s.add(i)
    i -= 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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

l,r = A+K-1,B-K+1

if l >= r:
  first = list(range(A, r))
else:
  first = list(range(A, l+1))
last  = list(filter(lambda n: n>=A, range(r, B+1)))

for n in (first + last):
  print(n)

Submission status: Accepted

Solution code:
x = list(map(int, input().split()))
res=[]

if x[0]+x[2]-1>=x[1]-x[2]:
    for i in range(x[0],x[1]+1):
        print(i)
    quit()

for i in range(x[0],x[0]+x[2]):
    res.append(i)
for i in range(x[1]-x[2]+1,x[1]+1):
    res.append(i)

for i in res:
    print(i)

Submission status: Accepted

Solution code:
master_list = list(map(int, input().split(' ')))

sabun = master_list[1] - master_list[0]

if master_list[2] >= sabun:
    next_list = [x for x in range(master_list[0], master_list[1] + 1)]
    print(*next_list, sep='\n')
else:
    a_list = [x for x in range(master_list[0], master_list[0] + master_list[2])]
    b_list = [x for x in range(master_list[1], master_list[1] - master_list[2], -1)]
    last_list = sorted(list(set(a_list) | set(b_list)))
    print(*last_list, sep='\n')

Submission status: Accepted

Solution code:
S = input().split(' ')
s1 = int(S[0])
s2 = int(S[1])
k = int(S[2])
sum = s2 - s1 + 1

if sum < k:
    for i in range(s1, s2 + 1):
        print(i)
elif sum / 2  < k:
    for i in range(s1, s2 + 1):
        print(i)
else:
    for i in range(s1, s1 + k ):
        print(i)
    for i in range(s2 - k + 1, s2 + 1):
        print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

if b - a + 1 > 2 * c:
    for i in range(a, a+c):
        print(i)
    for i in range(b-c+1, b+1):
        print(i)
else:
    for i in range(a, b+1):
        print(i)

Submission status: Accepted

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

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


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

    exit()

#l = [s[i] for i in range(0,K)]
#k = [s[h] for h in range(len(s) - K, len(s))]

for a in range(A,A+K):
    print(a)
for b in range(B-K+1,B+1):
    print(b)

#for t in range(0,K):
#    print(s[t])

# s.reverse()

#for h in range(len(s) - K,len(s)):
#    print(s[h])

Submission status: Accepted

Solution code:
import math

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

if math.ceil((b - a - 1) / 2) + 1 >= k + 1:
    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: Accepted

Solution code:
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

a, b, k = read_line(int, int, int)

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

Submission status: Accepted

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

n=b-a+1

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

else:
    for i in range(a,a+k): print(i)
    for i in range(b-k+1,b+1): print(i)

Submission status: Accepted

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

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem B

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

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

temp=[]
for i in range(K):
    if A+i<B+1: temp.append(A+i)

for i in range(K-1,-1,-1):
    if B-i>A-1: temp.append(B-i)

ans=set(temp)
ans=sorted(ans)

for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

a,b,k = na()
if (b-a+1) // 2 >= k:
    ans = list(range(a,a+k)) + list(range(b-k+1,b+1))
else:
    ans = list(range(a,b+1))
for i in ans:
    print(i)

Submission status: Accepted

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

nums = set()
for i in range(k):
    #print(a)
    nums.add(a)
    a += 1
    if a > b:
        break
for j in range(k):
    #print(b)
    nums.add(b)
    b -= 1
    if a > b:
        break

nums = sorted(nums)
for k in nums:
    print(k)

Submission status: Accepted

Solution code:
a,b,k = map(int, raw_input().split())
li = [i for i in xrange(a,b+1)] if (b-a+1)/2 < float(k) else [i for i in xrange(a,a+k)]+[i for i in xrange(b-k+1,b+1)]
for i in sorted(list(set(li))):
    print i

Submission status: Accepted

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 + 1, B + 1)])
else:
    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: Accepted

Solution code:
A,B,K=map(int,input().split())
if B-A+1<=K:
    for k in range(B-A+1):
        print(A+k)
elif B-A+1>K :
    for i in range(K):
        print(A+i)
if K<B-A+1 and B-A+1<K*2:
    a=B-A+1
    b=K*2-a
    for i in range(K-b):
        print(B-(K-b)+1+i)
elif B-A+1>=K*2 :
    for j in range(K):
        print(B-K+j+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)
for i in range(max(a + k, b - k + 1), b + 1):
    print(i)

Submission status: Accepted

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
k = int(s[2])

def sol(a,b,k):
    if b-a+1 <= 2*k:
        for i in range(a,b+1):
            print(i)
        return True
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
    return (True)

dummy = sol(a, b, k)

Submission status: Accepted

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

Submission status: Accepted

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

while a+i <= b and i < k:
    x = a + i
    print(x)
    i += 1

i = k - 1
while b-i <= b:
    y = b - i
    if y <= x:
        i -= 1
        continue
    print(y)
    i -= 1

Submission status: Accepted

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

if ((B+1-A)/2 >= K):
	for iA in range(A,A+K):
		print(iA)
	for iB in range((B-K+1),B+1):
  		print(iB)
       	
else:
  	for i in range(A,B+1):
	  	print(i)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
s = set()
l = range(a, b+1)

if len(l) <= k:
    for i in l:
        print(i)
else:
    for j in l[:k]:
        s.add(j)
    
    for j in l[len(l)-k:]:
        s.add(j)

    m = sorted(list(s))
    for i in m:
        print(i)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
answer = []
for i in range(A,A+K):
    if i > B: break
    answer.append(i)
for i in range(B,B-K,-1):
    if i < A: break
    answer.append(i)

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

Submission status: Accepted

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

if abs(A-B)<K:
    for i in range(A, B+1):
        print(i)
else:
    x = {i for i in range(A, A+K)}
    y = {j for j in range(B-K+1, B+1)}
    z = x | y
    z = sorted(list(z))
    for a in z:
        print(a)

Submission status: Accepted

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

list_num = []
a_max = -1
for i in range(K):
    if A+i <= B:
        a_max = A+i
        print(a_max)

tmp = K
for i in range(K):
    if B - tmp + 1 > a_max:
        print(B - tmp + 1)
    tmp -= 1

Submission status: Accepted

Solution code:
def small_and_large_integers(A,B,K):
    if B-A+1 <= 2*K:
        for i in range(A, B+1):
            print(i)
    else:
        for i in range(K):
            print(A+i)
        for i in range(K):
            print(B-K+1+i)

def main():
    i = input()
    A,B,K = i.split()
    A,B,K = int(A), int(B), int(K)
    small_and_large_integers(A,B,K)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding=utf-8


def from_down(base, number, upper):
    return_list = []
    range_upper = min(upper+1, base+number)
    for i in range(base, range_upper):
        return_list.append(i)
    return return_list


def from_up(base, number, down):
    return_list = []
    range_down = max(base-number+1, down)
    for i in range(range_down, base+1):
        return_list.append(i)
    return return_list


def remove_double(object_list):
    list_unique = []
    for x in object_list:
        if x not in list_unique:
            list_unique.append(x)
    return list_unique


if __name__ == '__main__':
    A, B, K = map(int, input().split())
    down_list = from_down(A, K, B)
    upper_list = from_up(B, K, A)
    down_list.extend(upper_list)
    unique_list = remove_double(down_list)
    output = [print(element) for element in unique_list]

Submission status: Accepted

Solution code:
data = list(map(int,input().split()))

A = data[0]
B = data[1]
K = data[2]

ans = []
for i in range(K):
    a = A+i
    b = B-i
    
    if a <= b:
        ans.append(a)
    if a >= b:
        break
    
    ans.append(b)
    
ans.sort()

for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())		# 5 7 2


ans=[]
count=0
for i in range(a, b+1):
	ans.append(i)
	count += 1
	if count >= k: break

count=0
for i in range(b, a-1, -1):
	ans.append(i)
	count += 1
	if count >= k: break

ans = sorted(set(ans))

for i in ans:
	print(i)

Submission status: Accepted

Solution code:
A, B, K = list(map(int, input().split()))
if K >= (B - A + 1) / 2 :
    for n in range(A, B+1):
        print(n)
else:
    for n in range(A, A + K):
        print(n)
    for n in range(B - K + 1, B + 1):
        print(n)

Submission status: Accepted

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

    for i in range(K):
        print(A+i)
    if A+2*K-B > 0:
        KD = B-A-K+1
    else: KD = K
    for i in range(KD):
        print(B-KD+1+i)

Submission status: Accepted

Solution code:
def main():
    A, B, K = (int(i) for i in input().split())
    result = set()
    A_min = min(A+K-1, B)
    B_max = max(A, B-K+1)
    for i in range(A, A_min+1):
        result.add(i)
    for j in range(B_max, B+1):
        result.add(j)
    for i in sorted(result):
        print(i)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(A,min(B,A+K)):
  print(i)
  P.append(i)
for i in range(max(A,B-K+1),B+1):
  if i not in P:
    print(i)

Submission status: Accepted

Solution code:
a=input().split()
A=int(a[0])
B=int(a[1])
K=int(a[2])
ans=A
ans1=B-K+1
X0=A
X1=A+K-1
Y0=B
Y1=B-K+1

if(Y1<=X1):
  for i in range(B-A+1):
    if(i>0):
     ans=ans+1
    print(ans)
else:
  for i in range(K):
    if(i>0):
     ans=ans+1
    print(ans)
  for i in range(K):
    if(i>0):
     ans1=ans1+1
    print(ans1)

Submission status: Accepted

Solution code:
A, B, K = (int(i) for i in input().split()) 
low = range(A,A+K)
high = range(B,B-K,-1)
t = sorted(list(set(low) | set(high)))
for s in t:
    if s >= A and s <= B:
        print(s)

Submission status: Accepted

Solution code:
a,b,k = map(int, input().split())
limit = a+k
if a+k >= b:
    limit = b + 1
f = list(range(a,limit))
limit = b-k
if b-k <= a:
    limit = b -1
l = list(range(b,limit,-1))
ll = f+l
ll.sort()
li_uniq = []
for i in ll:
    if i not in li_uniq:
        li_uniq.append(i)
        print(i)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
data = input().split(" ");
A = data[0];
B = data[1];
K = data[2];

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)+1):
        print(lop);