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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans_list = sorted(set(li))
for x in range(len(ans_list)):
  print(ans_list[x])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,k=map(int,input().split())
ans=[]
for i in range(a,min(a+k,b)):
    ans.append(i)
for j in range(b,max(b-k,a),-1):
    if j not in ans:
        ans.append(j)
ans.sort()
for k in range(len(ans)):
  print(ans[k])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = set(li[:K] + sorted(li,reverse = True)[:K])

for i in ans:
  print(i)

Submission status: Wrong Answer

Solution code:
A, B, K = map(int,input().split())
li = [i for i in range(A,B + 1)]
ans = li[:K] + sorted(li,reverse = True)[:K]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = []
ans2 = []
ans3 = []

for i in range(A,B+1):
    ans.append(i)



for i in ans[0:K]:
    ans2.append(i)
for j in ans[-K:]:
    ans3.append(j)

ans4 = ans2 + ans3

for i in ans4:
    print(ans4)

Submission status: Wrong Answer

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

if d>=b:
    for i in range(a,b+1):
        ele = i
        f.append(ele)
elif(a<b):
    for j in range(a,(a+d)):
        sum =j
        f.append(sum)
    for k in range((b-d+1),(b+1)): 
        sum = k
        if sum not in f:
            f.append(sum)
elif(a>b):
    b,a = a,b                    #a=5 b=2        a=2 b=5
    for j in range(a,(a+d)):
        sum =j
        f.append(sum)
    for k in range((b-d+1),(b+1)): 
        sum = k
        if sum not in f:
            f.append(sum)

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

Submission status: Wrong Answer

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

if d>=b:
    for i in range(a,b+1):
        ele = i
        f.append(ele)
else:
    for j in range(a,(a+d)):
        sum =j
        f.append(sum)
    for k in range((b-d+1),(b+1)): 
        sum = k
        if sum not in f:
            f.append(sum)

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

Submission status: Wrong Answer

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

if d>b:
    for i in range(a,b+1):
        ele = i
        f.append(ele)
else:
    for j in range(a,(a+d)):
        sum =j
        f.append(sum)
    for k in range((b-d+1),(b+1)): 
        sum = k
        if sum not in f:
            f.append(sum)

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

Submission status: Wrong Answer

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

if d>b:
    for i in range(a,b+1):
        ele = i
        f.append(ele)
else:
    for j in range(a,(a+d)): #j -> 3,4     sum=3      sum
        sum =j
        f.append(sum)
    for k in range((b-d+1),(b+1)): #k= 7->8        sum=7   
        sum = k
        if sum not in f:
            f.append(sum)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for j in range(max(b-k+1, a+1), b+1):
    X.append(j)

X_s = set(X)
for k in X_s:
    print(k)

Submission status: Wrong Answer

Solution code:
ABK=list(map(int,input().split()))
A=ABK[0]
B=ABK[1]
K=ABK[2]

answer=[]
for i in range(A,B+1):
    answer.append(i)

answer.sort()

s=answer[0:K]
l=answer[-K:]
s.extend(l)
s=list(map(str,s))
s=list(set(s))
s.sort()
print('\n'.join(s))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

if B-A+1 <= K:
  for i in range(A, B+1):
    print(i)
  sys.exit()
  
ans = set()

for i in range(A, A+K):
  ans.add(i)

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

for x in ans:
  print(x)

Submission status: Wrong Answer

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

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

lia.extend(lib)
for i in set(lia):
    print(i)

Submission status: Wrong Answer

Solution code:
import sys
import math

def main():
    a, b, k = map(int, sys.stdin.readline().split())
    query_range = range(a, b + 1)
    print('aaa')
    exit()
    query_range = list(query_range)

    if a == b:
        res = query_range
    elif k >= math.ceil((b - a + 1) / 2):
        res = query_range
    else:
        res = query_range[:k] + query_range[-k:]

    for i in res:
        print(i)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math

def main():
    a, b, k = [int(x) for x in sys.stdin.read().split()]
    print(a, b)
    exit()
    query_range = list(range(a, b + 1))
    if a == b:
        res = query_range
    elif k >= math.ceil((b - a + 1) / 2):
        res = query_range
    else:
        res = query_range[:k] + query_range[-k:]

    for i in res:
        print(i)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math

def main():
    a, b, k = [int(x) for x in sys.stdin.readline().split()]
    print('aaa')
    exit()
    query_range = list(range(a, b + 1))
    if a == b:
        res = query_range
    elif k >= math.ceil((b - a + 1) / 2):
        res = query_range
    else:
        res = query_range[:k] + query_range[-k:]

    for i in res:
        print(i)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin
a,b,c = [int(x) for x in stdin.readline().rstrip().split()]
if b-a <= c*2:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+c):
        print(i)
    for j in range(b-c+1,b+1):
        print(j)

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,k= [int(x) for x in stdin.readline().rstrip().split()]

if b-a+1 <= k:
    for i in range(a,b+1):
        print(i)
else:
    amari = max(0,k-(b-a+1)//2)
    for i in range(a,a+k+1):
        print(i)
    for j in range(a+k+amari,b+1):
        print(j)

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,k= [int(x) for x in stdin.readline().rstrip().split()]

li = [i for i in range(a,b+1)]

if k >= b-a+1:
    for i in li:
        print(i)
    exit()


elif k <= (b-a+1)//2:
    for i in range(k):
        print(li[i])
    for i in range(len(li)-k,len(li)):
        print(li[i])
else:
    amari = k - (b-a+1)//2
    for i in range(k):
        print(li[i])
    for j in range(len(li)-k+amari,len(li)):
        print(li[j])

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
List = []
for i in range(K):
    c = A + i
    d = B - i
    if((c in List) == False and c >= A and c <= B):
        List.append(c)
    if((d in List) == False and d >= A and d <= B):
        List.append(d)
List = sorted(List)
print(List)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections

a,b,k=map(int,input().split())
l1=list(range(a,a+k))
l1=[str(i) for i in l1]
l2=list(range(b-k+1,b+1))
l2=[str(i) for i in l2]
ans=l1+l2
ans=collections.Counter(ans)
ans=sorted(ans)
print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
a,b,k=map(int,input().split())
l1=list(range(a,a+k))
l1=[str(i) for i in l1]
l2=list(range(b-k+1,b+1))
l2=[str(i) for i in l2]
print(' '.join(l1))
print(' '.join(l2))

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
if B < K:
    for i in range(A,B+1):
        print(i)
    exit()
min_list = list(range(A,A+K))
max_list = list(range(B-K+1,B+1))
lists = list(set(min_list) | set(max_list))
lists.sort()
print(lists)

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
if (B-A) < K:
    for i in range(A,B+1):
        print(i)
    exit()
min_list = list(range(A,A+K))
max_list = list(range(B-K+1,B+1))
lists = list(set(min_list) | set(max_list))
lists.sort()
print(lists)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


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


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
A, B, K = map(int, input().split())
try:
    small = list(range(A, B + 1))[:K]
    big = list(range(A, B + 1))[-K:]
    nums = small + big
except:
    try:
        nums = list(range(A, B + 1))
    except:
        nums = []
for num in sorted(list(set(nums))):
    print(num)

Submission status: Wrong Answer

Solution code:
A, B, K = map(int, input().split())
for small in range(K):
    print(A + small)
for big in range(K - 1, -1, -1):
    print(B - big)

Submission status: Wrong Answer

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

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

for n in set(ans):
	print(n)

Submission status: Wrong Answer

Solution code:
a,b,k = map(int,input().split())
from_a = set(list(range(a,a+k)))
from_b = set(list(range(b,b-k,-1)))
ab= from_a | from_b
#print(ab)
list_ab = list(ab)
list_ab.sort()
#print(list_ab)
for i in list_ab:
    print(i)

Submission status: Wrong Answer

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

num_list = [num for num in range(A, B+1)]
K_minus = - K
if K >= len(num_list)//2:
  for num in num_list:
    print(num)
else:
  a = num_list[0:K]
  b = num_list[K_minus:]
  s = a + b
  s = set(s)
  s = sorted(s)
  for num in s:
    print(num)

Submission status: Wrong Answer

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a,b,k = inpl()
res = []
for i in range(k):
    res.append(a+i)
    res.append(b-i)
res.sort()
print(*res)

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
se =[]
for i in range(min(K,B-A)):
  se += [A+i]
for j in range(min(K,B-A)):
  se += [B-j]
result=list(set(se))
result=sorted(result)
for p in range(len(result)):
    print(result[p])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
if K > B - A:
    K = B - A
tmp1 = list(range(A,A+K))
tmp2 = list(range(B-K+1,B+1))
ans = sorted(list(set(tmp1 + tmp2)))
for i in ans:
    print(i)

Submission status: Wrong Answer

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

if (b-a)/2 <= k:
    [print(i+a) for i in range(b-a+1)]
else:
    al = {i+a for i in range(k)}
    bl = {b-i for i in range(k)}
    [print (i) for i in sorted(list(al | bl))]

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
tmp1 = list(range(A,A+K))
tmp2 = list(range(B-K+1,B+1))
ans = sorted(tmp1+tmp2)
for i in range(len(ans)):
    print(ans[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

small=[n for n in range(A,min(A+K,B+1))]

large=[n for n in range(max(A,B-K+1),B+1)]

ans=small+large
ans.sort()
ans_str=list(map(str,ans))

print(' '.join(ans_str))

Submission status: Wrong Answer

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

small=[n for n in range(A,A+K)]

large=[n for n in range(max(A+K,B-K+1),B+1)]

ans=small+large
ans.sort()
ans_str=list(map(str,ans))

print(' '.join(ans_str))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,k=map(int,input().split())
s=[]
for i in range(b-a+1):
    s.append(a+i)
A=s[0:k]
B=s[-k:]
ans=set(A+B)
print(*ans)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

set_ans = list(set(ans))
set_ans.sort()
print(set_ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

r = range(a, b+1)

for i in (set(r[:k]) or set(r[-k:])):
  print(i)

Submission status: Wrong Answer

Solution code:
A,B,K = map(int,input().split())
f = 0
s = []
p = []
n = B
l = []
for i in range(A,B):
  if f == K:
    f = 0
    break
  else:
    s.append(i)
    f += 1
for j in range(1000):
  if f == K:
    f = 0
    break
  elif n<A:
    break
  else:
    p.append(n)
    n = n-1
    f += 1
p = set(p)
s.extend(p)
s = set(s)
s = list(s)
s.sort()
for i in range(len(s)):
  print(s[i])

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

def main():
    ans=set()
    a,b,k=map(int, input().split())
    for i in range(a,min(b,a+k)):
        ans.add(i)
    for i in range(b,max(a,b-k),-1):
        ans.add(i)
    for i in sorted(ans):
        print(i)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B, K] = string_to_int(inputs[0])
    ret = set()
    count = 0
    for v in range(A, B+1):
        if count >= K:
            break
        ret.add(v)
        count += 1
    count = 0
    for v in reversed(range(A, B+1)):
        if count >= K:
            break
        ret.add(v)
        count += 1
    return ret


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    for r in ret:
        print(r)

Submission status: Wrong Answer

Solution code:
A,B,K = [int(x) for x in input().split()]
if A-B<K:
  c = [i for i in range(A,B+1)]
  print(*c)
  exit()
c = [i for i in range(A,A+K)]
d = [i for i in range(B-K+1,B+1)]
d =c+d
d = list(set(d))
d.sort()
print(*d)

Submission status: Wrong Answer

Solution code:
A,B,K = [int(x) for x in input().split()]
c = [i for i in range(A,A+K)]
d = [i for i in range(B-K+1,B+1)]
d =c+d
d = list(set(d))
d.sort()
print(*d)

Submission status: Wrong Answer

Solution code:
A,B,K = [int(x) for x in input().split()]
c = [i for i in range(A,K)]
d = [i for i in range(B-K+1,B+1)]
d =c+d
d = list(set(d))
d.sort()
print(*d)

Submission status: Wrong Answer

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

if a+k-1 >=b+k-1:
  ans = list(range(a,b+1))
else:
  ans = list(range(a,a+k))+list(range(b-k+1, b+1))

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

Submission status: Wrong Answer

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

if B - A > (2 * K):
    for a in range(A, A + K):
        print(a)
    for b in range(B - K + 1, B + 1):
        print(b)
else:
    for n in range(A, B + 1):
        print(n)

Submission status: Wrong Answer

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

if B - A > 2 * K:
    for a in range(A, A + K):
        print(a)
    for b in range(B - K + 1, B + 1):
        print(b)
else:
    for n in range(A, B + 1):
        print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

C=[]
for i in range(K):
  C.append(A+i)
for i in range(K):
  C.append(B-i)
#print(C)

C=list(set(C))
C.sort()
#print(C)

for i in C:
  print(i)

Submission status: Wrong Answer

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

(a, b, k) = [int(i) for i in input().rstrip().split(" ")]

for i in [i for i in range(a, min(a+k, b+1))] or [i for i in range(max(b-k + 1, a), b + 1)]:
    print(i)

Submission status: Wrong Answer

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

Answer = set([])
for i in range(K):
  Answer.add(A+i)
  Answer.add(B-i)
Answer = sorted(Answer)
for i in Answer:
    print(i)

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    a, b, k = list(map(int, input().rstrip('\n').split()))
    d = collections.defaultdict(list)
    for i in range(a, min(a + k, b)):
        d[i]
    for i in range(b, max(b - k, a), -1):
        d[i]
    d = sorted(d.keys())
    print(*d, sep='\n')


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

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

for i in range(k):
  s.append(a+i)
  s.append(b-i)
  
s.sort()
t = set(s)

for u in t:
  print(u)

Submission status: Wrong Answer

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

for i in range(k):
  s.append(a+k)
  s.append(b-k)
  
s.sort()
t = set(s)

for u in t:
  print(u)

Submission status: Wrong Answer

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)