fork download
  1. import sys
  2. from functools import reduce
  3. print('({a[0][0]}, {a[1][1]}), ({a[0][0]}, {a[0][1]}), ({a[1][0]}, {a[0][1]}), ({a[1][0]}, {a[1][1]})'.format(a=list(reduce(lambda a, l: [[min(a[0][0], l[0]-l[2]), max(a[0][1], l[1]+l[2])], [max(a[1][0], l[0]+l[2]), min(a[1][1], l[1]-l[2])]], list(map(lambda e: list(map(float, e.split( ',' ))), sys.stdin)), [[0,0], [0,0]]))))
Success #stdin #stdout 0.02s 28384KB
stdin
1,1,2
2,2,0.5
-1,-3,2
5,2,1
stdout
(-3.0, -5.0), (-3.0, 3.0), (6.0, 3.0), (6.0, -5.0)