Home Web Board ProblemSet Standing Status Statistics
long long输出请使用 %lld服务器的python版本为3.4
Problem M: 勇者屠龙(加强版)

Problem M: 勇者屠龙(加强版)

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 22  Solved: 3
[Submit][Status][Web Board]

Description

Input

Output

Sample Input

2

100 100 1
5 1
500 0 10
100 100 2 3 4 5 6 7 8 9

1 100 100
1000 0
10000 10000 3
10000 10000 10000

Sample Output

6 90
-1

HINT



[Submit][Status][Web Board]