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

if (s_2[1] - s_2[0]+1) <= s_2[2]*2:
    for x in range(s_2[1] - s_2[0] + 1):
        print(s_2[0] + x)

else:    

    # upper
    for x in range(s_2[2]):
        ans = s_2[0] + x
        print(ans)

    #lower
    for x in range(s_2[2]):
        ans = s_2[1] - s_2[2] + x +1
        print(ans)

Submission status: Accepted

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

x = list()
for i in range(a, a+min([k,b+1-a])):
  #print(i)
  x.append(i)
#print('---')
for i in range(b-min([k,b+1-a])+1, b+1):
  #print(i)
  x.append(i)
#print('---')

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

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
a = l[0]
b = l[1]
c = l[2]

ss = []
mm = []
ll = []
def checkK(x,y,z):
    if y - x + 1 <= z *2:
        counter = int(x)
        while counter != y+1:
            ss.append(counter)
            counter = counter + 1
        for i in range(len(ss)):
            print(ss[i])
    
        
    else:
        for i in range(c):
            ll.append(a+i)
        for i in range(c):
            ll.append(b-c+i+1)
        for i in range(len(ll)):
            print(ll[i])
        
checkK(a,b,c)

Submission status: Accepted

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

if ((max - min + 1) < 2*K):
    for i in range(min, max+1):
        print(i)

else:
    for i in range(min, min+K):
        print(i)
    for i in range(max-K+1, max+1):
        print(i)

Submission status: Accepted

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


if k*2 < 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:
#-*- coding:utf-8 -*-

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

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

Submission status: Accepted

Solution code:
A,B,K=map(int, input().rstrip().split()) #input parameters\
work=[] #make list
for i in range(0,K):
    if A+i<=B:
        print(A+i)
for i in range(0,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())
result = []
L = min(B-A+1,K)
for i in range(A,A+L):
    if i not in result:
        result.append(i)
for j in range(B,B-L,-1):
    if j not in result:
        result.append(j)
result.sort()
for x in result:
    print(x)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
s = []
for i in range(k):
    if a+i > 0 and a+i <= b:
        s.append(a+i)
for i in reversed(range(k)):
    if b-i > 0 and b-i > a and b-i not in s:
        s.append(b-i)
for j in s:
    print(j)

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
from collections import Counter
from pprint import pprint as pp

YN = {True: 'Yes', False: 'No'}
ri = lambda: int(input())
ria = lambda: list(map(int, input().split()))
rian = lambda n: [ria() for _ in range(n)]
rs = lambda: input()
rsa = lambda: input().split()
rsn = lambda n: [rs() for _ in range(n)]

A, B, K = ria()
K = min(K, B-A+1)
s = set(range(A, A+K))
s |= set(range(B, B-K, -1))
for i in sorted(s):
  print(i)

Submission status: Accepted

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

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

else:
    for i in range(k):
        print(a+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,a+k):
    if i > b:
        break
    print(i)
for i in range(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()))
ans = set() 
mi = max(B-K+1, A)
ma = min(A+K, B+1)
for i in range(A, ma):
    ans.add(i)
for i in range(mi, B+1):
    ans.add(i)
ans = list(ans)
for i in sorted(ans):
    print(i)

Submission status: Accepted

Solution code:
a,b,k = [int(i) for i in input().split()]

if a+k-1<b-k+1:
    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):
        print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
text = input()

a = int(text.split(' ')[0])
b = int(text.split(' ')[1])
k = int(text.split(' ')[2])

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

if max(b - k + 1, t) < b + 1:
    for i in range(max(b - k + 1, t), b + 1):
        print(i)

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())
    num = []
    for i in range(A, A + K):
        num.append(i)

    for i in range(B, B - K, -1):
        num.append(i)

    num = list(set(num))
    num.sort()
    num = filter(lambda x: A <= x <= B, num)
    for i in num:
        print(i)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

