#include <bits/stdc++.h>
using namespace std;
#define int long long
constexpr int mod = 1e9 + 7;
int32_t main() {
#ifdef JahonaliX
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int h, w, a, b, c, n, x, y, xx, yy;
cin >> h >> w >> a >> b >> c >> n >> x >> y >> xx >> yy;
cout << min({abs(x - xx) * c + abs(y - yy) * c, abs(x - xx) * c + abs(y - yy) * a + b, abs(y - yy) * c + abs(x - xx) * a + b});
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |