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())
X = range(a, b+1)
Y = sorted(list(set(X[:k]) | set(X[-k:])))
print(*Y, sep='\n')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#B - Small and Large Integers
A,B,K = map(int,input().split())

ans = []
for j in range(K):
    a = A+j
    b = B-j
    if a > B or b < A:
        break
    ans.append(a)
    ans.append(b)

ans = list(sorted(set(ans), reverse = False))

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:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()
import math

def resolve():
    import sys
    input = sys.stdin.readline
    a, b, k = [int(x) for x in input().rstrip().split(" ")]

    if (b - a + 1)  <= k * 2:
        print("\n".join([str(num) for num in range(a, b+1)]))
    else:
        print("\n".join([str(num) for num in range(a, a+k)]))
        print("\n".join([str(num) for num in range(b-k+1, b+1)]))



if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

ans = {}
for i in range(a,a+k):
    if i<=b:
        ans.setdefault(i,0)
        ans[i] += 1
    else:
        break
for i in range(b-(k-1),b+1):
    if a<=i:
        ans.setdefault(i,0)
        ans[i] += 1
    else:
        break
for i in ans.keys():
    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):
        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 = 0
S = []
if B - A <= K:
    for i in range(A,B+1):
        print(i)
    exit()
for i in range(A,B+1):
    if c == K:
        break
    print(i)
    S.append(i)
    c += 1
for i in range(B-K+1,B+1):
    if i not in S:        
        print(i)

Submission status: Accepted

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

for s in sorted(set(r[:K]) | set(r[-K:])):
    print(s)

Submission status: Accepted

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

if (b-a+1) < k:
    for i in range(a,b+1):
        print(i)
else:  
    lst1 = [i for i in range(a,a+k)]
    lst2 = [i for i in range(b-k+1,b+1)]

    lst = sorted(list(set(lst1 + lst2)))

    for i in lst:
        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:
def main():
    a, b, k = map(int, input().split())
    printed = 0
    l = []
    for i in range(k):
        if a + i > b:
            return
        print(a + i)
        printed = a + i
        l.append(printed)
    if printed >= b:
        return
    for i in range(k):
        if b - k + 1 + i in l:
            continue
        elif b - k + 1 + i > b:
            break
        print(b - k + 1 + i)

main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans1 = [i for i in range(A, A + K) if A <= i and i <= B]
ans2 = [i for i in range(B, B - K, -1) if A <= i and i <= B]

ans = ans1 + ans2
ans = list(set(ans))
ans.sort()
for ans in ans:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=list(map(int, input().split()))
a=min(A+K-1,B)
b=max(A,B-K+1)
L=list(range(A,a+1)) + list(range(b,B+1))
L=list(set(L))
L.sort()
for _ in range(len(L)):
  print(L[_])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
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())
A=[]
B=[]
for i in range(a,min(a+k,b+1)):
    A.append(i)
for j in range(b,max(b-k,a-1),-1):
    A.append(j)
B=list(set(A))
B.sort(reverse=False)
for p in range(len(B)):
    print(B[p])

Submission status: Accepted

Solution code:
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)
ans_list = sorted(list(ans))
for a in ans_list:
    print(a)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import defaultdict


def read():
    A, B, K = list(map(int, input().strip().split()))
    return A, B, K


def solve(A, B, K):
    d = defaultdict(bool)
    for a in range(A, min(A+K, B+1)):
        d[a] = True
    for b in range(B, max(A-1, B-K), -1):
        d[b] = True
    ans = list(sorted(d.keys()))
    for a in ans:
        print(a)


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, x = rm()
set_ = set()
for i in range(x):
    if a+i <= b:
        set_.add(a + i)
        set_.add(b - i)
li = sorted(list(set_))
for i in li:
    print(i)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

ans = []
for i in range(a,min(b+1,a+k)):
    ans.append(i)
for i in range(b,max(a-1,b-k),-1):
    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,input().split())
lsans = []
for i in range(A,A+K):
    if i <= B:
        lsans.append(i)
for j in range(B+1-K,B+1):
    if j >= A and not(j in lsans):
        lsans.append(j)
for i in lsans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
if B-A>200:
    k=range(A,A+K)
    l=range(B-K+1,B+1)
    for i in k:
        print(i)
    for i in l:
        print(i)
else:
    s=range(A,B+1)
    t=[x for x in s if A<=x<=A+K-1 or B-K+1<=x<=B]
    t.sort()
    for i in t:
        print(i)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
r = []
for i in range(A, min(A+K, B+1)):
    r.append(i)
for i in range(max(B-K+1, A), B+1):
    r.append(i)
for i in sorted(list(set(r))):
    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:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

a, b, k = inintm()

