repl.it
@anonymous/

UnnaturalLastWryneck

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
h=lambda a:[map(sum,zip(*s))for s in zip(a,a[1:],a[2:])]
f=lambda a:min(map(min,h(zip(*h(a)))))/9.

tests = [[[35,1,6,26,19,24],[3,32,7,21,23,25],[31,9,2,22,27,20],[8,28,33,17,10,15],[30,5,34,12,14,16],[4,36,29,13,18,11]],
         [[100,65,2,93],[3,11,31,89],[93,15,95,65],[77,96,72,34]],
         [[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1]],
         [[4,0,0,5,4],[4,5,8,4,1],[1,4,9,3,1],[0,0,1,3,9],[0,3,2,4,8],[4,9,5,9,6],[1,8,7,2,7],[2,1,3,7,9]]
        ]

for test in tests:
  print 'input:'
  w = max(len(`v`)for r in test for v in r) + 1
  for r in test:print ('%%%ds'%w)*len(r)%tuple(r)
  print '\nresult = %f\n\n' % f(test)
Fetching token
?