Problem3408--【Div2】枚举子集练习 - abc404d-Goin' to the Zoo

3408: 【Div2】枚举子集练习 - abc404d-Goin' to the Zoo

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description



Input

Sample Input Copy

4 3
1000 300 700 200
3 1 3 4
3 1 2 4
2 1 3

Sample Output Copy

1800

HINT

Source/Category