Orange Boy Can You Solve It Out? Ep.41

Long time no see 思考题!

Allow me to cut through those words!

Have you ever played Danganronpa? It’s a game which allows you to cut through others words by exposing lies. Our adorable swordsman Ookami decides to try it too!

There are N words Ookami needs to cut. They will appear in a plane as rectangles. The i-th one will appear at second , with its left-up corner at and right-down corner at . The left-up corner will move to and its right-down corner will move to linearly and smoothly in seconds. It will also have a health of

In every moment, Ookami can choose one of the following lines and damage all rectangles that intersect with it(include boundaries) and doing this will cost her 1 energy.

  • y=x
  • x=0
  • y=0
  • y=-x

What’s the minimal number of energy Ookami has to spend to kill all rectangles?

Please note that:

  • A rectangle will die when its health is 0
  • Ookami can cut multiple times in a single moment even with different lines.
  • She doesn’t need to cut them at integer seconds.

Constraints

For 60%,

For all tests,