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())
r=range(A,B+1)
l=list(r[:K]);l.extend(list(r[-K:]))
for i in sorted(set(l)):
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if B-A+1 > K*2:
  ans = list(range(A, A+K))+list(range(B-K+1, B+1))
  print(*ans, sep="\n")
else:
  print(*list(range(A,B+1)), sep="\n")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(k):
    ans.append(a+i)
for i in range(k):
    if not b-i in ans:
        ans.append(b-i)
ans.sort()
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
res = [a + i for i in range(k) if a + i <= b
       ] + [b - i for i in range(k) if b - i >= a]
res = list(set(res))
res.sort()
print(*res, sep='\n')

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 == B:
  print(A)
  exit()


ans = [i for i in range(A,min(A+K,B))] + [i for i in range(B,max(B-K,A),-1)] 
[print(num) for num in sorted(list(set(ans)))]

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

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
c = range(a,b+1)
for i in sorted(set(c[:k])|set(c[-k:])):
    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())
L = []
for i in range(a,min(a+k,b+1)):
    L.append(i)
for i in range(max(b-k+1,a),b+1):
    L.append(i)
l = list(set(L))
l.sort()
for i in l:
    print(i)

Submission status: Accepted

Solution code:
# ABC093b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

for i in range(a, min(a + k, b+1)):
    print(i)
# print('hi')
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 != b:
  if k == 0:
    print(a, b, sep='\n')
    exit()
else:
  print(a)
  exit()
for i in range(a, min(b,a+k)):
  print(i)
for j in range(max(i,b-k)+1,b+1):
  print(j)

Submission status: Accepted

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

ans.extend(range(A, min(A + K, B + 1)))
ans.extend(range(max(B - K + 1, A), B + 1))
ans = list(set(ans))
ans.sort()

for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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-1)+i)>=a:
        ans.append(b-(k-1)+i)
anset=list(set(ans))
anset.sort()
for i in range(len(anset)):
    print(anset[i])

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+1+i >= A:
        s.append(B-K+1+i)
s = set(s)
Ans = []
for i in s:
    Ans.append(i)
Ans = sorted(Ans)
for i in Ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# A to A + K - 1
# B - K + 1 to B 

candidate = []

for i in range(A, min(A+K, B+1)):
  candidate.append(i)
  
for i in range(B, max(B-K, A-1), -1):
  candidate.append(i)
  
candidate = set(candidate)

for num in sorted(candidate, reverse=False):
  print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

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

Submission status: Accepted

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

ans = set()

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

ans = list(ans)
ans.sort()

for ele in ans:
    print(ele)

Submission status: Accepted

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

l       = range(A, B+1)

s       = sorted(set(l[:K])|set(l[-K:]))

for i in s:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

A, B, K =  map(int, sys.stdin.readline().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)

"""
X = [x for x in range(A, min(A + K, B + 1))] + [x for x in range(max(B - K + 1, A), B + 1)]
for x in sorted(list(set(X))):
    print(x)
"""

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

A, B, K =  map(int, sys.stdin.readline().split())
X = [x for x in range(A, min(A + K, B + 1))] + [x for x in range(max(B - K + 1, A), B + 1)]
for x in sorted(list(set(X))):
    print(x)

Submission status: Accepted

Solution code:


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


    if a+k > b:
        c = b
    else:
        c = a+k
    
    if a == c:
        c += 1

    for i in range(a,c):
        ansSet.add(i)
    
    if b-k < a:
        c = a
    else:
        c = b-k

    for i in range(b,c,-1):
        ansSet.add(i)

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


if __name__== "__main__":
    main()

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    a, b, k = list(map(int, input().rstrip('\n').split()))
    ans = []
    for i in range(a, min(a + k, b+1)):
        if i not in ans:
            ans.append(i)
    for i in range(b, max(b - k, a-1), -1):
        if i not in ans:
            ans.append(i)
    ans.sort()
    print(*ans, sep="\n")


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

ans=[]
for i in range(k):
  if a+i<=b and a+i not in ans:
    ans.append(a+i)
for i in range(k):
  if b-i>=a and b-i not in ans:
    ans.append(b-i)
ans.sort()
print(*ans,sep='\n')

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
ans =range(a,b+1)
for i in sorted(set(ans[:k])|set(ans[-k:])):
    print(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):
    if i-A<K or B-i<K:
      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(tok) for tok in input().split())

