이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll h, w, a, b, c, n;
pll arr[101010];
int main() {
cin >> h >> w >> a >> b >> c >> n;
for (int i=0; i<n; i++) {
cin >> arr[i].va >> arr[i].vb;
}
ll x = abs(arr[0].va-arr[1].va);
ll y = abs(arr[0].vb-arr[1].vb);
cout << min({c*(x+y), a*x+b+c*y, c*x+a*y+b});
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |