呸,大傻逼题,我更傻逼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;
}

相关文章:

  • 2021-05-22
  • 2021-07-17
  • 2022-02-07
  • 2021-12-23
  • 2021-10-05
  • 2021-05-28
  • 2022-12-23
猜你喜欢
  • 2021-06-16
  • 2022-12-23
  • 2021-12-27
  • 2021-05-19
  • 2022-12-23
  • 2021-05-07
  • 2021-06-03
相关资源
相似解决方案