#P2053. SRM199 ClosestPoints

SRM199 ClosestPoints

题目描述

给出 N,Range,Seed0N,\text{Range},\text{Seed}_0,按照 $\text{Seed}_{i+1} = (\text{Seed}_i \times 16807) \bmod (2^{31}-1) $ 以及 $\text{Range}_i = (\text{Seed}_i \bmod (2 \times \text{Range})) – \text{Range}$ 的规则,计算出 Range1\text{Range}_1Range3n\text{Range}_{3n} 。定义三维空间内的点 PkP_k 的坐标为 $(\text{Range}_{3k-2}, \text{Range}_{3k-1}, \text{Range}_{3k})(1\leq k\leq n)$。求出所有点中两点间最小距离的平方以及有多少对点的距离等于最小距离。 $2 ≤ N ≤ 150000,1 ≤ \text{Range} ≤ 10^6,1 ≤ \text{Seed} ≤ 10^3 $ 注意:如果有多个点重合,就当成一个点

输入格式

输出格式

3
100
1


9163
1

提示

The three points are: (-93, -51, -27), (-42, 30, -28), and (44, -22, 23). The closest pair of points are the first and third, and the square of their distance is 9163. There is 1 pair of points with a squared distance of 9163.

题目来源

没有写明来源