Mop
Freshman Roma arrived at his dormitory and was taken aback by the mess in the room and the thick layer of dust on the floor. Determined to clean up, he decided to start by washing the floor. To do this, Roma bought an innovative mop from the store.
Initially, the mop's cleaning part was a perfect rectangle. However, during the journey from the store to the dormitory, one of its corners broke off. Now, the mop's cleaning part forms a polygon, consisting of two adjacent sides of the original rectangle, fragments of the other two sides, and a broken line connecting the ends of these fragments.
Roma lives in a large rectangular room. He moved the broken mop from one side of the room to the other, keeping it against the wall, so that the broken corner of the mop ended up in the corner of the room. Consequently, a portion of the corresponding rectangular strip of the floor in the corner remained unwashed.
Roma assumes that all points touched by the mop's cleaning part at any time were cleaned. Now, he wants to determine which part of this strip remained dirty.
Help him calculate the area of this unwashed part. You can assume that the room where Roma lives is significantly larger than the mop's cleaning part.
Input
The first line of the input contains two integers w and h — the dimensions of the mop's cleaning part before it was damaged (2 ≤ w, h ≤ 10^5).
The second line contains an integer n — the number of vertices of the broken line connecting the adjacent sides of the mop (2 ≤ n ≤ 10^5). In the i-th of the following n lines, two integers x_i and y_i (1 ≤ x_i < w, 1 ≤ y_i < h, except for y_1= h, x_n = w) are given — the coordinates of the i-th vertex of the broken line. The line has no self-intersections or self-tangencies.
The coordinates are provided such that the wall along which Roma moved the mop corresponds to the line y = h.
Output
Output the area of the unwashed part of the floor with an absolute or relative error not exceeding 10^{−6}. This means that if the correct answer is a, and you output p, your answer will be considered correct if |a−p|/max(|a|,1) ≤ 10^{−6}.