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
Siu Ching Pong (Asuka Kenji): 2015-03-08 09:59:35

Cost me 2 TLEs for using Python (PyPy), and WAs for printing "Scenario #0" for the first test case!!!

Last edit: 2015-03-08 09:59:56
:.Mohib.:: 2014-12-18 21:27:39

Got AC in first attempt.....;)

ROHIT RAJ: 2014-07-10 10:32:32

AC in first go!! simple kinematics :)

Saniya Najeeb: 2014-06-04 14:33:06

AC in one go!! just kinematics of cl 11

pvkcse: 2014-05-28 13:21:10

my 50th in spoj...at first considered very silly as this was studied in my 11th std but printing scenerio instead of scenario costed me 1 WA...AC...!!!

Krishna Nakkeeran: 2014-03-02 20:02:16

My 100th in spoj.....

Roman: 2013-12-29 21:25:31

plz give more time limit, I can't submit HASKELL
Time limit: 1s
current top 1 HASKEL - 1.53s

Last edit: 2013-12-29 21:32:02
Rudradeep Mukherjee: 2013-07-22 06:49:18

3 WA due the misspelling of "Scenario"! Don't underestimate easy questions ! :)

Vipul Pandey: 2013-07-15 19:22:09

easy. just 11th standard physics.


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