Problem:


Score : 200 points

Problem Statement

Print all the integers that satisfies the following in ascending order:

Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

Constraints

1 \leq A \leq B \leq 10^9

1 \leq K \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B K

Output

Print all the integers that satisfies the condition above in ascending order.

Sample Input 1

3 8 2

Sample Output 1

3
4
7
8

3 is the first smallest integer among the integers between 3 and 8.

4 is the second smallest integer among the integers between 3 and 8.

7 is the second largest integer among the integers between 3 and 8.

8 is the first largest integer among the integers between 3 and 8.

Sample Input 2

4 8 3

Sample Output 2

4
5
6
7
8

Sample Input 3

2 9 100

Sample Output 3

2
3
4
5
6
7
8
9



Sample input:
3 8 2


Sample output:
3
4
7
8

Submission status: Accepted

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

Submission status: Accepted

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

a_list =  [ i for i in range(a,min(a+k,b+1)) ]
b_list =  [ i for i in range(max(a,b+1-k),b+1) ]

ans_list = sorted(list(set(a_list+b_list)))
ans_list = [ str(v) for v in ans_list ]
print(" ".join(ans_list))

Submission status: Accepted

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

if (b - a) / 2 >= k:
  for i in range(a, a+k):
    print(i)

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

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

Submission status: Accepted

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

result = set()

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

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

Submission status: Accepted

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

result = set()

for n in range(A, min(A + K, B + 1)):
    result.add(n)

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

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

Submission status: Accepted

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


def solve(A: int, B: int, K: int):
    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)



# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, raw_input().split())
numberlst = []
for i in range(0, K):
	if A+i > B: break
	numberlst.append(A+i)
for i in range(0, K):
	if A > B-i or B-i in numberlst: break
	numberlst.append(B-i)
numberlst.sort()
for i in range(0, len(numberlst)):
	print numberlst[i]

Submission status: Accepted

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

Submission status: Accepted

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

lst = []
for i in range(K):
    lst += [A + i]
for i in range(K):
    lst += [B - i]

lst.sort()
a = 0
for i in lst:
    if A <= i and i <= B:
        if a == i:
            pass
        else:
            a = i
            print (a)

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(A: int, B: int, K: int):
    s = set()
    for i in range(A, min(A + K, B + 1)):
        s.add(i)
    for i in range(max(B - K + 1, A + K - 1), B + 1):
        s.add(i)
    ret = sorted(list(s))
    for n in ret:
        print(n)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
A,B,K = list(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())
num = []
for _ in range(A, A + K):
    if _ <= B:
        num.append(_)
for _ in range(B - K + 1, B + 1):
    if A <= _:
        num.append(_)
num = sorted(list(set(num)))
for n in num:
    print(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:
  # 小さい方からK個出力
  for i in range(A,A+K):
    print(i)
  # 大きい方からK個出力
  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 >= b-k:
    for i in range(a, b+1):
        if i < a+k or b-i+1 <= 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:
# 2019/05/22
# AtCoder Beginner Contest 093 - B

# Input
a, b, k = map(int, input().split())
cnt = b - a + 1

vals = list()
if cnt < k:
    wk = cnt
else:
    wk = k

# small
for i in range(a, a + wk):
    print(i)

if k * 2 > cnt:
    wk = cnt - wk

# large
for i in range(b - wk + 1, b+1):
    print(i)

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def main():
    a, b, k = intin()

    ans = []

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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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):
  l.append(i)

l = list(set(l))
l.sort()
for i in l:
  print(i)

Submission status: Accepted

Solution code:
a,b,k = (int(i) for i in input().split())
al,bl = [a],[b]
for i in range(min(k-1,b-a)):
    al.append(al[i]+1)
for i in range(min(k-1,b-a)):
    bl.append(bl[i]-1)
al.extend(bl)
al = list(set(al))
while True:
    print(min(al))
    al.remove(min(al))
    if al == []:
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

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 i in range(b,b - k,-1):
	if a <= i <= b:l.append(i)
l = sorted(set(l))
for i in l: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)
    if b-i>=a:l.append(b-i)
l=list(set(l))
l.sort()
for i in l:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

