@[lyxsunday](/user/461676) `n % a == 0` 的时候就不用加一
by cqazy811 @ 2022-08-25 15:21:56
@[bxnya_miana](/user/297675) 这样?
```cpp
if(n%a==0)
{
t=n/a;
}
else
{
t=n/a+1;
}
```
by lyxsunday @ 2022-08-25 15:23:56
@[lyxsunday](/user/461676)
我按你的改了下:
```cpp
#include<iostream>
using namespace std;
int n,a,b,t,ans=100000000;
int main()
{
cin>>n;
for(int i=1;i<=3;i++)
{
cin>>a>>b;
t=n/a;
while(a * t < n){
t++;
}
ans=min(ans,b*t);
}
cout<<ans;
return 0;
}
```
by tbdsh @ 2022-08-25 15:24:25
@[lyxsunday](/user/461676) 1
by cqazy811 @ 2022-08-25 15:25:01
@[tianbiandeshenghuo11](/user/752485) @[bxnya_miana](/user/297675)
感谢大佬,[过了](https://www.luogu.com.cn/record/85080067)。
by lyxsunday @ 2022-08-25 15:26:07