|
|||
game-1There are games on an online platform, and we know their prices . There are also friends on this platform, and we know how much money each has in their (online) wallet () and which games they already own . The group wants to play the same game together. Money cannot be gifted, but games can be - any number of them. For each game, we want to know the minimum total money spending required if they want to play that game together. Create a report of this ! Input specificationThe first line contains , the number of test cases. Description of a test case: First line: (number of games and friends). Next line: game prices . Next lines: the numbers . Output specificationlines, each containing the numbers for that test case. If it’s not possible for everyone to get a particular game, output . Constraints
Sample input 1
Sample output 1
|
|||
| University of Debrecen; Faculty of Informatics; v. 09/30/2024 |