#include <iostream>
#include <cmath>
using namespace std;
int main()
{
for (int n = 1; ; n ++ )
{
int cnt = 0;
for (int a = 1; a * a * 2 <= n; a ++ )
{
int b = sqrt(n - a * a);//由a求b
if (a * a + b * b == n) cnt ++ ;
}
if (cnt >= 12)
{
cout << n << endl;
break;
}
}
return 0;
}
#include <iostream>
using namespace std;
const int N = 1e8 + 10;
int n[N];
int main()
{
int res = 1e9;
for (int a = 1; a <= 1000; a ++ )
for (int b = a; b <= 1000; b ++ )
{
int t = a * a + b * b;
n[t] ++ ;
if (n[t] >= 12)
res = min(res, t);
}
cout << res << endl;
return 0;
}