Input Format

The problem instance files have the following format (all numbers are integers, all intra-line separators are spaces):

First line:
Number of events, number of rooms, number of features, number of students.

One line for each room:
Roomsize.

One line for each student/event:
A zero or one. Zero means that the student does NOT attend the event, one means that he DOES attend the event. For example, if there were 3 students and 4 events then the following:

0
1
0
0
1
1
0
0
0
0
1
0

would give us the following attends matrix (where rows represent students and columns events)

0 1 0 0
1 1 0 0
0 0 1 0

meaning:

  1. the first student attends the second event
  2. the second student attends the first and second events
  3. the third student attends the third event

One line for each room/feature:
A zero if the room does NOT satisfy the feature, or a one if the room DOES satisfy the feature. For example, if there were 3 rooms and 4 features, then the following:

0
1
0
0
1
1
0
0
0
0
1
0

would give this roomFeatures matrix (where rows represent rooms and columns features):

0 1 0 0
1 1 0 0
0 0 1 0

Meaning:

  1. the first room satisfies the second feature
  2. the second room satisfies the first and second features
  3. the third room satisfies the third feature.


One line for each event/feature:
A zero if the event does NOT require the feature, or a one if it DOES. For example, if there were features then the following:

0
1
0
0
1
1
0
0
0
0
1
0

would give this eventFeatures matrix (where rows represent events and columns features):

0 1 0 0
1 1 0 0
0 0 1 0

Meaning:

  1. the first event requires the second feature
  2. the second event requires the first and second features
  3. the third event requires the third feature