# 2019 Mock AMC 10B Problems/Problem 24

Let's label the people from three schools with A,B,C. We can consider the case in which A is in seat number 1. Now, we consider to space between two successive A's. There are totally 8 spaces, which can be broken into sum of four positive integers:

$8 = 1 + 1 + 1 + 5 = 1 + 1 + 2 + 4 = 1 + 2 +2 + 3 = 1 + 1 + 3 + 3 = 2 + 2 + 2 + 2$.

For case of $1+1+1+5$, there are four possible orders. For each order, we can arrange 5 people in the space with 5 seats as $BCBCB$ or $CBCBC$, and then arrange two B's or two C's in two of three remaining spaces, making a total of $2\times 3\times = 24$.

For case of $1+1+2+4$, there are twelve possible orders, $1124$, $1241$, $2411$, $4112$, $1142$, $1421$, $4211$, $2114$, $1214$, $2141$, $1412$, $4121$. For each order, we can arrange 4 people in the space with 4 seats as $BCBC$ or $CBCB$, and then arrange the space with two seats as $BC$ or $CB$, and then choose 1 space for $B$ and one space for $C$, making a total of $2\times 2\times 2\times 12 = 96$.

For case of $1+2+2+3$, there are twelve possible orders, similar to the case above. For each order, we can arrange 3 people in the space with 3 seats as $BCB$ or $CBC$, and then arrange the space with two seats as $BC$ or $CB$, and then arrange the last people in the space with 1 seat, making a total of $2\times 2\times 2\times 12= 96$.

For case of $1+1+3+3$, there are six possible orders, $1133$, $1331$, $3311$, $3113$, $1313$, $3131$. For each order, we can arrange 3 people in the two spaces with 3 seats as $BCB/BCB$ or $BCB/CBC$ or $CBC/BCB$ or $CBC/CBC$, and then arrange the space with one seats for the people left, so there six arrangements in total: $BCB/BCB/C/C$, $BCB/CBC/B/C$, $BCB/CBC/C/B$, $CBC/BCB/B/C$, $CBC/BCB/C/B$, $CBC/CBC/B/B$, making a total of $6\times 6 = 36$.

For case of $2+2+2+2$, there is only one order, and each space can be arranged as $BC$ or $CB$, making a total of 16.

Considering the three possibilities for seat 1, the final result is $$3\times(24+96+96+36+16) = \boxed{804}.$$