$83$ people are at the beach, each holding a coin in one hand. $25$ have one in their right hand, and $58$ have one in their left hand, but you don't know which is which.

Your task is to split the people into two groups such that the same number in each group has a coin in their right hand, and you can do this in two steps:

- Separate the people into two groups with $n$ people in the smaller group.
- Tell $m$ people, including however many you like in either or both groups, to switch their coin to the opposite hand.

What is $m + n$ ?

**
Clarification:
**
You have no idea which
$25$
of the
$83$
people has the stone in their right hand. You split the people into two groups of size
$n$
and
$83-n$
, (with no control over how many right handed or left handed coin holders are in each group) and then you ask
$x \leq n$
people in the first group to switch (not knowing which hand holds the coin for any of them), and
$y \leq 83-n$
to switch in the other group, again not knowing which of the people you ask might have a coin in their left or right hand.

If you think this is impossible to do, provide -1 as your answer.

The answer is 50.

**
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.

The solution is to separate them into groups of size $58$ and $25$ and tell all the people in the group of $25$ to switch the coin to their other hand.

After separating them, lets say there are $i$ people in the group of $58$ that have a coin in their right hand. This means there are $25-i$ people in the group of $25$ who have it in their right hand. So once you tell the people in the group of $25$ to switch hands, there are $i$ people in each group that have the coin in their right hand.

So, in the end, you don't know how many will have a coin in their right hand, but you know there are an equal number in each group.

$25 + 25 = \boxed{50}$

Now, to explain why this is the only solution...

Here is my start....

================================================================

Lets suppose you ask $n$ people to go in one group, then there are $83-n$ in the other.

Let $r$ be the number of "people with coins in their right hand" that are in the group of size $n$ . So, the group of size $83-n$ has $25-r$ "righties".

So, now you have:

Gotta run, I will plan to finish this off in a bit...

==================================================================

Stay tuned...