I am trying to solve UVa 107 problem. It seems to be an maths oriented problem. Initially I tried to derive a few relation but they didn't seem to be helpful.
After searching for any online explaination i found this. Here if you consider first point in explaination (N/(N+1))^(M-1) = B / A, I am not able to understand how this relation is true. It would help me if anyone could explain it. Thanks.