SP1027 FPOLICE - Fool the Police

Description

Dhamaka Singh (a crook) has just robbed a bank and would like to get out of the country as soon as possible. But there is a slight problem, the police! On his way out of the country he has to pass through some police stations. Each police station has a certain risk (for Dhamaka Singh) associated with it. He wants to get to the airport within a certain time **T** or else he'll miss his flight. He also wants to take a path that minimizes the total risk associated with it. Help Dhamaka Singh get out of the country.

Input Format

The first line of the input contains an integer **t**, the number of test cases. **t** test cases follow. The first line of each test case contains 2 integers **N** (3

Output Format

For each test case output one line containing 2 integers separated by a single space. The first integer denotes the minimum total risk to reach the airport. The second integer denotes the minimum time required to reach the airport at the minimum total risk. If it is impossible to reach the airport within time **T** (inclusive), just print "-1" (quotes for clarity).