#include <iostream>
#include <algorithm>
#include <memory.h>
#define MAX 9999
using namespace std;
double dp[111];//到每个节点最短时间
void init(int x)
{
for (int i = 0; i < x; i++)
{
dp[i] = MAX;//先把每个dp值写大一点
}
}
int main(void)
{
int L;
while (cin>>L)
{
getchar();
int N,distance[100];
double C,T;
cin>>N>>C>>T;
getchar();
double VR,VT1,VT2;
cin>>VR>>VT1>>VT2;
for (int i = 1; i <= N; i++)
{
cin>>distance[i];
}
init(N+2);
dp[0] = -T;
distance[0] = 0;
distance[N+1] = L;
for (int i = 1; i <= N+1; i++)//不断更新当前i位置最优解
{
for (int j = 0; j < i; j++)//自动分析在i到j之前是否充电
{
if (C>=(distance[j] - distance[i]))//以电量能否通过一段路为标准
{
dp[i] = min(dp[i], T + dp[j] + (distance[i]-distance[j])/ VT1);
}
else
{
dp[i] = min(dp[i], T + dp[j] + C/VT1 + (distance[i] - distance[j] - C)/VT2);
}
}
}
if (dp[N+1] > L/VR)
{
printf("Good job,rabbit!\n");
}
else
{
printf("What a pity rabbit!\n");
}
}
return 0;
}
01-14
1606
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-15
329
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-27