You are required to implement a function that counts the distinct points covered by a set of line segments in a 2D plane, considering overlapping segments. The provided function signature is:
python
def count_distinct_covered_points(segments):
Functionality Requirements:
The function should accept a list of segments, where each segment is represented as a tuple (a, b, A, B). Here:
(a, b) are the coordinates of one endpoint of the segment.
(A, B) are the coordinates of the other endpoint of the segment.
The function should calculate:
The total number of distinct points that are covered by the segments, including points that are covered by overlapping segments.
Return the count as an integer.
Input/Output Requirements:
Input:
segments: A list of tuples, where each tuple has the format (a, b, A, B).
The list can contain 1 to 1000 segments, where coordinates are integers in the range [-10^9, 10^9].
Output:
Return an integer representing the count of distinct covered points.
Implementation Instructions:
Create a Python file named solution.py in the directory /app/.
Implement the function count_distinct_covered_points(segments) within solution.py based on the specified requirements.
Ensure that the implementation follows Python best practices and is efficient for the input constraints.
Example:
python
segments = [(1, 1, 4, 4), (1, 1, 2, 2), (2, 2, 4, 4)]
result = count_distinct_covered_points(segments)
print(result) # Output should represent the count of distinct points
Ensure that your solution handles edge cases and is well-documented.