RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 ICPC00091

F. Flatland Olympics

설명

It is the day after Olympia, and you—as the organizer—are happy that everything worked well in these troublesome times. Well, not everything....

Since this morning e-mails have been filling up your inbox, containing complaints about obscured views during the most important race: the \(100\)-meter dash. They demand their money back, or threaten exposing you on social media. To make things worse, spectators have not just complained once, but they have sent you a separate e-mail for every person that blocked their view at some point during the race! They even wrote multiple e-mails when two or more people blocked their view at the same time. And not only that, some visitors complained to the main sponsor Dy & Son who in turn has urged you to improve the situation.

Since you expect that a greater number of visitors will be allowed to spectate at the next Olympic games, you assume that there will be even more complaints if you do not address this issue. If the situation will be too bad, you may even lose your sponsor Dy & Son. Therefore, you decide to count the number of complaints beforehand. To do this, you model the running track as a straight line segment, and count the maximal number of complaints you could get based on the seating of the visitors. Depending on the number of complaints you expect, you will determine if you need to rework the seating or just reconfigure your spam blocker and try to find a new sponsor.

제약
입력 형식

The input consists of:

samepage
- One line containing four integers \(x_s\), \(y_s\), \(x_e\) and \(y_e\) \((|x_s|, |y_s|, |x_e|, |y_e| \leq10^{9})\), where \(s=(x_s, y_s)\) is the starting point of the running track and \(e=(x_e, y_e)\) is the end point of the running track. Both \(s\) and \(e\) belong to the running track. samepage
- One line containing an integer \(n\) \((1 \leq n \leq 10^{5})\), the number of visitors.
- \(n\) lines, each containing two integers \(x\) and \(y\) \((|x|,|y|\leq10^{9})\), where \((x,y)\) is the location of the seat of a visitor.

It is guaranteed that the track has a positive length, i.e. \(s\neq e\). Further, you can assume that all visitors are seated at distinct locations and that no visitor is seated on the track.

출력 형식

Output the total number of complaints that you would receive for the given seating.

예제 1
입력
0 0 100 0
4
50 20
50 30
50 50
120 0
출력
3
예제 2
입력
0 0 100 0
5
50 20
50 30
50 -20
50 -30
100 30
출력
2
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2021

평가 및 의견

F. Flatland Olympics

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

F. Flatland Olympics

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8