Mashup Trainings Day 3: F0RE1GNERS' Contest

D. Deprecated Template Book
PDF 题面可用
你可以在这里下载。

单点时限: 3.0 sec

内存限制: 512 MB

样例

Input
1
0 0 0
1 1 1
7
2 U 1.5708
2 U 1.5708
2 L 1.5708
2 L 1.5708
2 U 1.5708
2 U 1.5708
2 L 1.5708
Output
1.41
Input
3
98.0663 29.2686 4.0475
57.1690 9.4575 48.7680
2
42.6416 D 0.6391
92.5603 D 0.9831
24.2912 41.9040 34.3073
54.1783 11.1332 12.7184
4
27.4207 R 2.1224
61.1714 R 1.2875
67.7295 D 3.0435
61.2343 U 1.2411
79.0860 63.4667 8.9258
24.7665 9.3323 61.5733
3
60.9123 L 3.0820
90.0900 L 2.8897
73.7178 R 1.5021
Output
63.7573
28.2537
83.3797