If N is the number of friends in the group then they buy N milkshakes costing R1 360 altogether. One milkshake costs 1360/N
When 4 friends left, N-4 had to pay extra R17(N-4) in total. They also had to pay for their own milkshakes at a cost of (N-4)(1360/N). The total amount paid was 1360 so (N-4)(1360/N)+17(N-4)=1360.
(N-4)(1360/N+17)=1360,
1360+17N-5440/N-68=1360,
17N-5440/N-68=0,
N-320/N-4=0,
N2-4N-320=0=(N-20)(N+16), so N=20.
CHECK
There were 20 in the group, so a milkshake costs 1360/20=R68.
So 16 people paid R68 each, totalling R1 088. They also had to pay R17 extra=R272.
1088+272=R1 360. In other words, it's as if the milkshakes cost 68+17=R85 each. 85×16=1360.