Optimization problem: maximise horizontal distance 
Fifteen men are placed on a Dead Man's Chest in a rectangular pattern, with each man distant $a$ from his neighbours,thus:
The average weight of the men is $w$, and the heaviest man weighs no more than $2w$. Find the maximum possible horizontal distance from the centre of the rectangle to the centre of mass of the fifteen men(You are allowed to have some of the men as pixies, with zero weight, but negative weights are not allowed). Show how the men should be placed so as to achieve this, and explain why your solution is the best.

I have never encountered problems like this. What is a Dead Man's Chest, shall I assume it to be functioning as the ground? How to place the men in a rectangular pattern with the same distance, I tried a number of times and think only an even number of men can be placed in a rectangular pattern. How to decide the dimension of the rectangle? How to construct a model to this question?
 A: For the centroid
$\overline{x} = \dfrac{\sum\limits_{i}{m_i x_i}}{\sum\limits_{i}{m_i}}$.
Since the average mass is fixed, we have that the denominator equals $15w$.
So we need to maximise the magnitude of the numerator. This can be done by placing men of mass $2w$ in the six positions to the right of the centerline, six men of mass $0$ to the left of the centerline and men of average mass $w$ (e.g. 0, $w$, $2w$) on the centerline. Assume the long side of the dead man's chest has length $l$, then
$\overline{x} = \dfrac{3w\cdot0 + 3\cdot2w\cdot0.25l + 3\cdot2w\cdot{0.5l}}{15w} = \dfrac{4.5wl}{15w} = 0.3l = 1.2a$
(to the right of the centerline).
It is easily seen that the mass of the men of the centerline does not matter as it has no moment about the centerline, while reducing the mass of any men on the right will shift the centroid leftward, so this is the maximal distance.
A: The comments establish that this means a grid of $3\times 5$ masses, laid out like one of the following:


For a model, you can write down the formula for the center of mass of the collection of points on the grid, with 15 variables, one for each weight; I'd use the center of the rectangle as the origin. Since this problem is scale invariant, we can take $a=1$ for convenience. Relative to that origin and in those units, I get the following distances:
$$
\begin{array}{ccc}
x&y&\text{weight}\\
-2 & -1 & w_{1} \\ 
-2 & 0 & w_{2} \\ 
-2 & 1 & w_{3} \\ 
-1 & -1 & w_{4} \\ 
-1 & 0 & w_{5} \\ 
-1 & 1 & w_{6} \\ 
0 & -1 & w_{7} \\ 
0 & 0 & w_{8} \\ 
0 & 1 & w_{9} \\ 
1 & -1 & w_{10} \\ 
1 & 0 & w_{11} \\ 
1 & 1 & w_{12} \\ 
2 & -1 & w_{13} \\ 
2 & 0 & w_{14} \\ 
2 & 1 & w_{15} \\ 
\end{array}
$$
Then the problem is to maximize one of the Cartesian coordinates of the center of mass over all 15 variables subject to the constraints that the weights are all between $0$ and $2w$, and that they sum up to $15w$. However, what "horizontal distance" means in this case is ambiguous because we are not given the picture of the grid and an indicator of which direction is horizontal.
An optimization algorithm can maximize one of the coordinates of the center of mass easily over fifteen variables, so a computer approach will be quickest. My sense is that all the weights should be $2w$ or $0$, with no weights in between in the optimal solution. Something like put the $2w$ guys on one side, and the zeros everywhere else; that'll skew the center of mass away from the geometric center. However, I'm often surprised by my intuition being wrong in such simple problems so the easiest approach is to simply use an available optimization algorithm (MATLAB is great for this).
