VPL2_AA - Luis Quest

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

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


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

hide comments
2014-09-29 21:41:03 Vipul Srivastava
Use double!! Float cost me 2 WAs
2014-02-14 17:07:27 Prakhar Gupta
using double gave me AC...instead of float
2013-12-26 11:20:34 Sadhana Srinivasan
can someone please specify the exact output format?
2013-12-02 20:12:47 vincent Dass
Easy problem. try to get every value in float rather than int.. 12th standard maths :P
2013-10-29 06:43:33 Rohit Retnakaran
Bingo!!!! first attempt... :p
2013-08-09 07:52:31 sumanth kumar
My output is correct but its giving wrong answer... 9804717
2013-07-29 17:51:48 game2712
why my code giving wrong output

[code removed -- see notes below, "1. Don't post any source code here."]

Last edit: 2013-07-30 00:04:07
2013-07-25 15:07:41 Karan Chauhan
Reminded me of Chemistry and the nth order reactions. Trivial
2013-07-25 10:55:37 Slimshady
there's always has be an answer...i don't get this statement...ofcourse there vl always be an answer....
2013-07-17 06:15:33 Hamim Raavi
AC in 1 go...requires basic math
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.