All submissions for this problem are available.
Natalie, Dylan and Alex of the Charlie’s Angels are on a mission and they are lost in the ruins of some ancient city with enemies approaching quickly. Trying to escape they find themselves on a plank 100 feet above the ground that is held up by some unstable rock structures. This plank can only be balanced if the distribute their weight correctly. The sum of the weights of Natalie, Dylan and Alex of the Charlie’s Angels are equal to A. The product of their weights is equal to B. And the sum of the squares of their weights is equal to C. Using this information find the weights of the Charlie’s Angels so that they can figure out how to place themselves to ensure their survival?
The first line of the input file gives the number of test cases P (less than 20). Each of the following P lines give the values of A,B and C(0<=A,B,C<10000).
For each test case, output the corresponding weights of Natalie, Dylan and Alex. If there are many possible answers, choose the one with the lower weight of Natalie. If there is a tie, output the one with the lower weight of Dylan. If there is no solution, output the line "No solution." instead.
Input: 2 1 2 3 6 6 14 Output: No solution. 1 2 3
Note : This problem has been inspired from previously solved questions.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.