func_code_string: #include <bits/stdc++.h>   using namespace std;   const int Iinf = 1e9;   const long long LLinf = 1e18;   const double eps = 1e-6;   const long long mod = 1e9 + 7;   int32_t main() {     ios_base::sync_with_stdio(0);     cin.tie();     cout.tie();     int s, x1, x2;     cin >> s >> x1 >> x2;     int t1, t2;     cin >> t1 >> t2;     int p, d;     cin >> p >> d;     if (d > 0) {       if (x1 > x2) {         cout << min(t1 * (s * 2 - p - x1 + abs(x1 - x2)), t2 * abs(x1 - x2));       } else if (p > x2) {         cout << min(t1 * (s * 2 - p + x1 + abs(x1 - x2)), t2 * abs(x1 - x2));       } else if (p <= x1) {         cout << min(t1 * (x1 - p + abs(x1 - x2)), t2 * abs(x1 - x2));       } else if (p > x1) {         cout << min(t1 * (s * 2 - p + x1 + abs(x1 - x2)), t2 * abs(x1 - x2));       }     } else {       if (x1 > x2) {         if (p >= x1) {           cout << min(t1 * (p - x1 + abs(x1 - x2)), t2 * (x1 - x2));         } else {           cout << min(t1 * (p + s + s - x1 + abs(x1 - x2)), t2 * abs(x1 - x2));         }       } else {         cout << min(t1 * (p + x1 + abs(x1 - x2)), t2 * abs(x1 - x2));       }     }     return 0;   }   