1 #include <cstdio>
2 #include <cstdlib>
3 #include <string>
4 #include <cmath>
5 #include <algorithm>
6 #include <iostream>
7 #include <sstream>
8 using namespace std;
9
10 int main(){
11 #ifndef ONLINE_JUDGE
12 freopen("in.txt","r",stdin);
13 #endif
14 int i, j, p[102];
15 int l, n, c, t;
16 int vr, v1, v2;
17 int len;
18 double dp[102], min, e;
19 while (scanf("%d",&l)!=EOF){
20 scanf("%d %d %d",&n,&c,&t);
21 scanf("%d %d %d",&vr,&v1,&v2);
22 dp[0] = p[0] = 0;
23 for (i = 1; i <= n; i++)
24 scanf("%d",&p[i]);
25 p[i] = l;
26 for (i = 1; i < n+2; i++){
27 min = 0xffffff;
28 for (j = 0; j < i; j++){
29 len = p[i] - p[j];
30 e = len>c ? (1.0*c/v1+(len-c+0.0)/v2) : (1.0*len/v1);
31 e += dp[j];
32 if(j)
33 e+= t;
34 if(min>e)
35 min = e;
36 }
37 dp[i] = min;
38 }
39 if(1.0 * l / vr > dp[n+1])
40 puts("What a pity rabbit!");
41 else
42 puts("Good job,rabbit!");
43 }
44 return 0;
45 }
posted on 2012-05-28 08:55
Leo.W 阅读(220)
评论(0) 编辑 收藏 引用