Cority Software Interview Question

provide solution to split the bills