Question 1: A company is working on a new algorithm that operates on a special CPU that can handle n types of tasks, and the priority of the ith task is represented by the array priority[i]. The CPU will run for y seconds and you can choose to perform which follows the given conditions:
Given n tasks, an array priority, and an integer x and y, find the maximum possible sum of the priority tasks performed during the y seconds.
Question 2:
company is planning to buy some GPUs for training their new computer vision models using them. They have two clusters on which all the models are saved. There are 'n' GPUs available where the cost of the 'i'th GPU is represented by array element cost[i]. Also, there are 2 arrays 'compatible1' and 'compatible2', each containing 'n' integers, where each integer is either 0 or 1, representing the following: 1. If compatible1[i] = 1, then the i th GPU is compatible with cluster 1, else it is not compatible with cluster 1. 2. If compatible2[i] = 1, then the i th GPU is compatible with cluster 2, else it is not compatible with cluster 2. the company wants to buy the GPUs such that there are atleast a min_compatible number of GPUs compatible with each of cluster 1 and cluster 2. Given 'n' GPUs, an integer min_compatible and arrays cost, compatible1, and compatible2, find the minimum possible cost of GPUs such that there are atleast a min_compatible number of GPUs compatible with each of cluster 1 and cluster 2. Return "-1" if it is not possible to buy the GPUs satisfying the above condition.