k = min(b - a + 1, k)
ans = set()

for i in range(k):
    ans.add(a + i)
    ans.add(b - i)

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

Submission status: Accepted

Solution code:
[A,B,K] = [int(s) for s in 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 = input().split()
a = int(a)
b = int(b)
k = int(k)
s = set()

for i in range(k):
   if a <= (a+i) <= b:
      s.add(a+i)
for j in range(k):
   v = b - (k - j - 1)
   if a <= v <= b:
      s.add(v)

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

Submission status: Accepted

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

for i in range(k):
    if i == 0:
        ans = [a + i]
    else:
        if a + i <= b:
            ans.append(a + i)
        else:
            break
            
for i in range(k):
    p = b - (k - 1) + i
    if p < a:
        break
    
    elif p not in ans:
        ans.append(p)
        
    else:
        continue


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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(k):
        if large_start > b:
                break
        print(large_start)
        large_start = large_start + 1

Submission status: Accepted

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

B += 1
K = min(B-A, K)

ans_F = [x for x in range(A, A+K)]
ans_B = [x for x in range(B-K, B)]

ans = sorted(set(ans_F)|set(ans_B))

for i in ans:
    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(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())
if b-a >= 2*k:
    for i in range(k):
        print(a+i)
    for i in range(1, k+1):
        print(b-k+i)
else:
    for i in range(b-a+1):
        print(a+i)

Submission status: Accepted

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

num = set()

for i in range(k):
    num.add(a+i)
    num.add(b-i)

num = list(num)
num.sort()
num = [i for i in num if i >= a and i <=b]

for i in num:
    print(i)

Submission status: Accepted

Solution code:
# a = input()
# b = input()
# k = input()
str = input()
str = str.split()
#print(str)
a = int(str[0])
b = int(str[1])
k = int(str[2])
#print("ans")
if b - a >= k*2:
    for i in range(a,a+k):
        print(i)
    #print("ss")
    for i in range(b-k+1,b+1):
        print(i)
else:
    for i in range(a,b+1):
        print(i)

Submission status: 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:
#!/usr/bin/env python
# coding: utf-8
#

def main(input_str):
    a, b, k = list(map(int, input_str.split(' ')))
    li = []
    for i in range(a, a + k):
        if i <= b:
            li.append(i)
    for i in range(b + 1 - k, b + 1):
        if a <= i:
            li.append(i)
    set_li = sorted(list(set(li)))
    for i in set_li:
        print(i)
    
    

if __name__ == '__main__':
    try:
        main(input().strip())
    except EOFError:
        pass

Submission status: Accepted

Solution code:
import sys

s_args = sys.stdin.read().splitlines()

s_args = s_args[0].split(' ')

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

if k*2 >= b-a+1:
    for i in range(a, b+1):
        print(i)
    sys.exit()

for i in range(k):
    print(a+i)

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

Submission status: Accepted

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

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


main()

Submission status: Accepted

Solution code:
inputs  = list(map(int, input().strip().split(' ')))
l1 = set(range(inputs[0],min(inputs[0]+inputs[2],inputs[1]+1)))
l2 = set(range(max(inputs[1]-inputs[2]+1,inputs[0]),inputs[1]+1))
returnList = sorted(list(set().union(l1,l2)))
for l in returnList :
    print(l)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
inputs  = list(map(int, input().strip().split(' ')))
l1 = set(range(inputs[0],min(inputs[0]+inputs[2],inputs[1]+1)))
l2 = set(range(max(inputs[1]-inputs[2]+1,inputs[0]),inputs[1]+1))
returnList = sorted(list(set().union(l1,l2)))
for l in returnList :
    print(l)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
a = []
if K > (abs(A - B) / 2):
    for i in range(A, B + 1):
        a.append(i)
else:
    for i in range(K):
        a.append(A + i)
        a.append(B - i)
        
a.sort()
for i in range(len(a)):
    print(a[i])

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if a+k >= b-k+1:
    s = list(range(a,b+1))
else:
    s= list(range(a,a+k)) + list(range(b-k+1,b+1))
ss = " ".join(map(str,s))
print(ss)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y,z=map(int,input().split())
if x+z-1<y-z+1:
	for i in range(x,x+z):
		print(i)
	for j in range(y-z+1,y+1):
		print(j)
else:
	for k in range(x,y+1):
		print(k)

Submission status: Accepted

Solution code:
def main():
    #1. input
    A, B, K = map(int, input().split())
    
    #2. append nums while A+K<B
    ans_set = set()
    for k in range(K):
        if A+k > B:
            break
        ans_set.add(A+k)
        ans_set.add(B-k)
    ans_set = sorted(ans_set)
    
    #3. output
    for ans in ans_set:
        print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if B-A<=K*2-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():
    MinNum, MaxNum, Scale = map(int, input().split())
    PrintList = []
    for i in range(Scale):
        if((MinNum + i) > MaxNum):
            break
        PrintList.append(MinNum + i)
        
    for i in range(Scale-1, -1, -1):
        if((MaxNum - i) < MinNum):
            break
        PrintList.append(MaxNum - i)
    
    PrintList_uniq = sorted(list(set(PrintList)))
    for num in PrintList_uniq:
        print(num)
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split(" "))
_a = list(range(a, min(b, a + k)))
_b = list(range(max(a, b - k + 1), b + 1))
for i in sorted(list(set(_a + _b))):
    print(i)

