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()))
if A+K-1 < B-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:
A, B, K = map(int, input().split())
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 j in range(B - K + 1, B + 1):
		print(j)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
xs = list(range(a, min(a+k, b+1)))
ys = list(range(max(a+k, b+1-k), b+1))

print('\n'.join(map(str, xs+ys)))

Submission status: Accepted

Solution code:
a, b, k = map(int, raw_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())
    
if B - (A-1) < 2*K:
    l = []
    for i in range(A, B+1):
        l.append(i)
    for j1 in l:
        print(j1)
else:
    for j2 in range(A, A+K):
        print(j2)
    for j3 in range(B-K+1, B+1):
        print(j3)

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 = [int(x) for x in input().split()]

def main():
    ans = []

    a_end = min(A + K, B + 1)
    for i in range(A, a_end):
        ans.append(i)
    
    b_start = max(A, B - K + 1)
    for i in range(b_start, B + 1):
        ans.append(i)
    ans = sorted(set(ans))
    
    for a in ans:
        print(a)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(a,a+k):
    if i <=b:
        forward.append(i)
    else:
        continue


back = list()
for i in range(b,b-k,-1):
    if b-k >= a:
        back.append(i)
    else:
        continue
        
answer = forward + back

answer = sorted(list(set(answer)))

for num in answer:
    print(num)

Submission status: Accepted

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

Submission status: Accepted

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

if A+K > B:
    for i in range(A, B+1):
        print(i)

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

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(' '))
i = 0
ans = ''
if k*2 <= (b - a):
    while i < k:
        ans += str(a+i) + '\n'
        i += 1
    while k > 0:
        ans += str(b-k+1) + '\n'
        k -= 1
else:
    while a <= b:
        ans += str(a) + '\n'
        a += 1
print(ans[:-1])

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
data=[]
for k in range(K):
  data.append(A+k)
  data.append(B-k)
  
data_set = set(data)
data=list(data_set)
data.sort()
for i in data:
  if A<=i<=B:
    print(i)

Submission status: Accepted

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

if B - A + 1 <= K * 2:
  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())
a = [A+i for i in range(K) if A+i <= B]
b = [B-K+1+i for i in range(K) if B-K+1+i >= A]
a.extend(b)
a = set(a)
a = [x for x in a]
a.sort()
for i in range(len(a)):
  print(a[i])

Submission status: Accepted

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

if K > (B - A) / 2:
    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 + 1 < K * 2:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(A,min(B,A + K)):
        print(i)

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

Submission status: Accepted

Solution code:
#Small and Large Integers

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

#パターン足りない
if 2*K > B-A:
	for i in range(B-A+1):
		print(A+i)

#パターン足りる
else:
	for j in range(K):
		print(A+j)
	for k in range(K):
		print(B-K+1+k)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
ret = set(range(A, min(A + K, B)))
ret.update(range(max(A, B - K + 1), B + 1))

for r in sorted(ret):
    print(r)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split());i,c=0,[]
while a+i<b-i and i<k:c+=[a+i];i+=1
i-=i==k
while -~i:c+=[b-i];i-=1
print(*sorted(set(c)),sep='\n')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if (2*K) >= (B-A+1):
    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-i)+1)

Submission status: Accepted

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

S=set()
for i in range(k):
    if a+i <= b:
        S.add(a+i)
    if b-i >= a:
        S.add(b-i)
S = [x for x in S]
S.sort()
for i in range(len(S)):
    print(S[i])

Submission status: Accepted

Solution code:
import numpy as np
a,b,k = map(int,input().split())
data = [i for j in (range(a,min(a+k,b)),range(max(b-k+1,a),b+1)) for i in j]
data = np.unique(data)
for i in data:
    print(i)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
list_A = list(range(A,min(B+1,A+K)))
list_B = list(range(max(A+K,B-K+1),B+1))
list_C = list_A + list_B
print(*list_C,sep='\n')

Submission status: Accepted

Solution code:
a,b,c  = map(int,input().split())
li = []
for i in range(c):
    if(a+i <= b-i):
        li.extend([a+i,b-i])
    else:
        break
for i in sorted(set(li)):
    print(i)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
