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=map(int,input().split())
atmp=a; btmp=b;
ans=set()

for i in range(1,k+1):
    ans.add(atmp)
    atmp+=1
    if atmp>b:
        break

for i in range(1,k+1):
    ans.add(btmp)
    btmp-=1
    if btmp<a:
        break

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

Submission status: Accepted

Solution code:
int_a, int_b, int_k = map(int, input().split())

minset = set(range(int_a, int_a + int_k))
maxset = set(range(int_b - int_k + 1, int_b + 1))

result = list(minset | maxset)
result.sort()
for i in result:
    if int_a <= i <= int_b:
        print(i)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
ans = []
for i in range(a,a+k):
    if i>b:
        break
    ans.append(i)
for i in range(b,b-k,-1):
    if i<a:
        break
    ans.append(i)
ans = sorted(list(set(ans)))
for i in ans:
    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)[: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())

s = set()

for i in range(A, min(A + K, B + 1)):
    s.add(i)

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

s = sorted(s)

for i in s:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=[int(i) for i in input().split()]
ans=[]
if k<b-a:
    for i in range(a,a+k):
        if (i in ans)==False:
            ans.append(i)
    for i in range(b-k+1,b+1):
        if (i in ans)==False:
            ans.append(i)
    result=sorted(ans)
else:
    result=[i for i in range(a,b+1)]
for i in range(len(result)):
    print(result[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)
    exit(0)
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:
n,m,k = map(int,input().split())
l = []
for i in range(n,n+k):
    if n <= i <= m:
        l.append(i)
for i in range(m,m-k,-1):
    if n <= i <= m:
        l.append(i)
l = sorted(set(l))
for i in range(len(l)):
    print(l[i])

Submission status: Accepted

Solution code:
import math
A, B, K = map(int, input().split())
l = []
for k in range(min([K, math.floor((B - A + 1)/2)])):
    l.append(k + A)
for k in range(min([K, math.ceil((B - A + 1) / 2)])):
    l.append(B - k)
l.sort()
for i in l:
  print(i)

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())
    if B - A + 1 > 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)


main()

Submission status: Accepted

Solution code:
# ABC093B
a,b,k = map(int,input().split())
xx =[]
for x in range(a,a+k):
    if x>b:
        break
    xx.append(x)
for x in range(b+1-k,b+1):
    if x<a:
        break
    xx.append(x)
for x in sorted(list(set(xx))):
    print(x)

Submission status: Accepted

Solution code:
""" AtCoder """

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

l = []

ans = []

if B - A < K:
    for i in range(A, B + 1):
        ans.append(i)
else:
    for i in range(A, A + K + 1):
        l.append(i)
    for i in range(B - K, B + 1):
        l.append(i)
    for i in range(K):
        ans.append(l[i])
        ans.append(l[-i-1])

ans = set(ans)

ans = sorted(ans)

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

Submission status: Accepted

Solution code:
""" AtCoder """

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

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

ans = []

if B - A < K:
    for i in range(A, B + 1):
        ans.append(i)
else:
    for i in range(A, A + K + 1):
        l.append(i)
    for i in range(B - K, B + 1):
        l.append(i)
    for i in range(K):
        ans.append(l[i])
        ans.append(l[-i-1])

ans = set(ans)

ans = sorted(ans)

for i in range(len(ans)):
    print(ans[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): #AからB
        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 k*2>(b-a+1):
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)

Submission status: 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(" "))
list = []

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

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("AC")
    else:print("WA")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

#n = ip()                              #入力整数1つ
#x,y= (int(i) for i in input().split())      #入力整数横2つ
a,b,k = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列

#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
c = [ i for i in range(a,min(b,a+k))]
d = [ i for i in range(max(b-k+1,a),b+1)]
e = set()
for i in range(len(c)):
    e.add(c[i])
for i in range(len(d)):
    e.add(d[i])
e = list(e)
e.sort()
for i in range(len(e)):
    print(e[i])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
list=[]
if(a==b):
    print(a)
if(b-a<c):
    c=b-a
for i in range(c):
    list.append(a+i)
    list.append(b-i)
list=sorted(set(list))
for j in range(len(list)):
    print(list[j])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
v=set([])
if b-a<c:
    c=b-a
