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: Runtime Error

Solution code:
def actual(A, B, K):
    min_left = A
    max_left = min(A + (K - 1), B)

    min_right = max(B - (K - 1), max_left + 1)
    max_right = B

    left = set(range(min_left, max_left + 1))
    right = set(range(min_right, max_right + 1))

    unique_nums = left | right

    return '\n'.join(map(str, sorted(unique_nums)))

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

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
l = list(range(A, B+1))
l_s = l[:K]
l_m = l[K*-1:]
ans = l_s + l_m
ans = list(set(ans))
ans.sort()
for i in ans:
    print(i)

Submission status: Runtime Error

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

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int, int>;

int main() {
  int a,b,k; cin >> a >> b >> k;

  for (int i = a; i <= min(b, a+k-1); i++) printf("%d\n", i);
  for (int i = max(b-k+1, a+k); i <= b; i++) printf("%d\n", i);
}

Submission status: Runtime Error

Solution code:
print(input()[0::2])   
A,B,K=map(int,input().split())
l=range(A,B+1))
S=set(l[:K]+l[-K:])
for i in sorted(list(S)):
    print(i)

Submission status: Runtime Error

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


if (b-a+1)>= 2*k:
    nlis = []
    for i in range(a, min(b+1, a+k)):
        nlis.append(i)
        
    for j in range(max(a,b-k+1, a+k), b+1):
        nlis.append(j)
        
    for k in sorted(nlis):
        print(k)
else:
    for i in range(a,b+1):
        print(i)

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

lis = list(range(a,b+1))


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

Submission status: Runtime Error

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

lis = list(range(a,b+1))


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

Submission status: Runtime Error

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

lis = list(range(a,b+1))


