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())
if K <= (B - A) // 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 b-a+1<=2*k:
  for x in range(a, b+1):
    print(x)
else:
  for x in range(a, a+k):
    print(x)
  for x in range(b-k+1, b+1):
    print(x)

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> None:
    a, b, k = [int(next_str()) for _ in range(3)]

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

    for j in range(k - 1, -1, -1):
        if a + k - 1 < b - j:
            print(b - j)


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
a,b,k = map(int, input().split())
l=[]
for i in range(a,min(b,a+k)):
  l.append(i)
for i in range(max(a,b-k+1),b+1):
  if not i 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())
L = range(a, b+1)
for l in sorted(set(L[:k])|set(L[-k:])):
    print(l)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
s={a}
for i in range(a,a+k):
    if a<=i<=b:
        s.add(i)
for i in range(b,b-k,-1):
    if a<=i<=b:
        s.add(i)
s=list(s)
s.sort(reverse=True)
for i in range(len(s)):
    print(s.pop())

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
l=set()
for i in range(a,a+c):
    if i!=b:l.add(i)
    else:break
for i in range(max(b-c+1,a),b+1):
        l.add(i)
print("\n".join(map(str,sorted(list(l)))))

Submission status: Accepted

Solution code:
"""
B - Small and Large Integers
"""

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

numbers = []
for i in range(a, a + k):
    if a <= i and i <= b:
        numbers.append(i)
    else:
        break

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

for i in numbers:
    print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans = set([])
for i in range(a, min(a+k, b+1)):
    ans.add(i)
for i in range(max(a, b-k+1), b+1):
    ans.add(i)
for a in sorted(list(ans)):
    print(a)

Submission status: Accepted

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

Submission status: Accepted

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

if a + k > b - 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())
AB = range(A, B+1)
 
for i in sorted(set(AB[:K]) | set(AB[-K:])):
    print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,K = map(int, input().split())
X = range(A,B+1)

for _ in sorted(set(X[:K]) | set(X[-K:])):
  print(_)

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:
    for i in range(a,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())

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

Z = []
for i in range(K):
    Z.append(A)
    A += 1
    if A > B:
        break
    
for i in range(K):
    Z.append(B)
    B -= 1
    if B < A:
        break

S = (set(Z))
for i in sorted(S):
    print(i)

Submission status: Accepted

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

s=[]

for i in range(k):
	if a+i not in s and a-1<a+i<b+1:	
		s.append(a+i)
for j in range(k) :
	if b-k+j+1 not in s and a-1<b-k+j+1<b+1:
		s.append(b-k+j+1)
for l in range(len(s)):
	print(s[l])

Submission status: Accepted

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

ans = []

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

#ans.sort()
ans = set(ans)

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