if a==b:
    print(a)
for i in range(c):
    v.add(a+i)
    v.add(b-i)
l=list(v)
l.sort()
for i in range(len(l)):
    print(l[i])

Submission status: Accepted

Solution code:

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


sep = b - a > 2 * (k - 1)

if sep:
    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=[]
if k>=(b-a+1)/2:
  ans=list(range(a,b+1))
else:
  ans=list(range(a,a+k))
  ans_back=list(range(b+1-k,b+1))
  ans.extend(list(range(b+1-k,b+1)))
for i in ans:
  print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=[int(x) for x in input().split()]
#print(a,b,k)#
ans = []
for i in range(k):
  if a+i<=b:ans.append(a+i)
  if b-i>=a:ans.append(b-i)
#print(ans)#
ans = list(set(ans))
ans.sort()
for e in ans: print(e)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)#setで重複避ける,[k:][-k:]の範囲を選択

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 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 sorted(set(range(A,B+1)[:K])|set((range(A,B+1)[-1*K:]))):
    print(i)

Submission status: Accepted

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

a=A
b=B
list=[]
while a<A+K and a<=b:
    list.append(a)
    a+=1

while b>B-K and b>=a:
    list.append(b)
    b-=1

list.sort()
ANS=set(list)
ANS=sorted(ANS)

for ans in ANS:
    print(ans)

Submission status: Accepted

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

    ans = set()

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

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


def main2():
    a, b, k = map(int, input().split())
    ans = []
    if 2 * k >= b - a + 1:
        for i in range(a, b + 1):
            ans.append(i)
    else:
        for i in range(k):
            ans.append(a + i)
            ans.append(b - i)

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


if __name__ == '__main__':
    main2()

Submission status: Accepted

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

    ans = set()

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

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


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

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


if __name__ == '__main__':
    main2()

Submission status: Accepted

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

    ans = set()

    # for i in range(a, b + 1):
    #     ans.add(i)

    for i in range(k):
        x = a + i
        if x <= b:
            ans.add(x)

        y = b - i
        if a <= y:
            ans.add(y)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans1 = set(range(A, min(A+K, B+1)))
ans2 = set(range(max(A, B-K+1), B+1))

print('\n'.join(map(str, sorted(ans1 | ans2))))

Submission status: Accepted

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

a -= 1
for _ in range(c):
  a += 1
  print(a)
  if a == b:
    break

b=b-c+1

for _ in range(c):
  if b > a:
    print(b)
  b=b+1

Submission status: Accepted

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

Submission status: Accepted

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

sub1 = [i for i in range(A,A+K)]
sub2 = [i for i in range(B-K+1,B+1)]
sub = set(sub1) | set(sub2)
sub = sorted(sub)
for i in sub:
    if A<= i <= B:
        print(i)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
r = range(a, b + 1)
for i in sorted(set(r[:k]) | set(r[-k:])):
    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:
    ans = []
    for i in range(k):
        ans.append(a + i)
    for i in range(k-1, -1, -1):
        ans.append(b - i)

    for i in ans:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    na = list(map(int, input().split()))
    A, B, K = na[0], na[1], na[2]

    if B - A < 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)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

l = []
for i in range(a, min(a + k, b + 1)):
    if i not in l:
        l.append(i)
for i in range(max(a, b - k + 1), b + 1):
    if i not in l:
        l.append(i)

ans = '\n'.join(map(str, l))
print(ans)

Submission status: Accepted

Solution code:
A, B, K = map(int, str(input()).split(" "))
disp = []
for i in [j for j in range(A, A + K) if j <= B]:
    disp.append(i)
for i in [j for j in range(B - K + 1, B + 1) if A <= j]:
    disp.append(i)
for i in sorted(set(disp)):
    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)
    if B-i >= A:
        ans.append(B-i)
ans = list(set(ans))
ans.sort()

for i in ans:
    print(i)

Submission status: Accepted

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

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

for a in ans:
    print(a)

Submission status: Accepted

Solution code:
def inpl(): return [int(i) for i in input().split()]
A, B, K = inpl()
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())
if A+K-1>=B-K+1:
    while A<=B:
        print(A)
        A+=1
else:
    i=0
    while i<=K-1:
        print(A+i)
        i+=1
    while B-K+1<=B:
        print(B-K+1)
        K-=1

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
if B - A < K + 1:
    c = list(range(A, B + 1))
else:
    a = list(range(A, A + K))
    b = list(range(B - K + 1, B + 1))
    c = sorted(list(set(a + b)))
for i in range(len(c)):
    print(c[i])

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(b-k+1,a+k),b+1) :
    print(i)
#copy page

Submission status: Accepted

Solution code:
A, B, K = map(int,input().split())
ans = []
for i in range(A, B+1)[:K]:
  ans.append(i)
for i in range(A, B+1)[-K:]:
  ans.append(i)
for a in sorted(list(set(ans))):
  print(a)
#copy page

Submission status: Accepted

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

Submission status: Accepted

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

ans_array = []

for i in range(A, A + K if B > (A + K) else (B+1)):
    ans_array.append(i)

for i in range(B, B - K if A < (B - K) else (A-1), -1):
    ans_array.append(i)

ans_array = sorted(list(set(ans_array)))

for i in ans_array:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline

A, B, K = map(int, input().split())
diff = B - A
if diff < 2*K:
    for c in range(A, B+1):
       print(c)
else:
    for a in range(A, A+K):
        print(a)
    for b in range(B-K+1, B+1):
        print(b)

Submission status: Accepted

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

output_list = []
output=[]

for i in range(K):
    output_list.append(A+i)
    output_list.append(B-K+i+1)

for num in output_list:
    if A <= num <= B:
        output.append(num)
    else:
        continue
output_set = set(output)
output_list = list(output_set)
output_list.sort()

for num in output_list:
    print(num)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if(A==B and K>=1):
    print(A)
    quit()
elif(A==B and K==0):
    quit()

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

else:

    if(K>B):
        K=B

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


    if(B-K<=0):
        quit()


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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
s = set()
for i in range(K):
    s |= {A + i, B - i}
for x in sorted(s):
    if A <= x <= B:
        print(x)

Submission status: Accepted

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


def main():
    """Function."""
    a, b, k = map(int, input().split())

    check = set()
    for i in range(k):
        temp = a + i
        if temp > b:
            pass
        else:
            check.add(temp)
    for i in range(k):
        temp = b - k + i + 1
        if temp < a:
            pass
        else:
            check.add(temp)

    uniq = list(check)
    uniq.sort()
    for i in uniq:
        print(i)


if __name__ == "__main__":
    main()

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

first = [i for i in range(A, B+1)] if A + K >= B else [i for i in range(A, A+K)]
latter = [i for i in range(B-K+1, B+1)] if B - K >= A else [i for i in range(A, B+1)]

for i in sorted(list(set(first + latter))):
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, X = map(int, input().split())
ANS = []
for i in range(X):
    if(A<=A+i<=B):
        ANS.append(A+i)

for i in range(X):
    if(B-X+i+1 not in ANS):
        if(B-X+i+1>=A):
            ANS.append(B-X+i+1)

for j in ANS:
    print(j)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, k = map(int, input().split())
    s1 = set(range(a, min(a + k, b + 1)))
    s2 = set(range(max(b - k + 1, a), b + 1))
    for c in sorted(s1 | s2):
        print(c)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

counter = 1
ans_list = []
for i in range(A,B+1) :
	ans_list.append(i)
	counter += 1
	if (counter > K) :
		break

counter = 1
for i in range(B,A,-1) :
	ans_list.append(i)
	counter += 1
	if (counter > K) :
		break

ans_list = list(set(ans_list))
ans_list.sort()
for i in ans_list :
	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 j in range(max(a+k, b-k+1), b+1):
    print(j)

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())
ans = set()

i = 0
tmp = A
while i < K and tmp <= B:
    ans.add(tmp)
    tmp += 1
    i += 1

i = 0
tmp = B
while i < K and A <= tmp:
    ans.add(tmp)
    tmp -= 1
    i += 1

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

Submission status: Accepted

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

res = set()

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

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

# print(res)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K = 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,c = map(int,input().split())
ar = []
if a + c > b:
    d = b+1
else:
    d = a+c
for i in range(a,d):
    ar.append(i)
if b - c < a:
    e = a
else:
    e = b-c+1
for i in range(e,b+1):
    ar.append(i)
