1727 - LL && FatalFightEX

Time Limit : 3 Second

Memory Limit : 256 MB

Submission: 0

Solved: 0

Description

       Fatal Fight is a horizontal axis game. Our hero, equipped with sword, need to kill all the enemy from his right or left.


       To simplify the problem, we suppose the scene is a coordinate axis which minimum unit is one. the hero is fixed in 0 point.


       This time, in order to kill more enemies, strengthen himself and learn a skill named XXXX, our hero can ruin enemies or observe enemies.


       In initial, hero's health point is H.


       For each second, hero will perform one of the actions below:


       Action1:hero use the XXXX attack the interval from L to R, the enemy between L and R will be eliminated and disappear.


       Action2:hero use the XXXX observe the number of enemies from L to R, you should tell the hero the number of enemies from L to R.


       Our hero, a poor guy, out of his expectation, the enemy also evolved.


       For each second, each enemy can perform two continuous action.


       Use the skill to move to a symmetrical coordinate. For example, if the current coordinates is POS, then his coordinates will be changed to –POS.


       Step forward one unit towards the hero.


       Once an enemy touch the hero, the enemy will sacrifice himself to assassinate the hero, which will reduce the health point of the hero by 1.


       Of course, if the health of hero declines to zero, then it's GAME OVER. After that, you should do nothing about the action2 of the hero.


 


       The game starts from the first second. the hero acts first, and your task is to help our hero to perform action2.   

Input

Multiple test cases


       The first row contains three positive numbers ,which means the number of enemies ,the number of action hero commend, and the initial health point of hero.


       The second row contains  numbers , means the initial position of i enemy.


       The next  rows ,each row contains three numbers ,if  equal to , means our hero perform action1, if   equal to , means our hero commend action2.


 


       We promise that there is at most one enemy for each position.

Output

For each test case , if the hero performs the action 2 and when the game is not OVER, you should tell the hero the number of enemies from L to R.


 


 

sample input
10 7 10
-20 -10 -15 -9 -8 1 2 3 4 5
0 -14 1
1 -20 5
0 -5  2
1 -20 5
1 -20 0
0 15 19
1 -20 100
10 4 2
-20 -10 -15 -9 -8 1 2 3 4 5
1 -20 100
1 -20 100
1 -20 100
1 -20 100
sample output
4
1
2
1
10
9
hint
source
WUST
© 2015 HUST ACMICPC TEAM. All Right Reserved.