F.A.Qs Home Discuss ProblemSet Status Ranklist Contest 入门OJ LoginRegister 捐赠本站
Problem 3265. -- 志愿者招募加强版

3265: 志愿者招募加强版

Time Limit: 20 Sec  Memory Limit: 512 MB
Submit: 934  Solved: 465
[Submit][Status][Discuss]

Description

Input

Output

Sample Input

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

Sample Output

14

HINT

Source

[Submit][Status][Discuss]

HOME Back