{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eCountry Z locates in the east of Continent Y. It faces the largest ocean while the highest plateau lies at its back.\r\n\u003c/p\u003e\u003cp\u003eThe summer vacation is coming. One day, a crazy idea occurs to little L that he is willing to go to the highest place for sightseeing. With a limited budget, little L will set out from PKU by bike and therefore he has to be well prepared for the route.\u003c/p\u003e\u003cp\u003eAs we known, the high altitude reaction affects the travel speed a lot. For simplicity, we assume that Country Z can be divided into N blocks with N+1 vertical lines x\u003dX[0],x\u003dX[1],...,x\u003dX[N]. At any point on the line x\u003dXi, the travel speed of little L v equals to V[i], and it linearly increases/decreases with the value of x-coordinate within a particular block. More specifically, if little L is at the point (x,y) in the block between line x\u003dX[i] and line x\u003dX[i+1], his travel speed is v \u003d V[i] + (V[i+1]-V[i]) * (x-X[i]) / (X[i+1]-X[i]).\u003c/p\u003e\u003cp style\u003d\"margin: 0px; text-indent: 0px; -qt-block-indent: 0;\"\u003e\u003c/p\u003e\u003cp style\u003d\"margin: 0px; text-indent: 0px; -qt-block-indent: 0;\"\u003eCould you tell little L how long it will take at least to travel from the starting point (x0,y0) to the terminal point (xN,yN)?\u003c/p\u003e\u003cp\u003e\u003cbr\u003e\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer T (1 \u0026lt;\u003d T \u0026lt;\u003d 10), indicating the number of test cases.\u003cbr\u003e\t\t\t\u003cbr\u003e\t\t\tFor each test case:\u003cbr\u003e\t\t\t\u003cbr\u003e\t\t\tThe first line contains an integer N (1 \u0026lt;\u003d N \u0026lt;\u003d 100), indicating the number of blocks;\u003cbr\u003e\t\t\t\u003cbr\u003e\t\t\tThe second line contains N+1 real numbers X[0],X[1],...,X[N] (0 \u0026lt;\u003d X[0] \u0026lt; X[1] \u0026lt; ... \u0026lt; X[N] \u0026lt;\u003d 4,000,000);\u003cbr\u003e\t\t\t\u003cbr\u003e\t\t\tThe third line contains N+1 real numbers V[0],V[1],...,V[N] (1 \u0026lt;\u003d V[i] \u0026lt;\u003d 20,000, and 1/3 \u0026lt;\u003d V[i]/V[i+1] \u0026lt;\u003d 3).\u003cbr\u003e\t\t\t\u003cbr\u003e\t\t\tThe forth line contains four real numbers x0, y0, xN, and yN, indicating the starting point is (x0,y0) and the terminal point is (xN,yN) (0 \u0026lt;\u003d y0,yN \u0026lt;\u003d 4,000,000, x0\u003dX[0], xN\u003dX[N])."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one real number on a single line, indicating the time cost for travel. The absolute error between your output and the standard answer should be less than 0.001."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1\r\n0 1\r\n1 1\r\n0 0 1 1\r\n1\r\n0 1\r\n1 2\r\n0 0 1 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1.414\r\n0.962\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}