for i in lis:
    if (i >= a and i <a+k) or (i <=b and b-k < i):
        print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if (2*k>b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if ((b-a+1)%2==0 and 2*k>=b-a) or ((b-a+1)%2==1 and 2*k>=b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if ((b-a+1)%2==0 and k>=b-a) or ((b-a+1)%2==1 and k>=b-a+1):
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
num=list(range(a,b+1))
ans=[]
if b-a+1<=k:
    for i in num:
        print(i)
    exit()
for i in range(k):
    ans.append(num[i])
    ans.append(num[-(i+1)])
ans=list(set(ans)) #重複を削除
ans.sort() #ソート
for i in ans:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input())
l = [i for i in range(a, b + 1)]
s = sorted(l)
if len(s) > k * 2:
    s = s[:k + 1] + s[k:]
print(s)

Submission status: Runtime Error

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

if B-A+1<= 2*K:
    print(*range(A,B+1), sep="\n")
else:
    a = list(range(A,A+K))
    b = list(range(B-K+1,B+1))
    C = set(a,b)
    print(*C, sep="\n")

Submission status: Runtime Error

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

resolve()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def resolve():
    A, B, K = list(map(int, input().split()))
    l = list(range(A, B+1))
    if 2*K > len(l):
        mn, mx = l, l
    else:
        mn = l[:K]
        mx = l[-K:]
    ans = mn + mx
    ans = list(set(ans))
    ans.sort()
    ans = list(map(str, ans))
    print('\n'.join(ans))

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    A, B, K = list(map(int, input().split()))
    l = list(range(A, B+1))
    if K > len(l):
        mn, mx = l, l
    else:
        mn = l[:K]
        mx = l[-K:]
    ans = mn + mx
    ans = list(set(ans))
    ans.sort()
    ans = list(map(str, ans))
    print('\n'.join(ans))

resolve()

Submission status: Runtime Error

Solution code:
def resolve():
    A, B, K = list(map(int, input().split()))
    l = list(range(A, B+1))
    mn = l[:K]
    mx = l[-K:]
    ans = (mn + mx)
    ans = list(set(ans))
    ans.sort()
    ans = list(map(str, ans))
    print('\n'.join(ans))

resolve()

Submission status: Runtime Error

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

# In[12]:


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


# In[13]:


mylist = list(range(A,B+1))
for x in mylist:
    if x < A+K or x > B-K:
        print(x)


# In[ ]:

Submission status: Runtime Error

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

# In[9]:


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


# In[10]:


mylist = list(range(A,B+1))
ans = [x for x in mylist if x < A+K or x > B-K]
print(ans)


# In[ ]:

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
from collections import deque
from collections import defaultdict

import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	#data = [2]
	data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	#ans = [x for x in data if x!=0]
	ans = data[:]
	return ans

a,b,k = readInts()

l = list(range(a,b+1))
o = l[:k]
t = l[-1*k:]
o.extend(t)
ans = set(o)
ans = sorted(list(ans))

for i in ans:
	print(i)

Submission status: Runtime Error

Solution code:
import math
from collections import deque
from collections import defaultdict

import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	#data = [2]
	data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	#ans = [x for x in data if x!=0]
	ans = data[:]
	return ans

a,b,k = readInts()

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

for i in ans:
	print(i)

Submission status: Runtime Error

Solution code:
import math
import re
import copy
import sys

a,b,k = map(int,input().split())
l = list(range(a,b+1))
if len(l) < k:
    k = len(l)
for i in l[:k]:
    print(i)
l = l[k:len(l)]
le = len(l)
k = le-k
if k < 0:
    k = 0
for i in l[k:le]:
    print(i)

Submission status: Runtime Error

Solution code:
import math
import re
import copy
import sys

a,b,k = map(int,input().split())
l = list(range(a,b+1))
for i in l[:k]:
    print(i)
l = l[k:len(l)]
le = len(l)
k = le-k
if k < 0:
    k = 0
for i in l[k:le]:
    print(i)

Submission status: Runtime Error

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

tmp = list(range(a, b+1))

ans = tmp[:k]
ans.extend(tmp[-1*k:])

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

Submission status: Runtime Error

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

S2 = sorted(set(S[:K]+S[-K:]))

for s in S2:
	print(s)

Submission status: Runtime Error

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

S2 = set(S[:K]+S[-K:])
S3 = sorted(S2)

for s in S3:
	print(s)

Submission status: Runtime Error

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

S2 = set(S[:K]+S[-K:])
S3 = sorted(S2)

for s in S3:
	print(s)

#print("\n".join(S3))

Submission status: Runtime Error

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

l = list(range(A,B+1))
if K >= len(l):
	for i in l:
		print(i)

a1 = l[:K]
a2 = l[len(l)-K:]

a3 = sorted(list(set(a1 + a2)))

for i in a3:
	print(i)

Submission status: Runtime Error

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

ans = list(sorted(list(set(candidate1+candidate2))))
ans = [str(ans[i]) for i in range(len(candidate2) + len(candidate1))]

print('\n'.join(ans))

Submission status: Runtime Error

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

ab = set(list(range(A,B+1,1)))
a = set(list(range(A,A+K,1)))&ab
b = set(list(range(B-K+1,B+1,1)))&ab
ans=list(a|b)
ans = sorted(ans)

if len(ansi)>0:
  for ansi in ans:
    print(ansi)

Submission status: Runtime Error

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

ab = set(list(range(A,B+1,1)))
a = set(list(range(A,A+K,1)))&ab
b = set(list(range(B-K+1,B+1,1)))&ab
ans=list(a|b)
ans = sorted(ans)

for ansi in ans:
  print(ansi)

Submission status: Runtime Error

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

ab = set(list(range(A,B+1,1)))
a = list(range(A,A+K,1))
b = list(range(B-K+1,B+1,1))
a.extend(b)
ans=a
ans = set(ans)
ans = list(ans&ab)
ans = sorted(ans)

for ansi in ans:
  print(ansi)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
L = list(range(a, b + 1))
if b - a + 1 < 2 * k:
	print(*L, sep='\n')
else:
	print(*L[:k], *L[-k:], sep='\n')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

num_list = list(range(a, b+1))

length = len(num_list)

for x in range(0, min(length, k)):
    print(num_list[x])

for x in range(max(k, length-k+1), length):
    print(num_list[x])

Submission status: Runtime Error

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

num_list = list(range(a, b+1))

length = len(num_list)

for x in range(0, min(length, k)):
    print(num_list[x])

for x in range(max(0, length-k), length):
    print(num_list[x])

Submission status: Runtime Error

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

num_list = list(range(a, b+1))

length = len(num_list)

for x in range(min(length, k)):
    print(num_list[x])

for x in range(max(k, length-k), length):
    print(num_list[x])

Submission status: Runtime Error

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

num_list = list(range(a, b+1))

length = len(num_list)

for x in range(min(length, k)):
    print(num_list[x])

for x in range(max(k, length-k+1), length):
    print(num_list[x])

Submission status: Runtime Error

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

anss = list(set(ans))

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

Submission status: Runtime Error

Solution code:
a, b, k = [int(x) for x in input().split()]
if a + k - 1 < b - k + 1:
    l = list(range(a, a + k)) + list(range(b - k + 1, b + 1))
else:
    lcnt = list(range(a, b + 1))
for ans in l:
    print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def Base_10_to_n(X, n):
  if (int(X/n)):
    return Base_10_to_n(int(X/n), n)+[X%n]
  return [X%n]


#############
# Main Code #
#############

A,B,K = inputIL()

S = list(filter(lambda x: (A+K>x or B-K<x),list(range(A,B+1))))
print(*S,sep="\n")

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def Base_10_to_n(X, n):
  if (int(X/n)):
    return Base_10_to_n(int(X/n), n)+[X%n]
  return [X%n]


#############
# Main Code #
#############

A,B,K = inputIL()

S = list(filter(lambda x: A+K>x or B-K<x,list(range(A,B+1))))
print(*S,sep="\n")

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
l=list(range(a,b+1))
if k%2==0:
    z=1
else:
    z=0

if k>len(l)/2:
    for m in range(len(l)):
        print(l[m])
elif k==1:
    print(l[0])
    print(l[-1])
else:
    for i in range(k):
        print(l[i])
    for j in reversed(range(1,k+z)):
        print(l[-j])

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
l=list(range(a,b+1))
if k%2==0:
    z=1
else:
    z=0
if k>len(l)/2:
    for m in range(len(l)):
        print(l[m])
else:
    for i in range(k):
        print(l[i])
    for j in reversed(range(1,k+z)):
        print(l[-j])

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
l=list(range(a,b+1))
if k%2==0:
    z=1
else:
    z=0
if k<len(l):
    for i in range(k):
        print(l[i])
    for j in reversed(range(1,k+z)):
        print(l[-j])
else:
    for m in range(len(l)):
        print(l[m])

Submission status: Runtime Error

Solution code:
import math
a , b , k = map(int , input().split())
ans = set()
for i in range(min(k , math.ceil((b - a + 1) / 2))):
  ans.add(a + i , b - i)
ans = sorted(list(ans))
print('\n'.join([str(n) for n in ans]))

Submission status: Runtime Error

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

for v in l:
    print(v)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
r = range(a,b+1)
l = list(r)
ans = sorted(set(l[:k] + l[len(l)-k:]))

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
l = list(range(a,b+1))
ans = sorted(set(l[:k] + l[len(l)-k:]))

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

Submission status: Runtime Error

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

for i in range(max(ans[-1] + 1, B - K + 1), B + 1):
  ans.append(i)

for a in ans:
  print(a)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
for n in sorted({*range(A, A + K), *range(B - K + 1, B + 1)}):
    print(n)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a>b or k == 0:
  print('')
elif a+k-1 < b-k+1:
  s = c+d
  ans_list = sorted(set(s))
else:
  ans_list = e
for num in ans_list:
  print(num)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a>b:
  print('')
elif a == b:
  print(a)
elif a+k-1 < b-k+1:
  s = c+d
  ans_list = sorted(set(s))
else:
  ans_list = e
for num in ans_list:
  print(num)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
s = c+d
ans_list = sorted(set(s))
for num in ans_list:
  print(num)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  s = c+d
  ans_list = sorted(set(s))
else:
  ans_list = e
for num in ans_list:
  print(num)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  s = c+d
  ans_list = set(s)
else:
  ans_list = e
for num in ans_list:
  print(num)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
c = list(range(a,a+k))
d = list(range(b-k+1,b+1))
e = list(range(a,b+1))
if a+k-1 < b-k+1:
  ans_list = c+d
else:
  ans_list = e
for num in ans_list:
  print(num)

Submission status: Runtime Error

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

ans = sorted(set(l[:k] + l[len(l)-k:]))

for i in ans:
    print(i)

Submission status: Runtime Error

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(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)
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(0, K):
    print(A+i)
  for i in reversed(range(0, K)):
    print(B-i)

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
l = list(range(s[0],s[1]+1))

ans = sorted(set(l[:s[2]] + l[len(l)-s[2]:]))

for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
l = list(range(s[0],s[1]+1))

ans = set(l[:s[2]] + l[len(l)-s[2]:])

for i in ans:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
d=set()
for i in range(k):
  d.add(a+i)
for i in range(k):
  d.add(b-i)
d.sort()
for i in d:
  print(i)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
d=set()
for i in range(k):
  d.add(a+i)
for i in range(k):
  d.add(b-i)
d.sort()
for i in d:
  print(d)

Submission status: Runtime Error

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

for i in range(k):
  ans.append(lis[i])
  ans.append(lis[-i-1])


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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

l = list(range(A,B+1))
res = set(l[:K] + l[-K:])
for i in sorted(set(res)):
    print(i)

Submission status: Runtime Error

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

l = list(range(A,B+1))
res = []
for i in range(len(l)):
    if i < K:
        res.append(l[i])
    if B-A+1-K <= i:
        res.append(l[i])

for i in set(res):
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#bA
A, B, K = map(int, input().split())
list = range(A, B+1) #上限下限を先に決めておく
set1 = set(:K)
set2 = set(-K:)
print(sorted(set1|set2))