Van P and Van Q return together every LCM(8, 10) days. Factor: 8 = 2³, 10 = 2 × 5, so LCM = 2³ × 5 = 40. In 360 days that happens 360 / 40 = 9 times. All three return together every LCM(8, 10, 12) days: 8 = 2³, 10 = 2 × 5, 12 = 2² × 3, so LCM = 2³ × 3 × 5 = 120, which occurs 360 / 120 = 3 times.
The question wants P and Q together but NOT R, so subtract: 9 − 3 = 6, answer (B). You can confirm by listing P-and-Q days {40, 80, 120, 160, 200, 240, 280, 320, 360} and striking the three all-three days {120, 240, 360}, leaving 6.
Diagnose the traps: (C) 9 forgets to exclude R. (A) 3 answers the all-three question. (D) 12 adds rather than subtracts the overlap. (E) 18 comes from a bad LCM of 8 and 10.