lena beautiful girl like logical puzzlesas gift birthday Lena get matrix puzzlethe matrix consist n row m column cell black white the coordinate ij denote cell belong ith row jth column 1leq leq n 1leq j leq m to solve puzzle Lena choose cell minimize Manhattan distance farth black cell choose cellmore formally let k ge 1 black cell matrix coordinate x_iy_i 1leq leq k Lena choose cell ab minimize max_i1kax_iby_iAs Lena skill ask help will tell optimal cell choose