def parse_problems(lines):
	""" Given a list of lines, parses them and returns a list of problems. """
	problems = []
	i = 0
	while i < len(lines):
		if int(lines[i]) > 0:
			problems.append(lines[i+1].strip().split(" "))
			i += 2
		else:
			problems.append([])
			i += 1
	return problems