There are n coordinates. The area of the shape using those n coordinates according to the statement. The given figure shows what it may look like. The area of the purple polygon will be output.
Here, these things should be observed,
A point is considered left to if .
A point is considered right to if .
There can be multiple coordinates with the same -value. In this case, only considering the coordinate with the maximum -value is to be considered as it will cover all the coordinates below while creating the shape.
While calculating area, The intersecting point of two adjacent triangles’ sides is to be found out. Then the area can be easily calculated using the shoelace theorem or triangle area or any other method. The implementation is up to the solvers.
Analysis and solutions: link to repository.