SP2008 BACKPACK - Dab of Backpack

Description

One day Blue Mary goes to a nearby supermarket to buy some goods. She has a backpack, whose capacity is _V-Max_. She finds that there are many goods in the market, each has a volume _V $ _{i} $_ (it will always be a multiple of 10 and less than 10000) and an importance _C $ _{i} $_ (1

Input Format

Multiple test cases, the number of them is given in the very first line. For each test case: The first line contains two space-separated integers _V-Max_ (1

Output Format

For each test case: The first and the only line contains a single integer denoted the answer.