In the following, two squares are adjacent if they share a vertex. (This means orthogonal and diagonal adjacencies.)
Consider a grid beginning with empty squares. You will play 9 turns. In each turn, select an empty square. If this empty square is not adjacent to a filled square, write a 1 to the square. Otherwise, write the sum of all numbers adjacent to it to the square.
Your objective is to maximize the final number that you write. What is this maximum?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
This is a very crude solution; I'll polish this up later.
Use brute force; there are only 9 ! combinations. The following code is pretty straightforward, although one-character names might be hard to follow.
We have m x = 5 7 .
perms
has all the permutations reaching the maximum; one of it is ( 0 , 2 , 1 , 3 , 4 , 6 , 7 , 5 , 8 ) , which corresponds to A C B D E G H F I in the following:The grid is