3882 - [Wc2015]K小割

Input

Output

Examples

Input

3 3 1 3 100
1 2 3
2 3 4
1 3 5

Output

8
9
12
-1
时间限制 1 秒
内存限制 128 MB
统计
上一题 下一题