In group A, there are 7 boys and 3 girls and in group B, there are 4 boys and 5 girls. For a picnic trip 4 boys and 4 girls are required such that 5 are selected from group A and 3 are selected from group B. Then the total number of ways to select the team for picnic trip is