Skip to content

Instantly share code, notes, and snippets.

@ThomPuiman
Created February 22, 2017 15:24
Show Gist options
  • Select an option

  • Save ThomPuiman/1d2f01d32bf7f596a2f124103e8f54f4 to your computer and use it in GitHub Desktop.

Select an option

Save ThomPuiman/1d2f01d32bf7f596a2f124103e8f54f4 to your computer and use it in GitHub Desktop.
reqs = input()
if len(reqs) > 0:
splitted = reqs.split(" ")
chairWeightReq = int(splitted[0])
porridgeTempReq = int(splitted[1])
availableChairs = []
currentInput = input()
while len(currentInput) > 0:
splitInput = currentInput.split(" ")
availableChairs.append((int(splitInput[0]), int(splitInput[1])))
currentInput = input()
#search for seats and add 2 because the first line was already extracted above
foundElements = [str(i+2) for i, v in enumerate(availableChairs) if v[0] <= chairWeightReq and v[1] <= porridgeTempReq]
print(' '.join(foundElements))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment