If a seven-digit number made up of all distinct digits 8, 7, 6, 4, 2, x, and y is divisible by 3, then
8, 7, 6, 4, 2, x and y
Any number is divisible by 3 if sum of digits is divisible by 3, i.e., x + y + 27 is divisible by 3. x and y can take values from 0, 1, 3, 5, 9. Possible pairs are (5, 1) (3, 0) (9,0) (9, 3) and (1, 5), (0, 3) (0, 9) (3, 9).