Bob goes to the fruit shop to buy apples. There are N apples numbered from 1 to N where the vitamin value of the ith apple is Vi and the price of the ith apple is Pi.
He wants to buy apples such that the sum of the price does not exceed M. He has one special magic spell. By using it, he can halve the price (floor value) of any apple present in a shop. He can use this spell at most one time.
Your task is to find the maximum vitamin Bob can get.
Input format
Output format
For each test case, the only line must contain an integer denoting the maximum vitamin Bob can get.
Constraints
1≤T≤10
1≤N≤1000
1≤M≤1000
1≤Vi≤105
1≤Pi≤103
Here, Shengij will perform the magic spell on apple number 1 and he will buy 1st and 2nd apples to maximize the total vitamin.