CF175E.Power Defence
省选/NOI-
通过率:0%
时间限制:3.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Vasya plays the Power Defence.
He must pass the last level of the game. In order to do this he must kill the Main Villain, who moves in a straight line at speed 1 meter per second from the point ( - ∞, 0) to the point ( + ∞, 0) of the game world. In the points (x, 1) and (x, - 1), where x is an integer number, Vasya can build towers of three types: fire-tower, electric-tower or freezing-tower. However, it is not allowed to build two towers at the same point. Towers of each type have a certain action radius and the value of damage per second (except freezing-tower). If at some point the Main Villain is in the range of action of k freezing towers then his speed is decreased by k + 1 times.
The allowed number of towers of each type is known. It is necessary to determine the maximum possible damage we can inflict on the Main Villain.
All distances in the problem are given in meters. The size of the Main Villain and the towers are so small, that they can be considered as points on the plane. The Main Villain is in the action radius of a tower if the distance between him and tower is less than or equal to the action radius of the tower.
瓦西娅正在玩《能量防御》游戏。
他必须通过游戏的最后一关。为此,他必须消灭主线反派。该反派以每秒 1 米的速度沿直线从游戏世界中的点 ( − ∞,0) 移动至点 ( +∞,0)。瓦西娅可在所有形如 (x,1) 和 (x,−1) 的点处(其中 x 为整数)建造三种类型的塔:火焰塔、电击塔或冰冻塔。但不允许在同一点建造两座塔。每种塔均具有特定的作用半径及每秒伤害值(冰冻塔除外,它不造成直接伤害)。若在某一时刻,主线反派处于 k 座冰冻塔的作用范围内,则其移动速度将降低为原来的 k+11 倍。
每种塔的可用数量均已知。需要确定我们能对主线反派造成的最大总伤害。
本题中所有距离单位均为米。主线反派与各塔的尺寸极小,可视为平面上的点。当主线反派与某塔之间的距离小于或等于该塔的作用半径时,即认为其处于该塔的作用范围内。
输入格式
The first line contains three integer numbers nf, ne and ns — the maximum number of fire-towers, electric-towers and freezing-towers that can be built (0 ≤ nf, ne, ns ≤ 20, 1 ≤ nf + ne + ns ≤ 20). The numbers are separated with single spaces.
The second line contains three integer numbers rf, re and rs (1 ≤ rf, re, rs ≤ 1000) — the action radii of fire-towers, electric-towers and freezing-towers. The numbers are separated with single spaces.
The third line contains two integer numbers df and de (1 ≤ df, de ≤ 1000) — the damage a fire-tower and an electronic-tower can inflict on the Main Villain per second (in the case when the Main Villain is in the action radius of the tower). The numbers are separated with single space.
第一行包含三个整数 nf、ne 和 ns —— 分别表示最多可建造的火焰塔、电击塔和冰冻塔的数量(满足 0≤nf,ne,ns≤20,且 1≤nf+ne+ns≤20)。这三个数以单个空格分隔。
第二行包含三个整数 rf、re 和 rs(1≤rf,re,rs≤1000)—— 分别表示火焰塔、电击塔和冰冻塔的作用半径。这三个数以单个空格分隔。
第三行包含两个整数 df 和 de(1≤df,de≤1000)—— 分别表示当主反派位于对应塔的作用半径内时,火焰塔与电击塔每秒对其造成的伤害值。这两个数以单个空格分隔。
输出格式
Print the only real number — the maximum possible damage to the Main Villain with absolute or relative error not more than 10 - 6.
输出唯一的实数——对最终反派所能造成的最大伤害值,其绝对或相对误差不超过 10−6。
输入输出样例
输入#1
1 0 0 10 10 10 100 100
输出#1
1989.97487421
输入#2
1 0 1 10 10 10 100 100
输出#2
3979.94974843
说明/提示
In the first sample we've got one fire-tower that always inflicts the same damage, independently of its position.
In the second sample we've got another freezing-tower of the same action radius. If we build the two towers opposite each other, then the Main Villain's speed will be two times lower, whenever he enters the fire-tower's action radius. That means that the enemy will be inflicted with twice more damage.
在第一个样例中,我们有一座火焰塔,其造成的伤害恒定,与其位置无关。
在第二个样例中,我们有另一座冻结塔,其作用半径与前者相同。若将这两座塔相对建造,则当主要反派进入火焰塔的作用半径时,其移动速度将降低为原来的二分之一。这意味着敌人将受到两倍的伤害。
输入解题思路,AI测评打分。不知道怎么写?