编程介的小学生 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条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题