{"problem":{"name":"B. Running Student","description":{"content":"And again a misfortune fell on Poor Student. He is being late for an exam. Having rushed to a bus stop that is in point (0, 0), he got on a minibus and they drove along a straight line, parallel to a","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF9B"},"statements":[{"statement_type":"Markdown","content":"And again a misfortune fell on Poor Student. He is being late for an exam.\n\nHaving rushed to a bus stop that is in point (0, 0), he got on a minibus and they drove along a straight line, parallel to axis _OX_, in the direction of increasing _x_.\n\nPoor Student knows the following:\n\n*   during one run the minibus makes _n_ stops, the _i_\\-th stop is in point (_x__i_, 0)\n*   coordinates of all the stops are different\n*   the minibus drives at a constant speed, equal to _v__b_\n*   it can be assumed the passengers get on and off the minibus at a bus stop momentarily\n*   Student can get off the minibus only at a bus stop\n*   Student will have to get off the minibus at a terminal stop, if he does not get off earlier\n*   the University, where the exam will be held, is in point (_x__u_, _y__u_)\n*   Student can run from a bus stop to the University at a constant speed _v__s_ as long as needed\n*   a distance between two points can be calculated according to the following formula:\n*   Student is already on the minibus, so, he cannot get off at the first bus stop\n\nPoor Student wants to get to the University as soon as possible. Help him to choose the bus stop, where he should get off. If such bus stops are multiple, choose the bus stop closest to the University.\n\n## Input\n\nThe first line contains three integer numbers: 2 ≤ _n_ ≤ 100, 1 ≤ _v__b_, _v__s_ ≤ 1000. The second line contains _n_ non-negative integers in ascending order: coordinates _x__i_ of the bus stop with index _i_. It is guaranteed that _x_1 equals to zero, and _x__n_ ≤ 105. The third line contains the coordinates of the University, integers _x__u_ and _y__u_, not exceeding 105 in absolute value.\n\n## Output\n\nIn the only line output the answer to the problem — index of the optimum bus stop.\n\n[samples]\n\n## Note\n\nAs you know, students are a special sort of people, and minibuses usually do not hurry. That's why you should not be surprised, if Student's speed is higher than the speed of the minibus.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"又一次不幸降临在可怜的学生身上。他考试要迟到了。\n\n他冲到位于点 #cf_span[(0, 0)] 的公交站，上了一辆小巴，小巴沿着一条与 #cf_span[OX] 轴平行的直线，朝 #cf_span[x] 增加的方向行驶。\n\n可怜的学生知道以下信息：\n\n学生希望尽快到达大学。请帮他选择应在哪个公交站下车。如果有多个这样的公交站，请选择离大学最近的那个。\n\n第一行包含三个整数：#cf_span[2 ≤ n ≤ 100]，#cf_span[1 ≤ vb, vs ≤ 1000]。第二行包含 #cf_span[n] 个按升序排列的非负整数：索引为 #cf_span[i] 的公交站的坐标 #cf_span[xi]。保证 #cf_span[x1] 等于零，且 #cf_span[xn ≤ 105]。第三行包含大学的坐标，两个整数 #cf_span[xu] 和 #cf_span[yu]，其绝对值不超过 #cf_span[105]。\n\n仅在一行中输出问题的答案——最优公交站的索引。\n\n正如你所知，学生是一种特殊的人群，而小巴通常不会着急。因此，如果学生的速度比小巴还快，你也不必感到惊讶。\n\n## Input\n\n第一行包含三个整数：#cf_span[2 ≤ n ≤ 100]，#cf_span[1 ≤ vb, vs ≤ 1000]。第二行包含 #cf_span[n] 个按升序排列的非负整数：索引为 #cf_span[i] 的公交站的坐标 #cf_span[xi]。保证 #cf_span[x1] 等于零，且 #cf_span[xn ≤ 105]。第三行包含大学的坐标，两个整数 #cf_span[xu] 和 #cf_span[yu]，其绝对值不超过 #cf_span[105]。\n\n## Output\n\n仅在一行中输出问题的答案——最优公交站的索引。\n\n[samples]\n\n## Note\n\n正如你所知，学生是一种特殊的人群，而小巴通常不会着急。因此，如果学生的速度比小巴还快，你也不必感到惊讶。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Parameters**\n*   $n \\in \\mathbb{Z}$ such that $2 \\le n \\le 100$.\n*   $v_b, v_s \\in \\mathbb{Z}$ such that $1 \\le v_b, v_s \\le 1000$.\n*   $X = \\{x_1, x_2, \\dots, x_n\\} \\subset \\mathbb{Z}_{\\ge 0}$ where $x_1 = 0$ and $x_i < x_{i+1}$ for $1 \\le i < n$.\n*   $(x_u, y_u) \\in \\mathbb{Z}^2$ where $|x_u|, |y_u| \\le 10^5$.\n\n**Definitions**\nFor each bus stop index $i \\in \\{1, \\dots, n\\}$:\n1.  **Euclidean distance** from stop $i$ to the University:\n    $$D(i) = \\sqrt{(x_i - x_u)^2 + y_u^2}$$\n2.  **Total travel time**:\n    $$T(i) = \\frac{x_i}{v_b} + \\frac{D(i)}{v_s}$$\n\n**Objective**\nFind the index $k \\in \\{1, \\dots, n\\}$ that minimizes the tuple $(T(k), D(k))$ lexicographically:\n$$k = \\arg\\min_{i \\in \\{1, \\dots, n\\}} \\left( T(i), D(i) \\right)$$\n\n**Output**\nOutput the integer $k$.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF9B","tags":["brute force","geometry","implementation"],"sample_group":[["4 5 2\n0 2 4 6\n4 1","3"],["2 1 1\n0 100000\n100000 100000","2"]],"created_at":"2026-03-03 11:00:39"}}