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

20697번 - Robust Defense 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 512 MB52266.667%

문제

The Department of Defense (DoD) has developed a new wireless technology that is claimed to be unpenetrable. This new technology consists of two types of devices: a transmitter and a receiver. Even though the DoD has tried to make those devices to be robust, the new transmitter might be spoilt depending on the cause. The new receiver, on the other hand, is quite robust and designed such that it cannot be turned off. The receiver is online if only if at least one of the following conditions is satisfied.

  • There exists 2 active transmitters (not spoilt) such that the receiver is located exactly at a line segment connecting those 2 transmitters.
  • There exists 3 active transmitters (not spoilt) such that the receiver is located strictly inside a triangle formed by those 3 transmitters.

This new technology allows the DoD to strategically place their communication towers such that their military bases cannot be tapped by an outsider. There are N military bases each located at a coordinate (xi, yi) and M communication towers each located at a coordinate (xj, yj). Each military base is equipped with a new receiver, and each communication tower is equipped with a new transmitter. It is guaranteed that there is no pair of buildings (i.e. military bases or communication towers) that are located at the same location. It is also guaranteed that the receiver in each military base is online, thus, all military bases are online.

One day, the DoD predicts that a heavy storm will come close to its communication towers. During this heavy storm, each transmitter has a chance of (100 − S)% to be spoilt and S% to survive (or not to be spoilt).

The DoD asks your help to calculate the probability that all the military bases are still online right after the heavy storm. This probability can be expressed as a rational number P Q where P and Q are two coprime integers. You should output an integer P · Q−1 (mod 998 244 353) where Q−1 is the modular inverse of Q modulo 998 244 353. In other words, you should output an integer R (0 ≤ R < 998 244 353) such that P ≡ Q · R (mod 998 244 353).

입력

Input begins with a line containing three integers: N M S (1 ≤ N ≤ 500; 2 ≤ M ≤ 500; 0 < S < 100) representing the number of military bases, the number of communication towers, and the probability of a transmitter not to be spoilt due to the heavy storm, respectively. The next N lines each contains two integers: xi yi (−109 ≤ xi, yi ≤ 109) representing the location of each military base. The next M lines each contains two integers: xj yj (−109 ≤ xi, yi ≤ 109) representing the location of each communication tower. It is guaranteed that there are no buildings (i.e. military bases or communication towers) that are located at the same location. It is also guaranteed that all military bases are online before the heavy storm.

출력

Output in a line an integer R (0 ≤ R < 998 244 353) such that P ≡ Q · R (mod 998 244 353) where P and Q are two coprime integers and P/Q is the probability that all the military bases are still online right after the heavy storm.

제한

예제 입력 1

1 4 50
0 0
-1 0
3 0
0 1
2 -1

예제 출력 1

686292993

Each transmitter has a chance of 50% to survive the heavy storm. In this case, there are 16 possible outcomes with the same probability, and only 5 of them cause all the military bases to be still online right after the heavy storm, i.e. the set of active transmitters (not spoilt) are either of the following: {1, 2}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 4}, and {1, 3, 4}. Therefore, the probability is 5 16 , hence P = 5, Q = 16, and R = 686 292 993.

예제 입력 2

3 5 20
3 0
1 3
5 3
0 0
0 6
6 0
6 6
3 3

예제 출력 2

771443236

All transmitters except the 5th transmitter must not be spoilt so that all the military bases are still online right after the heavy storm. With each transmitter having a chance to survive of 20% or 1/5, the probability of such a case is (1/5)4 = 1/625. Therefore, P = 1, Q = 625, and R = 771 443 236

힌트

출처

ICPC > Regionals > Asia Pacific > Indonesia > Jakarta > The 2020 ICPC Asia Jakarta Regional Contest L번

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

출처

대학교 대회

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

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