VPL2_AA - Luis Quest

no tags 

Luis is playing his old metroid game. Just a little while ago he pass trough a scenario where the room was filled with some amoeba-like creatures. The room started with some initial number of creatures, but they multiply their selves very quickly, because their growth rate is proportional to the number of creatures at a certain time. Luis took note about this fact, he wrote the number of creatures at the initial time, and then, after wait t time units, he wrote the new amount. Now Luis wants to know, for a certain number of creatures p, the exact time he has to be in the room to see that amount.

Input

The first line contains an integer T, which specifies the number of test cases. Then, will follow the descriptions of T test cases.

For each test case, there will be 2 lines, the first one will contain 4 integers, p0, p1, t and p. These numbers represents the initial amount of creatures, the second amount of creatures, the time units that Luis waited to see that change, and the number of creatures that Luis wants to see.

Output

For each input case you must print a single line containing the string "Scenario #i: " where i is the number of the test case (starting at one), and then the answer to the problem rounded to two decimal places. There will always be an answer.

Example

Input:
4
10 15 3 15
10 15 3 20
5 12 2 50
5 12 2 7

Output:
Scenario #1: 3.00
Scenario #2: 5.13
Scenario #3: 5.26
Scenario #4: 0.77

Constraints - 100%

1 ≤ T, p0, p1, t, p ≤ 100


hide comments
Miguel Oliveira: 2013-07-16 04:48:53

I felt really dumb solving this problem. Made me review basic stuff..
Imho, it should stay in classical.

Vipul Pandey: 2013-07-04 16:17:16

definitely an easy question but i believe it should not be moved to tutorial as you have to apply a bit of maths which is not easy for all. definitely a good question for beginners. helped me to brush my math and physics of 12th standard.

Ouditchya Sinha: 2013-06-29 16:52:50

@prateek kumar nischal : I was just kidding about the output format, this problem is too easy. As to your NZEC problem, mail me your code & I'll try to find the bug at osinha6792@gmail.com. :)

Last edit: 2013-06-29 16:55:11
pika_pika: 2013-06-28 10:51:01

@Ouditchya sinha ... output was fairly simple in scanf() i just used %.2f flag.
but i had a wierd thing in my code. I got NZEC while there was a separate function to define the code for one test case. And when i copied the code in the main() under the loop i ran fine... why??

Shubham Sharma: 2013-06-26 09:35:07

Damn easy ... just 12th standard stuff

Akash: 2013-06-26 00:47:46

less than 5 minutes task..:P

Alien: 2013-06-26 00:47:46

Last edit: 2013-06-25 03:31:28
Ouditchya Sinha: 2013-06-26 00:47:46

The only challenge was the output format! :) :P

Rishabh Dugar: 2013-06-26 00:47:46

esy enuph..
* Easy enough

Last edit: 2013-06-30 16:04:48

Added by:Venezuelan Programming League
Date:2013-06-22
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64