x=nr nuci
x/2+1/2 = (x+1)/2 nuci luate de 1 marinar
x- (x+1)/2 =(2x-x-1)/2=(x-1)/2 rest
(x-1)/2 * 1/2+1/2=(x-1+2)/4=(x+1)/4 nuci luate de al 2-lea marinar
(x-1)/2 - (x+1)/4=(2x-2-x-1)/4=(x-3)/4 rest
(x-3)/4 *1/2=(x-3)/8 nuci luate de al 3-lea marinar
x=(x+1)/2+(x+1)/4+(x-3)/8+1
8x=4x+4+2x+2+x-3+8
x=11 nuci
1 marinar 11:2+1/2 = 6 nuci
11-6=5 nuci rest
al 2-lea marinar 5:2+1/2=3 nuci
5-3=2 nuci rest
al 3-lea marinar 2:2=1 nuca
2-1=1 nuca rest