Three children shared a basket of mangoes in such a way that the first child…