fork download
  1. cnt = 0
  2. w = 7
  3. h = 5
  4. for x1 in range(w):
  5. for y1 in range(h):
  6. for x2 in range(x1 + 1, w + 1):
  7. for y2 in range(y1 + 1, h + 1):
  8. if x2 - x1 != y2 - y1:
  9. cnt += 1
  10. print(cnt)
Success #stdin #stdout 0.02s 8688KB
stdin
Standard input is empty
stdout
335