{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"Floating-point numbers are represented differently in computers than integers. That is why a 32-bit oating-point number can represent values in the magnitude of 10^38 while a 32-bit integer can only represent values as high as 2^32.\n\nAlthough there are variations in the ways floating-point numbers are stored in Computers, in this problem we will assume that floating-point numbers are stored in the following way:\n\nFloating-point numbers have two parts mantissa and exponent. M-bits are allotted for mantissa and E bits are allotted for exponent. There is also one bit that denotes the sign of number (If this bit is 0 then the number is positive and if it is 1 then the number is negative) and another bit that denotes the sign of exponent (If this bit is 0 then exponent is positive otherwise negative). The value of mantissa and exponent together make the value of the floating-point number. If the value of mantissa is m then it maintains the constraints 1/2\u003c\u003d m\u003c1. The left most digit of mantissa must always be 1 to maintain the constraint 1/2\u003c\u003dm\u003c1. So this bit is not stored as it is always 1. So the bits in mantissa actually denote the digits at the right side of decimal point of a binary number (Excluding the digit just to the right of decimal point)\nIn the figure above we can see a floating-point number where M\u003d 8 and E\u003d 6. The largest value this floating-point number can represent is (in binary) 0:111111111(2)*2^111111(2). The decimal equivalent to this number is: 0.998046875 *2^63\u003d 9205357638345293824(10). Given the maximum possible value represented by a certain floating point type, you will have to find how many bits are allotted for mantissa (M) and how many bits are allotted for exponent (E) in that certain type.\nInput\nThe input file contains around 300 line of input. Each line contains a oating-point numberFthatdenotes the maximum value that can be represented by a certain oating-point type. The oating pointnumber is expressed in decimal exponent format. So a numberAeBactually denotes the value A*10^B.A line containing `0e0\u0027 terminates input. The value of A will satisfy the constraint 0\u003cA\u003c10 and will have exactly 15 digits after the decimal point.\n\nOutput\n\nFor each line of input produce one line of output. This line contains the value ofMandE. You canassume that each of the inputs (except the last one) has a possible and unique solution. You can alsoassume that inputs will be such that the value ofMandEwill follow the constraints: 9M0 and30E1. Also there is no need to assume that (M+E+ 2) will be a multiple of 8.\n\nSample Input\n\n5.699141892149156e76\n9.205357638345294e18\n0e0\n\nSample Output\n\n5 8\n8 6\n\n"}},{"title":"","value":{"format":"PLAIN","content":"浮点数在计算机中的表示方法与整数不同,这就是为什么32位浮点数可以表示1038的数值,而32位整数只能表示232的数值。这就是为什么一个32位的浮点数可以表示10^38的数值,而一个32位的整数只能表示2^32的数值。\n\n虽然计算机中浮点数的存储方式有多种,但在本题中,我们假设浮点数的存储方式如下。\n\n浮点数有两个部分: 尾数和指数。M位分配给万字符,E位分配给指数。M位分配给mantissa,E位分配给指数,还有一个位表示数字的符号(如果该位为0,则数字为正,如果为1,则数字为负),另一个位表示指数的符号(如果该位为0,则指数为正,否则为负)。尾数和指数的值共同构成浮点数的值。如果mantissa的值是m,那么它就保持了约束条件1/2\u003c\u003dm\u003c1,mantissa的最左边的数字必须总是1,以保持约束条件1/2\u003c\u003dm\u003c1。所以,mantissa中的位数实际上表示二进制数小数点右边的位数(不包括小数点右边的位数)\n在上图中,我们可以看到一个浮点数,其中M\u003d8,E\u003d6,这个浮点数可以表示的最大值是(二进制)0:11111111(2)*2^11111111(2)。这个数的十进制等价物是:0.998046875 *2^63\u003d 9205357638345293824(10)。给定某个浮点类型所代表的最大可能值,你必须找出在该类型中,有多少位分配给尾数(M)和多少位分配给指数(E)。\n输入法\n输入文件包含大约300行输入。每行都包含一个定点数字F,表示某一定点类型所能表示的最大值。表示某一个定点类型的最大数值,定点数字用小数指数格式表示。因此,数字AeB实际上表示A*10^B.包含 \"0e0 \"的一行结束输入。A的值将满足0\u003cA\u003c10的约束条件,小数点后正好有15位。\n\n輸出\n\n对于每一行输入,产生一行输出。这一行包含M和E的值。你可以假设每一个输入(除了最后一个)都有一个可能的和唯一的解。你也可以假设输入将是这样的,MandE的值将遵循约束条件。9M0和30E1 同时也不需要假设(M+E+2)将是8的倍数。\n\n输入示例\n\n5.699141892149156e76\n9.205357638345294e18\n0e0\n\n采样输出\n\n5 8\n8 6"}}]}