For q, the total number of six-digit numbers formed using only the digits 4, 5, 9, which are divisible by q=11, let's recheck the alternating sum of the digits:
- Alternating sum of digits in the units place, hundreds place, and ten-thousands place: 4−5+9=84−5+9=8
- Alternating sum of digits in the tens place, thousands place, and hundreds-of-thousands place: −4+5−9=−8−4+5−9=−8
The difference between these two sums is 8−(−8)=168−(−8)=16. This is not divisible by 11. So, q=0.
Now, for p, the total number of six-digit numbers formed using only the digits 4, 5, 9, which are divisible by 7, let's recheck the divisibility of the last three digits:
- 459 (not divisible by 7)
- 495 (not divisible by 7)
- 549 (not divisible by 7)
- 594 (not divisible by 7)
- 945 (not divisible by 7)
- 954 (divisible by 7)
There is only 1 combination that is divisible by 7.
So, p=1×1×1×1=1.
Therefore, p+q=0+1=1.
The correct answer is p+q=1.