br = set(ar)
cr = sorted(br)
for i in cr:
    print(i)

Submission status: Accepted

Solution code:
# Small and Large Integers
a, b, k = map(int, input().split())
s = {a, b}
for i in range(k):
    if a+i <= b:
        s.add(a+i)
    if b-i >= a:
        s.add(b-i)
s = sorted(s)
for i in s:
    print(i)

Submission status: Accepted

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

if b-a+1>2*c:
	x=[i for i in range(a,a+c)]
	y=[i for i in range(b-c+1,b+1)]
	e=x+y
else:
	e=[i for i in range(a,b+1)]
#print(e)
for i in e:
	print(i)

Submission status: Accepted

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

Submission status: Accepted

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

n = A
while n <= B:
    print(n)
    n += 1
    if n >= A + K:
        n = max(n, B - K + 1)

Submission status: Accepted

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

n = A
while n < A + K and n <= B:
    print(n)
    n += 1

n = max(n, B - K + 1)

while n <= B:
    print(n)
    n += 1

Submission status: Accepted

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

nums = set(
    [n for n in range(A, min(A + K, B + 1))] +
    [n for n in range(max(B - K + 1, A), B + 1)]
)

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

Submission status: Accepted

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

    i = a
    while True:
        if i > b:
            return
        if i-a + 1 > k:
            i = max(i, b-k+1)
            break
        print(i)
        i += 1
    while True:
        if i > b:
            break
        print(i)
        i += 1

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B, K = [int(_) for _ in input().split()]
if 2*K <= B-A:
    print("\n".join([str(_) for _ in list(range(A,A+K)) + list(range(B-K+1,B+1))]))
else:
    print("\n".join([str(_) for _ in list(range(A,B+1))]))

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
center = (A + B) // 2

max_limit = A + K - 1
min_limit = B - K + 1

end_n = center if center <= max_limit else max_limit
for i in range(A, end_n + 1):
    print(i)
        
begin_n = center + 1 if center + 1 >= min_limit else min_limit
for i in range(begin_n, B + 1):
    print(i)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
if B - A + 1 <= 2 * K:
    l = list(range(A,B + 1))
else:
    l1 = list(range(A,A + K))
    l2 = list(range(B - K + 1,B + 1))
    l = l1 + l2
for e in l:
    print(e)

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())
if a+k>=b:
	for i in range(a,b+1):
		print(i)
	exit()
x=[i for i in range(a,a+k)]
y=[i for i in range(b-k+1,b+1)]
z=list(set(x+y))
z.sort()
for i in z:
	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(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:
l = list(map(int, input().split()))

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

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
i=0
while(a+i <= a+k-1 and a+i<=b):
  print(a+i)
  i+=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = [int(i) for i in input().split()]
if k >= b-a+1:
  for i in range(a, b+1):
    print(i)
else:
  c = [i for i in range(a, a+k)]
  d = [i for i in range(b-(k-1), b+1)]
  e = sorted(list(set(c) | set(d)))
  for i in e:
    print(i)

Submission status: Accepted

Solution code:
def main():
    a, b, k = map(int, input().split())
    
    s = set()

    for i in range(a, a+k):
        s.add(i)

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

    for i in sorted(s):
        if a <= i and i <= b:
            print(i)

if __name__ == "__main__":
    main()

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,B-K,-1):
    if i>=A:
        ANS.append(i)

for i in sorted(list(set(ANS))):
    print(i)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5)
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())
 
a,b,k = li()
ans = set()
for i in range(k):
    if a+i > b:
        break
    
    ans.add(a+i)
    
for i in range(k):
    if b-i < a:
        break
    
    ans.add(b-i)
    
ansl = sorted(list(ans))
 
for ans in ansl:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

a,b,k = li()
ans = set()
for i in range(k):
    if a+i > b:
        break
    
    ans.add(a+i)
    
for i in range(k):
    if b-i < a:
        break
    
    ans.add(b-i)
    
ansl = sorted(list(ans))

for ans in ansl:
    print(ans)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
ans = set()
for a in range(A,A+K):
    if a > B: break
    ans.add(a)
for a in range(B,B-K,-1):
    if a < A: break
    ans.add(a)
for a in sorted(ans):
    print(a)