이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	int H, W, A, B, C, N;
	cin >> H>> W>> A>> B>> C>> N;
	vector<int> px(N), py(N);
	for(int i = 0; i < N; i ++){
		cin >> px[i] >> py[i];
	}
	if(N == 2){
		int dx = labs(px[0]-px[1]), dy = labs(py[0]-py[1]);
		int a = (dx + dy) * C;
		int b = min({dx * A + B + dy * C, dy * A + B + dx * C, a});
		cout << b << endl;
	}
	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... |