编程介的小学生 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 关于下拉菜单选项关联的问题
  • ¥15 如何修改pca中的feature函数
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况