Logo
(追記) (追記ここまで)

30447번 - Paper Folding 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB402513513.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ドル$.

제한

예제 입력 1

30 20
0 10
15 0

예제 출력 1

525

예제 입력 2

30 20
5 20
30 2

예제 출력 2

397

힌트

출처

ICPC > Regionals > Asia Pacific > Korea > Nationwide Internet Competition > Seoul Nationalwide Internet Competition 2023 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /