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: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    a, b, k = map(int, input().split())
    
    li = list(filter(lambda x: x <= a+k-1 or b-k+1 <= x 
        , [x for x in range(a, b+1)]))
    
    for i in li:
        print(i)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    a, b, k = map(int, input().split())
    
    for x in range(a, b+1):
        if x <= a+k-1 or b-k+1 <= x:
            print(x) 
    
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,c=map(int,input().split())
print("\n".join([str(i) for i in range(a,b+1) if abs(a-i)<c or abs(b-i)<c]))

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
c = []
for x in range(a,b+1):
  if a <= x and x <= b:
    c.append(x)
c1 = []
for x in c[:k]:
  c1.append(x)
for x in c[(len(c)-k):]:
  if x not in c1:
    c1.append(x)
for x in c1:
  print(x)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
c = []
for x in range(a,b+1):
  if a <= x and a <= b:
    c.append(x)
c1 = []
for x in c[:k]:
  c1.append(x)
for x in c[(len(c)-k):]:
  if x not in c1:
    c1.append(x)
for x in c1:
  print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = []

for i in range(b - a + 1):
    n = a + i
    if n <= a + k - 1 or n >= b - k + 1:
        ans.append(n)

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

A, B, K = map(int, Input().split())
N = [n for n in range(A, B+1) if n < A+K or n > B-K]
for n in N:
    print(n)

Submission status: Time Limit Exceeded

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

nums = [i for i in range(a,b+1)]
apply_nums = set()

for i in nums[:k]:
    apply_nums.add(i)
for i in nums[-k:]:
    apply_nums.add(i)

apply_list = list(apply_nums)
apply_list.sort()

for i in apply_list:
    print(i)

Submission status: Time Limit Exceeded

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

for i in nums[:k]:
    apply_nums.add(i)
for i in nums[-k:]:
    apply_nums.add(i)

apply_list = list(apply_nums)
apply_list.sort()

for i in apply_list:
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

int_list = [i for i in range(a, b + 1)]
out_list = sorted(int_list[:k] + int_list[-k:])

last_val = 0
for out_val in out_list:
    if last_val != out_val:
        print(out_val)
    last_val = out_val

Submission status: Time Limit Exceeded

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

int_list = [i for i in range(a, b + 1)]
out_list = sorted(int_list[:k] + int_list[-k:])

last_val = 0
for out_val in out_list:
    # Neglect duplicated value
    if last_val != out_val:
        print(out_val)
    last_val = out_val

Submission status: Time Limit Exceeded

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

int_list = [i for i in range(a, b+1)]
out_list = sorted(set(int_list[:k] + int_list[-k:])) 

for out_val in out_list:
    print(out_val)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
l = []
for i in range(B-A+1):
  l.append(A+i)
del l[K:-K]
for e in l:
  print(e)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
listN=range(a,b+1)
index=0
while index<len(listN):
    if index<k or index>len(listN)-k-1:
        print(listN[index])
    index+=1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

else:
    ss = [0 for i in range(100)]
    sb = [0 for i in range(100)]

    for i in range(K):
        print(i + A)

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

Submission status: Time Limit Exceeded

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

for i in range(B - A + 1):
    if s[i] == 1:
        print(i + A)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
a = []
for i in range(A,B+1):
    a.append(i)
b =set(a[0:K]+a[-K:])
print(' '.join(map(str, sorted(b))))

Submission status: Time Limit Exceeded

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

def main():
    a, b, k = list(map(int, input().split()))
    cnt = 1

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

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

Submission status: Time Limit Exceeded

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

def get_candidates(A, B, K):
    """Find matching numbers, return as list"""
    L = B - A + 1 # length of list
    c = set()
    for index, val in enumerate(range(A,B+1)):
        #print(index,val)
        if index < K:
            c.add(val)
        elif index >= max(0, L-K):
            c.add(val)
    #c = sorted(list(c))
    return sorted(list(c))

for n in get_candidates(A, B, K):
    print(n)

Submission status: Time Limit Exceeded

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

result = set(range(A,B+1)) & set(list(range(A, A+K))+list(range(B-K+1, B+1)))
for i in sorted(list(result)):
    print(i)

Submission status: Time Limit Exceeded

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

Solution code:
A, B, K = map(int, input().split())
l = [int(x) for x in range(A, B + 1)]
ans = set()
if K > len(l):
	for i in l:
		print(i)
else:
	for i in range(K):
		ans.add(l[i])
	l.reverse()
	for j in range(K):
		ans.add(l[j])
	ans = list(ans)
	ans.sort()
	for k in ans:
		print(k)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

