UFBA - DSU Training Contest |
---|
Finished |
You have been given the coordinates of $$$N$$$ points in three-dimensional space—namely, $$$P_1, P_2, \dots, P_N$$$. Initially, these points are distributed into $$$N$$$ singleton sets, one for each point. You have been asked to execute $$$Q$$$ operations involving these sets.
Operations may be of three distinct types:
The first line contains a single integer $$$N$$$, indicating the number of points which follow. Each of the next $$$N$$$ lines contain three integers $$$x_i$$$, $$$y_i$$$ and $$$z_i$$$, representing the coordinates of the $$$i$$$th point.
The next line contains an integer $$$Q$$$, indicating the number of queries that should be answered. Each of the next $$$Q$$$ lines represents a query, and has one of the following three formats:
Limites:
For each Type 3 query, you should print its answer in a single line.
5 1 5 0 2 4 0 3 3 0 4 2 0 5 1 0 7 3 1 2 1 1 4 3 1 2 1 2 5 3 1 2 2 3 1 2
2 4 8 4
4 -10 -10 0 -10 10 0 10 -10 0 10 10 0 6 3 2 4 1 1 2 3 2 4 3 4 3 3 1 3 3 1 4
20 40 20 40 40
Name |
---|