#P7558. [JOISC 2021] 曲芸飛行 (Day1)
[JOISC 2021] 曲芸飛行 (Day1)
Background
This is an output-only problem.
SPJ modified by wlzhouzhuan.
Problem Description
On a 2D Cartesian coordinate plane, there are points . Xiao B starts from one point, chooses any point as the destination, walks to it along a straight-line path, and repeats this process times. It is not hard to see that this will form a polyline consisting of line segments. For every point except the first and the last, an angle is formed (the one that is ; denotes the -th visited point). Xiao B asks you to maximize the following expression by planning the visiting order of the points along the polyline:
Input Format
The first line contains two integers , representing the number of points and the scoring parameter (see Constraints and Notes, and the evaluation description below).
The next lines each contain two integers , representing a point.
Output Format
Output lines, each containing an integer , representing the index of the -th visited point.
7 90
3 1
2 5
0 2
-1 6
-3 1
-1 -4
4 -2
5
3
1
7
6
4
2
Hint
Sample 1 Explanation
As shown in the figure below:

The smallest angle is at point , which is . With and the scoring parameter description in the evaluation method below, this output can get a score of .
Constraints and Notes
For of the testdata, , , no two points coincide, and .
In particular, this is an output-only problem, with a total of test cases:
- The input files are
input_01.txttoinput_06.txt. - The output files are
output_01.txttooutput_06.txt. - For each test case, its , , and score are as follows:
| Test case ID | Score | ||
|---|---|---|---|
Scoring Parameters
This problem uses a Special Judge.
Thanks to @035966_L3 for providing the Special Judge.
If your output format is wrong, or the numbers you output are not in , or there are other errors, then you are doomed.
If your output format is correct, suppose the minimum angle you obtain is . Then your score is:
- If , you will get full score.
- If , let the score of this test case be , then you will get .
Define the function as:
Evaluation Library
We additionally provide an evaluation library (in the file aerobatics.h), which you can use to compute the angle (in degrees) formed by three points.
The calling formats are:
double GetAngle(int xb,int yb,int xa,int ya,int xc,int yc)ordouble GetAngle(int xb,int yb,int xc,int yc,int xa,int ya)- This function computes , with sufficiently small error.
- Please ensure the order is correct.
- is point .
- is point .
- is point .
- If or , then, heh, hehehe.
Additional File Description
- Name:
aerobatics-dist.zipin the attachments below.- in & out: sample input and output.
- aerobatics.h: evaluation library.
- Name:
aerobatics-data.zipin the attachments below:- in: input data.
Notes
Translated from The 20th Japanese Olympiad in Informatics Spring Training Camp Day1 A Aerobatics (曲芸飛行) English version.
Translated by ChatGPT 5