Chef and Three Dogs

All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
Chef has three dogs sitting at the vertices of an equilateral triangle. The length of each side of the triangle equals to s meters. Chef gives the command "Start!" and each dog starts to run with constant speed v meters per second. At each moment, each dog is running towards the dog just right to him (in counterclockwise direction). Therefore, their trajectories are forming some spirals that converging to one point as illustrated below.
How long does it takes dogs to meet each other after the command "Start!"?
Input
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
The only line of each test case contains two spaceseparated integers s and v.
Output
For each test case, output a single line containing a real number corresponding to the answer of the problem. The answer will be considered correct if its absolute or relative error does not exceed 10^{6}.
Constraints
 1 ≤ T ≤ 10
 1 ≤ s, v ≤ 10^{9}
Subtasks
 Subtask #1 (40 points): 1 ≤ s, v ≤ 10
 Subtask #2 (60 points): original constraints
Example
Input: 2 2 5 1 1000000000 Output: 0.266667 0.0000001
Explanation
Due to the triangle being very small, but the dogs running extremely fast, they will meet after less than 1e6 seconds. Thus, due to remark about absolute or relative error in the output section, any answer within [0, 1e6] will be considered correct.
Author:  antoniuk1 
Tester:  alex_2oo8 
Editorial  http://discuss.codechef.com/problems/CHDOGS 
Tags  antoniuk1, oct16, simple, symmetry, trigonometry 
Date Added:  12022016 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 