Medium30 pts
Queen's Attack II
n x n board, queen at (r_q,c_q). k obstacles. In how many squares can the queen attack? (8 dirs, stop at obstacle or edge)
Input
n k\nr_q c_q\nk lines: r c
Output
Count.
Sample
4 0 4 4
Expected
9
Loading editor…
Output
No output yet. Run your code to see results.