Presently Nezzar has a beatmap of n particular focuses A1,A2,… ,An. Nezzar might want to reorder these n focuses so the subsequent beatmap is great. Officially, you are needed to find a change p1,p2,… ,pn of integers from 1 to n, to such an extent that beatmap Ap1,Ap2,… ,Apn is great. In case it is unthinkable, you ought to decide it. Input
Correct answer will be upvoted else downvoted. Computer science.
Presently Nezzar has a beatmap of n particular focuses A1,A2,… ,An. Nezzar might want to reorder these n focuses so the subsequent beatmap is great.
Officially, you are needed to find a change p1,p2,… ,pn of integers from 1 to n, to such an extent that beatmap Ap1,Ap2,… ,Apn is great. In case it is unthinkable, you ought to decide it.
Input
The primary line contains a solitary integer n (3≤n≤5000).
Then, at that point, n lines follow, I-th of them contains two integers xi, yi (−109≤xi,yi≤109) — directions of point
It is ensured that all focuses are unmistakable.
Output
In case there is no arrangement, print −1.
In any case, print n integers, addressing a legitimate change p.
In case there are numerous potential replies, you can print any.
Step by step
Solved in 4 steps with 1 images