Buggy python submission (verdict: Runtime Error):


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	median = n // 2

	for i in range(m):
		if n % 2 == 0 and i => n // 4:
			print(median-i, median+i+2)
		else:
			print(median-i, median+i+1)


if __name__ == '__main__':
	format_input()

	get_answer()


Fixed submission:


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	median = n // 2

	for i in range(m):
		if n % 2 == 0 and i >= n // 4:
			print(median-i, median+i+2)
		else:
			print(median-i, median+i+1)


if __name__ == '__main__':
	format_input()

	get_answer()

Buggy python submission (verdict: Runtime Error):


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	median = n // 2

	for i in range(m)
		print(median-i, median+i+1)


if __name__ == '__main__':
	format_input()

	get_answer()


Fixed submission:


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	median = n // 2

	for i in range(m):
		if n % 2 == 0 and i >= n // 4:
			print(median-i, median+i+2)
		else:
			print(median-i, median+i+1)


if __name__ == '__main__':
	format_input()

	get_answer()

Buggy python submission (verdict: Runtime Error):


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	unused = list(range(n))

	for i in range(m):
		a = unused[0]
		b = unused[0]+i+1
		unused.remove(a)
		unused.remove(b)
		print(a+1, b+1)	


if __name__ == '__main__':
	format_input()

	get_answer()


Fixed submission:


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	median = n // 2

	for i in range(m):
		if n % 2 == 0 and i >= n // 4:
			print(median-i, median+i+2)
		else:
			print(median-i, median+i+1)


if __name__ == '__main__':
	format_input()

	get_answer()

Buggy python submission (verdict: Runtime Error):


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	unused = list(range(n))

	for i in range(m):
		a = unused[0]
		b = unused[0]+i+1
		unused.remove(a)
		unused.remove(b)
		print(a+1, b+1)	


if __name__ == '__main__':
	format_input()

	get_answer()


Fixed submission:


n, m = [0] * 2

def format_input(filename = None):
	global n, m
	if filename == None:
		n, m = list(map(int, input().split()))

	elif filename == '__random__':
		from random import randint as rng
		n = rng(3, 10**5)
		m = rng(1, (n-1) // 2)
		print(n, m)

def get_answer():
	median = n // 2

	for i in range(m):
		if n % 2 == 0 and i >= n // 4:
			print(median-i, median+i+2)
		else:
			print(median-i, median+i+1)


if __name__ == '__main__':
	format_input()

	get_answer()