fork download
  1. def F(x):
  2. return abs(abs(x - 6) + abs(x + 6) - 16) + 2
  3.  
  4. a = -20
  5. b = 20
  6. M = a
  7. R = F(a)
  8. for t in range(a, b + 1):
  9. if (F(t) <= R):
  10. M = t
  11. R = F(t)
  12. print (M + R)
Success #stdin #stdout 0.02s 9064KB
stdin
Standard input is empty
stdout
10