fork(1) download
  1. # We can get the data from standard input.
  2. # The number of pairs can be removed; the data is unnecessary.
  3. import sys
  4. input_data = list(sys.stdin)[1:]
  5. output = []
  6. # We need to iterate through the data sets.
  7. for dataset in input_data:
  8. # Separate the elements. Create a temporary list for this purpose.
  9. l = dataset.split(" ")
  10. # Cast each element (currently a string) to an integer.
  11. # This is necessary to use the min() function.
  12. l = [int(e) for e in l]
  13. # Get the minimum value and append it to the output list.
  14. output.append(min(l))
  15. print(output)
Success #stdin #stdout 0.03s 9984KB
stdin
3
5 3
2 8
100 15
stdout
[3, 2, 15]