Black Circles

Source: Codeforces 2002C

  1. Read the problem and summarise the task requirements.
  2. Do some examples with pen and paper.
  3. Design an algorithm to solve the problem.

  4. Analyse the time complexity of your algorithm and estimate its running time.

  5. Implement this algorithm in code.
  6. Submit your program for judging!