Farmer Josh is raising kangaroos! There are
- The kangaroo's position will increase by its velocity. More specifically,
will increase by . - The kangaroo's velocity will increase by its acceleration. More specifically,
will increase by .
Note that this means neither the position nor the velocity of a kangaroo is continuously changing.
However, since the kangaroos aren't too bright, Farmer Josh is worried that the kangaroos may bump into each other. Collisions occur when more than one kangaroo hop onto the same location at the same time. Kangaroos will only collide at positive integer times.
Farmer Josh is fine with a few kangaroos colliding with each other since they will be able to recover quickly (kangaroos will continue hopping like normal after collisions), but he will be very concerned if many kangaroos collide together at the same time. So, before the kangaroos start hopping around,
1 i x y z
Kangaroo moves to position , changes its initial velocity to and changes its acceleration to . In other words, is set to , is set to and is set to . Note that events of this type are cumulative, i.e., this event affects all future events.2 l r
If all the kangaroos were to begin hopping right now, Farmer Josh would like to know the minimum number of kangaroos that need to be moved to prevent all kangaroos with IDs in the inclusive range from colliding with each other at the same time; that is, he wants to ensure that at no integer point in time do all kangaroos with IDs in the range share the same position. Farmer Josh may move any number of kangaroos to any other integral position this way, but he cannot change the velocity nor the acceleration of any kangaroo. Kangaroos cannot share initial positions with other kangaroos after being moved. Note that Farmer Josh is only asking a question, so he does not actually move any kangaroo, and no kangaroo actually hops.
For each event of type
Constraints
All
Subtask 1 [15%]
All kangaroos will always have an acceleration of
Subtask 2 [25%]
All kangaroos will always have an acceleration of
Subtask 3 [60%]
No additional constraints.
Input Specification
The first line will contain two integers
The next
The next
Output Specification
For each event of type
Sample Input
3 3
-1 2 1
8 -3 2
10 8 10
2 1 2
1 2 6 2 1
2 1 3
Sample Output
1
0
Explanation
Initially, kangaroo
For the first event of type
For the second event of type
Comments