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

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条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 ME21N 创建采购成功并且生成采购订单号,但显示“快件文档更新已取消”,SM13看错误提示为如下截图:
      • ¥30 android 集成fmod实现变声功能中遇到的问题
      • ¥60 matlab传染病模型分段
      • ¥15 关于#matlab#的问题,如何解决?
      • ¥15 51单片机汇编语言Keil5基础问题!
      • ¥15 CygwinPortable 中 NumPy 无法安装
      • ¥15 vivado如何支持多维打包数组模式
      • ¥15 请问第13题到底应该怎么做
      • ¥15 倒计时汇编语言RTC实时时钟
      • ¥15 CCS安装出现Failed to create the part's controls