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:
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B, K = map(int, readline().split())
ans=''
if B-A+1 <= 2 * K:
    ans += '\n'.join(str(x) for x in range(A, B + 1))
else:
    ans += '\n'.join(str(x) for x in range(A, A + K))
    ans+='\n'
    ans += '\n'.join(str(x) for x in range(B + 1 - K, B + 1))
print(ans)

Submission status: Accepted

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

if l >= 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:
from itertools import chain
import sys

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

if diff == 0:
    print(A)
    sys.exit()

if K > diff:
    K = diff

ans = [x for x in chain(range(A, A + K), range(B - K + 1, B + 1))]
ans = sorted(list(set(ans)))

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

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

l = range(A, B+1)
a = [n for n in l[:K]]
b = [n for n in l[-K:]]

for n in sorted(set(a + b)):
    print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in range(max(x+1, B-K+1), B+1):
  if x>=A: print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
if A+K-1>=B-K+1:
    print(*list(range(A,B+1)),sep="\n")
else:
    print(*(list(range(A,A+K))+list(range(B-K+1,B+1))),sep="\n")

Submission status: Accepted

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

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

else:
  nList = []
  for i in range(k):
    nList.append(a+i)
    nList.append(b-i)

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if b-a<2*k:
  for i in range(a,b+1):
    print(i)
  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:
# -*- coding: utf-8 -*-
a,b,k = map(int,input().split())

"""
for i in range(a, b + 1):
    if a + k - 1 >= i or b - k + 1 <= i:
        print(i)
"""
"""
tmp = []
for i in range(k):
    if a + i <= b:
        print(a + i)
        tmp.append(a + i)
for i in range(k):
    i = k - i - 1
    if (b - i >= a) and (not((b - i) in tmp)):
        print(b - i)
"""

#くれないさんのわかりやすい解答
ans = []
for i in range(k):
    number = a + i
    if a <= a + i <= b:
        ans.append(number)
    number = b - i
    if a <= number <= b:
        ans.append(number)
ans = list(set(ans))
ans.sort()
for i in range(len(ans)):
    print(ans[i])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a,b,k = map(int,input().split())

"""
for i in range(a, b + 1):
    if a + k - 1 >= i or b - k + 1 <= i:
        print(i)
"""
tmp = []
for i in range(k):
    if a + i <= b:
        print(a + i)
        tmp.append(a + i)
for i in range(k):
    i = k - i - 1
    if (b - i >= a) and (not((b - i) in tmp)):
        print(b - i)

Submission status: Accepted

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

res = set()

for i in range(K):
    num = A+i
    if A <= num <= B:
        res.add(num)
    num = B-i
    if A <= num <= B:
        res.add(num)

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

Submission status: Accepted

Solution code:
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+k-1, b-k), -1):
    ans.append(i)

ans.sort()
for num in ans:
    print(num)

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

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

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

Submission status: Accepted

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

t = []

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

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

y = list(set(t))

for x in sorted(y):
    print(x)

Submission status: Accepted

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

Submission status: Accepted

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

a_list = list(range(A, min(B, A+K)))
b_list = list(range(max(A, B-K+1), B+1))
for i in sorted(list(set(a_list + b_list))):
    print(i)

Submission status: Accepted

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

if ((b-a)+1 >= 2*k):
   c1 = [print(x) for x in range(a, a+k)]
   c2 = [x for x in reversed(range(b+1-k, b+1))]
   c2.sort()
   for i in c2:
      print(i)
else:
   c = [print(x) for x in range(a, b+1)]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
A = range(A, B+1)
A = (set(A[:K]) | set(A[-K:]))

[print(i) for i in sorted(A)]

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = set()
for i in range(min(k, b-a+1)):
    t.add(a+i)
    t.add(b-i)

l = sorted(list(t))

for i in l:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
small = [i for i in range(a,min(a+k,b+1))]
large = [i for i in range(max(a,b-k+1),b+1)]
for i in sorted(set(small+large)):
  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:
import sys
input = sys.stdin.readline
a,b,k=map(int,input().split())
ans=[]
for i in range(k):
    if a+i<=b:
        ans.append(a+i)
for i in range(k):
    if ans[-1]<b-k+i+1<=b:
        ans.append(b-k+i+1)
for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input().split()
i=int(s[0])
j=int(s[1])
k=int(s[2])
a=[]
for l in range(k):
  if i+l<=j:
    a.append(str(i+l))
  else:
    break
b=int(a[-1])
if b>=j-k and b<j:
  for l in range(1,j-b+1):
    if b+l<=j:
      a.append(str(b+l))
elif b<j-k:
  for l in range(k-1,-1,-1):
    if j-l<=j:
      a.append(str(j-l))
print(*a)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

L = [int(v) for v in input().split()]

if L[1] - L[0] <= L[2]:
    L[2] = L[1] - L[0]

    for v in range(L[0], L[1] + 1):
        print(v)
    exit()

s = set()
for v in range(L[0], L[0] + L[2]):
    s.add(v)
for v in range(L[1] - L[2] + 1, L[1] + 1):
    s.add(v)

for v in sorted(s):
    print(v)

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A, B, K = [int(x) for x in input().rstrip().split()]
left = [int(x) for x in range(A, A+K)]
right = [int(x) for x in range(B, B-K, -1)]
ans = []
for i in left:
    if i not in ans and i <= B:
        ans.append(i)
for j in right:
    if j not in ans and j >= A:
        ans.append(j)
ans.sort()
for k in ans:
    print(k)

Submission status: Accepted

Solution code:
# -coding: utf-8 -

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

s = range(a,b+1)
s_small = s[:k]
s_large = s[-k:]
ans = list(set(s_small)|set(s_large))
ans = sorted(ans)
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#N = int(input())
A, B, K = map(int, input().split())

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
lst =  range(a, b + 1)
lst_small = lst[:k]
lst_large = lst[-k:]
ans = list(set(lst_small) | set(lst_large))
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 > k:
    lst_small = [x for x in range(a, a + k)]
    lst_large = [x for x in range(b - k + 1, b + 1)]
    ans = list(set(lst_small) | set(lst_large))
    ans = sorted(ans)
else:
    ans = [x for x in range(a, b + 1)]

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

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)

#print(ans)
for j in range(k):
    if b-j<a:
        break
    ans.append(b-j)
v = set(ans)
w = list(v)
w.sort()
#print(w)

for l in w:
    print(l)

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)
a = list(s)
a = sorted(a, key=lambda x: x, reverse=False)
for i in a:
    print(i)

Submission status: Accepted

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

if b-a+1 < c*2:
    #print('flag')
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+c):
        print(i)
    for i in range(b-c+1,b+1):
        print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, k = list(map(int, readline().split()))
    res = []
    for i in range(a, min(a + k, b + 1)):
        if i not in res:
            res.append(i)
    for i in range(b, max(b - k, a - 1), -1):
        if i not in res:
            res.append(i)
    res.sort()
    print(*res, sep="\n")


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(map(int,input().split()))
for i in range(li[0],min(li[1]+1,li[0]+li[2])):
    print(i)
for k in range(li[1]-li[2]+1,li[1]+1):
    if k>li[0]+li[2]-1:
        print(k)

Submission status: Accepted

Solution code:
import sys

a, b, k = map(int, sys.stdin.readline().split())

def main():
    if k >= b - a + 1:
        res = list(range(a, b+1))
    else:
        res = set(range(a, a+k)) | set(range(b, b-k, -1))
        res = sorted(res)
    return res

if __name__ == '__main__':
    ans = main()
    print(*ans, sep='\n')

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

ans = set([])

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

for i in range(B - K + 1, B + 1):
        if i < A:
                continue
        ans.add(i)


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

Submission status: Accepted

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


def solve(A: int, B: int, K: int):
    if A + K > B - K:
        for i in range(A, B+1):
            print(i)
        return

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


# Generated by 1.1.6 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:
x=list(map(int,input().split()))
a=x[0]
b=x[1]
k=x[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=[]
for i in range(a,min(a+k,b+1)):
    ans.append(i)
for j in range(b,max(b-k,a-1),-1):
    if j not in ans:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
l = []
for i in range(K):
  if A + i > 0 and A + i <= B:
    l.append(A + i)
  elif A + i > B:
    break
for x in range(K):
  if B-(K-1)+x > 0 and B-(K-1)+x >= A:
    l.append(B - (K - 1) + x)
  elif B - (K - 1) + x < A:
    break

for y in sorted(set(l), key = l.index):
  print(y)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a,b,k=map(int ,input().split())

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

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

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

"""
3 8 2

3
4
7
8

4 8 3

4
5
6
7
8

2 9 100

2
3
4
5
6
7
8
9
"""

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    a,b,k=map(int,input().split())
    ans = [a+i if a+i<=b else a for i in range(k) ]
    ans += [b-k+i+1if a<=b-k+i+1else b for i in range(k)]
    ans = sorted(set(ans))
    print("\n".join(map(str,ans)))
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys
a,b,k = map(int, sys.stdin.readline().split())

s = set(range(a,a+k)) | set(range(b-k+1,b+1))

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
i = list(map(int, input().split()))
num_list = []
if(i[1]-i[0]+1<i[2]):
	i[2] = i[1] - i[0] + 1
for j in range(i[2]):
	num_list.append(i[0]+j)
for j in reversed(range(i[2])):
	num_list.append(i[1]-j)
ans = sorted(list(set(num_list)))
for k in range(len(ans)):
	print(ans[k])

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
r = []
for i in range(min(k,b-a+1)):
    r.append(a+i)
    r.append(b-i)
res = list(set(r))
res.sort()
print("\n".join(map(str,res)))

Submission status: Accepted

Solution code:
a,b,d = [int(x) for x in input().split()] 
f = []
sum = 0

for i in range(a,(a+d)):
    sum = i
    if sum >b:
        break
    #print(sum)

    f.append(sum)

for j in range(b,(b-d),-1):
    sum=j
    if sum<a:
        break
    if sum not in f:
        f.append(sum)

f.sort()
for x in range(len(f)):
    print(f[x])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, k = list(map(int, readline().split()))
    st = set()
    for i in range(a, min(a + k, b + 1)):
        st.add(i)
    for i in range(b, max(b - k, a - 1), - 1):
        st.add(i)
    for v in sorted(st):
        print(v)


if __name__ == '__main__':
    solve()

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,c=map(int,input().split())
if c>(b-a)//2:
  for i in range(a,b+1):
    print(i)
else:
  for i in range(a,a+c):
    print(i)
  for i in range(b-c+1,b+1):
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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)
    quit()
