编程介的小学生 2017-08-27 12:05 采纳率: 20.5%
浏览 761
已采纳

Alice, Bob and Magic Balls

On each positive integer point of the number axis, like 1, 2, 3, ..., there is a magic ball with an equal tiny amount of negative charge q. And in the origin point of the number axis, a small super magic ball with an immense amount of positive charge Q is twinkling. Alice and Bob undertake a difficult task. They try to move all the magic balls except the super one. They move each ball an equal distance x to the positive direction. When they move one magic ball, Bob throws the ball, and Alice receives it (Of course, these is no gravity in the linear number axis). And after Alice receives the ball, the magic power reacts! She is doubled! There are TWO Alices in the same point now! One Alice stays there with the magic ball, and the other Alice goes forward to receive the next ball. Then Bob moves forward to throw the next one. He will never be doubled. Because Alice is copied again and again, she will never feel tired. But there is always only one Bob on the number axis, he feels tired more and more, so he wants to know how much work he will do if he can finish the whole task, although the process is endless.

Because each magic ball is with only a tiny amount of negative charge except the super one, Bob ignores the interaction between them. All the work he does is to overcome the electric force from the super magic ball. Each ball's electric potential energy to the super magic ball is E(r) = − k × Q × q ÷ r, where k is 9 × 109 N · m2 · C-2, and r is the distance from the super magic one to this ball. The work Bob does is E(r2) − E(r1), if he throws the ball from r1 to r2. To simplify the calculation, Bob assumes k × Q × q is 1.

Input

This problem contains multiple test cases, one line per case. Each case contains only one real number x (0.000 ≤ x ≤ 2.000) rounded to 3 digits after the decimal point, which indicates the distance each ball moves.

Output

One line for each case, each line contains a real number rounded to 12 digits after the decimal point, which indicates the work Bob needs to do.

Sample Input

1.000
2.000
Sample Output

1.000000000000
1.500000000000

  • 写回答

1条回答

报告相同问题?

悬赏问题

  • ¥20 蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