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

def main():
    a, b, k = [int(x) for x in sys.stdin.readline().split()]
    query_range = list(range(a, b + 1))
    if 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: Runtime Error

Solution code:
import sys
import math

def main():
    a, b, k = [int(x) for x in sys.stdin.readline().split()]
    query_range = list(range(a, b + 1))
    if 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: Runtime Error

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

lin = []

for i in range(k):
    lin.append(li[i])
    lin.append(li[len(li)-i-1])

lin = list(set(lin))
lin.sort()

for i in lin:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
l=set(l)
l=sorted(list(l))
print(*l,sep='\n')

Submission status: Runtime Error

Solution code:

a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
print(*set(l),sep='\n')

Submission status: Runtime Error

Solution code:
#93B
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l=l[:k]+l[-k:]
print(*l,sep='\n')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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:
    nums = list(range(A, B + 1))
for num in sorted(list(set(nums))):
    print(num)

Submission status: Runtime Error

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:
    nums = list(range(A, B + 1))
for num in set(nums):
    print(num)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
print("\n".join(list(range(A, B + 1))[:K] + list(range(A, B + 1))[-K:]))

Submission status: Runtime Error

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-07 02:35:07(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator

def main():
    a, b, k = (int(i) for i in sys.stdin.readline().split())
    ab = list(range(a, b+1))
    if k * 2 >= len(ab):
        res = ab
    else:
        res = ab[:k] + ab[-k:]
    for r in res:
        print(r)
    
if __name__ == "__main__":
    # execute only if run as a script
    main()

# 何故

Submission status: Runtime Error

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-07 02:35:07(JST)
import sys
# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator

def main():
    a, b, k = (int(i) for i in sys.stdin.readline().split())
    ab = list(range(a, b+1))
    if k * 2 >= len(ab):
        res = ab
    else:
        res = ab[:k] + ab[-k:]
    for r in res:
        print(r)


if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Runtime Error

Solution code:
import copy

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

num = copy.deepcopy(list(range(a, b + 1)))

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
ans_list = copy.deepcopy(list(ans_set))
ans_list.sort()
for i in ans_list:
    print(i)

Submission status: Runtime Error

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

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

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
ans_list = list(ans_set)
ans_list.sort()
for i in ans_list:
    print(i)

Submission status: Runtime Error

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

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

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k) | set(k_e)
for i in sorted(ans_set):
    print(i)

Submission status: Runtime Error

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

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

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k) | set(k_e)
for i in sorted(list(ans_set)):
    print(i)

Submission status: Runtime Error

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

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

a_k = num[:k]
k_e = num[-k:]

# print(a_k, k_e)
ans_set = set(a_k + k_e)
for i in sorted(list(ans_set)):
    print(i)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
t = list(range(A, B+1))
if K > len(t):
    K = len(t)
ans = set()
for i in range(K):
    ans.add(t[i])
    ans.add(t[-(i+1)])
ans2 = list(ans)
ans2.sort()
for a in ans2:
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,K = map(int,input().split())
tmp = list(range(A,B+1))
ans = []
flag = 1
for i in range(min([len(tmp),K])):
    ans.append(tmp[i])
for j in range(min([len(tmp),K])):
    ans.append(tmp[-j-1])
ans = sorted(list(set(ans)))
for k in range(len(ans)):
    print(ans[k])

Submission status: Runtime Error

Solution code:
A,B,K = map(int,input().split())
tmp = list(range(A,B+1))
ans = []
flag = 1
for i in range(K):
    ans.append(tmp[i])
for j in range(K):
    ans.append(tmp[-j-1])
ans = list(set(ans))
for k in range(len(ans)):
    print(ans[k])

Submission status: Runtime Error

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

for i in l[:k]:
    print(i)

if len(l)<=k:
    exit()

if (b-a+1)/2<=k:
    for i in l[k:]:
        print(i)
else:    
    for i in l[c:]:
        print(i)

Submission status: Runtime Error

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

for i in l[:k]:
    print(i)

if len(l)<=k:
    exit()

if (b-a+1)/2<k:
    for i in l[k:]:
        print(i)
else:    
    for i in l[c:]:
        print(i)

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)
  quit()
result = l[:k] + l[-k:]
for i in sorted(set(result), key=result.index):
  print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

for i in sorted(list(nums)):
  print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B,K = map(int, input().split())
var = list(range(A, B + 1))
ans = var[0:K]
ans += var[-K:]
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())
var = list(range(A, B + 1))
ans = var[0:K]
ans += var[-K:]
ans = set(ans)
for i in ans:
    print(i)

Submission status: Runtime Error

Solution code:
A,B,K = map(int, input().split())
var = list(range(A, B + 1))
print(var)
ans = var[0:2]
ans += var[-2:]

for i in ans:
    print(i)

Submission status: Runtime Error

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

AB = range(A,B+1)

tail = len(AB)

for i in range(K):
    print(AB[i])

for i in range(tail - K, tail):
    print(AB[i])

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline


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

    for i in area[:k]:
        print(i)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline


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

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


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline


def main():
    a, b, k = map(int, input().split())
    area = list(range(a, b + 1))
    for i in sorted(set(area[:k] + area[-k:])):
        print(i)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys

input = sys.stdin.readline


def main():
    a, b, k = map(int, input().split())
    area = list(range(a, b + 1))
    for i in set(area[:k] + area[-k:]):
        print(i)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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


