Hello everyone
When I was solving this problem, accidentally found a test where some "accepted" solutions would crash! It would be really nice, if someone somehow add this test case!
Input:
4 6 4
1 2
1 3
1 4
3 1 4 2 1 1
2 2 2
1 3 1 3
1 2 1 1
1 2 1 1
Output:
3 1 2 5
1 4
1 6