We have 20 balls in two colors and two different sizes.
5 big red (R)
5 small red (r)
5 big white (W)
5 small white (w)
In how many ways we can order them in line with this rule:
Red balls must be in blocks of 5 balls and cant be together (adjacent) with other block of 5 red balls.
Note: Balls with same size and same color we dont distinguish.
example of this kind of order: (W-w-R-R-r-R-r-w-w-w-R-R-r-r-r-W-W-W-w-W)
You can count the possible placements of the blocks, and then place the balls accordingly.
Label the positions in the list with the interval $[1,20]$, and let $b_1$ and $b_2$ be the positions of the first ball in each block. The first block can start at positions $b_1\in[1,10]$, and the second block can start at positions $b_2\in[b_1+6,16]$. Therefore the total number of distinct placements of blocks is given by:
$$\sum_{b_1=1}^{10}\ \sum_{b_2=b_1+6}^{16}1=\sum_{b_1=1}^{10}(11-b_1)=\sum_{b_1=1}^{10}b_1=55$$
For each of these positions, there are $10$ positions to be filled by red balls and $10$ to be filled by white balls. Because each of these $55$ block placements indicates a specific arrangement of red and white, irrespective of size, the red and white balls can be placed independently. This adds a factor of $\binom{10}5$ for each color. The total is thus:
$$55\binom{10}5\binom{10}5=349720$$