sys.setrecursionlimit(4100000)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 sorted(list(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)



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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
s=[]
x=list(range(a,b+1))
for i in range(min(c,b-a+1)):
    s.append(x[i])
    s.append(x[-(i+1)])
s.sort()
for i in range(len(s)-2):
    if s[i]==s[i+1]:
        s.remove(s[i+1])
for i in s:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
s=[]
x=list(range(a,b+1))
for i in range(min(c,b-a+1)):
    s.append(x[i])
    s.append(x[-(i+1)])
s.sort()
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        s.remove(s[i+1])
for i in s:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
s=[]
x=list(range(a,b+1))
for i in range(min(c,b-a+1)):
    s.append(x[i])
    s.append(x[-(i+1)])
s.sort()
#print(s)
for i in set(s):
    print(i)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
s=[]
x=list(range(a,b+1))
for i in range(min(c,b-a+1):
    s.append(x[i])
    s.append(x[-(i+1)])
s.sort().set()
#print(s)
for i in s:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
s=[]
x=list(range(a,b+1))
for i in range(c):
    s.append(x[i])
    s.append(x[-(i+1)])
s.sort()
#print(s)
for i in s:
    print(i)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
s=[]
x=list(range(a,b+1))
for i in range(k):
    s.append(x[i])
    s.append(x[-(i+1)])
s.sort()
#print(s)
for i in s:
    print(i)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

if B-A+1 > K:
  ans = list(range(A, A+K))+list(range(B-K+1, B+1))
  print(*ans, sep="\n")
  
else:
  print(*list(range(A,B+1)), sep="\n")

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
L = []
if A+K+1 >= B-K+1:
    for i in range(A, b+1):
        print(i)
        exit()
for i in range(A, A+K):
    L.append(i)
for j in range(B-K+1, B+1):
    L.append(j)
list(set(L)).sort()
for k in L:
    print(k)

Submission status: Runtime Error

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

if B < K:
    K = len(num)

for i in range(K):
    print(num[i])
    numset.append(num[i])

num.sort(reverse=True)
num = num[:K]
num.sort()

for i in range(K):
    if num[i] not in numset:
        print(num[i])

Submission status: Runtime Error

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

if B < K:
    K = len(num)

for i in range(K):
    num_set.append(num[i])

num.sort(reverse=True)
for i in range(K):
    if num[i] not in num_set:
        num_set.append(num[i])

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in newl:
  print(i)

Submission status: Runtime Error

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

for i in newl:
  print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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


if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
L = [i for i in range(a,b+i)]
rL = sorted(L, reverse=True)
for i in range(k):
  print(L)
for i in range(k):
  print(rL)

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())
L = [i for i in range(a,b+i)]
rL = sorted(L, reverse=True)
for i inrange(k):
  print(L)
for i in range(k):
  print(rL)

Submission status: Runtime Error

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

master = list(range(A,B+1))
sho = master.copy()
ko = master.copy()
L = len(master)

sho.sort()
ko.sort(reverse = True)

for i in range(min(K,L)):
    ans.append(sho[i])

for i in range(min(K,L)):
    ans.append(ko[i])

ans2 = set(ans)
ans3 = list(ans2)
ans3.sort()

print(ans3)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in l:
    print(i)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

# cand = list(range(a, b+1))

S = sorted(list(set(cand[:k] + cand[-k:])))
# for i in res:
#     print(i)
# last = 0
# for so in range(a, a+k, 1):
#     if so <= b:
#         print(so)
#         last = so

# for lo in range(b-(k-1), b+1, 1):
#     if last < lo and lo <= b:
#         print(lo)

# S=sorted(set(range(a,min(a+k,b+1))) | set(range(max(b+1-k,a),b+1)))
for _ in S:
    print(_)

Submission status: Runtime Error

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

# res = sorted(list(set(cand[:k] + cand[-k:])))
# for i in res:
#     print(i)
# last = 0
# for so in range(a, a+k, 1):
#     if so <= b:
#         print(so)
#         last = so

# for lo in range(b-(k-1), b+1, 1):
#     if last < lo and lo <= b:
#         print(lo)

S=sorted(set(range(a,min(a+k,b+1))) | set(range(max(b+1-k,a),b+1)))
for _ in S:
    print(_)

Submission status: Runtime Error

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

# res = sorted(list(set(cand[:k] + cand[-k:])))
# for i in res:
#     print(i)
last = 0
for so in range(a, a+k, 1):
    if so <= b:
        print(so)
        last = so

for lo in range(b-(k-1), b+1, 1):
    if last < lo and lo <= b:
        print(lo)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

tmp = n[0]
sum1=1
for i in range(1,S):
  if tmp <= n[i]:
    tmp=n[i]
    sum1=sum1+1
print(sum1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(K):
    ans.append(ab[i])
    ans.append(ba[i])

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

i = x[:k]
j = x[-k:]

l = []

for k in i:
    l.append(k)

for k in j:
    l.append(k)

for i in sorted(list(set(l))):
    print(i)

Submission status: Runtime Error

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

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

i = x[:k]
j = x[-k:]

for k in i:
    print(k)

for k in j:
    print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s=set()
l=[]

for i in range(a,b+1):
    l.append(i)

for i in range(k):
    s.add(l[i])
    s.add(l[-i-1])
    
s_l=list(s)
s_l.sort()
for i in range(len(s_l)):
    print(s_l[i])

Submission status: Runtime Error

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

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

else:
    
    l1=[i for i in range(a,b+1)] 
    l2=[]
    for i in range(k):
        l2.append(l1[i])
    for i in range(b-a-k+1,b-a+1):
        l2.append(l1[i])

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