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, c = map(int, input().split())
d = []
for i in range(a, a + c):
    if i not in d and i <= b:
        d.append(i)
for i in range(b, b - c, -1):
    if i not in d and i >= a:
        d.append(i)
d.sort()
for i in d:
    print(i)

Submission status: Accepted

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

ans=list(set(list(i for i in range(a,a+k,1) if i<=b)+list(j for j in range(b,b-k,-1) if j>=a)))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

'''
if (B-A+1)<K:
  s =  list(range(A,B+1))
  [print(i) for i in s]
else:           
  s_f = list(range(A,A+K))
  s_b = list(range(B,B-K,-1))
  ans = s_f + s_b
  ans =list(set(ans))
  ans.sort()
  [print(i) for i in ans]

Submission status: Accepted

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

Submission status: Accepted

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

if K >= B-A+1:
    ans = list(range(A, B+1))
else:
    ans = list(range(A, A+K)) + list(range(max(A+K, B-K+1), B+1))

for a in ans:
    print(a)

Submission status: Accepted

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

AK = A+K-1
BK = B-K+1
for i in range(A,A+K):
  if i <= B:
    if i >= A and i <= AK:
      print(i)
for i in range(BK,B+1): 
  if (i <= AK)!=1:
    if i >= BK and i <= B:
      print(i)

Submission status: Accepted

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

Submission status: Accepted

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

for i in ll:
    print(i)

Submission status: Accepted

Solution code:
# ABC93, B - small and large integers
a, b, k = map(int, input().split(' '))


if k >= (b-a+1)/2:
    [print(x) for x in range(a, b+1)]
else:
    [print(x) for x in range(a, a+k)]
    [print(x) for x in range(b-k+1, b+1)]

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) > 2*(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):
        if A <= i < A + K or B - K < i <= B:
            print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

#x = int(input())
#a = int(input())
a,b,k = list(map(int,input().split(" ")))
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b,c = list(input().split())
#string = input()
#ls = [int(input()) for i in range(n)]

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

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())
S=set()
for i in range(K):
  S.add(A+i)
  S.add(B-i)
print("\n".join(str(x) for x in sorted(list(S)) if A <= x <= B))

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

Submission status: Accepted

Solution code:

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

low = [a + i for i in range(0, k)]
high = [b - i for i in range(0, k)]
res = set(low + high)

res = sorted(filter(lambda s: a <= s <= b, res))

for x in res:
    print(x)

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=sorted(list(set(ans)))
for i in range(len(ans)):
    print(ans[i])

Submission status: Accepted

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

if k * 2 > (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())
tmp = [0] * K
for i in range(K):
    aTmp = A + i
    if B >= aTmp:
        print(aTmp)
        tmp[i] = aTmp

for i in range(K):
    bTmp = B - K + 1 + i
    if tmp.count(bTmp) == 0 and A <= bTmp:
        print(bTmp)

Submission status: Accepted

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

i = a
while i < a+k:
  if i <= b:
    l.append(i)
  i += 1

i = b-k+1
while i <= b:
  if a <= i:
    l.append(i)
  i += 1

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 = {i for i in range(a, min(a+k, b))} | {i for i in range(max(a, b+1-k), b+1)}
ans = sorted(ans)
for i in ans:
    print(i)

Submission status: Accepted

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

nums = []
for num in range(A, min(A+K, B+1)):
  nums.append(num)
for num in range(max(B-K+1, A), B+1):
  nums.append(num)
ans = sorted(set(nums))
for num in ans:
  print(num)

Submission status: Accepted

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

nums = []
for num in range(A, min(A+K, B+1)):
  nums.append(num)
for num in range(max(B-K+1, A), B+1):
  if not num in nums:
    nums.append(num)
nums.sort()
for num in nums:
  print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int,input().split())
c = b - a + 1
if k > c:
  for i in range(a, b+1):
    print(i)
else:
  l = list(range(a, a+k))
  l1 = list(range(b-k+1, b+1))
  l2 = l + l1
  l3 = set(l2)
  l4 = sorted(l3)
  for i in l4:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

#+++++


def main():
	a, b, k = map(int, input().split())
	if a+k < b+1-k:
		#print('ffff')
		ff=range(a,b+1)[:k]
		bb=range(a,b+1)[-k:]
		ret=list(ff)+list(bb)
	else:
		ret=range(a,b+1)
	
	for i in ret:
		print(i)
		
#+++++

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
	else:
		input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    s = S()
    s.sort()
    if s == ["a", "b", "c"]:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    a, b, k = LI()
    ans = []
    for i in range(a, min(a + k, b + 1)):
        ans.append(i)
    for i in range(max(b - k + 1, a + k), b + 1):
        ans.append(i)
    for i in ans:
        print(i)
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = {}
for i in range(a, a+c):
    d[i] = 1
    if i == b:
        break
for i in range(b, b-c, -1):
    d[i] = 1
    if i == a:
        break
d = sorted(d.items())
for i, j in d:
    print(i)

Submission status: Accepted

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

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

for i in range(k):
  print(a+i)

for i in sorted([b - i for i in range(k)]):
  print(i)

Submission status: Accepted

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

Submission status: Accepted

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

# リスト同士の結合
smallK.extend(largeK)

# 重複を除外する
set1=list(set(smallK))

set1.sort()

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

A, B, K = map(int, input().split())
a1 = [_ for _ in range(A, min(A + K, B + 1))]
a2 = [_ for _ in range(max(A, B - K + 1), B + 1)]
s = sorted(set(a1 + a2))

for i in s: print(i)

Submission status: Accepted

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

if a+k<b+1:
  e = a+k
else:
  e = b+1
for i in range(a,e):
  tmp.append(i)

if a<b-k+1:
  f = b-k+1
else:
  f = a
for i in range(f,b+1):
  tmp.append(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = 0
e = {}
for i in range(a, b+1):
    if i not in e:
        e.setdefault(i, i)
    d += 1
    if d >= c:
        break
d = 0
for i in range(b, a-1, -1):
    if i not in e:
        e.setdefault(i, i)
    d += 1
    if d >= c:
        break
e = sorted(e)
for i in e:
    print(i)

Submission status: Accepted

Solution code:
from itertools import chain
a, b, k = map(int, input().split(" "))
r1 = range(a, min(b + 1, a + k))
r2 = range(max(a, b - k + 1), b + 1)
ans = sorted(set((chain(r1, r2))))
print('\n'.join(str(x) for x in ans))

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
R = range(A, min(B + 1, A + K))
S = range(max(A, B - K + 1), B + 1)
L = list(set(R) | set(S))
L.sort()
print(*L, sep="\n")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np
import statistics
from statistics import mean, median,variance,stdev
import math

def main():
	A, B, K = map(int, input().split(" "))
	
	tmp = -1
	e = min(B, A+K)
	for i in range(A, e):
		print(i)
		tmp = i
	
	#Aprint("sss")
	
	s = max(A, tmp+1, B-K+1)
	for i in range(s, B+1):
		print(i)
			
	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
A,B,K=map(int, input().split())
if A+K-1<B-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())
anslist = []
for i in range(0, K):
	if A+i in anslist or B < A+i:
		break
	anslist.append(A+i)
	if B-i in anslist or B-i < A:
		break
	anslist.append(B-i)
anslist.sort()
for i in range(0, len(anslist)):
	print(anslist[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC93 B

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

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

se = set(range(a,a+k)) | set(range(b-k+1,b+1))
li = list(se)
li = [x for x in li if a<=x<=b]

li.sort()
print(*li,sep='\n')

Submission status: Accepted

Solution code:
mi, ma, num = map(int,input().split())
ans = []
if num <= ma-mi+1:
  for i in range(mi,mi+num):
    ans.append(i)
  for j in range(ma-num+1,ma+1):
    if j not in ans:
      ans.append(j)
  for k in ans:
    print(k)
else:
  for l in range(mi,ma+1):
    print(l)

Submission status: Accepted

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

Submission status: Accepted

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

S = set()
for i in range(K):
    a = A+i
    if A <= a <= B:
        S.add(a)
    b = B-i
    if A <= b <= B:
        S.add(b)

l = list(S)
l.sort()
for s in l:
    print(s)

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:
    aa=[a+i for i in range(k)]
    bb=[b-j for j in range(k)]
    cc=sorted(aa+bb)
    for c in cc:
        print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

m  = min(A+K, B+1)
for i in range(A, m):
    print(i)
n = max(A+K, B-K+1)
for j in range(n, B+1):
    print(j)

Submission status: Accepted

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

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

else:
    aa=[a+i for i in range(k)]
    bb=[b-j for j in range(k)]
    cc=sorted(aa+bb)
    for s in cc:
        print(s)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
lst = []
for i in range(a,a+k):
    if a<=i<=b:
        lst.append(i)
for i in range(b-k+1,b+1):
    if a<=i<=b:
        lst.append(i)    
ans = list(set(lst))
ans.sort()
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:
    aa=[a+i for i in range(k)]
    bb=[b-i for i in range(k)]
    cc=sorted(aa+bb)
    for s in cc:
        print(s)
else:
    for n in range(a,b+1):
        print(n)

Submission status: Accepted

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

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, B - K, -1):
  if i < A:
    break
  ans.add(i)
for i in sorted(ans):
  print(i)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    a, b, k = map(int, input().split())

    mid = (a + b) // 2

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

Submission status: Accepted

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

resolve()

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    A, B, K = (int(_) for _ in input().split())
    s = set()
    for i in range(A,A+K):
        if i > B:
            break
        s.add(i)
    for i in range(B-K+1,B+1):
        if i < A:
            break
        s.add(i)
    l = list(s)
    l.sort()
    print('\n'.join(str(_) for _ in l))
    
if __name__ == '__main__':
    main()

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

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

for i in ans:
    print(i)

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A, B, K = nl()

seen = set()

for i in range(A, B+1):
    if i-A >= K:
        break
    seen.add(i)

count = 0
for i in range(B, A-1, -1):
    if count >= K:
        break
    seen.add(i)
    count += 1

for c in sorted(list(seen)):
    print(c)

Submission status: Accepted

Solution code:

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


if B-A+1 <= 2*K:

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

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())
ans = set()
for i in range(A, A + K):
  if i > B:
    break
  ans.add(i)
for i in range(B, B - K, -1):
  if i < A:
    break
  ans.add(i)
for i in sorted(ans):
  print(i)

Submission status: Accepted

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

    answer = []
    for i in range(K):
        n = A + i
        if n <= B:
            answer.append(n)
        m = B - i
        if A <= m:
            answer.append(m)
    answer = sorted(list(set(answer)))

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

Submission status: Accepted

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

S1 = [i for i in range(A, min(A + K, B + 1))]
S2 = [i for i in range(max(A, B - K + 1),B + 1)]
S = list(set(S1 + S2))
S.sort()

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

Submission status: Accepted

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

aend = a + k - 1
bstart = b - k + 1
if aend >= bstart:
    for i in range(a, b+1):
        print(i)
else:
    for i in range(a, aend+1):
        print(i)
    for i in range(bstart, b+1):
        print(i)

Submission status: Accepted

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

c = 1
while n <= b:
    print(n)
    n += 1
    c += 1
    if c > k:
        break

Submission status: Accepted

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


abc()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
# coding: utf-8
import time
import re
import math

def main():
    A,B,K = map(int,input().split())
    ls=[]
    for a in range(K):
        ls.append(A + a)
        ls.append(B - K +1+ a)
    ls=set(ls)
    ls=sorted(ls)
    for a in ls:
        if (a>=A and a<=B):print(a)
main()

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

# N, M, X = list(map(int, sys.stdin.readline().split()))
# A = np.array(list(map(int, sys.stdin.readline().split())))
#
# print(min(len(A[A > X]), len(A[A<X])))

A, B, K = list(map(int, sys.stdin.readline().split()))

a = list(range(A, min(B, A + K)))
b = list(range(max(A, B - K + 1), B + 1))



print('\n'.join(map(str, list(sorted(set(a + b))))))

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
lia = list(range(a,a+k))
lib = list(range(b-k+1,b+1))
if a+k > b:
  setans = set(lia + lib)&set(range(a,b+1))
else:
  setans = set(lia + lib)
for i in sorted(setans):
  print(i)

Submission status: Accepted

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

se = set(range(a,a+k)) | set(range(b-k+1,b+1))
li = list(se)
li = [x for x in li if a<=x<=b]

li.sort()
print(*li,sep='\n')

Submission status: Accepted

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

num = []

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

ans = sorted(set(num))

for s in ans:
    print(s)

Submission status: Accepted

Solution code:
# a以上b以下の整数で小さい方からk番目以内であるか、大きい方からk番目以内である
a,b,k = map(int, input().split())
for i in range(a, min(a+k,b+1)):
    print(i)
for i in range(max(a+k,b-k+1), b+1):
    print(i)

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
aa=a
l=[]
while a<(min(aa+k,b+1)):
  l.append(a)
  a+=1  
for i in range(max(b-k+1,a),b+1):
  l.append(i)
x=list(set(l))
x.sort()
for i in range(len(x)):
  print(x[i])

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

li1 = [i for i in range(a,a+k) if i <= b]
li2 = [i for i in range(b+1-k,b+1) if i >= a]

li1.extend(li2)
li1 = set(li1)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in sorted(set(x[:k]) | set(x[-k:])):
    print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

r=range(a,b+1)
for i in sorted(set(r[:k])|set(r[-k:])):print(i)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
if b-a <= 2 * 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 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())
L = b - a + 1
if L <= 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 = [int(x) for x in input().split()]

u = set(range(A, min(B+1, A+K)))
l = set(range(B, max(A-1, B-K),-1))
for i in sorted(u | l):
    print(i)