In the event of technical difficulties with Szkopuł, please contact us via email at szkopul@fri.edu.pl.
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
The Bytean cross spider (Araneida baitoida) is known to have an amazing ability. Namely, it can instantly build an arbitrarily large spiderweb as long as it is contained in a single plane. This ability gives the spider an opportunity to use a fancy hunting strategy. It does not need to wait until a fly is caught in an already built spiderweb; if only the spider knows the current position of a fly, it can instantly build a spiderweb to catch the fly.
A cross spider has just spotted flies in Byteasar's garden.
Each fly is flying still in some point of a 3D space.
The spider is wondering if it can catch all the flies with a single spiderweb.
Write a program that answers the spider's question.
The first line of the input contains an integer (
).
The following
lines contain a description of the flies in a 3D space:
the
-th line contains three integers
,
,
(
)
giving the coordinates of the
-th fly (a point in a 3-dimensional Euclidean space).
No two flies are located in the same point.
Your program should output a single word TAK (i.e., yes in Polish) if the spider can catch all the flies with a single spiderweb. Otherwise your program should output the word NIE (no in Polish).
For the input data:
4 0 0 0 -1 0 -100 100 0 231 5 0 15
the correct result is:
TAK
whereas for the input data:
4 0 1 0 -1 0 -100 100 0 231 5 0 15
the correct result is:
NIE
Task author: Szymon Acedanski.