if k >= -(-len(data)//2):
    for i in data:
        print(i)
else:
    for i in range(k):
        print(data[i])
    for i in range(len(data) - k, len(data)):
        print(data[i])

Submission status: Time Limit Exceeded

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

ans = []
if k >= -(-len(data)//2):
    for i in data:
        print(i)
else:
    for i in range(k):
        ans.append(data[i])
    for i in range(len(data) - k, len(data)):
        ans.append(data[i])
    for i in ans:
        print(i)

Submission status: Time Limit Exceeded

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

ans = []
if k > len(data):
    for i in data:
        print(i)
else:
    for i in range(k):
        if data[i] not in ans:
            ans.append(data[i])        
    for i in range(len(data) - k, len(data)):
        if data[i] not in ans:
            ans.append(data[i])
    
    for i in ans:
        print(i)

Submission status: Time Limit Exceeded

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

ans = []
if k > len(data):
    k = len(data)
for i in range(k):
    if data[i] not in ans:
        ans.append(data[i])
for i in range(len(data) - k, len(data)):
    if data[i] not in ans:
        ans.append(data[i])

for i in ans:
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split(' '))
ab = [i for i in range(a, b+1)]
#print(ab)
for i in ab:
  if i in ab[k:-k]:
  	continue
  else:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split(' '))
ab = [i for i in range(a, b+1)]
del ab[k:-k]
abp = [print(i) for i in ab]

Submission status: Time Limit Exceeded

Solution code:
m,n,x=[int(i) for i in input().split()]
a=set(range(m,m+x))
b=set(range(n-x+1,n+1))
c=set(range(m,n+1))
for i in sorted(list((a|b)&c)):
  print(i)

Submission status: Time Limit Exceeded

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

lst = [i for i in range(A, B + 1)]

if len(lst) < 2 * K:
    for item in lst:
        print(item)
else:
    for item in lst[:K]:
        print(item)
    for item in lst[-K:]:
        print(item)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# PROBLEM B
a, b, k = [int(arg) for arg in input().split()]
for x in range(a, b + 1):
    if x - a < k or b - x < k:
        print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def solve():
    A, B, K = map(int, input().split())
    for i in range(A, B+1):
        if A <= i <= A+K-1 or B-K+1 <= i <= B:
            print(i)
if __name__ == '__main__':
    solve()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
A, B, K = list(map(int, input().strip().split(' ')))
for j in range(A,B+1):
    if not(j >= A+K and j <= B-K):
        print(j)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for k in newlist:
    print(k)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = list(map(int, input().strip().split(' ')))
tmplist = list([i for i in range(A,B+1)])
newlist=[]
for j in range(len(tmplist)):
    if not(tmplist[j] >= A+K and tmplist[j] <= B-K):
        newlist.append(tmplist[j])

for k in newlist:
    print(k)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

l = [i for i in range(A, B + 1)]
small = l[:K]
big = l[-K:]
small.extend(big)
small = list(set(small))
small.sort()
for i in small:
    print(i)

Submission status: Time Limit Exceeded

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

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
print("\n".join([str(p) for p in range(a,b+1) if a<=p<a+k or b-k<p<=b]))

Submission status: Time Limit Exceeded

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

items = [i for i in range(A, B + 1) if i - A + 1 <= K or B - i + 1 <= K]
for item in items:
    print(item)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
i=A
while i<=B:
    if abs(i-A)<K or abs(i-B)<K:
        print(i)
    i+=1

Submission status: Time Limit Exceeded

Solution code:
x=input().split()
x=list(map(int,x))

for i in range(x[0],x[1]+1):
  if (i<x[0]+x[2])|(i>x[1]-x[2]):
    print(i)

Submission status: Time Limit Exceeded

Solution code:

# coding: utf-8

# In[37]:


line = input().split(' ')
A = int(line[0])
B = int(line[1])
K = int(line[2])


# In[38]:


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

Submission status: Time Limit Exceeded

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

for i in l:
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
A, B, K = map(int, input().split())
for i in range(A, B + 1):
    if i < A + K or B - K < i:
        print(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding:utf-8 -*-
if __name__ == "__main__":
    a,b,k = map(int, input().split())
    factors = [ tmp for tmp in range(a, b+1) ]
    ans = list(set(factors[0:k]+factors[-k:]))
    ans.sort()
    for factor in ans:
        print(factor)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = [int(i) for i in input().split()]
s1 = {x for x in range(a, b+1) if a + k > x}
s2 = {x for x in range(a, b+1) if b - k < x}
for i in sorted(list(s1 | s2)):
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

tmp_list = [i for i in range(A, B + 1)]

if (B - A + 1) / 2 < K:
    print('\n'.join(str(i)for i in tmp_list))
else:
    for i in tmp_list[0 : K]:
        print(i)
    for i in tmp_list[len(tmp_list) - K:]:
        print(i)

Submission status: Time Limit Exceeded

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

tmp_list = [i for i in range(A, B + 1)]
tmp_list2 = []

for i in tmp_list[0 : K]:
    tmp_list2.append(i)
    print(i)

for i in tmp_list[len(tmp_list) - K:]:
    if i not in tmp_list2:
        print(i)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
 
A, B, K = map(int, input().split())
 
value = deque()
s = [i for i in range(A, B+1)]
 
value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])
 
num = list(set(value))
num.sort()
for i in range(len(num)):
    print(num[i])

Submission status: Time Limit Exceeded

