山东省第八届ACM省赛 K 题 CF 解答(未完,待续)

xiaoxiao2021-02-28  33

CF

Time Limit: 1000MSMemory Limit: 65536KB

Problem Description

LYD loves codeforces since there are many Russian contests. In an contest lasting forT minutes there are n problems, and for the ith problem you can getai−di∗ti points, where ai indicates the initial points,di indicates the points decreased per minute (count from the beginning of the contest), andti 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?

Input

The first line contains two integers n,T(0≤n≤2000,0≤T≤5000). The second line contains n integers a1,a2,..,an(0<ai≤6000). The third line contains n integers d1,d2,..,dn(0<di≤50). The forth line contains n integers c1,c2,..,cn(0<ci≤400).

Output

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

Example Input

3 10 100 200 250 5 6 7 2 4 10

Example Output

254

转载请注明原文地址: https://www.6miu.com/read-600292.html

最新回复(0)