#include <bits/stdc++.h>
using namespace std;
int n,d,s,a,b,c,e;
int main(){
cin>>n;
cin>>d;
if(n>d){
s=n/d;
a=d*s;
b=d*(s+1);
c=n-a;
e=b-n;
if(c<e){
cout<<a;
}else if(e<c){
cout<<b;
return 0;
}else{
cout<<a<<endl;
cout<<b;
return 0;
}
}else{
s=d/n;
a=d/(s+1);
b=d/s;
c=n-a;
e=b-n;
if(c<e){
cout<<a;
}else if(e<c){
cout<<b;
return 0;
}else{
cout<<a<<endl;
cout<<b;
return 0;
}
}
}
#712. 有趣的问题
最新推荐文章于 2024-10-16 19:08:56 发布