list_A = list(range(A,min(B,A+K)))
list_B = list(range(max(A,B-K+1),B+1))
list_C = list_A + list_B
set_C = set(list_C)
list_D = sorted(list(set_C))
for i in list_D:
	print(i)

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+1+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)//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:
a, b, k = map(int, input().split())
st = list(range(a, min(b+1, a+k))) + list(range(b, max(a-1, b-k), -1))
for i in sorted(set(st)):
    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(" "))
print("\n".join(map(str, sorted(list(set(range(a, b+1)[:k]) | set(range(b, a-1, -1)[:k]))))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    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)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
m,n,x=[int(i) for i in input().split()]
a=set([i for i in range(m,m+x) if i<=n])
b=set([i for i in range(n-x+1,n+1) if i>=m])
for i in sorted(list(a|b)):
  print(i)

Submission status: Accepted

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


for num in abc093b():
    print(num)

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 B-K+i+1 >= A + K:
        print(B-K+i+1)

Submission status: Accepted

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

if 2 * K <= B - A:
    x = 0
    while x < K:
        print(A + x)
        x += 1
    x = K
    while x > 0:
        print(B - x + 1)
        x -= 1
    
else:
    x = A
    while x <= B:
        print(x)
        x += 1

Submission status: Accepted

Solution code:
def main5():
    str = input("");
    #unk
    buf = str.split();
    num = [];
    for i in range(3):
        num.insert(i,int(buf[i]));
    if num[2] > int((num[1] - num[0])/2):
        for i in range(num[1]-num[0]+1):
            print(num[0] + i,end=' ');
    else:
        for i in range(num[2]):
            print(num[0] + i,end=' ');

        for i in range(num[2]):
            print(num[1] - (num[2]-1) + i,end=' ');

    #end


if __name__ == '__main__':
    #main4()
    main5()

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
ans = []
for i in range(A,A+K):
    if i <= B:
        ans.append(i)
for i in range(B-K+1,B+1):
    if not i in ans and A <= i:
        ans.append(i)
for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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:
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())

for x in range(a, min(a+k, b+1)) :
    print(x)

for x in range(max(a+k, b-k+1), b+1) :
    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:
#import numpy as np
#n = int(input())
x = [int(i) for i in input().split()]
#s = list(input())

a = x[0]
b = x[1]
k = x[2]

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:
x = list(map(int,input().split()))
a = x[0]
b = x[1]
k = x[2]
if b - a + 1 < k * 2:
    for i in range(b - a + 1):
        print(a + i)
else:
    for i in range(k):
        print(a + i)
    for i in range(k):
        print(b - k + 1 + i)

Submission status: Accepted

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

X = list(range(A, min(A+K, B+1)))
Y = list(range(max(A+K, B-K+1), B+1))
for v in X + Y:
    print(v)

Submission status: Accepted

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

res = []

for i in range(a, min(a+k, b+1)):
    res.append(i)

for j in range(max(a, b-k+1), b+1):
    res.append(j)

for k in sorted(set(res)):
    print(k)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, k = map(int, raw_input().split())
L1 = [a + i for i in range(k)]
L2 = [b - k + 1 + i for i in range(k)]
in_range = lambda x: a <= x <= b
print "\n".join(map(str, filter(in_range, sorted(set(L1 + L2)))))

Submission status: Accepted

Solution code:

mondai = input()

mondai = mondai.rstrip().split(" ")
saisyou = int(mondai[0])
saidai = int(mondai[1])
hanni = int(mondai[2])

if saidai - saisyou +1 <=hanni *2:
    for k in range(saidai - saisyou + 1):
        print(k+saisyou)
        k +=1
else:
    i=saisyou
    for i in range(hanni):
        if saisyou+i <= saidai:
            print(saisyou+int(i))
            i +=1
        else:
            i +=1
    j =saidai
    for j in range(hanni):
        if int(saidai) - int(hanni) +j+1>=int(saisyou):
            print(saidai - hanni +j+1)
            j +=1
        else:
            j +=1

Submission status: Accepted

Solution code:
l = input().split()
a = int(l[0])
b = int(l[1])
k = int(l[2])
ans = set()
for i in range(k):
    n = a + i
    if n <= b and not n in ans:
        ans.add(n)
    n = b - i
    if n >= a and not n in ans:
        ans.add(n)
