Logo
(追記) (追記ここまで)

9125번 - Contest 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB22171386.667%

문제

You and your team are participating in a programming contest. After reading all problems, you have estimated for each problem how long it will take you to solve it. Your teammates have done exactly the same. Now you want to divide the problems, so that the total number of solved problems will be maximized.

Your team is very organized and each team member always writes down all the details on paper. Therefore the computer never forms a bottleneck. The only constraint is that for each team member, the total time required to solve the problems assigned to him should not exceed the time left in the contest.

입력

On the first line an integer t (1 ≤ t ≤ 100): the number of test cases. Then for each test case:

  • One line with two integers n (1 ≤ n ≤ 10) and m ( 1 ≤ m ≤ 300). The number of problems and the number of minutes left in the contest.
  • Three lines with n integers each. Each line describes the solving times for a different team member. The jth integer on the ith line is denoted by sij: either the time in minutes it takes the ith person to solve the jth problem (1 ≤ sij ≤ 300), or −1 if the person cannot solve this problem.

출력

For each test case:

  • One line with the maximum number of problems your team can solve.

제한

예제 입력 1

1
10 300
10 60 -1 -1 10 10 10 240 1 30
15 -1 30 -1 60 60 60 300 5 250
20 -1 -1 60 60 90 90 300 2 245

예제 출력 1

10

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2007 Preliminaries C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /