8683: Global Positioning System

内存限制:128 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:3 通过:2

题目描述


Global Positioning System (GPS) is based on nnn artificial satellites, where each satellite has a 3D-coordinates (x,y,z)(x,y,z)(x,y,z). Since the coordinates are always changing, we can hardly know the exact value of the coordinates, even if the satellites are relative static to each other.

To get more information about their coordinate, we still try every effort to do mmm measurements. For each measurement, we choose the uuu-th and the vvv-th satellites, and measure the coordinate difference between them. Specifically, we will get (xv−xu,yv−yu,zv−zu)(x_v - x_u, y_v - y_u, z_v - z_u)(xvxu,yvyu,zvzu) after the measurement of them. With these mmm measurement results, we can now know the coordinate difference between any two satellites.

However, lzr010506 has the impression that he has mistaken exactly one measurement result, so there may exist no possible coordinates to match all the measurements for the satellites for now. You need to find out all the measurements results that might be mistaken, so he can try to fix it as soon as possible.

Here a measurement result might be mistaken iff there exist possible coordinates to match all the measurements after modifying the mistaken measurement result to the one other than the original one.

输入格式


The first line contains two integers nnn (2≤n≤500000)(2\le n\le 500\,000)(2n500000) and mmm (n−1≤m≤500000)(n-1\le m\le 500\,000)(n1m500000), denoting the number of the satellites that form the GPS and the number of the measurements that we have made.
The following mmm lines decribe the mmm measurements. Each of the mmm lines contains five integers u,vu,vu,v (1≤u,v≤n,u≠v)(1\le u,v\le n, u \neq v)(1u,vn,u=v), x,yx,yx,y and zzz (−2×109≤x,y,z≤2×109)(-2 \times 10^9 \le x,y,z \le 2 \times 10^9)(2×109x,y,z2×109), which means that the measurement result between the uuu-th and the vvv-th satellites is (x,y,z)(x,y,z)(x,y,z).
It is guaranteed that any (unordered) pair of satellites will not be measured more than once, and at least one measurement result might be mistaken.

输出格式


The first line contains a single integer kkk, denoting the number of the measurements results that might be mistaken.
The second line contains kkk integers, denoting the indices of the measurement results that might be mistaken in increasing order.

输入样例 复制

3 3
1 2 3 3 3
1 3 1 1 1
2 3 -3 -2 -3

输出样例 复制

3
1 2 3

数据范围与提示


In the first sample test case, you can modify the first measurement result to (4,3,4)(4,3,4)(4,3,4), or modify the second measurement result to (0,1,0)(0,1,0)(0,1,0), or modify the third measurement result to (−2,−2,−2)(-2,-2,-2)(2,2,2).

分类标签