num = a
while num <= b and num < a + k:
  print(num)
  num += 1
  
num = max(num, b - k + 1)
while num <= b:
  print(num)
  num += 1

Submission status: Accepted

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

ans=set()
for i in range(a,a+k):
    ans.add(i)

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

for i in sorted(ans):
    print(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)
    quit()

ans=[]
for i in range(a,a+k):
    ans.append(i)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
aa=set(range(a,min(b+1,a+k)))
bb=set(range(max(b-k+1,a),b+1))
print(*sorted(aa|bb),sep='\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
if k > b-a+1:
    k = b-a+1
li = set()
for i in range(k):
    li.add(a+i)
    li.add(b-i)
for l in sorted(li):
    print(l)

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())
l = range(a,b+1)
new = set(l[:k])|set(l[-k:])
 
for i in sorted(new):
  print(i)

Submission status: Accepted

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

if (b-a)//2 + 1 <= 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:
import sys
from statistics import *
stdin = sys.stdin

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

a, b, k = na()
ct = 0
li = []
for i in range(a, a + k):
    if i <= b:
        li.append(i)
for i in range(b - k + 1, b+1):
    if i >= a:
        li.append(i)
print(*(sorted(list(set(li)))))

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(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)

Submission status: Accepted

Solution code:
a,b,k=map(int, input().split())
s=[a+i for i in range(k) if a+i<=b]
t=[b-i for i in range(k) if b-i>=a]
u=sorted(list(set(s+t)))
for i in u:
    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());print(*(list(range(a,b+1))if b-a<2*k else list(range(a,a+k))+list(range(b-k+1,b+1))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
arr = range(A, B + 1)
ans = []
for i in range(K):
    ans.append(A + i)
for j in range(K):
    ans.append(B + 1 - K + j)

anset = list(set(ans))
anset.sort()
if A+K<=B+1:
    for ele in range(len(anset)):
        print(anset[ele])
else:
    for ele in range(A,B+1):
        print(ele)

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    a, b, k = list(map(int, input().rstrip('\n').split()))
    ls = []
    for i in range(a, min(a + k, b)):
        if i not in ls:
            ls.append(i)
    for i in range(b, max(b - k, a - 1), -1):
        if i not in ls:
            ls.append(i)
    ls.sort()
    for i in ls:
        print(i)


if __name__ == '__main__':
    main()

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 + 1  >= 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)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
A = {i for i in range(a,a+k) if i >=a and i <=b}
B = {j for j in range(b-k+1,b+1) if j >=a and j <=b}
print(*sorted(A|B),sep="\n")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

else:
    if A + K - 1 < B and A <= B - K + 1:
        ans = [A + i for i in range(K)] + [B - i for i in reversed(range(B - (A + K - 1)))]
    else:
        ans = [i for i in range(A,B+1)]

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

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())
    res = set()
    for i in range(K):
        if A+i <= B:
            res.add(A+i)
        if B-i >= A:
            res.add(B-i)
    res = sorted(list(res))
    for i in res:
        print(i)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,x=map(int,input().split())
A=sorted(set(range(a,min(a+x,b+1)))|set(range(max(b-x+1,a),b+1)))
print(*A,sep='\n')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
c=a+(k-1)
for i in range(a,a+k):
    if i<=b:
        print(i)
    else:
        break
if c<b:
    if b-(k-1)<=c:
        for i in range(c+1,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())
la = list(range(a, a+k))
lb = list(range(b-k+1, b+1))
set = sorted(set(la+lb))

for i in set:
    if a <= i <= b:
        print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(k):
    if a + i > b - i:
        break
    ans.append(a + i)
    ans.append(b - i)

for i in sorted(set(ans)):
    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())

x=list(set( [i for i in range(a,min(a+k,b+1), 1)] + \
            [i for i in range(b,max(b-k,a-1),-1)] ))
print(*sorted(x),sep='\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = [int(x) for x in input().split()]
if K >= (B - A + 1) / 2:
  l = [i for i in range(A, B + 1)]
else:
  l = [i for i in range(A, A + K)]
  l += [i for i in range(B - K + 1, B + 1)]

for i in l:
  print(i)

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().split())
s = {a, b}
for i in range(k):
    s.add(min(b, a + i))
    s.add(max(a, b - i))
print(*sorted(s), sep=' ')

Submission status: Accepted

