이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<stdio.h>
using namespace std;
typedef long long int lld;
lld absol(lld x){
if(x>0)return x;
return -x;
}
int main(){
int h,w;
cin>>h>>w;
lld a,b,c;
cin>>a>>b>>c;
int n;
cin>>n;
lld x1,y1;
lld x2,y2;
cin>>x1>>y1>>x2>>y2;
lld ans=absol(x1-x2)+absol(y1-y2);
ans*=c;
ans=min(ans,absol(x1-x2)*c+absol(y1-y2)*a+b);
ans=min(ans,absol(x1-x2)*a+b+absol(y1-y2)*c);
cout<<ans<<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... |