Computer Science, asked by sthota003, 6 months ago

You bought N robots. Each robot has some Intelligence, for example, the ith robot has knowledge Pi. While you are playing with robots, she found a way to transfer the knowledge of one robot to
another. In this process, you observe that if X amount of knowledge is transferred from the ith robot to gth, then K percent of the knowledge that is getting transferred gets dissipated in this process.
Therefore, your task is to make the knowledge of all robots equal and maximum.
Input:
. The first line contains T denoting the number of test cases.
• The first line of each test case contains two space-separated integers N and K denoting the number of robots and the percentage of knowledge getting dissipated.
• The second line of each test case contains N space-separated integers P1, P2, P3, ...,Pn denoting the initial knowledge of each robot.
Output format
1
For each test case, print a single line float value (round to 4 decimal places) denoting the maximum knowledge of each robot.
Constraints
1<T < 50
1<N< 105
1<K< 99
0<P < 105, (1 Si< N)
Sample input 1
Copy
Sample output 1
Copy
1
3 50
1 2 3
1.7500
Explanation
Robot 3 will transfer Its 1.25 Intelligence to Robot 1. So the new Intelligence of Robot 3 is 1.75 and Robot 1 is 1.625 (1 +0.5 1.25 )
Robot 2 will transfer its 0.25 Intelligence to Robot 1. So the new Intelligence of Robot 2 is 1.75 and Robot 1 is 175 (1.625 +0.5 0.25)
So the Intelligence of each Robot Is 1.75, which is maximum possible​​

Answers

Answered by sanajazarida
0

Answer:

what is this

Explanation:

I am not able to understand

Similar questions