Submission status: Accepted

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

    for i in range(len(c)):
        print(c[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 and A <= B - i:
        ans.append(A + i)
        ans.append(B - i)

ans = set(ans)

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
#l=[int(i) for i in input().split()]
#ans=chk=0
ans={a,b}
for i in range(a,min(a+k,b)):
    ans.add(i)
for i in range(b,max(a,b-k),-1):
    ans.add(i)
ans=list(ans)
ans.sort()
for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

max_=A+K-1
min_=B-K+1
if max_<min_:
    for i in range(A,max_+1):
        print(i)
    for i in range(min_,B+1):
        print(i)
else:
    for i in range(A,B+1):
        print(i)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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 a<=b-i:
        ans.append(b-i)
c = list(set(ans))
c.sort()
for x in c:
  print(x)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import math


def main():
    a, b, k = [int(a) for a in input().split()]

    aaa = []

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

    for a in aaa:
        print(a)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, k = [int(v) for v in input().split()]
for line in range(a, min(a+k, b+1)):
    print(line)
for line in range(max(b-k+1, a+k), b+1):
    print(line)

Submission status: Accepted

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

lower_list = [i for i in range(a, a + k)]
upper_list = [i for i in range(b, b - k, -1)]

out_list = sorted(set(lower_list + upper_list))
for out in out_list:
    if a <= out <= b:
        print(out)

Submission status: Accepted

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

Submission status: Accepted

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

lower_list = [i for i in range(a, a + k)]
upper_list = [i for i in range(b, b - k, -1)]
out_list = sorted(set(lower_list + upper_list))

for out_val in out_list:
    if a <= out_val <= b:
        print(out_val)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A〜Bの範囲のK番目以内の数字をリストに入れた後、
#重複をなくし、ソートして順に出力する。

#入力値読み込み
A,B,K = map(int, input().split())

#AからAよりK分大きい数までをLisに入れる。
    #B以下の数字のみlisに追加
lis = []
for i in range(A, A+K):
    if i <= B:
        lis.append(i)

#BよりK分小さい数からBまでをlisに入れる
    #A以上の数字のみlisに追加
for j in range(B-K+1, B+1):
    if j >= A:
        lis.append(j)

#集合にして重複をなくす
ans_set = set(lis)

#リストにする
ans_list = list(ans_set)

#昇順にsortでソートする
ans_list.sort()

#順に出力する
for n in ans_list:
        print(n)

Submission status: Accepted

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

num = B-A+1
lis = []

#AからAよりK分大きい数までをLisに入れる
for i in range(A, A+K):
    #もし入れる数がB以下であればlisに追加
    if i <= B:
        lis.append(i)

#BよりK分小さい数からBまでをlisに入れる
for j in range(B-K+1, B+1):
    #もし入れる数がA以上であればlisに追加
    if j >= A:
        lis.append(j)

#集合にして重複をなくす
ans_set = set(lis)

ans_list = list(ans_set)
ans_list.sort()

for n in ans_list:
        print(n)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
ans = list(set(range(A, min(B, A+K))) | set(range(max(A, B-K+1), B+1)))
ans.sort()
print(' '.join(map(str, ans)))

Submission status: Accepted

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

Submission status: Accepted

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

x = []

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

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

y = set(x)

for i in range(len(y)):
    print(sorted(list(y))[i])

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
listN=range(a,b+1)
index=0
if k>len(listN):
    for number in listN:
        print(number)
else:
    listForP=[]
    index1=0
    while index<k:
        print(listN[index])
        listForP.append(listN[index])
        index+=1
    index2=len(listN)-k
    while index2<len(listN):
        if listN[index2] not in listForP:
            print(listN[index2])
        index2+=1

Submission status: Accepted

Solution code:
# coding:utf-8


def inpl(): return list(map(int, input().split()))


A, B, K = inpl()

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

if c <= B - K:
  c = B - K + 1
  
while c > B - K and c <= B:
  print(c)
  c += 1

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a, b, k = map(int, raw_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):
        if i >= 1:
            print(i)

Submission status: Accepted

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

if (B+1-A)/2 <= K:
    # 数列の半分よりKが大きければ、素直に全部printする
    [print(n) for n in range(A, B+1)]
else:
    [print(n) for n in range(A, A+K)]
    [print(n) for n in range(B+1-K, B+1)]

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
c=set()
for i in range(a,a+k):
    if i <a or i>b:
        continue
    c.add(i)
for j in range(b-k+1,b+1):
    if j <a or j>b:
        continue
    c.add(j)
c=sorted(list(c))
print("\n".join(map(str,c)))

Submission status: Accepted

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

ans = []

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

for j in range(B, B-K, -1):
    ans.append(j)
    if j == A:
        break

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

Submission status: Accepted

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

R = [A, B]

for k in range(1, K):
    if A + k >= B:
        break
    R.append(A + k)

for k in range(1, K):
    if B - k <= A:
        break
    R.append(B - k)


R = list(set(R))
R.sort()

for r in R:
    print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a_upper = min(b, a+k-1)
b_lower = max(a, b-k+1)

u = set(range(a, a_upper+1))
v = set(range(b_lower, b+1))

for i in sorted(list(u | v)):
    print(i)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
for i, num in enumerate(range(A, B + 1)):
    if i + 1 > K:
        break
    print(num)
x = []
for i, num in enumerate(range(B, A-1, -1)):
    if i + 1 > K:
        break
    x.append(num)
x.sort()
k = B - A +1

for i in x:
    if k < 2 * K:
        k += 1
    else:
        print(i)

Submission status: Accepted

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

else:
    ss = [0 for i in range(100)]
    sb = [0 for i in range(100)]

    for i in range(K):
        print(i + A)

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

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

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 n in range(a, b + 1):
    print(n)

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

Submission status: Accepted

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

for i in range(0, K):
    if A + i <= B:
        X.append(A + i)
for i in range(K-1, -1, -1):
    if B-i in X:
        continue
    else:
        if B - i >= A:
            X.append(B - i)
for i in range(len(X)):
    print(X[i])

Submission status: Accepted

Solution code:
#!/usr/bin/python3

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    A, B, K = map(int, input().split())
    ans = set()
    for i in range(A, min(B + 1, A + K)):
        ans.add(i)
    for i in range(B, max(A - 1, B - K), -1):
        ans.add(i)
    for x in sorted(list(ans)):
        print(x)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 = B - A + 1

if l == 1:
  print(A)
elif l == 2:
  print(A)
  print(B)
else:
  if (l+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 b-a+1 <= 2*k:
    for num in range(a, b+1):
        print(num)
else:
    for num in range(a, a+k):
        print(num)
    for num in range(b-k+1,b+1):
        print(num)

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output


def chkprint(*args):
    names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))

# Binary converter


def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]

# --------------------------------------------


dp = None


def main():
    A, B, K = li_input()

    C = []

    for i in range(A, min(A + K, B+1)):
        C.append(i)

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

    for c in C:
        print(c)


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 b in range(B-K+1,B+1):
    if b < A: break
    ans.add(b)
print(*sorted(ans), sep='\n')

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

for a in ans:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(min(k,b-a)):
    ans.append(a+i)
for j in range(min(k,b-a)):
    ans.append(b-j)
    ans.append(b)
for k in range(len(set(ans))):
    print(sorted(set(ans))[k])

Submission status: Accepted

Solution code:
a, b, x = map(int, input().split())
s = set()
for i in [j for j in range(a, min(b + 1, a + x))] :
  print(i)
  s.add(i)
for i in [j for j in range(max(a, b - x + 1), b + 1)] :
  if i not in s:
    print(i)

Submission status: Accepted

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

if B-A <= K:
  for i in range(A, B+1):
    print(i)
else:
  C = []
  for i in range(A, A+K):
    C.append(i)
  
  D = []  
  for i in range(B, B-K, -1) :
    D.append(i)
    
  E = set(C) | set(D)
  F = sorted(E)
  
  for i in range(len(F)):
      print(F[i])

Submission status: Accepted

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

if B-A<=K:
    for i in range(A,B+1):
        print(i)
else:
    for i in range(A,A+K):
        a.append(i)
    for i in range(B-K+1,B+1):
        a.append(i)
    b =set(a)
    print(' '.join(map(str, sorted(b))))

Submission status: Accepted

Solution code:
#coding:utf-8
n=[int(i) for i in input().split()]
if(n[1]-n[0]+1<=2*n[2]):
  for i in range(n[0],n[1]+1):
    print(i)
else:
  for j in range(n[0],n[0]+n[2]):
    print(j)
  for k in range(n[1]-n[2]+1,n[1]+1):
    print(k)

Submission status: Accepted

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

if k < (b - a + 1) / 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 = input().split()
A = int(a)
B = int(b)
K = int(k)

nums = []
for i in range(K):
	if(A+i <= B):
		nums.append(A+i)
	if(B-i >= A):
		nums.append(B-i)
nums_unique = list(set(nums))
nums_unique.sort()
for j in range(len(nums_unique)):
	print(nums_unique[j])

Submission status: Accepted

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

def main():
    a, b, k = list(map(int, input().split()))
    ab_set = set()
    cnt1 = 1
    cnt2 = 1
    
    for i in range(a, b+1):
        if cnt1 <= k:
            ab_set.add(i)
        else:
            break
        cnt1 += 1
        
    for j in range(b, a-1, -1):
        if cnt2 <= k:
            ab_set.add(j)
        else:
            break
        cnt2 += 1
    
    ab_list = list(ab_set)
    ab_list.sort()
    for i in ab_list:
        print(i)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


l = [i for i in range(a, min(b+1,a+k))] + [i for i in range(b, max(a-1,b-k),-1)]
l = list(set(l))
l.sort()

for i in l:
    print(i)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
if B-A+1-2*K>=0:
    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())
x = []
lx = b-a+1
if k <= lx//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:

from collections import defaultdict 
import sys,heapq,bisect,math,itertools,string

sys.setrecursionlimit(10**8)

#N:頂点数   M:辺数
A,B,K = map(int,input().split())


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

Submission status: Accepted

Solution code:
# your code goes here
a,b,k = map(int,input().split())

if 2*k < b-a + 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())
K = min(K,B-A+1)
S = set()
for i in range(K):
    S.add(A + i)
for i in range(K):
    S.add(B - i)
L = sorted(list(S))
for x in L:
    print(x)

Submission status: Accepted

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

ans=[]

for i in range(d):
    tmp=a+i
    if tmp<b+1:
        ans.append(a+i)

for i in range(d-1,-1,-1):
    if b-i>a-1:
        ans.append(b-i)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

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

    ans = list(s)
    ans.sort()

    for a in ans:
        print(a)
            
if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = set()
temp1 = a
temp2 = b
for i in range(k):
    ans.add(temp1)
    ans.add(temp2)
    temp1 += 1
    temp2 -= 1
    if not(a <= temp1 <= b):
        break

ans_p = sorted(ans)
for val in ans_p:
    print(val)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=[]

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

Submission status: Accepted

Solution code:
a,b,k=map(int,raw_input().split())
s=set()
k=min(k,b-a+1)
s.update(range(a,a+k))
s.update(range(b+1-k,b+1))
l = sorted(list(s))
for n in l:
  print n

Submission status: Accepted

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

l1 = list(range(A,min(B+1,A+K)))
l2_lower = max(A,(B+1) - K)
l2 = list(range(l2_lower, B+1))
for n in sorted(list(set(l1+l2))):
    print(n)

Submission status: Accepted

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

ret = []
for i in range(k):
    if 0<=a+i<=b:
        ret.append(a+i)
    if a<=b-k+1+i<=int(1e9):
        ret.append(b-k+1+i)
        
ret = list(set(ret)) # only unique
ret.sort()
for r in ret:
    print(r)

Submission status: Accepted

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

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 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 <= K:
    for i in range(A,B+1):
        print(i)
else:
    result = set(list(range(A, A+K))+list(range(B,B-K, -1)))

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

Submission status: Accepted

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

print(*sorted(list(u)), sep='\n')