70 - ZOJ Monthly, September 2008 - 1002
The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations. The standard defines formats for representing floating-point numbers (including negative zero and denormal numbers) and special values (infinities and NaNs) together with a set of floating-point operations that operate on these values. It also specifies four rounding modes and five exceptions (including when the exceptions occur, and what happens when they do occur).
A single-precision binary floating-point number is stored in 32 bits.
In theory, the number is made up of three parts.
But IEEE 754 make some special specifications:
You can see wikipedia for further details and more pictures :)
Int64 ago, there was an animal named "Fanazhe" in Mars. And you may know, he didn't like to run the sample against his solution, so people gave it a nickname "Fan Notrun" (Do you know "Fan Runrun"?)
And one day, Murphy became angry because of the wrong sample made by Fan, so he hacked the server of the God, and tried to change the RP value of poor Fan.
It is known that the RP value was stored in the server as an IEEE-754 single precision folating point number.
You may know, the internat speed of God is very slow (maybe he live in Lantian^_^), and God's computer is very strange, so Murphy can change one bit at same time, and he can change at most k times.
Murphy want to change Fan's RP as low as possible. He want to know the minimul possible number. Since Murphy don't know programming at all(do you believe?), can you help him?
One case per line.
Each case is a 32-bit integer in binary and a number K. See sample for more details.
Output the minimul possible number. One per line.
Author: SHANG, Zechao