Submission status: Accepted

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

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:
def exec():
    a,b,k = map(int, input().split())
    if(k >= (b-a+1)/2):
        for i in range(a,b+1):
            print(i)
    else:
        arr = []
        for i in range(k):
            arr.append(i+a)
        for i in reversed(range(k)):
            arr.append(b - i)
        for c in arr:
            print(c)


if __name__ == "__main__":
    exec()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c  = [int(x) for x in input().strip().split()]

res = {x for seq in [range(a,min(a+c, b)), range(b, max(a,b-c), -1)] for x in seq}

if a==b:
    res = {a}

for x in sorted(list(res)):
    print(x)

Submission status: Accepted

Solution code:
A, B, K = (int(x) for x in input().split())
if (B - A) / 2 >= K:
  for x in range(A, A + K):
    print(x)
  for x in 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,input().split())
if b-a < 2 * k:
    for h in range(b-a+1):
        print(a + h)
else:
    for i in range(k):
        print(a + i)
    for m in range(k):
        print((b-k)+1+m)

Submission status: Accepted

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

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

if A+2*K>=B+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 = [int(x) for x in input().split()]
b += 1

k_temp = b - a
if k > k_temp:
    k = k_temp

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

ans = [x for x in range(a, a + k)]
ans.extend(range(b - l, b))
print(' '.join([str(x) for x in ans]))

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
ans = []
for i in range(a, a+k):
  if i >= a and i <= b:
    ans.append(i)

for i in range(b-k+1, b+1):
  if not i in ans and i >= a and i <= b:
    ans.append(i)

for i in ans:
  print(i)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
ans = []
flag = 0
for i in range(k):
    temp_a = i+a
    temp_b = b-i
    ans.append(temp_a)
    ans.append(temp_b)
    if(temp_a >= b or temp_b <= a):
        break

ans = list(set(ans))
ans.sort()
for a in ans:
    print(a)

Submission status: Accepted

Solution code:
import numpy as np

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

if((b - a + 1) / 2 < k):
    for i in range(a, b+1, 1):
        print(i)
else:
    for i in range(a, a+k, 1):
        print(i)
    for i in range(b-k+1, b+1, 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):
        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())
c=int((a+b)/2)
for i in range(k):
    e=i+a
    if e<=c:
        print(e)
for i in range(k):
    d=b-k+i+1
    if d>c:
        print(d)

