# Dancing, dancing, dancing

My friend Kim told me:

Last week I went to an afternoon party. I was the last guest to arrive. I looked around and counted (not including myself) altogether 14 grown-ups and 17 children. Altogether, there were 12 male and 19 female present.

Later in the afternoon, the dancing started. There was a lot of dancing. Every boy danced exactly once with every girl, and every man danced exactly once with every woman. The number of children couples that formed during these dances was equal to the number of grown-up couples.

Question: Is Kim a boy? A girl? A man? A woman?

Let's define M male, F females, B baby, G grown-up.

Now, if we don't consider you and Kim, we call X the MG. Easily we can deduce that:
$MG=X$
$FG=14-X$
$MB=12-X$
$FB=19-(14-X)=5+X$

With a males and b females, the etero couples are a*b. So:
$X(14-X)=(12-X)(5+X)$

But we forgot Kim! Well, let's add +1 to only one of the 4 factors in the above equation. We have 4 different equations now (remember that X must be natural):

1. $(X+1)(14-X)=(12-X)(5+X)$
2. $X(15-X)=(12-X)(5+X)$
3. $X(14-X)=(13-X)(5+X)$
4. $X(14-X)=(12-X)(6+X)$

The only equation that returns a positive integer X is the 4th, adding +1 to Female Babies:

$X(14-X)=(12-X)(5+X)$
$MG=X=9$
$FG=5$
$MB=3$
$FB=14+1=15$