As one of the most powerful brushes in the world, zhx usually takes part in all kinds of contests.
One day, zhx takes part in an contest. He found the contest very easy for him.
There are $n$ problems in the contest. He knows that he can solve the $i^{th}$ problem in $t_i$ units of time and he can get $v_i$ points.
As he is too powerful, the administrator is watching him. If he finishes the $i^{th}$ problem before time $l_i$, he will be considered to cheat.
zhx doesn't really want to solve all these boring problems. He only wants to get no less than $w$ points. You are supposed to tell him the minimal time he needs to spend while not being considered to cheat, or he is not able to get enough points.
Note that zhx can solve only one problem at the same time. And if he starts, he would keep working on it until it is solved. And then he submits his code in no time.