It is too easy to calculate the length of a segment in a convex polygon. But now you must calculate the length of a segment in a simple polygon. You are given a simple polygon and a segment, and then you must work out the sum of all the section which is in the polygon.You must notice that a section which is on the side of the polygon will not be considered. For example, in Figure 1, some section of segment PQ is on the side ED of polygon ABCDEF, so the length of segment DQ is the answer of this problem.