CF140F.New Year Snowflake
省选/NOI-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
As Gerald ..., in other words, on a New Year Eve Constantine prepared an unusual present for the Beautiful Lady. The present is the magic New Year snowflake that can make any dream come true.
The New Year snowflake consists of tiny ice crystals, which can be approximately regarded as points on the plane. The beauty of the New Year snowflake is that it has a center of symmetry. This is a point such that for each crystal of the snowflake exists another crystal, symmetrical to it relative to that point. One of the crystals can be placed directly in the center of symmetry.
While Constantine was choosing a snowflake among millions of other snowflakes, no less symmetrical and no less magical, then endured a difficult path through the drifts to the house of his mistress, while he was waiting with bated breath for a few long moments before the Beautiful Lady opens the door, some of the snowflake crystals melted and naturally disappeared. Constantine is sure that there were no more than k of such crystals, because he handled the snowflake very carefully. Now he is ready to demonstrate to the Beautiful Lady all the power of nanotechnology and restore the symmetry of snowflakes.
You are given the coordinates of the surviving snowflake crystals, given in nanometers. Your task is to identify all possible positions of the original center of symmetry.
正如杰拉尔德……换句话说,在新年前夜,康斯坦丁为这位美丽的女士准备了一份不同寻常的礼物。这份礼物是一片神奇的新年雪花,它能实现任何梦想。
新年雪花由微小的冰晶组成,这些冰晶可近似视为平面上的点。新年雪花的美丽之处在于它具有一个对称中心:即存在一个点,使得雪花中的每个冰晶都存在另一个冰晶,二者关于该点中心对称。其中一个冰晶可以恰好位于该对称中心上。
当康斯坦丁在数以百万计的其他雪花中精心挑选这一片雪花时(那些雪花同样高度对称、同样充满魔力),当他艰难地穿越雪堆前往心上人的住所时,当他屏住呼吸、焦急等待那位美丽女士开门的那几段漫长时刻里,雪花中的一些冰晶融化并自然消失了。康斯坦丁确信,消失的冰晶数量至多为 k 个,因为他一直极其小心地持握着这片雪花。如今,他已准备好向这位美丽女士展示纳米技术的全部威力,恢复雪花的对称性。
你将获得幸存下来的雪花冰晶的坐标(单位:纳米)。你的任务是找出所有可能的原始对称中心位置。
输入格式
The first line contains two integers n and k (1 ≤ n ≤ 200 000, 0 ≤ k ≤ 10) — the number of the surviving snowflake crystals and the maximum number of melted crystals, correspondingly. Next n lines contain the coordinates of the crystals that are left in the following form: "x__i y__i". The coordinates are integers and do not exceed 5·108 in absolute value. All given points are different.
第一行包含两个整数 n 和 k(1≤n≤200000,0≤k≤10),分别表示幸存的雪花晶体数量和最多融化的晶体数量。接下来的 n 行每行包含一个剩余晶体的坐标,格式为:“xi yi”。坐标的绝对值不超过 5⋅108,且所有给定的点互不相同。
输出格式
The first line contains an integer c — the number of possible symmetry centers. Next c lines should contain the centers' descriptions. Each symmetry center is described by a couple of coordinates "x y", separated by a space. Print the coordinates with absolute error not exceeding 10 - 6. You are allowed to print the symmetry centers in any order. All printed points should be different. If there exist an infinite number of possible symmetry centers, print the single number "-1".
第一行包含一个整数 c —— 可能的对称中心数量。接下来的 c 行应包含各对称中心的描述。每个对称中心由一对坐标 “x y” 描述,两个坐标之间用空格分隔。输出坐标的绝对误差不得超过 10−6。允许以任意顺序输出对称中心。所有输出的点必须互不相同。如果存在无穷多个可能的对称中心,则仅输出单个数字 “-1”。
输入输出样例
输入#1
4 0 0 0 0 1 1 0 1 1
输出#1
1 0.5 0.5
输入#2
4 2 0 0 0 1 1 0 1 1
输出#2
5 0.0 0.5 0.5 0.0 0.5 0.5 0.5 1.0 1.0 0.5
输入#3
4 4 0 0 0 1 1 0 1 1
输出#3
-1
输入解题思路,AI测评打分。不知道怎么写?