import java.util.*; public class c2 { public static Scanner in=new Scanner(System.in).useLocale(Locale.US); public class Result { long a,b,val; public Result(long a,long b,long val) { this.a=a; this.b=b; this.val=val; } public boolean better(Result r) { if(this.val!=r.val) return this.val "+fromh+".."+toh+" ["+tmp(x,fromh)+" / "+tmp(x,toh)+" "+ret.val+"]"); for(long h=fromh;h<=toh;h=Math.max(h+1,fromh)) { Result cur=calc(x,h); if(cur.better(ret)) { ret=cur; a=40; b=8+440*x-ret.val; c=88*x; d=Math.sqrt(b*b-4*a*c); fromh=Math.max(1,(long)Math.floor((-b-d)/(2*a))); toh=(long)Math.ceil((-b+d)/(2*a)); // System.out.println(h+","+((x+h-1)/h)+" => "+fromh+".."+toh+" ["+tmp(x,fromh)+" / "+tmp(x,toh)+" "+ret+"]"); } } System.out.println(ret); } public static void main(String[] args) { int n=in.nextInt(); for(int i=0;i