A colorless aqueous solution contains nitrates of two metals, X and Y. When it was added to an aqueous solution of NaCl, a white precipitate was formed. This precipitate was found to be partly soluble in hot water to give a residue P and a solution Q. The residue P was soluble in aq. NH3 and also in excess sodium thiosulfate. The hot solution Q gave a yellow precipitate with KI. The metals X and Y, respectively, are
(A) Ag and Pb
(B) Ag and Cd
(C) Cd and Pb
(D) Cd and Zn