5514: 暑期营第三天 cake

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

3 6
6 1 100 
2 2 20
3 1 30

Sample Output Copy

50

HINT