You have an array of integers of size . Initially, all elements of the array are equal to . You can perform the following operation: choose two integers () and (), and then increase the value of by (i.e. make ).
After performing all operations, you will receive coins for all such that .
Your task is to determine the maximum number of coins that you can receive by performing no more than operations.
The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and () — the size of the array and the maximum number of operations, respectively.
The second line contains integers ().
The third line contains integers ().
The sum of over all test cases does not exceed .
For each test case, print one integer — the maximum number of coins that you can get by performing no more than operations.
Solution:
solution link 1
https://shareus.in/?i=GZatxNl0g
if 1st link is not work then click on another link
Solution link 2
Solution link 3
Solution link 4
How to get link tutorial video link
No comments:
Post a Comment