시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 0 | 0 | 0 | 0.000% |
The army has given you an assignment: given a model of a tank hull and a hit by a shot on that tank, which crucial components of that tank are pierced by the shot?
The tank hull is modelled by a convex three-dimensional polygon. All crucial components are modelled by axis-aligned boxes. Crucial components are disjoint and all fully inside the tank. The components and the tank hull also do not touch each other anywhere. The tank shot is specified by an origin vector, a direction vector and an initial speed. The origin vector always lies strictly outside of the tank hull.
All faces of the tank and crucial components have a resistance and a deflection threshold. The tank shot does not lose speed except when it hits a face, at which point the speed is reduced by the resistance of that face. After reduction, if the speed is at most the deflection threshold, the shot ricochets, deflecting from the face. We assume these ricochets are perfect, in that the angle of reflection is identical to the angle of incidence. A crucial component has the same resistance and deflection threshold for all six of its faces. Note that it is possible for a shot to ricochet more than once. If the shot does not ricochet, it continues in the same direction, potentially hitting another face after.
The shot disintegrates if its speed has been reduced to 0, or after it has pierced or deflected off of D faces. When the shot disintegrates, it no longer moves to pierce or deflect off of any other face. If a shot disintegrates when it reaches the limit of D face hits, it disintegrates at the position it hits that last face. A crucial component only counts as pierced if the tank shot comes strictly inside of it (so deflections off crucial components don’t count).
The army has told you that they will be happy with your software if it correctly deals with all cases in which the tank shot never comes within 10 centimeters of any edge or vertex of a face of the tank or a crucial component - your software can return any answer it wants if this does happen to be the case. You can therefore also assume it never happens that a tank shot goes through any face while moving parallel to that face (as you’d need different modelling for that anyway).
Given the tank hull, the crucial components, D, and the specification of the tank shot, can you list which crucial components end up being hit by the shot, and give the position where the tank shot ends up disintegrating?
The input starts with a line containing an integer T, the number of test cases. Then for each test case:
Integers on the same input line are separated by single spaces.
For each test case, output:
1 6 2 10 100 -20 0 0 1 0 0 4 50 30 10 10 10 10 10 -10 10 -10 -10 10 -10 10 4 50 30 -10 10 10 -10 10 -10 -10 -10 -10 -10 -10 10 4 50 30 10 10 10 10 10 -10 -10 10 -10 -10 10 10 4 50 30 10 -10 10 10 -10 -10 -10 -10 -10 -10 -10 10 4 50 30 10 10 10 -10 10 10 -10 -10 10 10 -10 10 4 50 30 10 10 -10 -10 10 -10 -10 -10 -10 10 -10 -10 3 0 0 2 2 2 10 20 -3 0 0 2 2 2 10 20
1 1 2 0 0
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2015 Preliminaries K번