For 5.28 try using complementary counting (proceed similar to example 5.8). To count how many ways are there to sum to $200$ with repeated digits consider cases: all numbers repeated and two numbers repeated.
For 5.29, proceed similar to example 5.9. Note $40 = 2^3 \times 5$. So any factor of $40$ is of the form $2^a \times 5^b$. Consider three factors of this form and multiply them so they equal $40$. What can you say about the exponents of the numbers?
For 5.27 pretend for a second that all black cards are identical. How would you proceed? Once you find the answer to the problem pretending all black cards are identical, arrange the black cards in some order and arrange them with the red cards as you did before.