ans = sorted(list(ans))
ans = [str(a) for a in ans]
for a in ans:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
b=min(A+K-1,B)
for i in range(A,b+1):
    print(i)
b2=max(b+1,B-K+1)
for i in range(b2,B+1):
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m = list(map(int, input().split()))
A = m[0]
B = m[1]
K = m[2]

ans = []

for v in range(A, min(A+K, B)):
    ans.append(v)
for v in range(max(B-K+1, A), B+1):
    ans.append(v)

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

Submission status: Accepted

Solution code:
# PROBLEM B
a, b, k = [int(arg) for arg in input().split()]
if a + k < b + 1 - k:
    for x in range(a, a + k):
        print(x)
    for x in range(b+1-k, b+1):
        print(x)
else:
    for x in range(a, b + 1):
        if x - a < k or b - x < k:
            print(x)

Submission status: Accepted

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

if K<(B-A)/2+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:
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 j in range(b-k+1,b+1):
        print(j)

Submission status: Accepted

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

D = set()
RANGE = A+K if A+K<B else B+1
for i in range(A,RANGE):
    D.add(i)
    
RANGE = B-K+1 if B-K+1>A else A
for i in range(RANGE,B+1):
    D.add(i)
    
for i in sorted(D):
    print(i)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
aup = min(a+k-1, b)
bdn = max(b-k+1, aup+1)
l1 = list(map(str,range(a, aup+1)))
l2 = list(map(str,range(bdn, b+1)))
print("\n".join(l1 + l2))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,X = map(int,input().split())
if((B-A)/2 < X):
    for i in range(A,B+1):
        print(i)
else:
    for j in range(A,A+X):
        print(j)
    for k in range(B+1-X,B+1):
        print(k)

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))
a,b,k = l[0],l[1],l[2]
c = []
for i in range(a,min(a+k,b)):
    c.append(i)
for i in range(max(b-k+1,a),b+1):
    if i not in c:
        c.append(i)
for i in c:
    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 = [int(x) for x in input().split()]
i = a
j = b
arr = []
while i < a + k and i <= j:
#     print('i:', i)
    arr.append(i)
    arr.append(j)
    i += 1
    j -= 1
a = list(set(arr))
a.sort()
for i in a:
    print(i)

Submission status: Accepted

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

T =[]

for i in range(A,min(A+K,B+1)):
    T.append(i)
for j in range(max(A+K,B-K+1),B+1):
    T.append(j)
S = map(str,sorted(set(T)))
print('\n'.join(S))

Submission status: Accepted

Solution code:
A, B, K = list(map(int, input().strip().split(' ')))
for j in range(A,min(A+K,B+1)):
    if not(j >= A+K and j <= B-K):
        print(j)
for i in range(max(B-K,j+1),B+1):
    if not(i >= A+K and i <= B-K):
        print(i)

Submission status: Accepted

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

if A + K >= B or A >= B - K:
    ans = [i for i in range(A, B+1)]
else:
    ans = [i for i in range(A, A+K)]
    ans.extend([j for j in range(B - K + 1, B+1)])
    ans = sorted(list(set(ans)))
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
s=list(map(lambda x:int(x), input().split()))
if s[1]-s[0] <= s[2]:
    for k in range(s[0],s[1]+1):
        print(k)
else:
    dst=[s[0]+i for i in range(s[2])]
    dst.extend([s[1]-i for i in range(s[2])])
    dst = sorted(list(set(dst)))
    for k in dst:
        print(k)

Submission status: Accepted

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

ans = set()
for i in range(0, K):
    if A + i <= B:
        ans.add(A + i)
    if B - i >= A:
        ans.add(B - i)
ans = list(ans)
ans.sort()
for i in ans:
    print(i)

Submission status: Accepted

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

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

for x in range(B, B-K, -1):
	if x < A:
		break
	
	S.add(x)

L = list(S)
L.sort()

for x in L:
	print(x)

Submission status: Accepted

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

if b - a + 1 <= k * 2:
    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:
def main():
    A,B,K = map(int, input().split())

    a = []
    for i in range(A, A+K):
        if i <= B:
            a.append(i)
            print(i)
    for i in range(B-K+1, B+1):
        if ((i in a)==False)and(i>=A):
            print(i)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(int(i) for i in input().split())

if l[1]-l[0]+1 < 2*l[2]:
    for i in range(l[1]-l[0]+1):
        print("%d" % (i+l[0]))
else:
    for i in range(l[2]):
        print("%d" % (l[0]+i))
    for i in range(l[2]):
        print("%d" % (l[1]-l[2]+1+i))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b,k = LI()
    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)


    return '\n'.join(map(str, sorted(list(s))))


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


	l1 = [a+x for x in range(k) if a+x <= b]
	l2 = [b-x for x in range(k) if b-x >= a]
	nums = set(l1+l2)

	for elm in sorted(nums):
		print(elm)

Submission status: Accepted

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

a, b, k = map(int, input().split())
if k > b - a:
    for i in range(a, b+1):
        print(i)
else:
    low = [i for i in range(a, a+k)]
    high = [i for i in range(b-k+1, b+1)]
    high_removed = [i for i in high if i not in low]
    for l in low:
        print(l)
    for h in high_removed:
        print(h)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
s = set()
if b - a == 0:
    print(a)
elif b - a + 1 <= k:
    print(*range(a, b + 1), sep="\n")
else:
    for i in range(k):
        s.add(a + i)
        s.add(b - i)
    s = sorted(s)
    print(*s, sep="\n")

Submission status: Accepted

Solution code:

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

ret = []
i = A
while i <= min([A+K-1,B]):
    ret.append(i)
    i = i + 1
i = max([B-K+1,A])
while i <= B:
    ret.append(i)
    i = i + 1

ret.sort()
b_i = A - 1
for i in ret:
    if i != b_i:
        print i
    b_i = i

Submission status: Accepted

Solution code:
a,b,k=map(int,list(input().split(" ")))
if b-a+1 <= k*2:
   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())
l = []
if A+K > B+1:
    for i in range(A,B+1):
        if i < A+K or B - K < i:
            l.append(i)
else :
    for i in range(A,A+K):
        if i < A+K or B - K < i:
            l.append(i)
if A+K-1 >= B - K+1:
    for i in range(A+K,B+1):
        l.append(i)
else :
    for i in range(B-K+1,B+1):
        l.append(i)


for i in l:
    print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#coding:utf-8                           
                                        
ABK = [int(i) for i in input().split()] 
A, B, K = ABK[0], ABK[1], ABK[2]        
                                        
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 = list(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,input().split())
if (b-a)<2*k:
	for i in range(a,b+1):
		if (i-a)<k or (b-i)<k:
			print(i)
else:
	for i in range(0,k):
		print(a+i)
	for i in range(k-1,-1,-1):
		print(b-i)

Submission status: Accepted

Solution code:
# coding:utf-8
A,B,K = map(int, input().split())

sub = B - A + 1
if K*2 >= sub:
	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=[int(i)for i in input().split()]
if 2*k<b-a+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())
def solve_b(a,b,k):
    if b - a >= 2 * k:
        for i in range(a,a+k):
            print(i)
        for j in range(b-k+1,b+1):
            print(j)
    else:
        for i in range(a,b+1):
            print(i)
solve_b(a,b,k)

Submission status: Accepted

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

if b - k < a:
  b_k = a
else:
  b_k = b - k
  
if a == b:
  a_k = a + 1
  b_k = b + 1

result = list(set([i for i in range(a, a_k)] + [i for i in range(b_k + 1, b + 1)]))
result.sort()
for n in result:
  print(n)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in xrange(a, min(b + 1, a + k)):
    print i

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
A, B, K = map(int, input().split())
for i in range(A, min(B + 1, A + K)):
    print(i)
for i in range(max(0, B - K + 1), B + 1):
    if i < A + K:
        continue
    print(i)

Submission status: Accepted

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

c=b-a+1

a1=[]
b1=[]

for i in range(k):
    a1.append(a+i)
    b1.append(b-i)

if c>2*k-1:
    for i in range(k):
        print(a1[i])
    for i in range(k):
        print(b1[k-i-1])

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

Submission status: Accepted

Solution code:
a = input().split()

for i in range(len(a)):
 a[i] = int(a[i])

mina = a[0]
maxa = a[1]
numbers = a[2]

for i in range(mina,mina+numbers):
 if i <= maxa:
  print (i)

for j in range(maxa-numbers+1,maxa+1):
 if j> i:
  print (j)