Caladan interview question

An question regarding coordinates and a question regarding dp