x-suma initiala
x/2 -1 -a cheltuit prima data
x-(x/2-1)= x-x/2 +1 = (2x-x+2)/2= (x+2)/2 -restul
1/3 din (x+2)/2 +5= 1/3 * (x+2)/2+5= ( x+2)/6 + 5= (x+2+30)/6=( x+32)/6 -a doua oara
(x+2)/2 - (x+32)/6= (3x+6-x-32)/6 = (2x-26)/6 -noul rest
(2x-26)/6=29
2x-26=6*29
2x-26=156
2x=156+26
2x=182
x=91