for i in range(a,min(b, a+k-1)+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())

L = []

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

ans = sorted(set(L))

print(*ans, sep="\n")

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, K = map(int, readline().split())

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

    print(*ans, sep='\n')

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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 = list(map(lambda x: int(x), input().split(" ")))
ans = []
for i in range(A, min([A + K, B + 1])):
  ans.append(i)
for j in range(max([B - K + 1, A]), B + 1):
  ans.append(j)

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

print("\n".join(list(map(lambda s: str(s), ans))))

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:
mini, maxi, K_ban = map(int, input().split())

if (maxi - mini + 1 <= 2 * K_ban):
    ans = [i for i in range(mini, maxi + 1)]

else:
    left = [i for i in range(mini, mini + K_ban)]
    right = [i for i in range(maxi - K_ban + 1, maxi + 1)]
    
    ans = left + right
    

[print(n) for n in ans]

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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+1), B+1):
    l.append(i)

l = list(set(l))
l.sort()
print(*l, sep="\n")

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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(max(b-k+1,a),b+1):
  ans.append(i)
ans = sorted(list(set(ans)))
for i in ans:
  print(i)

Submission status: Accepted

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

r = []

for i in range(A, min(A + K, B)):
    print(i)
    r.append(i)

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

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(max(b-k+1,a),b+1):
  ans.append(i)
ans = sorted(list(set(ans)))
for i in ans:
  print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
ans = set(range(A,min(A+K,B+1))).union(set(range(B,max(A-1,B-K),-1)))

print(*sorted(ans))

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,0):
    if B + i >= A:
        ans.append(B + i + 1)
ans = list(set(ans))
ans = sorted(ans)
for i in range (len(ans)):
    print(ans[i])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

from bisect import bisect_left

A, B, K = MAP()
s = set()
for i in range(K):
    x = A + i
    if A <= x <= B:
        s.add(x)
for i in range(K):
    x = B - K + 1 + i
    if A <= x <= B:
        s.add(x)
for x in sorted(s):
    print(x)

Submission status: Accepted

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

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

else:
    for j in range(A, A+K):
        print(j)
    for k in range(B-K+1, B+1):
        print(k)

Submission status: Accepted

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

if b-a <= k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        num.append(i)
    for i in range(b-k+1,b+1):
        num.append(i)
        
    num = list(set(num))
    num.sort()
    
    for i in num:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
# print(f"{a} {b} {k}")

# l = []
# for i in range(a, b + 1):
#     l.append(i)
# print(l)

# l_small = set()
# for i in range(a, a + k):
#     l_small.add(i)
# print(l_small)

# l_large = set()
# for i in range(b, b - k, -1):
#     l_large.add(i)
# print(l_large)

# l = [i for i in range(a, b + 1)]
# print(l)

l_ans = set()

count = 1
for i in range(a, b + 1):
    if count <= k:
        l_ans.add(i)
    else:
        break
    count += 1

count = 1
for i in range(b, a - 1, -1):
    if count <= k:
        l_ans.add(i)
    else:
        break
    count += 1

for num in sorted(l_ans):
    print(num)

Submission status: Accepted

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

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

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
a, b, k = list(map(int, input().split()))
al, bl = [], []
if a == b:
    print(a)
else:   
    for i in range(min(b-a,k)):
        al.append(a+i)
        bl.append(b-i)
        ans = list(set(al) | set(bl))
    ans.sort()
    for i in ans:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
if b - a + 1 <= k * 2:
    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());r=range(a,b+1);print(*sorted({*r[:k]}|{*r[-k:]}))

Submission status: Accepted

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

if b-a <= k:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        num.append(i)
    for i in range(b-k+1,b+1):
        num.append(i)
        
    num = list(set(num))
    num.sort()
    
    for i in num:
        print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, K = input().split(' ')
A = int(A)
B = int(B)
K = int(K)
N = []
if B-A>K:
  for i in range(A, A+K):
    print(i)
    N.append(i)
  for i in range(B-K+1, B+1):
    if not i in N:
      print(i)

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

Submission status: Accepted

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

L = list(range(A, min(B, A+K))) + list(range(max(A, B-K+1), B+1))
L_no_duplication = set(L)
print(*sorted(L_no_duplication), sep="\n")

Submission status: Accepted

Solution code:
MM = input().split()
A = int(MM[0])
B = int(MM[1])
K = int(MM[2])
MM = set()
for i in range(A, A+K):
  if i <= B:
    MM.add(i)
for i in reversed(range(B-K+1,B+1)):
  if i >= A:
    
    MM.add(i)

MM = sorted(MM)

for i in MM:
  print(i)

Submission status: Accepted

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
k = int(s[2])




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)

Submission status: Accepted

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

ans = list(ans)
ans.sort()

for a in ans:
    print(a)

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
if 2*K > B-A:
    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())
li = []
if k*2 >= b-a+1:
    for i in range(a,b+1):
        li.append(i)
    for i in range(len(li)):
        print(li[i])
else:
    for i in range(k):
        li.append(a+i)
        li.append(b-i)
    li.sort()
    for i in range(len(li)):
        print(li[i])

Submission status: Accepted

Solution code:
A,B,K = (int(X) for X in input().split())
Low  = list(range(A,min(B+1,A+K)))
High = list(range(B,max(A-1,B-K),-1)) 
Num  = sorted(set(Low+High))
print('\n'.join(str(X) for X in Num))

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=sorted(list(set(l)))
for i in l:print(i)

Submission status: Accepted

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

answer = []
for i in range(0,k):
  if a+i <= b:
    answer.append(a+i)
  else:
    break
  
for i in range(0,k):
  if b-i >= a:
    answer.append(b-i)
  else:
    break  
    
answer = list(set(answer))  
answer.sort()

for a in answer :
  print(a)

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)
  exit()
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 = [int(i) for i in input().split()]
ans = list(set([i for i in range(A,min(A+K, B+1))] + [j for j in range(max(A, B-K+1),B+1)]))
ans.sort()
print("\n".join(map(str, ans)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
4,5,6,7,8,9,10
a, b , k = map(int, input().split())
if k > (b-a)//2:
  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, open(0).read().split())

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

Submission status: Accepted

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

lst = []

for i in range(K):
    if A + i <= B:
        lst.append(A+i)
    else:
        break

for j in range(K):
    if A <= B - j:
        lst.append(B-j)
    else:
        break

lst = sorted(list(set(lst)))

for l in lst:
    print(l)

Submission status: Accepted

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

Submission status: Accepted

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

if B-A > K:
    ax = [i for i in range(A,A+K)]
    bx = [i for i in range(B-K+1,B+1)]
    sum = sorted(list(set(ax + bx))) 
else:
    sum = [i for i in range(A,B+1)]

for i in sum:
    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 :
        print(i)

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

Submission status: Accepted

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

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

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

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)

Submission status: Accepted

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

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

ans = []

# 以内の判定
for i in range(A, A + K):
    if i <= B:
        ans.append(i)

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

ans = sorted(set(ans))

for x in ans:
    print(x)

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:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

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

    ans_list = []

    for i in range(a,a+k):
        if i > b:
            continue
        ans_list.append(i)

    for i in range(b-k+1,b+1):
        if i < a:
            continue
        ans_list.append(i)

    ans_list = list(set(ans_list))

    for num in ans_list:
        print(num)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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))
print(*res, sep='\n')

Submission status: Accepted

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

for n in range(A,min(A+K,B+1)):
  L.append(n)
  
for n in range(max(A,B-K),B+1):
  M.append(n)
  
L = sorted(set(L[:K]+M[-K:]))
  
print(*L,sep="\n")

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

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())
    ans = []
    for v in range(A, min([A+K, B+1])):
        ans.append(v)
    for v in range(max([A, B-K+1]), B+1):
        if v not in ans:
            ans.append(v)
    print("\n".join([str(v) for v in ans]))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B, K = list(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, min(b, a + k - 1) + 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())
ans = []
for i in range(k):
    if a + i <= b:
        ans.append(a + i)
for j in range(b - k + 1, b + 1):
    if j not in ans and a <= b - k + 1:
        ans.append(j)
for k in range(len(ans)):
    print(ans[k])

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b, k = map(int, input().split())
if (b - a) // 2 + 1 < k:
    print(*range(a, b + 1), sep="\n")
else:
    print(*sorted(set([*range(a, a + k)] + [*range(b - k + 1, b + 1)])),
          sep="\n")

Submission status: Accepted

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

Submission status: Accepted

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

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

L = set()
for i in range(min(K, B-A+1)):
    L.add(A+i)
    L.add(B-i)
L = sorted(list(L))
for i in range(len(L)):
    print(L[i])

Submission status: Accepted

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

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

t = list(set(t))
t.sort()

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

Submission status: Accepted

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

m = set(range(a, min(a+k, b)))
n = set(range(max(a, b-k+1), b+1))
l = m | n

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

Submission status: Accepted

Solution code:
def main():
  a,b,k = list(map(int,input().split()))
  minlist=[]
  maxlist=[]
  ans=[]
  for i in range(0,k):
    if b-i>=a:
      minlist.append(a+i)
    if b-i>=a+k:
      maxlist.insert(0,b-i)
  ans=minlist+maxlist
  set(ans)
  for i in range(0,len(ans)):
    print(ans[i])
main()

Submission status: Accepted

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