I need some help
UVa 1315
Someone help me solve this problem please, I don't know how to find formula for this problem