题目描述
样例
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n;
scanf("%d",&n);
int up1=sqrt(n/4);
for(int i=0;i<=up1;i++){
int up2=sqrt((n-i*i)/3);
for(int j=i;j<=up2;j++){
int up3=sqrt((n-i*i-j*j)/2);
for(int k=j;k<=up3;k++){
int down=n-i*i-j*j-k*k;
int x=sqrt(down);
if(x*x==down){
printf("%d %d %d %d",i,j,k,x);
return 0;
}
}
}
}
return 0;
}