A numerical approach for a class of risk-sharing problems