Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this is the code written side of it pls solve asap I'll provide best review tks Question 2 Max. score: 50.00 Intelligent Robots Krisha is

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

this is the code written side of it

image text in transcribed

image text in transcribed

pls solve asap I'll provide best review tks

Question 2 Max. score: 50.00 Intelligent Robots Krisha is very much fascinated about Robots, so she bought N robots. Each robot is having some Intelligence, lets say the i' th robot is having Intelligence P; While she was playing with robots, she found a way to transfer the Intelligence of one robot to another. In this process she observed that, if X amount of Intelligence is transferred from th robot then, K percent of Intelligence which is getting tranferred gets dissipated in this process. So she need your help to make the Intelligence of all Robots equal and maximum possible. to sth Input: First line contains T, denoting the number of Test cases. First line of each test case contains two space separated integers N and K, denoting the Number of Robots and the Percentage of power getting dissipated. P1, P2, Pz......,P PN denoting the initial Intelligence of each Robots. Output: For each test case, print a single line float value (round to 4 decimal places) denoting the the maximum Intelligence of each robots. Constraints: 1> Sample output 2 16 87215.4587 49495 88 70397.6328 78061 87217 87217 87217 87217 87 25531 30 12251.6053 34024.1095 93475 70397 70397 70397 70397 70 12391.5716 35090 51 22675.3150 55600 12251 12251 12251 12251 12 1852.0207 61199 17 70144.3230 412097 24024 2424 24024 2.4924 24 97214 2792 35899 51 22675.3159 55600 12251 12251 12251 12251 12 1852.8207 61199 17 79144.3238 42097 34824 34024 34824 34024 34 97214.2792 58856 37 41799.5868 View more Note: Your code must be able to print the sample output from the provided sample input. However, your code is run against multiple hidden test cases. Therefore, your code must pass these hidden test cases to solve the problem statement. Limits Time Limit: 2.0 secs) for each input file Memory Limit: 256 MB Source Limit: 1024 KB Scoring Score is assigned if any testcase passes Allowed Languages Bash, C, C-C-414, C--17, Clojure, C# D. Erlang, F#, Go, Groovy, Haskell, Java, Java 8, Java 14, JavaScript(Rhino). JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL). Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, Python 3.8, Racket, Ruby, Rust, Scala, Swift-4.1, Swift, TypeScript, Visual Basic Save C++17 (g++ 10.3.0) 1 2 3 Finclude using namespace std; 5 double solve (int N, int K, vector int> P) { 11 Type your code here } 6 int main() { 8 9 10 11 12 13 ios::sync_with_stdio(@); cin.tie(e); int T; cin >> T; for(int i = @; t > N; int K; cin >> K; 15 16 17 18 19 Test against custom input Compile & Test code 3 14 | 15 16 17 18 19 cin >> T; for(int t_i = ; t_i > N; int K; cin >> K; vector P(N); for(int i_P = 0; i_P > P[i_P]; } 20 21 22 23 24 N N 25 26 M & W o r o ad 27 double out_; out_ = solve(N, K, P); () cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

=+a) Show that mixing implies ergodicity.

Answered: 1 week ago