pre_arr = [i for i in range(a, min(a+k, b+1))]
back_arr = [i for i in range(max(b-k+1, a), b+1)]
arr_slice = set(pre_arr) | set(back_arr)
[print(i) for i in sorted(arr_slice)]

Submission status: Accepted

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

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

for i in range(k):
    numlist.append(a+i)
    numlist.append(b-i)
numlist=sorted(list(set(numlist)))
for item in numlist:
    print(item)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
l=[int(i) for i in range(A,min(B+1,A+K))]
s=[int(i) for i in range(max(B-K+1,A+K-1),B+1)]
l=l+s
L=list(set(l))
L.sort()
for i in L:
    print(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))]
s=[i for i in range(max(a,b-k+1),b+1)]
l=l+s
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 >= k:
    hidari = [i for i in range(a,a+k)]
    migi = [j for j in range(b,b-k,-1)]
    for i in migi:
        if i not in hidari:
            hidari.append(i)
    hidari.sort()
    for k in hidari:
        print(k)
else:
    for h in range(a,b+1):
        print(h)

Submission status: Accepted

Solution code:

import bisect





def main():
    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)
    # print(ans)







if __name__ == '__main__':
    main()

Submission status: Accepted

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

heads = list(range(A, min(A+K, B+1)))
tails = list(range(max(B-K+1, A), B+1))
print(*sorted(list(set(heads + tails))), sep='\n')

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,k = f()
    s = set()
    for i in range(a, min(a+k, b)):
        s.add(i)
    

    for i in range(max(a,b+1-k), b+1):
        s.add(i)
    
    s = sorted(list(s))
    for i in s:
        print(i)

solve()

Submission status: Accepted

Solution code:
import sys
import math

a,b,k = list(map(int, input().split()))
if b-a+1 <= k:
    for i in range(a,b+1):
        print(i)
else:
    lis = list(range(a,a+k))
    lis.extend(list(range(b-k+1, b+1)))
    lis = list(set(lis))
    lis.sort()
    for i in range(len(lis)):
        print(lis[i])

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
la=[]
lb=[]
for i in range(k):
    if a+i<=b:
        la.append(a+i)
    if a<=b-i:
        lb.append(b-i)
