Skip to content

Instantly share code, notes, and snippets.

@lapla-cogito
Created October 2, 2018 07:38
Show Gist options
  • Save lapla-cogito/a2001dd332947262373f7740c32ccbc7 to your computer and use it in GitHub Desktop.
Save lapla-cogito/a2001dd332947262373f7740c32ccbc7 to your computer and use it in GitHub Desktop.
AGC019A
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
long long int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
long long ans=min(e*4*a,min(e*2*b,e*c));
cout<<min(e/2*d+e%2*ans/e,ans)<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment