5356: Rise in Price

内存限制:512 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

输入

输出

For each test case, output a single line containing an integer: the maximum number of dollars you can earn by selling diamonds.

样例输入 复制

1
4
2 3 1 5
6 3 2 4
3 5 1 4
5 2 4 1
3 2 5 1
2 4 3 5
1 2 3 4
4 3 5 3

样例输出 复制

528