#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using ll = long long;
#define pb push_back
#define F first
#define S second
#define vii vector<int>
#define vl vector<long long>
#define cinv(v) for (auto &it : v) cin >> it;
#define coutv(v) for (auto &it : v) cout << it << " "; cout << endl;
using namespace std;
//using namespace __gnu_pbds;
//template<class T> using ordset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
void solve()
{
int s,n;
cin>>s>>n;
int v,w,k;
cin>>v>>w>>k;
int neww = 0;
int ans = 0;
while(neww+w<=s&&k>0)
{
ans+=v;
k-=1;
neww+=w;
}
cout<<ans<<'\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
//int t;cin>>t;while(t--)
solve();
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |