Utilizing these cost transforms you are approached to work out the swelling coefficients for every month as the proportion of current cost increment pi to the cost toward the beginning of this current month (p0+p1+⋯+pi−1). Your supervisor said you unmistakably that the expansion coefficients should
Correct answer will be upvoted else downvoted. Computer science.
Utilizing these cost transforms you are approached to work out the swelling coefficients for every month as the proportion of current cost increment pi to the cost toward the beginning of this current month (p0+p1+⋯+pi−1).
Your supervisor said you unmistakably that the expansion coefficients should not surpass k %, so you chose to expand a few qualities pi in such a manner, that all pi remain integers and the swelling coefficients for every month don't surpass k %.
You know, that the greater changes — the more clear cheating. That is the reason you want to limit the all out amount of changes.
What's the base complete amount of changes you want to make all expansion coefficients not more than k %?
Input
The primary line contains a solitary integer t (1≤t≤1000) — the number of experiments.
The primary line of each experiment contains two integers n and k (2≤n≤100; 1≤k≤100) — the length of exhibit p and coefficient k.
The second line of each experiment contains n integers p0,p1,… ,pn−1 (1≤pi≤109) — the cluster p.
Output
For each experiment, print the base absolute amount of changes you really want to make all swelling coefficients not more than k %.
Step by step
Solved in 4 steps with 1 images