Donghyuk stands at the origin (0,0) of an infinite two dimensional grid. Some cells of the grid are blocked, and he cannot enter a blocked cell. The origin is not blocked.
Each second Donghyuk may move to one of the four cells next to his current cell (up, right, down, left) that is not blocked. He may also stay where he is.
Given the blocked cells and the time K, write a program that finds the largest x coordinate of a cell where Donghyuk can be after K seconds.