Implement a function that calculates the maximum number of distinct segments formed when a line is divided into n segments by n points marked on it.
Function Signature
python
def maximum_pieces(n: int) -> int:
Input Requirements
The function takes a single integer input n, where n (0 ≤ n ≤ 10^6) represents the number of points on the line.
Output Requirements
The function returns an integer which represents the maximum number of distinct segments that can be formed with n points on the line.
Example
If the input is 3, the output should be 7.
If the input is 0, the output should be 1.
Implementation Guidelines
Write the solution in a file named /app/solution.py. Ensure that the function is properly defined and implement any necessary test cases to validate the functionality.