If one has a stick of length n then what is the minimum number of cuts one can make on it to have n parts of it so that at the end of ith day one can give ith lenght of stick to someone ?
E.g if the length of stick is 5 one can make 2 cuts as follows:
First cut : length of 1 unit.
Second cut: length of 1 unit.
the remaining length is of 3 units which can be given on 3rd day , taking back the earlier 2 parts.
if lenght is of lenght 6 then one can make 3 cuts:
First cut: length of 1 unit.(give that on 1st day)
Second cut : length of 2 units.(give this on 2nd day ,take back 1st part)
Third day: give the remaing part(length of 3 units and take back parts of lenght 1 and 2)
Fourth day: give part of lenght 1 (so total length given 3+1)
Fifth day: cut the part of length 2 into 2 parts and give one part ,so total lenght given is 3+1+1
Sixth day : give the remaining part of length 1 (so total given length 3+1+1+1=6).
I have tried like:
if the lenght is odd then answer is n - ceil(n/2.0) and if lenght is even then ans = n/2
However i'm not too sure about it .