Submission #255216

#TimeUsernameProblemLanguageResultExecution timeMemory
255216a_playerRoses (BOI20_roses)C++14
0 / 100
1 ms256 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll A,B,C,D,N; cin>>N>>A>>B>>C>>D; if(B*D>A*C){ swap(A,C); swap(B,D); } ll q=N/A; ll sol=q*B; ll p=(N%A)/C; if(p*C<N%A)p++; if(p*D<B)sol+=p*D; else sol+=B; cout<<sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...