Problem1017--黄金矿工

1017: 黄金矿工

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Input

3 10 

1 1 1 1 

2 2 2 2 

1 3 15 9

Output

3


HINT

-----sample2------

1 1 13 1
2 2 2 2
1 3 4 7

-----sample2-----

7

-----------

30%的数据,0 < T ≤ 4000 


100%的数据,N ≤ 200, 0 < T ≤ 40000 

Source/Category