First we find the number of ways they can sit gender-wise,
then we'll see how many ways we can permute them.
We need only 16 of the boys to place them with the minimum
requirements for the seating arrangement. 7 boys between
the first two girls, 7 boys between the 2nd and 3rd girls,
and 1 boy on each end to preven a girl from sitting at the end.
BGBBBBBBBGBBBBBBBGB
There are 4 more boys left to place. There are 4 places they can go.
1. before the 1st girl
2. between the 1st and 2nd girls
3. between the 2nd and 3rd girls
4. after the 3rd girl.
So that's the ordered partitions of 4 into 4 groups, counting groups of 0.
The ordered partitions of n into r groups is C(n+r-1,r-1), counting groups
of 0.
So the ordered partitions of 4 into 4 groups, counting groups of 0 is
C(4+4-1,4-1) = C(7,3) = 35
For each of those the 3 girls can be arranged in 3! ways.
So that's C(7,3)*3! = 35*6 = 210
For each of those 210 ways to seat the girls, with the choices of
number of boys to sit left and right of the girls,
there are 20! ways to permute the 20 boys.
Answer: C(7,3)*3!*20! = 35*6*20! = 210*20!
Edwin