onemoreyear   1년 전

Why don't you add B = 1 and B = 3 like original statement?

For B = 1:

Input

1 6 5 100

25

50

50

10

20

23

Output

4

For B = 3

Input

3 8 10 20

10 10 10

10 10 20

10 20 10

10 20 20

20 10 10

20 10 20

20 20 10

20 20 20

Output

12

댓글을 작성하려면 로그인해야 합니다.