This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
#define int long long
using namespace std;
const int mod = 1000000007;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int n,s;
cin>>n>>s;
int sum=0;
int vec=0;
int a,b,c;
cin>>a>>b>>c;
int o=0;
while(vec+a<=s){
vec+=a;
sum+=b;
o++;
if(o==c){
break;
}
}
cout<<sum;
return 0;
// int t;
// cin>>t;
// while(t--){
// int n, m; cin >> n >> m;
//// f.resize(n + 1), inv.resize(n + 1);
////
//// f[0] = inv[0] = 1;
//// for(int i=1;i<=n;i++){
//// f[i] = f[i - 1] * 1ll * i % mod;
////
//// inv[i] = binary_power(f[i], mod - 2, mod);
//// }
//
// cout<<bin(n,m)<<"\n";
//}
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... |