49 empty cups are arranged in a 7×7 square. Each cup can hold up to 50 marbles.
Every time you add marbles to a cup you must add the same number of marbles to the adjacent cups.
Similarly, every time you remove marbles from a cup you must remove the same number of marbles from the adjacent cups. The central cup has 4 neighbors.
What is the largest number of marbles you can have in the center cup when all of the other cups are empty?
I took a simplifying assumption that the solution is symmetrical, similar to the symmetry in the solution of a 7x7 Lights Out puzzle for turning on just the center square.
Then I constructed this grid:
a b c d c b a
b e f g f e b
c f h i h f c
d g i j i g d
c f h i h f c
b e f g f e b
a b c d c b a
From this I created the following equations:
a+2b=0, a+b+c+e=0, b+c+d+f=0, 2c+d+g=0, 2b+e+2f=0, c+e+f+g+h=0, d+2f+g+i=0, 2f+h+2i=0, g+2h+i+j=0, 4i+j=50.
Wolfram Alpha gave a solution with 17s in the denominator, so I changed the last equation to 4i+j=17.
Then a=-12, b=6, c=-8, d=15, e=14, f=-13, g=1, h=6, i=10, j=-23. Positive numbers mean we add to that cup and its neighbors that many times, and similarly, negative numbers mean we remove from that cup and its neighbors that many times.
In this case we end up with 17 marbles in the center cup. The largest multiple of 17 not exceeding 50 is 34 marbles (assuming a symmetric solution).