We Know that: Number of persons above D is one more than below D. D lives in building Y and 1st floor is not vacant so D must live on 2nd floor. D lives immediate above G. G must live on 1st floor in building Y. Only one person lives below E and 1st floor is not vacant so we get 2 possibilities. Either E lives on 2nd or 3rd floor. Case 1: No one lives between E and H and they both live on odd numbers of floor. So this case gets rejected. Case 2: No one lives between E and H and they both live on odd numbers of floor. So H must live on 1st floor. G lives one of the floors below B. it means B lives also in building Y and B's and E's floor numbers are not same. So B lives either 4thand 5th floor. If B lives on 4th floor- At least one person lives between F and G. it means F lives also in Building Y. A and C live in building X. C lives below A. So C lives on 4th and A lives on 5th floor in building X. No one lives between F and B. F and A live on the same number of floor. So F lives on 5th floor in building Y and 3rd floor of building Y is Vacant. Here is the final table:Only E lives between C and H.