编程介的小学生 2017-04-09 02:09 采纳率: 20.5%
浏览 772
已采纳

Snowflake

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.

Snowflake Island Kingdom's shape in first seven 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.

Input

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])

Output

For each case, output the proportion of the Left Kingdom's coastline in percentage. Please reserve 100 decimal digits after the decimal point.

Sample Input

0/1
-1/5
Sample Output

50.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000%
32.3529411764705882352941176470588235294117647058823529411764705882352941176470588235294117647058823529%

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-22 15:54
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致