Eliot Andersol


Submit solution

Points: 15 (partial)
Time limit: 1.5s
Python 3 5.0s
Memory limit: 256M

Author:
Problem type

Eliot Andersol is a vigilante hacker who's objective is to save the world from conspiracy.

Recently he started investigating in a very scary subject : He thinks that the earth is flat and that governments are trying to hide it for an unknown reason. In the top secret classified documents he gained access to, there are \(N\) \(3D\) points measured from different points on the surface of earth. We want you to check if those points can represent a flat surface.

Input Specification

The first line of the input file contains an integer \(T\) the number of test cases \(1 \leq T \leq 100\)

Each test case starts with a line with one integer \(N\) the number of points.

Then follow \(N\) lines containing \(3\) integers \(a_{ij}\): the \(j^{th}\) integer of the \(i^{th}\) line contains the jth coordinate of the ith point \(-10^9 \leq a_{ij} \leq 10^9\).

You are guaranteed the following :

  • No two points coincide.
  • No \(4\) points are co-circular (that is, no circle can contain 4 points).
  • The set of the \(N\) points can be a part of either a 2D disk or 3D Sphere of any radius.

Output Specification

For each test case output 'Yes' if those points represent a flat surface, otherwise output 'No' (Case sensitive).

Scoring

  • \(4 \leq N \leq 100\) (2 points).
  • \(4 \leq N \leq 1000\) (2 points).
  • \(4 \leq N \leq 10^5\) (3 points).

Sample Input

2
4
0 0 1
0 0 2
0 0 3
0 0 4
4
1 0 0
0 1 0
0 0 1
0 0 -1

Sample Output

Yes
No

Comments

There are no comments at the moment.