130 - ZOJ Monthly, January 2014 - H
Long long ago, the territory of Snowflake Island Kingdom is an equilateral triangle whose center is in the coordinate origin (0,0). One edge of this triangle is parallel to the x-axis. And all the edges of this equilateral triangle are considered as long as 1. Everyone in the Kingdom reclaimed to expand territory every year. The picture below shows how the territory expands from an equilateral triangle in the first seven years. And it has expanded for very many years.
The length of the coastline of Snowflake Island Kingdom grows one third every year, but the area of the territory grows slower and slower. This year, kingdom splits into two independent kingdoms, Left Kingdom and Right Kingdom. The part x≤d of Snowflake Island is Left Kingdom, and the rest part is Right Kingdom. The King of Right Kingdom wants to know the proportion of the Left Kingdom's coastline.
There are multiple test cases. Each case is a fraction d in a line. (-1/2≤ d≤ 1/2, the numerator and denominator of d are integers in [-1000, 1000])
For each case, output the proportion of the Left Kingdom's coastline in percentage. Please reserve 100 decimal digits after the decimal point.
Author: ZHOU, Yuchen