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())
L = []

for i in range(K):
    if A + i > B - i:
        break
    else:
        L.append(A + i)
        L.append(B - i)

L = set(L)
L = sorted(L)

for l in L:
    print(l)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
N=[int(i) for i in range(a,min(a+k,b+1))]
M=[int(i) for i in range(max(a,b-k+1),b+1)]
print(*sorted(set(M+N)),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) :
    if i < A+K or B-K < i :
      print(i)
else :
  S=set()
  for i in range(K) :
    S.add(A+i)
    S.add(B-i)
  L=list(S)
  L.sort() 
  for i in L :
    print(i)

Submission status: Accepted

Solution code:
#094
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())
min = min(A + K -1, B)
max = max(A + K, B - K + 1)
for i in range(A, min + 1):
  print(i)
for i in range(max, B + 1):
  print(i)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


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:
lists = input().split()
a = int(lists[0])
b = int(lists[1])
x = int(lists[2]) * 2
answer  = []
next = 0
for num in range(0, x):
    if(a == b):
        answer.append(a)
        break
    answer.append(a)
    answer.append(b)
    a += 1
    b -= 1
    if(len(answer) >= x or a > b or b < 0):
        break
    if(a == b):
        answer.append(a)
        if(a + num < b - num):
            for b_num in range(b, a):
                answer.append(b_num)
                if (len(answer) > x):
                    break
        elif(a + num > b - num):
            for a_num in range(a, b):
                answer.append(a_num)
                if (len(answer) > x):
                    break
        break
answer.sort()
for a in answer:
    print(a)

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())
mitasu_seisu = []
for i in range(A, min(A + K, B)):
    mitasu_seisu.append(i)
for j in range(max(A, B - K + 1), B + 1):
    mitasu_seisu.append(j)
for k in sorted(set(mitasu_seisu)):
    print(k)

Submission status: Accepted

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


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


for i in range(K):
    if A <= B-(K-1)+i <= B and B-(K-1)+i not in ans:
        ans.append(B-(K-1)+i)
for a in ans:
    print(a)

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

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

Submission status: Accepted

Solution code:
A, B, K = list(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 + K), B + 1):
  L.append(i)

for i in L:
  print(i)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

l = [i for i in range(A, A + K) if i <= B]
li = l + [i for i in range(B - K + 1, B + 1) if i >= A]

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

Submission status: Accepted

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

res = []

for a in range(A,min(A + K,B)):
    res.append(a)
for b in range(max(A,B - K + 1),B + 1):
    res.append(b)

for r in sorted(list(set(res))):
    print(r)

Submission status: Accepted

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

Submission status: Accepted

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

ans = []

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

l1 = [x for x in range(A, min(A + K, B + 1))]
l2 = [x for x in range(max(B - K + 1, A),B + 1)]
ans = sorted(list(set(l1 + l2)))
for i in range(len(ans)):
    print(ans[i])

Submission status: Accepted

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

small = set(i for i in range(a,a+k) if i<=b)
big = set(i for i in range(b-k+1,b+1) if i>=a)

ans = small | big
for item in sorted(ans):
  print(item)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
g = range(A, B+1)
s = set(g[:K]) | set(g[len(g)-K:])
[print(n) for n in sorted(list(s))]

Submission status: Accepted

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

li = [i for i in range(A, A+K) if i <= B]
li = li + [i for i in range(B-K+1,B+1) if i >= A]

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if b-a+1>c*2:
  for i in range(a,a+c):
    print(i)
  for i in range(b-c+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())
a_ = min(a+k, b)
b_ = max(b-k+1, a)
s = list(range(a, a_)) + list(range(b_, b+1))
s = set(s)
s = list(s)
s.sort()
for s_ in s:
    print(s_)

Submission status: Accepted

Solution code:
import math
a,b,k = map(int, input().split())
res = []
if 2*k > b-a:
    k = math.ceil((b-a)/2)+1
for i in range(k):
    res.append(a+i)
    res.append(b-i)

for s in sorted(set(res)):
    print(s)

Submission status: Accepted

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

for i in range(K):
    if A+i <= B :
       l.add(A+i)
    else:
       continue
for j in range(K):
    if B-j >= A:
       l.add(B-j)
    else:
       continue
list = list(l)
list.sort()
for i in range(len(list)):
    print(list[i])

Submission status: Accepted

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

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

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

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

l = set(lists)
m = list(l)

m.sort()

for i in m:
    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())
for i in range(K):
    if A + i <= B:
        print(A + i)
    else:
        exit()
m = A + K - 1
for j in range(K):
    if m < B - K + j + 1 <=B:
        print(B - K + j + 1)

Submission status: Accepted

Solution code:
def print_all(a, b):
    for i in range(a - 1, b):
        print(i + 1)


a, b, k = map(int, input().split())
elem = b - a + 1

if elem <= 2 * k:
    print_all(a, b)

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b,k=map(int,input().split())
ans=[]
if b-a+1>=2*k:
    for i in range(a,a+k):
        ans.append(i)
    for i in range(b,b-k,-1):
        ans.append(i)
else:
    for i in range(a,b+1):
        ans.append(i)
ans.sort()
ans2=map(str,ans)
print(" ".join(ans2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
a,b,k = [int(_) for _ in stdin.readline().rstrip().split()]
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 = [int(x) for x in input().split()]

t1 = min(B, A + K - 1)
t2 = max(A + K, B - K + 1)
ans = []
for i in range(A, t1 + 1):
    ans.append(i)
for i in range(t2, B + 1):
    ans.append(i)

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

Submission status: Accepted

Solution code:
def solve(string):
    a, b, k = map(int, string.split())
    l = set(range(a, min(a + k, b)))
    r = set(range(max(a, b - k + 1), b + 1))
    return "\n".join(map(str, sorted(l | r)))


if __name__ == '__main__':
    print(solve(input()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = list(range(a, a+k)) + list(range(b-k+1, b+1))
ans.sort()
ans2 = []
for i in ans:
    if a<=i<=b and i not in ans2:
        ans2.append(i)

for j in ans2:
    print(j)

Submission status: Accepted

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

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
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007
sys.setrecursionlimit(1000000)

#A
def A():
    s = S()
    a = s.count("a")
    b = s.count("b")
    c = 3-a-b
    if a&b&c:
        print("Yes")
    else:
        print("No")
#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(a,b-k+1),b+1):
        ans.append(i)
    ans = list(set(ans))
    ans.sort()
    for i in ans:
        print(i)

#C
def C():
    a,b,c = LI()
    ans = 0
    if a%2:
        if b%2:
            if not c%2:
                ans += 1
                a += 1
                b += 1
        else:
            ans += 1
            if not c%2:
                b += 1
                c += 1
            else:
                a += 1
                c += 1
    else:
        if b%2:
            ans += 1
            if not c%2:
                a += 1
                c += 1
            else:
                b += 1
                c += 1
        else:
            if c%2:
                ans += 1
                a += 1
                b += 1
    ans += (3*max(a,b,c)-a-b-c)//2
    print(ans)
#D
def D():
    q = I()
    for i in range(q):
        a,b = LI()
        x = int((a*b)**0.5)
        y = math.ceil((a*b)/x)-1
        ans = x+y-2
        if a==b:
            ans += 1
        print(ans)

#E
def E():
    s = S()
    f = {"N":0,"W":0,"S":0,"E":0}
    for i in s:
        f[i] = 1
    if f["N"]^f["S"]:
        print("No")
    elif f["W"]^f["E"]:
        print("No")
    else:
        print("Yes")
#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

A, B, K = map(int, input().split())
s = set()
for v in range(A, min(B + 1, A + K)):
    s.add(v)
for v in range(max(A, B - K + 1), B + 1):
    s.add(v)
for v in sorted(s):
    print(v)

Submission status: Accepted

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

Submission status: Accepted

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

l = set(list(range(a, b+1)[:k]) + list(range(a, b+1)[-k:]))
l = sorted(list(l))

for n in l:
    print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
s1={i for i in range(A,A+K if A+K<B else B)}
s2={i for i in range(B-K+1 if A<B-K+1 else A,B+1)}
s=s1|s2
for i in sorted(list(s)):
    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())
lr = A+K-1
rl = B-K+1
if lr >= rl:
    for i in range(A,B+1): print(i)
else:
    for i in range(A,lr+1): print(i)
    for i in range(rl,B+1): print(i)

Submission status: Accepted

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

Submission status: Accepted

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

C = A + K - 1
D = B - K + 1

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
arr = []
for i in range(k):
    if int((b - a) / 2 + 0.5) >= i:
        arr.append(a + i)
        arr.append(b - i)
    else:
        break
arr = list(set(arr))
arr.sort()
for i in arr:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

if a+k <= 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())
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 = (int(i) for i in input().split())

len_ab = b-a+1

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

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if(b-a<300):
  for i in range(b-a+1):
    if(a+i<=a+(k-1)):
      print(a+i)
    elif(a+i>=b-(k-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:
def small_and_large_integers(A: int, B: int, K: int) -> list:
    l, r = [], []
    for k in range(K):
        if A + k == B - k:
            l = l + [A+k]
            break
        if B - k < A + k:
            break

        l = l + [A+k]

        r = [B-k] + r
    return l + r


if __name__ == "__main__":
    A, B, K = map(int, input().split())
    ans = small_and_large_integers(A, B, K)
    for a in ans:
        print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(A,A+K):
  if(A<= i<= B):
   ans.append(i)
for j in range(B-K+1,B+1):
  if(A<= j<= B):
   ans .append(j)
  
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
A, B, K = map(int, input().split())
ans = []
for i in range(K):
    a, b = A + i, B - i
    if a < b:
        ans.extend([a, b])
    elif a == b:
        ans.append(a)
    else:
        break
ans.sort()
for a in ans:
    print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
lst1 = [x for x in range(A, A + K) if x <= B]
lst2 = [x for x in range(B, B - K, -1) if x >= A]
for n in sorted(set(lst1 + lst2)):
    print(n)

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())
    x = A
    while x <= B and x <= A+K-1:
        print(x)
        x += 1
    x = max(x, B-K+1)
    while x <= B:
        print(x)
        x += 1


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc093/tasks/abc093_b

import itertools
import collections
import bisect

def main():
    A, B, K = map(int, input().split())
    ans = []
    for i in range(K):
        if A <= A + i <= B:
            ans.append(A + i)
        else:
            break
    for i in range(K):
        if A <= B - i <= B :
            ans.append(B - i)
        else:
            break

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


if __name__ == '__main__':
    main()

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:
import sys

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


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
A,B,K=(int(i) for i in input().split())
a=B-A+1
if K>=a:
  for i in range(A,B+1):
    print(i)
else:
  L1=list(range(A,A+K))
  L2=list(range(B-K+1,B+1))
  S=list(set(L1+L2))
  S.sort()
  for i in S:
    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)
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 x in range(0,K):
        print(A+x)
    for x in range(K-1,-1,-1):
        print(B-x)
else:
    for x in range(0,B-A+1):
        print(A+x)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc093/tasks/abc093_b
a, b, k = [int(x) for x in input().split()]
s = list(range(a, b + 1)[:k])
t = list(range(a, b + 1)[-k:])
for v in sorted(set(s + t)):
    print(v)

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
L = []
for a in range(A, min(A + K, B + 1)):
    L.append(a)
for b in range(max(B - K + 1, A + 1), B + 1):
    if b not in L:
        L.append(b)
for l in L:
    print(l)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    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(K):
            print(A+i)
        for i in range(K):
            print(B-K+1+i)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

S = list(range(A, min(A+K, B)))
L = list(range(max(B-K+1, A), B+1))

ans = list(sorted(list(set(S + L))))

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

Submission status: Accepted

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

S = list(range(A, min(A+K, B)))
L = list(range(max(B-K+1, A), B+1))

ans = list(sorted(list(set(S + L))))

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

Submission status: Accepted

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

st=a
while st<=min(a+k-1,b) :
    print(st)
    st+=1
st=max(st,b-k+1)
while st<=b :
    print(st)
    st+=1

Submission status: Accepted

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

Submission status: Accepted

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

numbers = []

for i in range(K):
  n, m = A + i, B - i
  
  if A <= n <= B and n not in numbers:
    numbers.append(n)
  if A <= m <= B and m not in numbers:
    numbers.append(m)

numbers.sort()

for n in numbers:
  print(n)

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());s=list((range(a,b+1)[:k]))
for r in sorted(set([s,s+list(range(a,b+1)[-k:])][b>k])):print(r)

Submission status: Accepted

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

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

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

for i in range(b + 1 - k, b + 1):
    if i >= a:
        s.add(i)

e = list(s)
e.sort()
for i in e:
    print(i)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
n = min(b,a + k-1)
m = max(b-k+1,a+k)
for i in range(a,n+1):
    print(i)
for i in range(m,b+1):
    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+1 <= k*2:
    for h in range(a, b+1):
        print(h)

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())
X=[]
for i in range(a,a+k):
    if i>b:
        break
    X.append(i)
    
    
for j in range(b-k+1,b+1):
    if j<a:
        break
    X.append(j)
    
X=set(X)
X=list(X)
X.sort()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    A,B,K = map(int, lines.pop(0).split(' '))
    NLIST = set()
    for i in range(K):
        if A+i <= B:
            NLIST.add(A+i)
        if A <= B-i:
            NLIST.add(B-i)

    NLIST = list(NLIST)
    NLIST.sort()
    for i in NLIST:
        print(i)

#
# main
#
lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)

Submission status: Accepted

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

for i in ans_list:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

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

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)

exit()
l = list(range(a, b + 1))
ans = []
ans.extend(l[:min(k,len(l))])
ans.extend(l[max(0,len(l) - k):])

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

Submission status: Accepted

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