If you want to create an aquarium with exotic fish you must take the advise of an expert
in order to avoid a situation in which a certain type of fish can not coexist and live
together with another fish type. The reason is the "incompatibility" among fish
types.
Given the number of fish types and the available amount of money for spending, find the
maximum number of fish types. For this number of fish types find the maximum amount of
money that can be spent, provided that only one fish per type is used.
Input: INPUT DATA (file INPUT.TXT) The program reads input lines from the file INPUT.TXT as follows:
|
|
Output: OUTPUT DATA (file OUTPUT.TXT) Output is written in the file OUTPUT.TXT as follows:
|
|
Example:
|
|
Remark In the case of many solutions to the problem, only one is required to be listed. Time-limit for each test: 5 seconds. Maximal score: 30 points |