1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #include
23 #include
24 using namespace std;
25 const int N=110;
26 double p[N];
27 int n;
28 double len,c,t;
29 double vr,vt1,vt2;
30 double Time[N];
31 double Cap[N];
32 void Init()
33 {
34 scanf("%d %lf %lf",&n,&c,&t);
35 scanf("%lf %lf %lf",&vr,&vt1,&vt2);
36 p[0]=0;
37 for(int i=1;i<=n;i++)
38 scanf("%lf",&p[i]);
39 n++;
40 p[n]=len;
41 n++;
42 }
43
44
45
46
47 void Go(int x,int y,double &tt,double &tc)
48 {
49 double t1=Time[x];
50 double t2=Time[x];
51 double c1=Cap[x];
52 double c2=Cap[x];
53 double len=p[y]-p[x];
54
55 if(len<=c1)
56 {
57 t1+=len/vt1;
58 c1-=len;
59 }
60 else
61 {
62 t1+=c1/vt1;
63 len-=c1;
64 t1+=len/vt2;
65 c1=0;
66 }
67
68
69 t2+=t;
70 c2=c;
71 len=p[y]-p[x];
72 if(len<=c2)
73 {
74 t2+=len/vt1;
75 c2-=len;
76 }
77 else
78 {
79 t2+=c2/vt1;
80 len-=c2;
81 c2=0;
82 t2+=len/vt2;
83 }
84 if(t1<t2||t1==t2&&c1>c2)
85 {
86 tt=t1;
87 tc=c1;
88 }
89 else
90 {
91 tt=t2;
92 tc=c2;
93 }
94 }
95
96 void DP()
97 {
98 memset(Time,0,sizeof(Time));
99 memset(Cap,0,sizeof(Cap));
100 Time[0]=0;
101 Cap[0]=c;
102 double Min,Maxc;
103 double tt,tc;
104 for(int i=1;i<n;i++)
105 {
106 Min=INT_MAX;
107 Maxc=INT_MIN;
108 for(int j=0;j<i;j++)
109 {
110 Go(j,i,tt,tc);
111 if(tt<Min||tt==Min&&tc>Maxc)
112 {
113 Min=tt;
114 Maxc=tc;
115 }
116 }
117 Time[i]=Min;
118 Cap[i]=Maxc;
119 }
120 double t1=len/vr;
121 if(t1<Time[n-1])
122 printf("Good job,rabbit!\n");
123 else
124 printf("What a pity rabbit!\n");
125 }
126
127 int main()
128 {
129 while(scanf("%lf",&len)!=EOF)
130 {
131 Init();
132 DP();
133 }
134 }