Work in your variable setup with a0 through a6. You were wondering how to handle countries that are more than sextuply-landlocked; I think the easiest way is to dump them into a6 regardless of how excessively landlocked they are. We want to prove that if a0,...,a6 >= 1 and a0+...+a6 ⇐ 12, then the sum of ai(a(i-1)+ai+a(i+1)-1) is smaller than 6*(a0+...+a6). A simple way to do that is to enumerate all possible tuples, which took a few minutes of programming for me and a few milliseconds of runtime on my computer.
You can also work out a proof without a computer using the technique of “smoothing” (or anti-smoothing, rather). Suppose we have fixed a0+...+a6 and want to maximize the sum of ai(a(i-1)+ai+a(i+1)-1); we do this in order to show this maximum isn’t large enough. You may as well have a0 = 1 because anything in a0 is more productive in a1; it is adjacent to strictly more things. (In other words, replace (a0,a1) with (1,a0+a1-1).) The symmetric logic applies to a6 = 1.
Now that we have a0 = 1, consider the effect of replacing (a1,a2) with (1,a1+a2-1). One may compute that this increases our sum by 2(a1-1)(a3-1), or in other words, doesn’t decrease it. The same logic applies when a0 = a1 = 1 and we continue to push stuff over. The final result is that for any given sum a0+...+a6, the maximum sum can be achieved with a0 = a1 = a2 = a3 = a4 = a6 = 1 and a5 free. (In fact, the maximum is achieved whenever there are one or two consecutive ais other than a0 and a6 that are not 1.) Finally, you just check that a0+..+a6 ⇐ 12 doesn’t work.
The same logic implies that when a0+...+a6 = 13, the only way you can have an average of at least 6 is if its exactly 6.
Work in your variable setup with a0 through a6. You were wondering how to handle countries that are more than sextuply-landlocked; I think the easiest way is to dump them into a6 regardless of how excessively landlocked they are. We want to prove that if a0,...,a6 >= 1 and a0+...+a6 ⇐ 12, then the sum of ai(a(i-1)+ai+a(i+1)-1) is smaller than 6*(a0+...+a6). A simple way to do that is to enumerate all possible tuples, which took a few minutes of programming for me and a few milliseconds of runtime on my computer.
You can also work out a proof without a computer using the technique of “smoothing” (or anti-smoothing, rather). Suppose we have fixed a0+...+a6 and want to maximize the sum of ai(a(i-1)+ai+a(i+1)-1); we do this in order to show this maximum isn’t large enough. You may as well have a0 = 1 because anything in a0 is more productive in a1; it is adjacent to strictly more things. (In other words, replace (a0,a1) with (1,a0+a1-1).) The symmetric logic applies to a6 = 1.
Now that we have a0 = 1, consider the effect of replacing (a1,a2) with (1,a1+a2-1). One may compute that this increases our sum by 2(a1-1)(a3-1), or in other words, doesn’t decrease it. The same logic applies when a0 = a1 = 1 and we continue to push stuff over. The final result is that for any given sum a0+...+a6, the maximum sum can be achieved with a0 = a1 = a2 = a3 = a4 = a6 = 1 and a5 free. (In fact, the maximum is achieved whenever there are one or two consecutive ais other than a0 and a6 that are not 1.) Finally, you just check that a0+..+a6 ⇐ 12 doesn’t work.
The same logic implies that when a0+...+a6 = 13, the only way you can have an average of at least 6 is if its exactly 6.