include
#include<vector>
using namespace std;
class Balls {
public:
int calcDistance(int A, int B, int C, int D) {
// write code here
return calcDis(A) + calcDis(B) + calcDis(C) + calcDis(D);
}
int calcDis(int x)
{
float sum = x;
float xx = x;
while (xx>0.01)
{
xx = xx / 2;
sum =sum+ 2 * xx;
}
return sum+0.5;
}
};