| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 402 | 51 | 35 | 13.514% |
A rectangular paper is placed in the first quadrant with its vertex at the origin as shown in the figures below. We will fold this paper along a line which is specified by two points on the different edges of the paper. You are asked to compute the area of the 2D polygonal shape of the folded paper. In the following figures, you can see two papers and the corresponding fold lines (red dotted) and the folded paper (green polygon).
Your program is to read from standard input. The first line contains two integers $w$ and $h,ドル 10ドル ≤ w, h ≤ 1,000円$ which represent the width and height of a rectangular paper, respectively. The coordinates of the two points that determine the folding line will be given at the second line and the third line. Note that two folding points are on the two different edges of the rectangle.
Your program is to write to standard output. Print exactly one integer that is the integer part of the area of the folded polygon. For example, if the area of the folded polygon is 56ドル.678,ドル then you should print 56ドル$.
30 20 0 10 15 0
525
30 20 5 20 30 2
397