Implement a function that calculates the maximum number of full batches of coconuts that can be made from two sources, x and y, given a batch size z. The function should adhere to the provided signature and follow specific logic for handling the remaining coconuts from both sources.
x (0 ≤ x ≤ 10^9) - represents the number of coconuts from the first source.
y (0 ≤ y ≤ 10^9) - represents the number of coconuts from the second source.
z (1 ≤ z ≤ 10^9) - represents the required number of coconuts to form one full batch.
Output:
A tuple containing:
An integer denoting the maximum number of full batches of coconuts that can be formed from both sources combined.
An integer representing the number of remaining coconuts after forming the full batches. If the total remaining coconuts from both sources is less than z, the second value should be set to 0; otherwise, it should be the number of coconuts required to reach the next full batch.
Implementation
You need to write the implementation in a file named /app/solution.py. The file should define the function calculate_max_coconuts that follows the logic provided in the function implementation details. Ensure that the function is well-documented and handles the edge cases appropriately.