410807: GYM104118 I Item Crafting

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

I. Item Craftingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputExamplesInput
2 6
2 3 4
3 4 5 6
0 1
0 1
0 1
0 1
Output
1
Input
2 6
2 3 4
3 4 5 6
0 1
0 2
0 1
0 1
Output
2
Input
1 5
2 2 3
2 3 4
2 4 5
0 3
0 2
Output
1
Input
1 4
3 2 3 4
0 2
1 4
0 1
Output
0

加入题单

上一题 下一题 算法标签: