首页 > 其他 > 详细

cf965c Greedy Arkady

时间:2018-05-01 21:55:00      阅读:164      评论:0      收藏:0      [点我收藏+]

呸,大傻逼题,我更傻逼ref

#include <iostream>
using namespace std;
typedef long long ll;
ll n, k, m, d, ans;
int main(){
    cin>>n>>k>>m>>d;
    for(int i=1; i<=d; i++){
        ll x=n/(k*(i-1)+1);
        if(x==0)    break;
        x = min(x, m);
        ll tms=n/x;
        if(tms<(i-1)*k+1)   continue;
        ans = max(ans, i*x);
    }
    cout<<ans<<endl;
    return 0;
}

cf965c Greedy Arkady

原文:https://www.cnblogs.com/poorpool/p/8977161.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!