Company: JK_Tech_13nov
Difficulty: medium
Queue: Sharing Bread Problem Description You have a large loaf of brown bread of length L and N members in your family, including you. You must share your bread with your family members. The i-th family member wants a bread of length A[i]. Repeat the operation below to cut the loaf into lengths as the i-th member wants: - Choose a loaf of length K and an integer X between 1 and K-1 (inclusive). - Cut the loaf into two loaves of lengths X and K-X. - This operation incurs a cost of K. Each member must receive a loaf of the length exactly they want, but it is allowed to leave some loaves undistributed. Find the minimum cost to distribute/share loaves with all family members. In the provided code snippet, implement the provided sharingbread(...) method to find the minimum cost to distribute/share loaves with all family members. You can write your code in the space below the phrase "WRITE YOUR LOGIC HERE". There will be multiple test cases running so the Input and Output should match exactl