2 shunfurh shunfurh 于 2017.08.27 20:05 提问

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个回答

caozhy
caozhy   Ds   Rxr 2017.09.10 23:53
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
Alice与Bob问题
问题:一个2*n的方格,
hdu 5708 Alice and Bob(尼姆博弈)
规律相对入门级的题没有那么好找,但也算不上什么难题。
Alice和Bob的故事
Alice 和 Bob 的故事 没错,这篇内容写的就是上一篇开头提到的那个“极其无聊的问题”。本来不打算写的,既然研究过,还是整理出来纪念一下。 不论是看艰深的论文,还是看 那 些 geek 漫画,总能看到 Alice 和 Bob 这两个名字出现。已经记不起来第一次见到这对名字是在哪里了,总之从一开始就默默接受了这个惯例,直到前段时间才突然好奇起来,这两个人到底有什么来头才能在这么多地
2016BIT小学期——博弈DP(污神Alice和Bob)
1.题目描述: Alice: 上课好无聊啊!!! Bob:那你想干嘛? Alice:我们来玩游戏好伐? Bob:好哇!咋玩? Alice:我们写n个正整数,然后轮流拿数字,每次可以拿任意多个,每次的得分是这次拿的数字中的最小值,我们俩每次拿数都要让自己的得分与对方的得分差值最大化,我俩试着拿一拿看看最后我比你高多少分吧~ Bob:我拒绝,这明明O(瞬间)就知道答
4730: Alice和Bob又在玩游戏
4730: Alice和Bob又在玩游戏 Time Limit: 40 Sec  Memory Limit: 1024 MB Submit: 116  Solved: 52 [Submit][Status][Discuss] Description Alice和Bob在玩游戏。有n个节点,m条边(0 小的点。Alice和Bob轮流操作,每回合选择一个没有被删除的节点x,将x及其所有
[清华集训2016][UOJ266][BZOJ4730] Alice和Bob又在玩游戏 sg函数+字典树
对一棵树进行操作,那么它的根一定会被移除,所以我们可以将这一棵树的sg函数记录在根上 对于一次操作,这次操作可能操作在根上,那么我们将它的所有儿子sg值异或起来就能得到这次操作的结果,否则相当于操作它其中一个儿子,移除根,再异或上其它儿子。 对于每一个节点维护一棵字典树用来记录从根出发走出路径所能得到的新sg值的集合。 合并的时候按照线段树合并的方法合并,可以证明复杂度是O(nlogn)O(n
Alice and Bob(博弈)
Alice and Bob Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB Total submit users: 20, Accepted users: 10 Problem 11499 : No special judgement Problem descriptio
【BZOJ4730】Alice和Bob又在玩游戏
【题目链接】点击打开链接【思路要点】补档博客,无题解。【代码】#include<bits/stdc++.h> using namespace std; #define MAXN 100005 #define MAXP 20000005 #define MAXLOG 20 vector <int> a[MAXN]; int sg[MAXN], n, m, root[MAXN]...
A:Alice and Bob
A:Alice and Bob Alice and Bob are very smart guys and they like to play all kinds of games in their spare time. The most amazing thing is that they always find the best strategy, and that's why they
BZOJ4730 UOJ#266【清华集训2016】Alice和Bob又在玩游戏
同BZOJ4134-_- #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAXN 200010 #define MAXM 400001