Goldman Sachs Interview Question

1000 pirates problem (deviding a gold)