Solution code:
import collections
a, b, k = map(int, input().split())
ans = [a, b]
for i in range(a, min(a + k, b )):
    if i not in ans:
        ans.append(i)
for i in range(b, max(b - k, a), - 1):
    if i not in ans:
        ans.append(i)
ans = collections.Counter(ans).most_common()
ans.sort()
for i in ans:
    print(i[0])

Submission status: Accepted

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

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)

Submission status: Accepted

Solution code:
#from collections import deque
a,b,k=input().split()
a,b,k=int(a),int(b),int(k)

#多分両端からアクセスしないとTLEになる
'''
for i in range(b-a+1):
    if i<k:
        print(a+i)
    elif i>b-a-k:
        print(a+i)
'''

d=[]
if a+(k-1)>b:
    k=b-a+1
for i in range(k):
        d.append(a+i)
        d.append(b-i)
#辞書もsort可能
for i in sorted(set(d)):
    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(max(b-k+1, a), b+1):
    s.add(i)
s = list(sorted(s))

for n in s:
    print(n)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
line=[]
for i in range(a,a+k):
    if i>b:break
    else:
        if i not in line:
            line.append(i)

for i in range(b,b-k,-1):
    if i<a:break
    else:
        if i not in line:
            line.append(i)

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

Submission status: Accepted

Solution code:
a, b, k = [int(x) for x in input().split()]
r=range(a,b+1);
print('\n'.join(map(str,sorted(set(r[:k])|set(r[-k:])))))

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
r = range(A, B+1)
S = set(r[:K])|set(r[-K:])
for i in sorted(S):
  print (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(a+k, 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(a + k, 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:
        print(i)
for i in range(B-K+1,B+1):
    if i>A+K-1:
        print(i)

Submission status: Accepted

Solution code:
a,b,x = map(int,input().split())
a_set = set(range(a,min(a+x,b)))
b_set = set(range(max(a,b-x+1),b+1))

#print(a_set)
#print(b_set)

a_set = a_set.union(b_set)
ans_list = list(a_set)
ans_list.sort()
for ans in ans_list:
  print(ans)

Submission status: Accepted

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

for i in range(A, min(A+K, B+1)):
    s.add(i)
for i in range(max(B-K+1,A), B+1):
    s.add(i)
S=list(sorted(s))
for i in range(len(S)):
    print(S[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(A+K,B-K+1),B+1):
    print(i)

Submission status: Accepted

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

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(b, max(b - k, a - 1), -1):
    if i not in l:
        l.append(i)
l.sort()
for i in l:
    print(i)

Submission status: Accepted

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

r = range(A, B+1)
print(*sorted(set(r[:K]) | set(r[-K:])), sep='\n')

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split(' '))
A = list(filter(lambda x: x <= b, [i for i in range(a, a+k)]))
B = list(filter(lambda x: x >= a, [i for i in range(b-k+1, b+1)]))
print('\n'.join(map(str, sorted(list(set(A+B))))))

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

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

x = list(set(x))
x.sort()

for i in x:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

ans = set()
for i in range(K):
    ans.add(min(A+i, B))
    ans.add(max(B-i, A))
E = sorted(list(ans))
for e in E:
    print(e)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
S=sorted(set(range(a,min(a+k,b+1))) | set(range(max(b+1-k,a),b+1)))
for _ in S:
    print(_)

Submission status: Accepted

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

L = []
for i in range(K):
    x = A+i
    y = B-i
    if x not in L and x >= A and x <= B:
        L.append(x)
    if y not in L and x >= A and x <= B:
        L.append(y)
L.sort()

for x in L:
    print(x)

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-1,-1,-1):
    if b-i>=a and not b-i in l:
        l.append(b-i)
l.sort()
for i in range(len(l)):
    print(l[i])

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
ans = []
for i in range(k):
  if a <= a+i <= b:
    ans.append(a+i)
  if a <= b-i <= b:
    ans.append(b-i)
ans.sort()
last = 'null'
for i in range(len(ans)):
  if ans[i] != last:
    print(ans[i])
  last = ans[i]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
S=sorted(set(range(a,min(a+k,b+1))) | set(range(max(b+1-k,a),b+1)))
print(*S,sep="\n")

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

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

for i in range(B-K+1,B+1):
	if A <= i:
		ans.append(i)
#リストをset化して、重複を取り除く
ans=list(set(ans))
ans.sort()	#昇順にソート

for i in ans:
	print(i)