Необходимо написать работующий код по заданию на java.
Описание задачи:
Consider m machines and n >= m jobs, each of which is specified by a start time and a finish time. Each job can be assigned to any machine, but each machine can serve at most one job at any time. The objective is is to schedule a largest number of given jobs to the m machines. You are expected to develop an O (n log n)-time algorithm and write program to implement it.
Your program should be able to accept a file input (e.g. TXT file) specifying the job intervals, and you may choose the format of the input file associated with the problem.
Input / Output:
Your program should be able to read the input file. The first line of the file indicates the number of machines. The following is the start time and finish time of each job.
Your output should show the assignment details of each job (The job ordering in each machine) and the largest number of jobs.
Example input:
1
1 2
1 4
3 4
Example output:
Machine #1 has jobs:
(1,2)
(3,4)
Jobs not processed:
(1,4)
2 number of jobs out of 3 total jobs.