using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ String[] Ans = new String[M]; Parallel.For(0,M,i=>{ //for(int i=0;i f = x => a * Math.Log(x) + b * Math.Log(Math.Log(x)) - Math.Log(t); Func df = x => a / x + b / x / Math.Log(x); double xx = 1 + 1e-12; if(B[i] == 0){ xx = Math.Pow(t,1.0/a); }else if(A[i] == 0){ xx = Math.Exp(Math.Pow(t,1.0/b)); }else{ for(int j=0;j<20;j++){ var yy = Newton(xx,f,df); if(yy - xx < 1e-12)break; xx = yy; } } //Console.WriteLine("{0},{1},{2},{3},{4}",a,b,t,xx,f(xx)+t); Ans[i] = String.Format("{0:F11}",xx); //} }); Console.WriteLine(String.Join("\n",Ans)); } int M; int[] A,B; double[] T; public Sol(){ M = ri(); A = new int[M]; B = new int[M]; T = new double[M]; for(int i=0;i f, Func df) { // f(x)=0 => ret x-f(x)/df(x); return x - f(x)/df(x); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);} static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.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));} }