Solution code:
def main():
    A, B, K = map(int, input().split(' '))
    l = B + 1 - A
    for i, x in enumerate(range(A, B+1), 1):
        if i <= K or l - i < K:
            print(x)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

tmp_list = [i for i in range(A, B + 1)]
tmp_list2 = []

for i in tmp_list[0 : K]:
    tmp_list2.append(i)

for i in tmp_list[len(tmp_list) - K:]:
    if i not in tmp_list2:
        tmp_list2.append(i)

for i in tmp_list2:
    print(i)

Submission status: Time Limit Exceeded

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

# 3つの数字をリストから数値の変数に
input_list = input().split()
start_num = int(input_list[0])
end_num = int(input_list[1])
range_num = int(input_list[2])

for i in range(start_num, end_num + 1):
	# 条件に当てはまるものを抽出
	if i < start_num + range_num or i > end_num - range_num:
		print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

s = [i for i in range(A,B+1)]


if 2 * K >= len(s):
    for j in range(len(s)):
        print(s[j])

    exit()

l = [s[i] for i in range(0,K)]
k = [s[h] for h in range(len(s) - K, len(s))]

for a in range(len(l)):
    print(l[a])
for b in range(len(k)):
    print(k[b])

#for t in range(0,K):
#    print(s[t])

# s.reverse()

#for h in range(len(s) - K,len(s)):
#    print(s[h])

Submission status: Time Limit Exceeded

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

a,b,k = na()
f = [i for i in range(a,b+1)]
if (b-a+1) // 2 >= k:
    ans = list(range(a,a+k)) + list(range(b-k+1,b+1))
else:
    ans = list(range(a,b+1))
for i in ans:
    print(i)

Submission status: Time Limit Exceeded

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

s = [i for i in range(A,B+1)]

l = []

if 2 * K >= len(s):
    for j in range(len(s)):
        print(s[j])

    exit()


for t in range(0,K):
    print(s[t])

# s.reverse()

for h in range(len(s) - K,len(s)):
    print(s[h])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from collections import deque

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

A = int(A)
B = int(B)
K = int(K)

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = list(set(value))
num.sort()
for i in range(len(num)):
    print(num[i])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
master_list = list(map(int, input().split(' ')))

next_list = [x for x in range(master_list[0], master_list[1]+1)]

if master_list[2] >= len(next_list):
    print(*next_list, sep='\n')
else:
    a_list = next_list[0:master_list[2]]
    b_list = next_list[-master_list[2]:]
    last_list = sorted(list(set(a_list) | set(b_list)))
    print(*last_list, sep='\n')

Submission status: Time Limit Exceeded

Solution code:
A, B, K = list(map(int, input().split()))
if K >= (B - A + 1) / 2 :
    l = [n for n in range(A, B+1)]
else:
    l1 = {n for n in range(A, A + K)}
    l2 = {n for n in range(B - K + 1, B + 1)}
    l = sorted(list((l1 | l2) & {n for n in range(A, B+1)}))
for s in l:
    print(s)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
list_num = [i for i in range(A, B+1, 1)]
list_num2 = []

for i in range(K):
    if len(list_num) == 0:
        break
    print(list_num[0])
    list_num.pop(0)

for i in range(K):
    if len(list_num) == 0:
        break
    list_num2.append(list_num[-1])
    list_num.pop(-1)
list_num2.sort()
for i in list_num2:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int, input().split())
r = [i for i in range(A,B+1)]
num_list = []
# for i in r[:K]:
#     num_list.append(i)
num_list = r[:K]
num_list.extend(r[-K:])
# for i in r[-K:]:
#     num_list.append(i)
for num in sorted(set(num_list), key=num_list.index):
    print(num)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

# AtCoder Beginner Contest
# Problem B

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
re = list()
a,b,k = map(int, raw_input().split())
li = [i for i in xrange(a,b+1)]
re += li[:k]
li.sort(reverse=True)
re += li[:k]
for i in sorted(list(set(re))):
    print i

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

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

Submission status: Time Limit Exceeded

Solution code:
text = input()

a = int(text.split(' ')[0])
b = int(text.split(' ')[1])
k = int(text.split(' ')[2])

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

Submission status: Time Limit Exceeded

Solution code:
from collections import deque

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

A = int(A)
B = int(B)
K = int(K)

value = deque()
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = deque()

for i in range(len(value)):
    if value[i] not in num:
        num.append(value[i])
        print(value[i])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int, input().rstrip().split()) #input parameters\
work=[] #make list
for i in range(A,B+1):
    if (A<=i and i<A+K) or (B-K<i and i<=B):
        print(i)

Submission status: Time Limit Exceeded

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

A = int(A)
B = int(B)
K = int(K)

value = []
s = [i for i in range(A, B+1)]

value.extend(s[0:K])
value.extend(s[len(s)-K:len(s)])

num = []

for i in range(len(value)):
    if value[i] not in num:
        num.append(value[i])
        print(value[i])

Submission status: Time Limit Exceeded

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

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