The Secret Recipe

All submissions for this problem are available.
### Read problems statements in [Hindi](http://www.codechef.com/download/translated/COOK107/hindi/SECRECP.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/COOK107/mandarin/SECRECP.pdf), [Russian](http://www.codechef.com/download/translated/COOK107/russian/SECRECP.pdf), [Vietnamese](http://www.codechef.com/download/translated/COOK107/vietnamese/SECRECP.pdf), and [Bengali](http://www.codechef.com/download/translated/COOK107/bengali/SECRECP.pdf) as well. $N$ people (numbered $1$ through $N$) are trying to catch Chef because he has a secret recipe for the most delicious biryani ever. Chef does not have a number. The chase starts at time $t = 0$ and takes place on a circular road with length $L$. Positions on the road are described by one realvalued coordinate; for each real number $x$, position $x+L$ is the same as position $x$. Chef's initial position is $X_c = 0$ and for each valid $i$, the initial position of the $i$th person is $X_i$. Chef's *maximum velocity* is $V_c$ and for each valid $i$, the maximum velocity of the $i$th person is $V_i$. At each moment in time, any person (including Chef) with maximum velocity $V$ may choose any velocity $v$ (a real number) between $V$ and $V$ inclusive, possibly different at different moments in time, independently from all other people and this person's velocity at all other moments in time. All people move continuously — for any very small time difference $\Delta t$, a person at a position $x$ and with a velocity $v$ at time $t$ is approximately at the position $x + v \cdot \Delta t$ at time $t+\Delta t$. When Chef is at the same position as one of the $N$ people at the same moment in time, he is considered caught and the chase ends. It can be proved that Chef is unable to keep escaping forever; formally, there is a real number $T_u$ such that Chef can always be caught at a finite time which does not exceed $T_u$, regardless of his choices. The $N$ people want to catch Chef at the smallest possible time, while Chef wants to maximise the time when he will be caught. Find the time at which Chef gets caught if all people act optimally. ### Input  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first line of each test case contains three spaceseparated integers $N$, $L$ and $V_c$.  The second line contains $N$ spaceseparated integers $X_1, X_2, \ldots, X_N$.  The third line contains $N$ spaceseparated integers $V_1, V_2, \ldots, V_N$. ### Output For each test case, print a single line containing one real number — the time when Chef gets caught. Your answer will be considered correct if its absolute or relative error does not exceed $10^{6}$. ### Constraints  $1 \le T \le 1,000$  $2 \le N \le 10^5$  $2 \le L \le 10^6$  $1 \le X_i \le L1$ for each valid $i$  $1 \le V_i \le 10^6$ for each valid $i$  $1 \le V_c \le 10^6$  the sum of $N$ over all test cases does not exceed $10^6$ ### Example Input ``` 1 3 10 2 2 5 6 3 1 1 ``` ### Example Output ``` 1.50000000000 ```Author:  kingofnumbers 
Editorial  https://discuss.codechef.com/problems/SECRECP 
Tags  cook107, kingofnumbers 
Date Added:  18062019 
Time Limit:  2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, 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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions