Programming contests

DEIK Regionális Programozó Csapatverseny, egyetemi kategória, 2024. december 1.

December 1, 2024, 10:00 AM – December 1, 2024, 3:00 PM

Light

Péter has a large garden with NN Christmas trees. Out of these, he selects KK trees, each of which is illuminated with a bulb of strength SS. A bulb with strength SS provides light intensity Sd2\frac{S}{d^2}\ ​ at a distance dd. At any point in the garden, the light intensities of the illuminated trees add up. Péter wants to know the smallest positive integer SS such that at all unlit trees, the light intensity is at least 1.

Let’s help him calculate this!

Input specification

The first line contains NN and KK. The next NN lines contain the coordinates xix_i and yiy_i of the trees (i=1...Ni=1...N). Finally, the last line contains KK numbers: the indices of the illuminated trees. All numbers are integers, and the numbers on the same line are separated by spaces.

Output specification

A single line with the required number SS.

Constraints

1N1_0001\le N \le 1\_000
1K1_0001\le K \le 1\_000
10_000xi,yi10_000-10\_000\le x_i,y_i \le 10\_000
The numbers in the input are integers and the points xi,yix_{i},y_{i} are pairwise different and KK is always smaller than NN.

Sample input 1

  1. 3 2
  2. -1 0
  3. 0 0
  4. 1 0
  5. 1 3
download as text file

Sample output 1

  1. 1
download as text file

Sample input 2

  1. 5 2
  2. 0 0
  3. 10 0
  4. 0 10
  5. 10 10
  6. 5 5
  7. 1 4
download as text file

Sample output 2

  1. 50
download as text file

Sample input 3

  1. 4 2
  2. -1000 0
  3. 0 1000
  4. 0 -1000
  5. 1000 0
  6. 1 4
download as text file

Sample output 3

  1. 1000000
download as text file
University of Debrecen; Faculty of Informatics; v. 09/30/2024