#00001C

zice

We have a very precise machine that can cut off one third of a wire of arbitrary length. Write a program that calculates the number of cuts that must be made in the initial wire to get a piece of the length that is nearest to the desired length.


InputThe first line of the standard input contains the initial length of the wire, and the second line contains the desired length of wire. Both numbers are real numbers with double precision in the interval [1, 10 ^ 14] given to one decimal.

OutputTo the standard output in two rows write the number of cuts and the length (5 decimals) of the wire nearest to the desired length, which is arrived at with the specified number of cuts.


Input:
6000.0
187.7

Output:
5
197.53086


Comment: If the intial wire is 6000.0 long and the desired length 187.7, then in the second cutting we should cut the longer piece (4000). In the third cutting we should cut the longer piece (2666.66667). In the fourth cutting we should cut the longer piece (1777.77778). In the fifth cutting we should cut the shorter piece (592.59259) and then choose the shorter piece (197.53086), which is the solution.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.