Let A ∪ B=Y, B\A=M, A\B=N and X\Y=L.
Then X is the disjoint union of M,N,L and A ∩B.
We have, A ∩ B={5,7,8} is fixed.
The remaining seven elements 1,2,3,4,6,9,10 can be distributed in any of the remaining sets M,N,L.
This can be done in 37 ways.
Of these if all the elements are in the set L, then A=B={5,7,8} and this case has to be omitted.
Therefore total number of pairs (A,B) such that A⊆X, B⊆X, A≠B and A∩B={5,7,8} is 37−1.