[Solution] Schedule Management Codeforces Solution
There are workers and tasks. The workers are numbered from to . Each task has a value — the index of worker who is proficient in this task.
Every task should have a worker assigned to it. If a worker is proficient in the task, they complete it in hour. Otherwise, it takes them hours.
The workers work in parallel, independently of each other. Each worker can only work on one task at once.
Assign the workers to all tasks in such a way that the tasks are completed as early as possible. The work
starts at time . What's the minimum time all tasks can be completed by?
The first line contains a single integer () — the number of testcases.
Grass Field Codeforces Solution
Permutation Codeforces Solution
Schedule Management Codeforces Solution
Permutation Restoration Codeforces Solution
Text Editor Codeforces Solution
The first line of each testcase contains two integers and () — the number of workers and the number of tasks.
The second line contains integers () — the index of the worker proficient in the -th task.
The sum of over all testcases doesn't exceed .
For each testcase, print a single integer — the minimum time all tasks can be completed by.
No comments:
Post a Comment