U2

Source: Codeforces 1142C

  1. Read the problem and summarise the task requirements.
  2. Do some examples with pen and paper.

  3. Parabolas are annoying. Can we make them lines instead?

  4. Design an algorithm to solve the problem.

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

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