Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

il y a 4 ans
123456789101112131415
  1. import sys
  2. from itertools import combinations
  3. ns = [int(n) for n in sys.stdin.read().splitlines()]
  4. for a, b in combinations(ns, 2):
  5. if a + b == 2020:
  6. print(a * b)
  7. for a, b, c in combinations(ns, 3):
  8. if a + b + c == 2020:
  9. print(a * b * c)