lst1 = list(range(a, a + k))
lst2 = list(range(b - k + 1, b + 1))
lst = list(set(lst1 + lst2))
lst.sort()
print(*lst, sep='\n')

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
X = [p for p in range(A,A+K) if p<=B]
Y = [q for q in range(B-K+1,B+1) if q>=A]
ans = list(set(X+Y))
ans.sort()
for i in ans:
  print(i)

Submission status: Accepted

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

ls = []

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

ls_ans = sorted(ls)

for j in range(len(ls_ans)):
    print(ls_ans[j])

Submission status: Accepted

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

Submission status: Accepted

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

for j in range(max(b-k+1, a), b+1):
    X.append(j)
X = sorted(X)
X_s = sorted(set(X), key=X.index)
for k in X_s:
    print(k)

Submission status: Accepted

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

for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

#以下を満たす整数をすべて昇順に出力してください。
#A 以上 B 以下の整数の中で、小さい方から K 番目以内であるか、大きい方から K 番目以内である
ans = []
for i in range(A,min(B+1,A+K)):
  ans.append(i)  
for i in range(max(A,B-K+1),B+1):
  ans.append(i)
  
single_ans = list(set(ans))
single_ans.sort(reverse=False)

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

Submission status: Accepted

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

Submission status: Accepted

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

List = sorted(set(l))
for i in range(len(List)):
    print(List[i])

Submission status: Accepted

Solution code:
import numpy as np

A,B,K=list(map(int,input().split(" ")))
a=np.arange(A,min(A+K,B+1)) # 小さい方から
b=np.arange(max(A,B-K+1),B+1) # 大きい方から
ab=np.append(a,b) # かぶりをなくす

# 小さい順に出力
for u in np.sort(np.unique(ab)):
    print(u)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(map(int,input().split()))
a = 0
k  = []
for c in range(A[0],A[1]+1):
  k.append(c)
  a += 1
  if a== A[2]:
    break;
a = 0
for c in range(A[1], A[0], -1):
  if a == A[2]:
    break;
  k.append(c)
  a += 1
k = sorted(list(set(k)))
for i in k:
  print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for ll in l:
  print(ll)

Submission status: Accepted

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

        ans.append(a+i)
        ans.append(b-i)
    elif a+i==b-i:
        ans.append(a+i)
ans.sort()
for ai in ans:
    print(ai)

Submission status: Accepted

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

length = -(-(b-a+1)//2)

#print(length)

t = a

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

else:
	for i in range(k):
		print(t)
		t = t + 1
		
	t = b - k + 1
	for i in range(k):
		print(t)
		t = t +1

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def examB():
    A, B, K = LI()
    ans = []
    for i in range(K):
        low = min(B,A+i); up = max(B-i,A)
        if low not in ans:
            ans.append(low)
        if up not in ans:
            ans.append(up)
    ans.sort()
    for v in ans:
        print(v)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

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

ans = []
for i in range(K):
    if A not in ans:
        ans.append(A)

    if B not in ans:
        ans.append(B)

    if A + 1 <= b:
        A += 1
    if B - 1 >= a:
        B -= 1

ans.sort()
for i in ans:
    print(i)

Submission status: Accepted

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

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

w = sorted(list(set(w)))
for ww in w:
    print(ww)

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

Submission status: Accepted

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

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

lia = list(set(lia+lib))
lia.sort()
for i in lia:
    print(i)

Submission status: Accepted

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

ans = []
tmp_A = A-1
tmp_B = B+1
for i in range(K):
    tmp_A += 1
    if tmp_A <= B and tmp_A not in ans:
        ans.append(tmp_A)
    tmp_B -= 1
    if tmp_B >= A and tmp_B not in ans:
        ans.append(tmp_B)

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