using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ // (x+1)(y+1)(z+1) == N のもとで、 x+y+zのMax/Min を求める long min = (long)1e12; long max = 0; for(long x=0;x<5000;x++){ for(long y=x;y<5000;y++){ if(N%(x+1) == 0 && (N/(x+1))%(y+1) == 0){ long z = N/(x+1)/(y+1)-1; if(zint.Parse(e));} static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));} static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));} }