1307: CF

内存限制:64 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:85 解决:26

题目描述

LYD loves codeforces since there are many Russian contests. In an contest lasting for T minutes there are n problems, and for the ith problem you can get aiditi points, where ai indicates the initial points, di indicates the points decreased per minute (count from the beginning of the contest), and ti stands for the passed minutes when you solved the problem (count from the begining of the contest).
Now you know LYD can solve the
ith problem in ci minutes. He can't perform as a multi-core processor, so he can think of only one problem at a moment. Can you help him get as many points as he can?

输入

The first line contains two integers n,T(0n2000,0T5000).
The second line contains
n integers a1,a2,..,an(0<ai6000).
The third line contains
n integers d1,d2,..,dn(0<di50).
The forth line contains
n integers c1,c2,..,cn(0<ci400).

输出

Output an integer in a single line, indicating the maximum points LYD can get.

样例输入 复制

3 10
100 200 250
5 6 7
2 4 10

样例输出 复制

254