rt,自己造的数据也没问题,但是全WA。。。
#include<bits/stdc++.h>
using namespace std ;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a,b,n,m=0,p=1;
cin>>a>>b>>n;
for(int i=0;i<b;i++){
m=2*b;}
if(b*n<=a){
cout<<b*n<<"\n";
return 0;}
else{
if(a%b==0){
cout<<m<<"\n";
return 0;}
else{
while(p){
if(a%b==0) p=0;
else a--;}
if(a%b==0){
cout<<m<<"\n";
return 0;}}}
return 0;
}
谢谢你大佬~!