import java.util.Scanner;
import java.lang.Math.*;
public class Q11428 {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
while(true){
double N = cin.nextDouble();
boolean flag = false;
int tmpx=99999, tmpy=99999;
if(N==0)
break;
double base = (double) 1/3;
for(int x = (int)Math.ceil(Math.pow(N,base)); x <= Math.sqrt(N) ; x++){
if (((int)(((Math.pow((Math.pow(x,3)-N),base)+1e-7)*100000)%100000)==0)&&(Math.pow((Math.pow(x,3)-N),base)!=0)){
flag = true;
if((int)(Math.pow((Math.pow(x,3)-N),base)+1e-7)< tmpy){
tmpx = x;
tmpy = (int)(Math.pow((Math.pow(x,3)-N),base)+1e-7);
}
}
}
if(flag==false){
System.out.println("No solution");
}else{
System.out.println(tmpx+" "+tmpy);
}
}
}
}
2009年6月25日 星期四
ACM Q11428
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言