一只蒟蒻的第亿篇题解
这题太水了!
首先我们可以发现因为有了其中一边是
注意事项
要开 long long
我的 AC 代码
#include<bits/stdc++.h>
using namespace std;
inline long long read()
{
long long s=0;
char ch=getchar();
while(ch<'0'||ch>'9') ch=getchar();
while(ch>='0'&&ch<='9') {
s=(s<<3)+(s<<1)+(ch^48);
ch=getchar();
}
return s;
}
inline void write(long long x)
{
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
putchar(x%10+'0');
}
long long h,w,ans=1;
int main()
{
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
h=read();
w=read();
while(ans<<1 <= min(h,w)) ans<<=1;
if(min(h, (long long)(ans*1.25))>=min(w, (long long)(ans*1.25))) {
write(min(h, (long long) (ans*1.25)));
putchar(' ');
write(ans);
} else {
write(ans);
putchar(' ');
write(min(w, (long long) (ans*1.25)));
}
return 0;
}