This problem was originally published on CodeAbbey.com around March 10th, 2024
You have just started a job at a factory which produces high-purity Methane for industrial and laboratory uses. During your new-employee orientation, you learn a few things about Methane:
109 picometers.The factory has received some complaints about contamination in recent batches of Methane and so they have bought a "Hydrogen Detector" machine which will aid in identifying molecules, to determine if a batch may be contaminated with molecules other than Methane.
Unfortunately the machine is designed to be general-purpose, and so it doesn't identify Methane directly. Instead, it takes a given molecule and returns the XYZ coordinate positions (in picometer units) of the Hydrogen atoms in that molecule. It is your job to analyze these Hydrogen coordinate positions and determine if the molecule being examined is indeed Methane.
Input data will contain the number of testcases in the first line.
The following lines will contain one testcase each, consisting of 12 decimal values corresponding to 4 sets of XYZ coordinates. Values will be ordered as x1 y1 z1 x2 y2 z2 x3 y3 z3 x4 y4 z4.
Answer should be a string of space-separated values: True if the corresponding testcase is evaluated as Methane and False otherwise.
Example
In this example each line with test-case is further sub-split into four lines (all except first indented) to simplify human reading. To feed these data to your program you may need remove these extra line breaks (depending on your chosen language and input method).
input data:
4
-510.134842 -321.599931 -376.903097
-554.797813 -237.69143 -312.869955
-557.183259 -313.151736 -331.771654
-416.131227 -336.049727 -482.451894
795.762701 718.129006 -691.666904
809.080133 717.904762 -670.999801
695.835664 802.776936 -668.257661
788.564752 696.315454 -583.30922
148.239367 474.968476 -207.042879
163.248427 388.564664 -69.502184
210.813323 528.010266 -117.618413
244.304803 452.918487 -191.785573
-415.268144 -165.722105 -210.016587
-372.878841 -170.513449 -382.825316
-510.88644 -265.292058 -322.380427
-521.299032 -87.757988 -329.856956
answer:
False False False True
False False False True