The correct option is A in
Options A and B: 'In' and 'at' both refer to a place. But, when one speaks of a person's residence in particular, like 'flat', then 'in' is preferred over 'at'.
You say 'at the flat' when you have other residences too.
Hence option A is correct and B is incorrect.
Option C: 'On' refers to a surface. But here, the flat isn't a surface, but a residence. Hence C is incorrect.
Option D: 'With' means 'accompanied by'. For e.g., 'I live with my sister in a live'. One cannot 'live with a flat'. Hence D is also incorrect.