We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
start at B[0] and work through the array, up to B[N-1]. if B[i] is odd, then add one to B[i] and add one to B[i+1].
If the last number is odd, we won't be able to distribute bread evenly. If it is even, we have succeeded.
Fair Rations
You are viewing a single comment's thread. Return to all comments →
start at
B[0]
and work through the array, up toB[N-1]
. ifB[i]
is odd, then add one toB[i]
and add one toB[i+1]
. If the last number is odd, we won't be able to distribute bread evenly. If it is even, we have succeeded.