Submission #1157951

#TimeUsernameProblemLanguageResultExecution timeMemory
1157951dnnndaSoccer (JOI17_soccer)C++20
0 / 100
0 ms324 KiB
#include<bits/stdc++.h>
using namespace std;
#define S second
#define F first
#define ll long long
//#define int long long
//#pragma GCC optimize("Ofast, unroll-loop")
//#pragma GCC target("avx,avx2")
#pragma GCC optimize("O3")
const int inf=0x3f3f3f3f;
const ll inff=0x3f3f3f3f3f3f3f3f;
//const int X=1000000007;
const int X=998244353;

int x[5], y[5];

signed main(){
    ios::sync_with_stdio(0), cin.tie(0);
    int h, w; cin >> h >> w;
    int a, b, c; cin >> a >> b >> c;
    int n; cin >> n;
    for(int i=1 ; i<=n ; i++) cin >> x[i] >> y[i];
    int dx=x[2]-x[1], dy=y[2]-y[1];
    ll ans=min({1LL*a*dx+b+1LL*c*dy,1LL*a*dy+b+1LL*c*dx,1LL*(dx+dy)*c});
    cout << ans << '\n';

    return 0;
}

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...