Submission status: Accepted

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

ans = []
s = set()

for i in range(k):
    if a+i <= b and a+i >= a:
        ans.append(a+i)
        s.add(a+i)
for i in reversed(range(k)):
    if b-i <= b and b-i >= a:
        if b-i not in s:
            ans.append(b - i)

for i in ans:
    print(i)

Submission status: Accepted

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

if (b-a) > k:
    small_list = [i for i in range(a,a+k)]

    big_list = [j for j in range(b-k+1,b+1)]

    for number in small_list:
        if number in big_list:
            small_list.remove(number)

    list_number = small_list + big_list

else:
    list_number = range(a,b+1)

for i in list_number:
    print(i)

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
b = []
for i in range(a[2]):
    if a[0] <= (a[0] + i) <= a[1]:
        b.append(a[0] + i)
for i in range(a[2]):
    if (a[1] - i) not in b and a[0] <= (a[1] - i) <= a[1]:
        b.append(a[1] - i)
b.sort()
for i in range(len(b)):
    print(b[i])

Submission status: Accepted

Solution code:
s = input().split(" ")
s = [int(i) for i in s]
A = s[0]
B = s[1]
K = s[2]

dic = {}
for i in range(K) : 
    if A+i <= B : 
        print(A + i)
        dic[A+i] = True

for i in reversed(range(K)):
    if B-i >= A:
        if not (B-i in dic):
            print(B-i)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
if A+2*K<=B:
    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())
ans = []

for i in range(K):
    if A + i <= B:
        ans.append(A + i)
for i in range(K):
    if B - K + i + 1 not in ans and A <= B - K + i + 1:
        ans.append(B - K + i + 1)
ans.sort()
for a in ans:
    print(a)

Submission status: Accepted

Solution code:
def get_next_int():
    return int(float(input()))


def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])


def get_next_str():
    return input()


def get_next_strs(delim=" "):
    return tuple(input().split(delim))


def get_next_by_types(*value_types, delim=" "):
    return tuple([t(x) for t, x in zip(value_types, input().split(delim))])


def solve():
    A, B, K = get_next_ints()
    if K > B - A:
        for i in range(A, B + 1):
            print(i)
    else:
        ans = list(range(A, A + K))

        ans_b = list(range(B - K + 1, B + 1))
        for i in ans:
            print(i)
        for j in ans_b:
            if not j in (ans):
                print(j)
solve()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,K = [int(i) for i in input().split()]
ans = set()
for i,j in zip(range(A,A+K),range(B-K+1,B+1)):
  ans.add(min(i,B))
  ans.add(max(A,j))
ans = sorted(ans)
for e in ans:
  print(e)

Submission status: Accepted

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

    satisfied_integers = set()
    for i in range(K):
        if A + i <= B:
            satisfied_integers |= {A + i}
            
        if A <= B - K + 1 + i:
            satisfied_integers |= {B - K + 1 + i}

    satisfied_integers = sorted(satisfied_integers)
    for v in satisfied_integers:
        print(v)

Submission status: Accepted

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

Submission status: Accepted

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

    ans = set()
    n = min(A + K, B)
    for i in range(A, n):
        ans.add(i)

    n = max(B - K + 1, A)
    for i in range(n, B + 1):
        ans.add(i)

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

main()

Submission status: Accepted

Solution code:
import sys

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [A, B, K] = [int(input_raw[0]), int(input_raw[1]), int(input_raw[2])]
    for i in range(K):
        if A+ i >= B - K + 1:
            break;
        if A + i >= A and A + i <= B:
            print A + i

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

if __name__ == '__main__':
    main()

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 j in range(max(i + 1, b - k + 1), b + 1):
    print(j)

Submission status: Accepted

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

    end = min(A+K, B)
    for i in range(A, end):
        print(i)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding : utf-8

import numpy as np

A,B,C = input().split()
A,B,C = int(A),int(B),int(C)

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

Submission status: Accepted

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

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

print_list = []
for i in range(A,A+K):
    if print_list.count(i) == 0:
        print_list.append(i)

for i in range(B-K+1,B+1):
    if print_list.count(i) == 0:
        print_list.append(i)

for i in print_list:
    if A-1<i and i<B+1:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = []
for i in range(A, min(A+K, B)):
    ans.append(i)
for i in range(max(B-K+1, A), B+1):
    ans.append(i)

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

Submission status: Accepted

Solution code:
import sys

l=input().split()

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

i=0
for i in range(A,A+K):
	if(i==B+1):
		break
	print(i)

if(i>=B-K+1):
	i+=1
	while i<=B:
		print(i)
		i+=1
else:
	i=B-K+1
	while i<=B:
		print(i)
		i+=1

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
s = [A+i for i in range(K) if A+i <= B]
b = [B-i for i in range(K) if B-i >= A]
s.sort()
b.sort()
for i in s:
    print(i)
for i in b:
    if i not in s:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
f = lambda :[int(i) for i in input().split()]
from sys import stderr
debug = lambda x:stderr.write(repr(x)+'\n')

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

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 j in range(K):
        print(B-K+1+j)
else:
    for m in range(B-A+1):
        print(A+m)

Submission status: Accepted

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

#print A, B, K

array = []

for i in range(K):
    if i <= (B - A):
        array.append(A + i)
        array.append(B - i)

array_uniq = list(set(array))
array_uniq.sort()

for i in array_uniq:
    print i

Submission status: Accepted

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

for i in range(K):
    upnum = A + i
    if upnum <= B:
        anslist.add(upnum)

    downnum = B - i
    if downnum >= A:
        anslist.add(downnum)

sortedlist = sorted(anslist)

for n in sortedlist:
    print(n)

Submission status: Accepted

Solution code:
#! /usr/bin/env python3

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

res = []

for i in range(k):
    v = a + i
    if v <= b:
        res.append(v)

for i in range(k):
    v = b - i
    if v >= a and v not in res:
        res.append(v)

res.sort()

for row in res:
    print(row)

Submission status: Accepted

Solution code:
a, b, k = (int(i) for i in 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())

ans = []

if B - A + 1 > 2*K:
    ans += list(range(A, A + K))
    ans += list(range(B - K + 1, B + 1))

else:
    ans = list(range(A, B+1))
    
print(*ans, sep = "\n")

Submission status: Accepted

Solution code:


import copy

def main():
    temp=input()

    a,b,c=list(temp.split(" "))
    a=int(a)
    b=int(b)
    c=int(c)
    l1=[]
    l2=[]
    for i in range(c):
        l1.append(i+a)
    for i in range(c):
        l1.append(b-i)
    l1=list(set(l1))
    l1.sort()
    
    # print(l1)
    l2=copy.deepcopy(l1)
    for l in l2:
        if l<a or l>b:
            # print(l)
            l1.remove(l)
    for l in l1:
       print(l)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
down = a + k - 1
up = b - k + 1

if down < up:
    for i in range(a, down+1):
        print(i)
    for i in range(up, b+1):
        print(i)
    exit()

if down >= up:
    for i in range(a, b+1):
        print(i)
    exit()

Submission status: Accepted

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

z = []

for x in range(a,a+k):
  if x == (b+1):
    break
  z.append(x)

for x in range(b,b-k,-1):
  if x == (a-1):
    break
  z.append(x)

z = list(set(z))
z.sort()

for x in z:
  print x

Submission status: Accepted

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

l = []
for i in range(k):
    if (a+i > b) or (b-i < a):
        break
    l.append(a+i)
    l.append(b-i)
    

for j in sorted(set(l)):
    print(j)

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())
if B < A :
		A,B = B,A
if B - A < 2*K :
	#print ("Case 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)