fork download
  1. from itertools import count
  2. for r in count(1):
  3. for q in xrange(1, r + 1):
  4. for p in xrange(1, q + 1):
  5. # 1/p + 1/q + 1/r = 1/2
  6. # qr + pr + pq = pqr/2
  7. # 2(qr + pr + pq) = pqr
  8. if 2*(q*r + p*r + p*q) == p*q*r:
  9. print p, q, r
Time limit exceeded #stdin #stdout 5s 8832KB
stdin
Standard input is empty
stdout
Standard output is empty