PRACTICE EXERCISE
The Hellenic Society of Computer Scientists and IT Professionals (EPY) has been responsible for coordinating the internship program for students of Computer Engineering, Computer Science, and Telecommunications departments of Greek Universities since the Academic Year 2006-07. In the internship program, students from the respective departments participated (). The available internship positions are (). Table P [I, J] has a value of 1 if student I is interested in position J and otherwise.
You are asked to develop a program in one of the IOI languages that ensures internship for as many students as possible.
INPUT DATA
The file practice.in on the first line contains two numbers: the number of interested students and the number of available positions separated by a space. Each of the next lines contains digits or , separated by a space, representing the declarations of students for the respective positions.
OUTPUT DATA
The file practice.out contains one line with numbers, each number lying in the range []. The first number indicates the position that the first student will occupy, the second number the position that the second student will occupy, and so on. (A student with number means that he did not find a position for his internship).
Example of Input - Output Data
STDIN (practice.in)
4 5
1 0 1 1 0
1 0 0 0 0
0 1 1 0 0
0 0 0 1 0
STDOUT (practice.out)
3 1 2 4
Maximum execution time for each test: 5 sec.
Comments