A. Elevator or Stairs?

签.

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 
 4 int x, y, z, t[3];
 5 
 6 int main()
 7 {
 8     while (scanf("%d%d%d", &x, &y, &z) != EOF)
 9     {
10         for (int i = 0; i < 3; ++i) scanf("%d", t + i);
11         int a = (abs(z - x) + abs(x - y)) * t[1] + 3 * t[2];
12         int b = abs(x - y) * t[0];
13         puts(a <= b ? "YES" : "NO");
14     }
15     return 0;
16 }
View Code

相关文章: