Description
在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为可见的,否则Li为被覆盖的.
例如,对于直线:
L1:y=x; L2:y=-x; L3:y=0
则L1和L2是可见的,L3是被覆盖的.
给出n条直线,表示成y=Ax+B的形式(|A|,|B|<=500000),且n条直线两两不重合.求出所有可见的直线.
Input
第一行为N(0 < N < 50000),接下来的N行输入Ai,Bi
Output
从小到大输出可见直线的编号,两两中间用空格隔开,最后一个数字后面也必须有个空格
Sample Input
3
-1 0
1 0
0 0
-1 0
1 0
0 0
Sample Output
1 2
/*************************************************************************
> File Name: 67.cpp
> Author: wjzdmr
> Mail: wjzdmr@gmail.com
> Created Time: 2014年09月16日 星期二 20时05分58秒
************************************************************************/
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <deque>
#include <queue>
#include <cctype>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <limits>
#include <fstream>
using namespace std;
#define mem(A, X) memset(A, X, sizeof A)
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define vi vector<int>
#define all(x) x.begin(), x.end()
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
#define sz(x) (int)((x).size())
#define sl(a) strlen(a)
#define rep(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#define Rep(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define dbg(a) cout << a << endl;
#define fi first
#define se second
typedef long long int64;
int gcd(const int64 &a, const int64 &b) { return b == 0 ? a : gcd(b, a % b); }
int64 int64pow(int64 a, int64 b){ if (b == 0) return 1; int64 t = int64pow(a, b / 2); if (b % 2) return t * t * a; return t * t; }
const int inf = 1 << 30;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int MAX_N = 500005;
int n;
int st[MAX_N];
struct point {
double a, b;
int pos;
};
point p[MAX_N];
bool cmp(const point &s1, const point &s2)
{
if (s1.a != s2.a) {
return s1.a < s2.a;
}
else {
return s1.b > s2.b;
}
}
double cal(point e1, point e2)
{
return (e1.b - e2.b) / (e2.a - e1.a);
}
void work()
{
Rep(i, 1, n) {
scanf("%lf%lf", &p[i].a, &p[i].b);
p[i].pos = i;
}
sort(p + 1, p + n + 1, cmp);
int top = 1;
st[top] = 1;
Rep(i, 2, n) {
if (p[i].a != p[i - 1].a) {
while (top >= 2 && cal(p[st[top]], p[st[top - 1]]) >= cal(p[st[top]], p[i])) {
--top;
}
st[++top] = i;
}
}
vi v;
Rep(i, 1, top) {
v.pb(p[st[i]].pos);
}
sort(all(v));
rep(i, 0, sz(v)) {
cout << v[i] << " ";
}
cout << endl;
}
int main()
{
while (cin >> n) {
work();
}
return 0;
}