CF215B.Olympic Medal

普及-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The World Programming Olympics Medal is a metal disk, consisting of two parts: the first part is a ring with outer radius of _r_1 cm, inner radius of _r_2 cm, (0 < _r_2 < _r_1) made of metal with density _p_1 g/cm3. The second part is an inner disk with radius _r_2 cm, it is made of metal with density _p_2 g/cm3. The disk is nested inside the ring.

The Olympic jury decided that _r_1 will take one of possible values of _x_1, _x_2, ..., x__n. It is up to jury to decide which particular value _r_1 will take. Similarly, the Olympic jury decided that _p_1 will take one of possible value of _y_1, _y_2, ..., y__m, and _p_2 will take a value from list _z_1, _z_2, ..., z__k.

According to most ancient traditions the ratio between the outer ring mass m__out and the inner disk mass m__in must equal , where A, B are constants taken from ancient books. Now, to start making medals, the jury needs to take values for _r_1, _p_1, _p_2 and calculate the suitable value of _r_2.

The jury wants to choose the value that would maximize radius _r_2. Help the jury find the sought value of _r_2. Value _r_2 doesn't have to be an integer.

Medal has a uniform thickness throughout the area, the thickness of the inner disk is the same as the thickness of the outer ring.

世界编程奥林匹克奖牌是一块金属圆盘,由两部分组成:第一部分是一个环形,外半径为 r1r_1 厘米,内半径为 r2r_2 厘米(其中 0<r2<r10 < r_2 < r_1),由密度为 p1 g/cm3p_1\ \text{g/cm}^3 的金属制成;第二部分是一个内圆盘,半径为 r2r_2 厘米,由密度为 p2 g/cm3p_2\ \text{g/cm}^3 的金属制成。该内圆盘嵌套于环形内部。

奥林匹克评审团决定:r1r_1 将从可能的取值 x1, x2, …, xnx_1,\,x_2,\,\dots,\,x_n 中选取一个值,具体选哪一个由评审团决定;类似地,p1p_1 将从可能的取值 y1, y2, …, ymy_1,\,y_2,\,\dots,\,y_m 中选取一个值,而 p2p_2 将从列表 z1, z2, …, zkz_1,\,z_2,\,\dots,\,z_k 中选取一个值。

根据最古老的传承,外环质量 moutm_{\text{out}} 与内圆盘质量 minm_{\text{in}} 的比值必须等于 ,其中 A, BA,\,B 是取自古籍的常数。现在,为了开始制作奖牌,评审团需选定 r1, p1, p2r_1,\,p_1,\,p_2 的值,并计算出满足条件的 r2r_2 值。

评审团希望选择能使半径 r2r_2 最大的取值方案。请帮助评审团找出所求的 r2r_2 值。注意:r2r_2 不必为整数。

奖牌在整个区域上具有均匀厚度,且内圆盘的厚度与外环的厚度相同。

输入格式

The first input line contains an integer n and a sequence of integers _x_1, _x_2, ..., x__n. The second input line contains an integer m and a sequence of integers _y_1, _y_2, ..., y__m. The third input line contains an integer k and a sequence of integers _z_1, _z_2, ..., z__k. The last line contains two integers A and B.

All numbers given in the input are positive and do not exceed 5000. Each of the three sequences contains distinct numbers. The numbers in the lines are separated by spaces.

第一行输入包含一个整数 nn 和一个整数序列 x1, x2, …, xnx_1,\,x_2,\,\dots,\,x_n。
第二行输入包含一个整数 mm 和一个整数序列 y1, y2, …, ymy_1,\,y_2,\,\dots,\,y_m。
第三行输入包含一个整数 kk 和一个整数序列 z1, z2, …, zkz_1,\,z_2,\,\dots,\,z_k。
最后一行包含两个整数 AA 和 BB。

输入中给出的所有数字均为正整数,且不超过 50005000。三个序列中的每个序列均包含互不相同的数字。每行中的数字以空格分隔。

输出格式

Print a single real number — the sought value _r_2 with absolute or relative error of at most 10 - 6. It is guaranteed that the solution that meets the problem requirements exists.

输出一个实数——所求的值 r2r_2,其绝对误差或相对误差不超过 10−610^{-6}。题目保证存在满足要求的解。

输入输出样例

  • 输入#1

    3 1 2 3
    1 2
    3 3 2 1
    1 2

    输出#1

    2.683281573000
  • 输入#2

    4 2 3 6 4
    2 1 2
    3 10 6 8
    2 1

    输出#2

    2.267786838055

说明/提示

In the first sample the jury should choose the following values: _r_1 = 3, _p_1 = 2, _p_2 = 1.

在第一个样例中,裁判应选择以下值:r1=3r_1 = 3,p1=2p_1 = 2,p2=1p_2 = 1。

输入解题思路,AI测评打分。不知道怎么写?

首页