先佔坑
ACcode:
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<sstream>
#include<string>
#include<bitset>
using namespace std;
typedef long long LL;
typedef long double lldouble;
const LL LINF = (1LL <<60);
const int INF = 1 << 30;
const int NS = 110000;
const int MS = 19;
const int MOD = 1000000007;
const lldouble eps = 10e-12;
const lldouble PI = acos(-1.0);
struct mpoint
{
lldouble x, y;
lldouble angle;
int id;
mpoint() {};
mpoint(lldouble _x, lldouble _y, int _id)
{
id = _id;
x = _x, y = _y;
angle = getAngle();
}
mpoint operator + (const mpoint& _v)const
{
return mpoint(x + _v.x, y + _v.y, id);
}
mpoint operator - (const mpoint& _v)const
{
return mpoint(x - _v.x, y - _v.y, id);
}
double operator * (const mpoint& _v)const
{
return (x * _v.x + y * _v.y, id);
}
lldouble getDistance()
{
return sqrt(x * x + y * y);
}
bool isequal(lldouble _x, lldouble _y)
{
return bool(fabs(_x - _y) < eps);
}
bool isequal(const mpoint _v)
{
return isequal(x, _v.x) && isequal(y, _v.y);
}
bool isequalzero()
{
return isequal(mpoint(0.0, 0.0, 0));
}
lldouble getAngle()
{
lldouble _angle = 0.12345;
if(isequal(x, 0.0))
{
if(y > 0.0) _angle = 0.5 * PI;
else if(y < 0.0) _angle = 1.5 * PI;
else _angle = -1.0;
}
else
{
lldouble det = atan( fabs((lldouble)y / x) );
if(x > 0.0 && y >= 0.0) _angle = det;
else if(x > 0.0 && y < 0.0) _angle = 2.0 * PI - det;
else if(x < 0.0 && y >= 0.0) _angle = PI - det;
else _angle = PI + det;
}
/**angle [0, PI * 2]*/
return _angle;
}
bool operator < (const mpoint& _v) const
{
return angle < _v.angle;
}
};
int n;
mpoint p[NS];
int main()
{
#ifndef ONLINE_JUDGE
freopen("C.in", "r", stdin);
// freopen("out.txt", "w", stdout);
#endif
while(~scanf("%d", &n))
{
double x, y;
for(int i = 0; i < n; i++)
{
scanf("%lf %lf", &x, &y);
p[i] = mpoint(x, y, i + 1);
}
sort(p, p + n);
int ans = -1;
lldouble minv = 111111.0;
for(int i = 0; i < n; i++)
{
// printf("p[%d](%.0lf, %.0lf) = %.15lf\n", p[i].id, p[i].x, p[i].y, double(p[i].angle));
int j = (i + 1) % n;
lldouble det = p[j].angle - p[i].angle;
if(0 == j) det += 2 * PI;
if(det < minv)
{
minv = det;
ans = i;
}
}
printf("%d %d\n", p[ans].id, p[(ans + 1) % n].id);
}
return 0;
}