Description
Hot dog is a very delicious food,and Goc like it very much. The picture below shows how much does Goc like it. hhhhh...
Input
The first line contains the integer indicating to the number of test cases.
For each test case, the first line contains the integers and .
Following lines provide the information of each item.
The
All the inputs are integers.
Output
For each test case, output the maximum value.
Sample Input
15 1512 42 21 14 101 2
Sample Output
15
#include#include #include #include #include #include using namespace std;#define ll long longint t, n, pri, p[500+8], v[500+8], dp[500+8][5000+8], sum;void solve(){ fill(dp[0], dp[0] + 5005, 0x3f3f3f3f); dp[0][0] = 0; for(int i = 0; i