##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given jobs. You must do all jobs in some order.
For each job , two integers and are given.
If job is done among the first jobs of the order, it gives you points. Otherwise, it gives you points.
Choose the order of the jobs to maximize the total number of points.
The only possible order is [1]. Since job 1 is not among the first 0 jobs, its contribution is -5.
One optimal order is [1, 3, 2]. The contributions are 10, -7, and 5, so the total score is 8.
One optimal order is [4, 1, 2, 3]. The contributions are 6, 3, 8, and -2, so the total score is 15.
One optimal order is [2, 4, 3, 1, 5]. The contributions are 10, 3, 7, -4, and -5, so the total score is 13.
One optimal order is [2, 3, 1, 5, 4, 6]. The contributions are 2, 8, 10, -7, 6, and 1, so the total score is 20.