题目
解题思路
“数论”
代码
#include<cstdio>
#include<cmath>
#define file(x) freopen(#x".in","r",stdin);freopen(#x".out","w",stdout)
using namespace std;
int n,a,b; double te1,te2,te,ans;
int main()
{
scanf("%d",&n);
for (int i=1;i<=2*n-1;i++)
for (int j=1;j<=2*n-1;j++)
{
te1=sqrt(n*n-(i/2.0)*(i/2.0))*2;
te2=sqrt(n*n-(j/2.0)*(j/2.0))*2;
te=te1*i+te2*j-i*j;
if (te>ans)
{
ans=te;
a=i; b=j;
}
}
printf("%d\n",a);
printf("%d",b);
}