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:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions