RPLH - Hard Launching

no tags 

Felix, the cat, decided to play in the afternoon with some melons, he built a “melon launcher” and started pointing to targets. Soon he noticed that the melons sometimes overflies the victims or don't even get close to them.

The melon launcher can be rotated so it can shoot from an angle from 0 to 45 degrees.

Felix isn't good at maths, so he ask you to code a program that, given the target (in meters) distance and the speed (in meters / sec) you can give him the perfect angle for the melon launcher.

The gravity to be considered is of 9.806 meters / sec^2

PI value to be considered is 2*acos(0.0).

Input

The first line of input will contain an integer T denoting the T test cases, then, T cases will follow. Each of the following line will contain two integer numbers Ta and Sp, denoting the distance of the target and the speed of the melon respectively.

Output

Output the string “Scenario #i: “ where i is the test case you are analyzing followed by a single number D, denoting the Degrees necessary to do the launch, if the launching can't be done, output D as -1. the number must have a precision of 2 decimal digits.

Example

Input:
3
10 10
10 9
8 9

Output:
Scenario #1: 39.35
Scenario #2: -1
Scenario #3: 37.79

Constraints

0 < Ta, Sp < 10000


hide comments
ওয়াসী (Wasi): 2013-04-05 13:07:30

Nice Problem.
AC at 1st submission!

:-): 2013-04-04 10:25:00

very easy problem

strings: 2013-01-17 18:47:30

easy, just basic dynamics and rest is all explained !!

SAHIL SAREEN: 2013-01-15 12:07:32

got 2 WA for spelling error ! :P
@NOODLES: i think ur doing the same !

Himanshu: 2013-01-14 09:28:32

very very simple problem....
move to tutorial.... :H

Titas Skrebė: 2012-12-12 15:27:25

i dont understand one point. if a speed is great like 900 then if you change an angle the distance changes a lot. for instance when angle is 30,06 distance is 200 and when an angle is 30,07 distance is 203. and a given distance is 201. so the question: what the hell should i do then?? print -1 or what?

Last edit: 2012-12-12 15:28:39
eliminator: 2012-10-23 03:45:00

dont take any assumption ... :)
use range of sine

Last edit: 2012-10-23 03:45:19
Tao Qian: 2012-10-16 21:52:41

For java, remember to use bufferedreader/writer

Last edit: 2012-10-28 13:06:51
omar alkattan: 2012-07-05 16:12:12

yes ! AC ..
tack care angle <= 45

Last edit: 2012-07-08 18:20:59
Shubham Somani: 2012-06-25 01:34:09

NaN stands for not a number


Added by:david_8k
Date:2012-05-05
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own Problem used for the RPL contest