Equation AgainTime
limit:1000MS
Memory Limit:32768KB
64bit IO Format:%i64d &%i64 U SubmitStatus
Description
This problem's author is too lazy-to-write the problem description, so he only give you a equation like x (ey) = = (ey) x, And the value of Y, your task is calculate the value of X.
Note:here e is the Natural logarithm.
Input
Each line would contain one number Y (y >= 1). Process to end of file.
Output
For each case, output X on one line, accurate to five decimal places, if there is many answers, output them in increasing Order, if there is no answer, just output "Happy to women ' s day!".
Sample Input
1
Sample Output
2.71828
1#include <stdio.h>2#include <math.h>3 4 Const Doubleinf=0x3f3f3f3f;5 Const Doubles=1e-9;6 Const DoubleE=exp (1);7 Doubley,y;8 9 BOOLCDoublex)Ten { One if(log (x)///) < (log (e*y)/(e*y ))) A return true; - Else - return false; the } - - intMain () - { + inti,j; - while(SCANF ("%LF", &y)! =EOF) + { A Doubley= (log (e*y)/(e*y)); at if(y==1.0) -printf"%.5lf\n", e); - Else if(Y> (log (e)/e)) - { -printf"Happy to women ' s day!\n"); - } in Else - { to Doublelb=1.0, ub=e; + for(i=1; i<= +; i++) - { the DoubleMid= (LB+UB)/2; * if(C (mid)) $lb=mid;Panax Notoginseng Else -ub=mid; the } +printf"%.5LF", UB); Alb=e,ub=INF; the for(i=1; i<= +; i++) + { - DoubleMid= (LB+UB)/2; $ if(C (mid)) $ub=mid; - Else -lb=mid; the } -printf"%.5lf\n", LB);Wuyi the } - } Wu return 0; -}View Code
Equation Again Maximum Minimum value