First we have to select 5 toys from 8 toys in 8c5 ways and then placed them in box A which can be done in 5! ways.
So, total no of ways of placing 5 toys out of 8 toys in box A is 8c5 x 5! ways.
Now, we have left 3 toys which have to be placed in box B which can be done in 3! ways.
So, required number of ways
= 8c5 x 5! + 3!
= 6720 + 6
= 6726