A coach picks team members in two ways:

  A. The team of three people should consist of one experienced participant and two newbies. Thus, each experienced participant can share the experience with a large number of people.

  B. The team should have two experienced members plus one newbie. Thus, each newbie can gain more knowledge and experience.

All the teams during the training session should belong to one of the two ways described above. Furthermore, they agree that the total number of teams should be as much as possible.

There are $E$ experienced members and $N$ newbies on the training session. Can you calculate what maximum number of teams can be formed?

I have solved this problem in a purely mathematical way! Let the number of teams of type A be $x$ and type B be $y$. Now

$$\begin{align*} 2\cdot x+y&=E\\ 2\cdot y+x&=N \end{align*}$$

Now adding these equations, I get

$$\begin{align*} 3\cdot (x+y)&=N+E\\ (x+y)&=(N+E)/3 \end{align*}$$

For the maximum number of integral teams, I should take floor of $(N+E)/3$ as it is equal to $x+y$ (the number of teams).

We also have to check another condition, i.e., $x+y= (N+E)/3$. Now we have to back substitute in starting equations and constrain $x$ and $y$ to be greater than zero!

This would yield us the condition where this will be true; otherwise one type of teams will be zero and that case is trivial.

Now, I want to know is there a better solution than all of this maths?

  • $\begingroup$ When you add the 2 equations, it gives: $3 \cdot (x+y)=N+E$ not $N$ only. $\endgroup$
    – K. Rmth
    Jul 13, 2015 at 17:47
  • $\begingroup$ Edited! @K.Rmth $\endgroup$ Jul 13, 2015 at 17:52

1 Answer 1


It seems to me that the number of teams you can form would be $\min\left\{N,E,\left\lfloor\frac{N+E}{3}\right\rfloor\right\}$.

Certainly you can't form more teams than this. But on the other hand you can always form this many teams by the following procedure:

(1) Choose two members of type new or experienced according to which group has more members currently (if the groups are equal size, choose the type arbitrarily), and one member of the other type. These three form a team.

(2) Update values of remaining new and experienced players.

(3) Go back to step (1); continuing until you run out of one of the types (new or experienced).

  • $\begingroup$ How can you prove that this is the optimal way? $\endgroup$ Jul 13, 2015 at 18:50
  • $\begingroup$ It's quite obvious one can't make more teams than $\lfloor \frac{N+E}{3} \rfloor $. If one manages to make more than N teams from a roster containing N newbies, there will be at least a teams containing no newbies, which is supposed impossible. The same reasoning works for E experienced players. Hence, the number of teams one can form is $\leq \min\left\{N,E,\left\lfloor\frac{N+E}{3}\right\rfloor\right\}$. Since paw88789's solution manages to create that many teams, it is optimal. $\endgroup$
    – GBQT
    Aug 15, 2015 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .