easily done .
take switchline from each room to fan,dont take it from the light,take it from the switch.then use double pole switches.one switchline for light,1 switchline for fan.this stops room A backfeeding room B when you activate the switch in the relevant room
materials list...