CF1826F.Fading into Fog

省选/NOI-

通过率:0%

时间限制:4.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

This is an interactive problem.

There are nn distinct hidden points with real coordinates on a two-dimensional Euclidean plane. In one query, you can ask some line ax+by+c=0ax + by + c = 0 and get the projections of all nn points to this line in some order. The given projections are not exact, please read the interaction section for more clarity.

Using the minimum number of queries, guess all nn points and output them in some order. Here minimality means the minimum number of queries required to solve any possible test case with nn points.

The hidden points are fixed in advance and do not change throughout the interaction. In other words, the interactor is not adaptive.

A projection of point AA to line ax+by+c=0ax + by + c = 0 is the point on the line closest to AA.

这是一个交互式问题。

平面上预先固定了 nn 个互不相同的隐藏点,其坐标为实数。每次查询中,你可以指定一条直线 ax+by+c=0ax + by + c = 0,系统将返回这 nn 个点在该直线上的投影(以某种顺序给出)。注意:所给的投影并非精确值,请参阅“交互说明”部分以获得更清晰的解释。

你需要用尽可能少的查询次数,猜出全部 nn 个点的坐标,并以任意顺序输出它们。此处“最少查询次数”是指:对任意含 nn 个点的合法测试用例,均能保证求解成功的最小查询数。

所有隐藏点在交互开始前即已固定,且在整个交互过程中保持不变。换言之,交互器是非自适应的(non-adaptive)。

点 AA 到直线 ax+by+c=0ax + by + c = 0 的投影,定义为该直线上距离 AA 最近的点。

输入格式

The first line contains a single integer tt (1≤t≤501 \leq t \leq 50) — the number of test cases.

The description of the test cases follows.

The first line of each test case contains a single integer nn (2≤n≤252 \leq n \leq 25) — the number of hidden points.

For each test case, it is guaranteed that for any pair of hidden points, their xx coordinates differ by at least 11. Analogously, yy coordinates of any pair also differ by at least 11.

Coordinates xx and yy of all hidden points do not exceed 100100 by absolute value.

第一行包含一个整数 tt(1≤t≤501 \leq t \leq 50)—— 测试用例的数量。

接下来是测试用例的描述。

每个测试用例的第一行包含一个整数 nn(2≤n≤252 \leq n \leq 25)—— 隐藏点的数量。

对于每个测试用例,保证任意两个隐藏点的 xx 坐标之差的绝对值至少为 11;同理,任意两个隐藏点的 yy 坐标之差的绝对值也至少为 11。

所有隐藏点的坐标 xx 和 yy 的绝对值均不超过 100100。

输入输出样例

  • 输入#1

    1
    2
    
    1 1 2.5 1
    
    1.500000001 1.500000000 2 2

    输出#1

    ? 0 1 -1
    
    ? 0.2 -0.2 0
    
    ! 1 3 2.5 0.500000001

说明/提示

In the sample the hidden points are (1,3)(1, 3) and (2.5,0.5)(2.5, 0.5)

A picture, which describes the first query:

A picture, which describes the second query:

在样例中,隐藏的点为 (1,3)(1, 3) 和 (2.5,0.5)(2.5, 0.5)。

描述第一次查询的图片:

描述第二次查询的图片:

输入解题思路,AI测评打分。不知道怎么写?

首页