p=sorted(list(set(la+lb)))
for i in range(len(p)):
    print(p[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:
def main():
  A, B, K = [int(x) for x in 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)


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if b-a+1<2*k:
  l=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())
ab_min=[]
ab_max=[]
for i in range(a,min(b+1,a+k)):
    ab_min.append(i)
for j in range(max(a,b+1-k),b+1):
    ab_max.append(j)

ans=list(set(ab_min)|set(ab_max))
ans.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def read_input():
    a, b, k = map(int, input().split())
    return a, b, k


def submit():
    a, b, k = read_input()

    small_max = a + k - 1
    large_min = b - k + 1

    smalls = list(range(a, small_max + 1))
    larges = list(range(large_min, b + 1))

    result = smalls + larges
    result = list(set(result))
    result.sort()
    for r in result:
        if a <= r <= b:
            print(r)

if __name__ == '__main__':
    submit()

Submission status: Accepted

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

if K >= B:
  print(*sorted(range(A,B+1)), sep = "\n")

else:
  a = [i for i in range(A,min(B+1,A+K))]
  b = [i for i in range(B,max(A-1,B-K),-1)]
  print(*sorted(set(a+b)), sep = "\n")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
nums = set()
for i in range(k):
    if i > (b - a):
        break

    nums.add(a + i)
    nums.add(b - i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter

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

for i in range(a, a+k):
    if i > b:
        break
    ans_set.add(i)

for i in range(b, b-k, -1):
    if i in ans_set or b-k < 0:
        break
    ans_set.add(i)

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
L = [A+i for i in range(K) if A+i <= B]
R = [B-i for i in range(K) if B-i >= A]
S = set(L+R)
S = sorted(S)
for v in S:
    print(v)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
[A,B,K] = list(map(int,input().split()))
L = [A+i for i in range(K) if A+i <= B]
R = [B-i for i in range(K) if B-i >= A]
S = set(L+R)
S = sorted(S)
for v in S:
    print(v)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
li = []
x = 0
while a + x <= b and b - x >= a and x <= k-1 :
    li.append(a+x)
    li.append(b-x)
    x += 1
se = set(li)
li = list(se)
li.sort()
for i in li :
    print(i)

Submission status: Accepted

Solution code:
def main():
	A, B, K = map(int,input().split())
	head = min(A+K-1, B)
	tail = max(B-K, A)
	if tail < head:
		tail = head

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

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


if __name__ == '__main__':
	main()

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
#ABC093B
A,B,K = map(int, input().split())
ans = []
if B-A + 1 > K*2:
    for i in range(K):
        ans.append(A+i)
        ans.append(B-i)
    ans.sort()
    for j in ans: 
         print(j)
else:
    for l in range(B-A+1):
        print(A + l)

Submission status: Accepted

Solution code:
#ABC093B
A,B,K = map(int, input().split())
ans = []
if abs(A-B) > K:
    for i in range(K):
        ans.append(A+i)
        ans.append(B-i)
    ans = set(ans)
    ans = sorted(ans)
    for j in ans: 
         print(j)
else:
    for l in range(abs(A-B)+1):
        print(min(A,B) + l)

Submission status: Accepted

Solution code:
A,B,K = map(int, input().split())
list1 = []
list2 = []
for i in range(K):
    if A+i>B:
        break
    list1.append(A+i)
    list2.append(B-i)
ans_list = sorted(list(set(list1+list2)))
for i in range(len(ans_list)):
    print(ans_list[i])

Submission status: Accepted

Solution code:
# ABC093B - Small and Large Integers
a, b, k = list(map(int, input().rstrip().split()))
ans = []

if k >= b - a:
    for i in range(a, b + 1):
        print(i)
else:
    for i in range(k):
        ans.append(a + i)
    for j in range(k):
        if b - j not in ans:
            ans.append(b - j)
    ans = sorted(ans)
    for k in ans:
        print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = {i for i in range(a,min(a+k,b+1))}
ans2 = {i for i in range(b,max(b-k,a-1),-1)}

ans = ans | ans2
ans = sorted(list(ans))

for an in ans: print(an)

Submission status: Accepted

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

Submission status: Accepted

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

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=list(map(int,input().split()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

m = [A+i for i in range(K) if A+i <= B]
M = [B-i for i in range(K) if B-i >= A]
out = sorted(list(set(m+M)))
for ans in out:
    print(ans)

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)
  if B - i >= A:
    l.append(B - i)
l = list(set(l))
l.sort()
for i in range(len(l)):
  print(l[i])

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(K):
    C.add(A+i)
    C.add(B-i)

C = list(C)
C.sort()

for i in range(len(C)):
    if A <= C[i] <= B:
        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+1-K, A+K), 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())

answer = set()

answer |= set(range(a, min(a+k, b+1)))
answer |= set(range(b, max(b-k, a-1), -1))

for i in sorted(answer):
    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:
a,b,k = map(int,input().split())

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

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
L = range(A, B + 1)
print(*sorted(set(L[:K]) | set(L[-K:])), sep="\n")

Submission status: Accepted

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

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(max(a,b-k+1),b+1):
    ans.add(i)
A=[]
for i in ans:
    A.append(i)
A.sort()
for i in A:
    print(i)

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

Solution code:
A,B,K = [int(x) for x in 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):
    if(i<= A+K-1 or i>= B-K+1):
      print(i)

Submission status: Accepted

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

for j in sorted(set(ans)):
  if a <= j <= b:
    print(j)

Submission status: Accepted

Solution code:

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

ak = [i for i in range(a, min(b + 1, a + k))]
bk = [i for i in range(max(a, b - k + 1), b + 1)]

abk = list(set(ak) | set(bk))
abk.sort()

for i in abk:
    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:
def MI(): return map(int, input().split())
def II(): return int(input())
def IS(): return input()
def LI(): return list(map(int, input().split()))

a, b, k = MI()
small = [i for i in range(a, a+k, 1)]
large = [i for i in range(b-k+1, b+1, 1)]
for i in (sorted(list(set(small+large)))):
    if a <= i <= b: print(i)

Submission status: Accepted

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

Submission status: Accepted

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

l=range(A, min(B+1, A+K))
r=range(max(A, B+1-K), B+1)

print("\n".join(map(str, sorted(set(l)|set(r)))))

Submission status: Accepted

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