Problem:
Problem G: 天体観測

2012年のある日のこと。
北の田舎町に住むあなたは、愛娘を連れて展望台で星見をすることにした。
この町は都会と違って街明かりが少なく、空気も澄んでいるので、晴れた日は満天の星空が広がっている。
天文にそこそこ詳しいあなたは季節ごとの有名な星や星座、それにまつわる神話ぐらいは知っているのだが、
なにせここは星降る町、名前のわからない星座もたくさん見えている。
この前の星見のときにそういった星々に関する娘の質問に答えられなかったあなたは、
星見の時刻にいったいどの星座が見えるのかを調べたいと思った。

特定の日時にどの星が見えるのかを知るには、星座早見盤というアイテムが有用である。
最近では携帯端末のGPSと連携した星座早見盤アプリも提供されている。
だが、あいにくあなたの手元には星座早見盤がなく、携帯は七年前の機種で、最新のアプリが動くわけがなかった。
詰んだと思ったあなたが最後の望みをかけてハードディスクを漁ったところ、
なんと2012年1月1日の午前零時時点での各星座を構成する星々の位置を記したファイルを発見した。
これがあれば任意の日時の星の位置がわかるはず！
あなたは急いでどの星座が見えるのかを出力するプログラムを書くことにした。

星々の情報は、観測者を中心とした天球上の座標群として与えられている。
座標は方位角と高度のペアで表されている。
方位角は真北を0度、真東を90度というように時計回りに測った0度以上360度未満の角度であり、
高度は地平線上を0度、天頂を90度度、天底を-90度とした-90度以上90度以下の角度である。
各天体は北極星と観測者を結ぶ直線を回転軸として、天球上を一定速度で反時計回りに回転している。
その回転速度は24時間あたり(1+1/365.24)×360度である。
北極星は真北方向の高度43.2度の点にある。

ある星座が見えるとは、その星座を構成するすべての星が地平線より上にあることをいう。
テストデータにおいて、当該時刻に地平線から高度±0.01度以内に星があることはないとしてよい。
なお、地軸のズレ、天体との距離などは考えなくてよい。
また、2012年は閏年であることに注意せよ。

Input

入力は以下のような形式で与えられる。

mon/day hh:mm
n
name1 m1
a11 h11
a12 h12
...
a1m1 h1m1
name2 m2
a21 h21
...

一行目には星見をする2012年のある日時が24時制で与えられる。
二行目の n は見えるかどうか判定したい星座の数を表す。
残りの行はその n 個の星座の2012年1月1日 00:00時点での位置情報である。
各星座の情報の先頭行には、星座名 namei と星座を構成する星の数 mi が与えられる。
続く mi 行に、各星の方位角 aij と高度 hij が与えられる。
これらの二つの数値は小数点以下三桁まで記述された浮動小数点数である。

入力の数値は、1 ≤ n ≤ 1000、1 ≤ mi ≤ 1000、0.000 ≤ aij < 360.000、-90.000 ≤ hij ≤ 90.000を満たす。
また、星座名はアルファベットの大文字小文字からなり、長さが50文字を超えることはない。
サンプルにあるとおり、「夏の大三角」や「北斗七星」など、88星座に入っていないものが与えられることもある。
なお、時刻は日没後の時刻とはかぎらないが、気にせず星が見えるものとしてよい。

Output

入力に与えられた順に、指定された日時に見える星座の一覧を出力せよ。
一つも星座が見えないようなテストデータはないと仮定してよい。

Notes on Test Cases

上記入力形式で複数のデータセットが与えられます。

入力の1行目にデータセットの数Tが与えられます。

各データセットに対して上記出力形式で出力を行うプログラムを作成して下さい。

Sample Input

3
7/7 18:30
3
Aquila 8
359.216 -32.936
358.624 -49.913
352.155 -43.404
346.852 -35.279
345.110 -36.796
342.448 -44.407
343.088 -38.981
336.070 -43.369
Cygnus 11
357.838 6.615
355.808 5.107
353.475 -18.553
348.868 -10.771
347.949 1.298
344.907 -4.637
342.909 1.163
338.483 -9.293
338.854 -1.786
338.515 1.304
331.752 -10.737
Lyra 4
5.063 -7.812
2.708 -13.386
1.327 -2.841
0.815 -14.109
9/3 02:40
3
SevenStars 7
40.483 50.729
48.968 50.637
50.421 42.796
44.855 40.960
43.493 35.637
42.111 31.430
44.997 25.256
SummerTriangle 3
342.909 1.163
345.110 -36.796
5.063 -7.812
WinterTriangle 3
165.368 51.176
207.400 51.262
184.960 31.381
7/7 19:00
91
Andromeda 25
300.224 10.559
313.114 22.235
304.593 17.311
305.145 18.508
299.557 18.169
295.825 15.561
296.928 16.703
290.573 13.699
304.020 24.766
300.872 24.287
296.636 24.636
304.470 32.153
303.783 32.893
298.697 32.261
306.181 35.986
296.619 37.096
301.005 41.728
319.394 10.944
323.303 16.879
313.853 10.187
313.295 13.504
317.463 18.294
315.012 16.124
315.502 17.165
316.369 19.322
Antila 5
150.199 5.822
143.663 11.282
144.808 2.868
138.069 2.334
136.680 -6.080
Apus 6
159.498 -45.403
165.358 -47.196
157.404 -51.717
166.529 -52.133
167.065 -52.812
162.765 -60.430
Aquarius 28
318.790 -48.408
321.209 -45.287
318.270 -46.509
310.269 -47.366
305.625 -45.668
308.937 -39.175
306.021 -39.676
303.902 -30.310
293.964 -39.757
296.515 -33.643
282.661 -42.871
299.661 -28.583
300.287 -26.468
290.965 -33.635
281.107 -39.811
297.231 -25.827
293.848 -28.361
279.450 -36.914
284.435 -32.529
288.734 -27.776
281.899 -32.844
273.078 -34.510
284.834 -23.654
282.207 -25.447
282.043 -24.537
271.558 -31.463
273.631 -23.685
269.813 -26.206
Aquila 19
0.874 -31.730
359.216 -32.936
358.624 -49.913
355.895 -52.798
355.474 -35.099
353.377 -34.624
352.155 -43.404
349.613 -47.552
349.977 -38.924
345.808 -53.003
346.852 -35.279
339.294 -54.454
345.110 -36.796
342.448 -44.407
343.088 -38.981
340.624 -37.632
336.070 -43.369
340.114 -29.343
329.215 -43.658
Ara 8
139.371 -64.281
128.988 -67.070
126.140 -67.495
133.937 -70.565
146.948 -68.649
115.206 -73.448
124.296 -74.895
129.807 -78.284
Aries 16
275.089 19.700
277.208 23.346
277.494 27.270
273.485 25.417
269.538 23.135
277.570 29.777
272.582 27.036
270.956 32.094
275.776 36.366
274.279 37.296
262.543 29.989
266.391 34.798
273.056 41.891
263.012 36.658
263.680 38.088
262.590 39.297
Auriga 21
258.333 63.534
282.118 68.223
274.900 67.732
274.775 68.507
266.432 68.904
287.684 71.012
269.744 70.488
245.605 69.176
303.422 75.275
259.211 76.033
324.841 73.413
322.545 74.855
284.226 78.538
218.521 73.350
316.324 81.078
231.890 84.097
278.842 87.076
336.299 83.829
155.787 85.774
127.797 86.332
120.527 85.282
Bootes 24
63.869 9.873
69.774 4.070
67.862 3.467
60.529 5.629
63.774 0.539
40.081 23.036
44.262 19.473
67.421 -4.525
38.676 22.314
61.891 -1.179
53.418 6.177
47.886 11.938
53.387 5.299
42.612 15.477
64.297 -9.243
54.097 1.616
42.092 9.644
50.239 -1.089
36.476 15.172
51.041 -3.111
44.417 2.429
40.498 4.563
37.434 6.614
36.639 5.466
Caelum 3
206.749 -2.707
206.383 0.705
207.503 3.802
Camelopardis 9
336.366 53.550
306.868 63.261
314.379 64.832
333.859 61.000
324.283 65.152
333.999 66.052
347.170 66.444
358.133 64.282
22.412 70.692
Cancer 14
152.932 60.247
141.543 68.586
149.220 52.365
129.286 67.634
139.314 59.869
141.009 55.655
133.303 60.477
128.079 59.843
131.349 56.985
116.140 64.655
132.656 49.904
105.407 64.702
130.791 47.655
118.700 56.309
CanesVenatici 9
63.515 33.891
54.117 37.264
64.014 31.442
60.753 31.416
60.907 26.172
61.859 23.114
58.947 24.067
56.181 24.166
56.197 23.490
CanisMajor 12
189.554 16.222
191.117 30.052
187.145 25.454
184.960 31.381
182.841 15.253
182.535 34.807
180.964 19.769
180.236 20.737
179.917 24.636
179.696 32.436
178.624 21.184
175.070 17.938
CanisMinor 5
169.498 54.684
167.330 58.263
165.368 51.176
160.497 56.218
161.829 47.153
Capricornus 15
327.283 -54.381
319.640 -62.109
327.152 -54.307
324.725 -55.607
313.330 -57.369
302.734 -61.915
300.239 -61.281
305.714 -52.841
295.483 -58.754
302.466 -49.134
294.302 -53.161
297.453 -46.446
300.104 -41.866
295.158 -45.704
296.821 -42.155
Carina 7
186.061 -4.875
171.511 -4.945
169.452 -13.029
167.374 -24.125
162.642 -15.652
163.244 -28.369
156.225 -25.313
Cassiopeia 18
324.796 30.076
326.794 34.518
317.285 30.327
319.592 32.153
311.156 28.226
340.196 40.324
322.818 35.995
315.615 34.775
320.474 39.098
330.339 41.508
332.996 42.444
336.611 43.459
329.769 42.982
323.558 43.299
335.542 45.252
327.048 45.835
331.423 27.745
324.605 27.533
Centaurus 16
144.780 -21.358
151.103 -29.155
136.031 -24.020
134.304 -26.850
128.655 -31.224
114.889 -26.222
130.425 -37.948
109.349 -29.106
117.349 -34.385
122.386 -37.770
137.790 -43.449
109.153 -34.197
107.859 -36.848
112.627 -42.112
135.878 -47.823
110.171 -46.148
Cepheus 16
355.930 31.338
349.846 17.598
347.662 17.057
344.189 19.225
347.193 26.771
346.570 27.967
340.498 19.415
339.367 22.048
345.204 30.053
335.982 18.661
334.049 20.245
349.184 35.742
344.517 32.277
336.609 24.983
337.594 27.709
345.323 37.813
Cetus 29
267.392 -21.962
272.139 -12.783
274.115 -7.347
261.316 -14.311
265.273 -8.669
271.035 -2.352
270.805 1.139
261.818 -5.639
260.665 -1.490
256.455 -4.506
250.542 -9.105
252.749 -2.256
255.205 2.027
254.630 2.111
245.181 -4.356
264.415 18.831
253.034 9.471
247.128 6.587
261.394 21.309
243.942 5.376
257.758 20.709
249.146 12.323
253.144 17.620
243.530 9.279
259.617 25.458
255.832 27.254
251.561 24.282
245.843 22.473
247.574 26.675
Chamaeleon 6
174.828 -30.357
173.717 -31.227
167.691 -34.936
169.124 -36.723
161.658 -35.846
165.432 -40.069
Circinus 2
141.590 -48.550
132.085 -52.609
Columba 6
202.143 9.996
197.412 10.578
195.025 10.858
193.570 10.680
191.926 4.413
189.632 11.237
ComaBerenices 7
76.648 24.387
79.683 19.987
77.453 20.178
80.843 17.387
70.827 20.336
73.668 13.661
67.542 17.115
CoronaAustralis 3
76.831 -84.408
72.159 -87.309
349.050 -82.780
CoronaBorealis 6
44.830 -2.520
42.619 -1.332
44.991 -5.346
37.053 0.095
40.620 -8.046
33.560 -1.062
Corvus 4
114.367 -5.461
109.900 -2.973
106.846 -4.729
111.347 -10.379
Crater 7
124.123 8.440
124.193 3.979
117.555 8.787
118.622 5.586
110.936 9.608
116.023 1.385
113.531 0.100
Crux 4
142.482 -29.634
147.192 -33.867
140.733 -31.246
140.848 -33.879
Cygnus 26
357.838 6.615
355.808 5.107
353.475 -18.553
353.876 -12.067
354.603 3.708
351.653 -8.897
348.868 -10.771
346.567 -8.538
350.193 10.869
347.949 1.298
344.907 -4.637
342.557 -7.945
340.846 -13.795
342.909 1.163
338.483 -9.293
338.854 -1.786
340.656 4.326
338.515 1.304
336.234 -3.364
331.752 -10.737
334.609 -1.970
332.686 -6.040
335.619 5.437
334.489 4.935
331.664 0.559
334.307 9.233
Delphinus 5
333.672 -31.713
331.571 -32.362
333.741 -26.848
332.447 -27.320
332.054 -26.066
Dorado 7
205.464 -10.486
200.871 -13.113
196.063 -12.729
191.203 -21.965
190.853 -16.249
188.787 -18.553
185.561 -20.832
Draco 28
28.940 47.754
32.728 46.686
27.652 42.406
32.423 39.207
30.070 33.592
29.528 32.232
26.812 21.591
22.960 18.431
14.533 25.591
12.136 21.124
13.986 7.554
8.952 22.630
12.900 10.242
12.891 10.228
8.276 23.088
6.773 26.220
4.729 30.713
9.530 11.119
10.253 5.765
5.511 18.022
3.426 26.157
1.169 28.661
1.500 12.613
0.731 24.504
358.998 20.874
358.972 26.573
353.557 29.067
356.093 36.356
Equuleus 2
323.384 -29.260
319.354 -32.975
Eridanus 29
219.089 -30.779
223.136 -24.855
220.757 -22.413
222.767 -18.286
226.742 -10.667
236.404 3.705
244.644 15.058
223.094 -9.567
233.490 4.341
240.785 18.142
239.287 22.218
236.398 19.741
228.885 10.392
230.696 13.844
234.428 21.532
239.136 27.577
224.969 10.176
228.619 20.174
235.564 30.495
230.014 28.159
229.050 32.214
212.080 4.745
211.967 9.906
225.626 33.576
218.908 24.204
220.788 30.349
223.184 34.664
215.927 35.337
214.381 33.359
Fornax 7
238.898 -9.116
237.171 -8.220
240.540 -1.605
231.177 -8.178
229.829 -4.623
224.613 6.412
221.710 3.538
Gemini 22
215.932 66.683
204.877 67.736
199.742 65.953
193.146 62.679
193.518 71.530
188.373 59.467
192.635 80.565
180.202 71.018
179.143 67.371
174.375 62.866
171.813 63.143
168.932 68.478
161.323 73.914
153.261 77.453
148.264 77.059
154.841 72.360
152.127 69.337
146.998 72.565
156.258 63.667
134.440 76.874
143.773 70.603
136.491 70.307
Grus 10
266.639 -56.891
261.892 -55.418
250.399 -57.109
258.350 -51.534
252.761 -52.750
247.501 -51.272
238.441 -51.698
236.933 -49.917
245.584 -46.524
235.380 -46.029
Hercules 31
33.142 5.662
43.844 -17.673
29.344 6.259
26.982 6.515
39.748 -17.544
45.996 -28.329
41.678 -22.405
36.788 -16.433
26.483 1.894
22.911 7.383
26.485 -1.995
30.710 -15.768
27.551 -9.426
26.391 -10.747
25.126 -8.401
32.749 -27.966
25.531 -17.599
21.385 -6.334
21.711 -10.815
15.742 3.862
21.581 -17.539
14.288 1.096
17.591 -16.951
15.964 -19.046
13.290 -8.148
14.702 -16.037
17.081 -28.351
12.616 -16.934
9.946 -24.416
4.443 -26.136
4.239 -28.516
Horologium 4
212.195 -27.502
215.685 -21.711
209.563 -22.898
210.127 -2.984
Hydra 24
143.985 47.058
145.069 44.803
151.923 30.938
145.140 38.337
138.169 45.241
135.092 39.726
136.675 32.126
137.556 29.724
130.493 33.636
138.050 22.682
132.130 20.111
130.180 20.428
129.080 15.379
131.778 8.535
124.835 11.440
128.852 0.658
126.517 -5.926
127.538 -9.245
104.527 -18.245
98.485 -25.440
99.975 -26.915
99.280 -28.259
98.943 -34.064
93.274 -36.105
Hydrus 11
198.297 -43.876
202.979 -41.907
208.163 -34.122
213.775 -30.545
205.448 -32.460
200.398 -35.209
193.118 -38.207
203.866 -31.341
200.214 -31.329
193.659 -34.973
194.307 -31.540
Indus 7
249.907 -72.922
239.450 -71.406
220.919 -67.358
206.717 -56.713
235.616 -59.690
231.364 -58.806
207.454 -50.856
Lacerta 4
330.868 14.794
328.679 13.927
320.762 5.716
321.696 8.482
Leo 27
108.913 56.585
123.339 44.644
122.115 42.133
99.000 55.511
117.773 44.879
106.792 51.358
102.424 51.543
118.908 37.713
109.440 42.916
113.660 39.315
100.430 45.670
106.478 36.782
110.515 33.255
99.191 37.449
106.077 31.291
109.303 24.383
105.551 26.268
109.300 22.087
92.537 33.471
97.094 30.159
110.548 17.282
103.478 22.505
104.608 19.066
104.441 16.037
87.023 27.107
91.610 23.269
89.591 22.768
LeoMinor 9
90.267 60.380
78.517 57.855
92.724 53.388
86.200 50.349
81.581 50.769
86.265 46.546
95.468 40.706
86.698 44.569
81.288 45.027
Lepus 9
208.923 19.793
209.526 25.864
209.073 29.219
204.435 23.896
204.385 27.140
199.741 22.797
201.635 31.020
198.720 25.558
198.849 30.984
Libra 16
81.767 -29.125
83.418 -30.457
77.768 -27.899
74.449 -26.474
89.322 -38.371
81.462 -35.785
72.163 -30.079
75.587 -36.700
69.669 -33.980
72.203 -36.540
86.964 -46.207
75.625 -41.168
74.720 -44.181
67.649 -40.782
68.788 -42.391
61.765 -36.662
Lupus 11
117.171 -41.790
118.068 -45.036
111.531 -46.416
116.593 -50.101
123.695 -51.230
93.851 -43.568
104.221 -48.998
99.276 -47.504
98.305 -47.468
90.274 -51.170
91.817 -55.374
Lynx 10
340.957 72.851
350.646 71.341
13.353 77.484
18.414 73.281
59.902 79.893
47.406 76.156
83.141 75.429
72.888 72.348
78.567 66.265
96.482 61.871
Lyra 7
8.778 -10.140
5.063 -7.812
2.708 -13.386
1.327 -2.841
0.815 -14.109
359.054 -10.696
357.282 -8.610
Mensa 7
188.214 -35.195
193.058 -25.199
190.066 -28.325
185.361 -35.800
186.324 -29.775
184.202 -26.795
181.257 -32.429
Microscopium 5
264.385 -70.579
286.221 -64.016
274.073 -66.473
281.802 -61.120
266.935 -63.909
Monoceros 11
193.937 39.673
195.344 50.445
191.879 42.909
192.497 53.543
187.013 55.210
185.664 49.081
177.432 43.009
176.624 47.247
168.308 42.271
167.934 37.614
160.433 42.707
Musca 5
152.442 -31.405
156.829 -38.365
153.135 -37.536
154.045 -40.135
148.162 -39.941
Norma 3
108.500 -58.666
125.170 -60.575
117.887 -61.581
Octans 13
198.046 -45.252
176.567 -38.166
173.012 -42.811
172.072 -43.886
172.730 -47.145
179.818 -46.801
191.207 -53.945
182.212 -45.697
194.137 -52.731
192.192 -49.399
186.876 -46.654
191.609 -47.909
184.474 -44.508
Ophiuchus 20
54.470 -34.618
54.219 -36.013
48.446 -37.238
54.066 -43.720
50.326 -45.370
36.864 -29.115
36.334 -30.222
43.032 -42.256
53.910 -61.019
53.402 -62.293
31.010 -37.921
59.681 -65.616
25.109 -30.741
42.187 -61.743
25.758 -38.990
25.154 -41.103
26.385 -52.352
20.997 -41.799
16.895 -35.752
14.223 -42.479
Orion 20
228.557 43.501
227.159 42.547
233.926 49.831
224.091 40.245
231.313 52.497
224.916 48.508
212.650 33.396
213.079 36.124
214.760 41.605
217.291 47.355
211.550 42.550
216.105 51.230
208.390 38.774
209.681 41.921
203.047 35.727
207.400 51.262
202.907 45.028
202.227 48.919
206.751 59.217
201.381 57.499
Pavo 10
157.654 -67.059
164.415 -71.696
176.459 -62.514
176.133 -71.320
189.680 -61.203
196.371 -65.611
220.726 -71.988
203.251 -63.374
200.903 -58.638
210.828 -60.620
Pegasus 31
289.423 1.639
292.789 5.389
325.271 -19.328
325.355 -15.082
321.576 -18.057
315.029 -25.454
309.887 -31.091
324.502 -7.231
321.746 -10.569
313.113 -20.498
318.709 -9.439
322.477 -2.549
322.345 -2.460
306.855 -24.931
308.208 -18.427
304.677 -19.779
318.503 -0.637
303.255 -16.572
314.882 -0.922
310.240 -4.458
309.992 0.187
301.577 -9.597
297.306 -13.646
295.935 -13.393
304.294 -0.680
309.331 6.413
303.256 -0.214
295.450 -7.529
295.715 0.944
290.000 -4.903
299.060 6.102
Perseus 24
307.992 37.714
307.408 38.982
311.185 41.765
294.837 44.540
301.426 46.254
310.678 48.794
305.863 48.704
281.711 43.164
306.515 50.399
285.480 45.931
287.939 47.329
300.332 50.249
299.861 52.709
296.472 53.324
295.380 55.305
286.455 54.355
269.053 51.499
280.841 55.738
273.943 54.251
299.144 59.485
293.899 59.557
295.040 60.674
268.445 57.603
282.731 62.992
Phoenix 9
240.413 -36.726
241.278 -32.781
234.988 -34.724
235.320 -32.610
223.631 -37.224
233.002 -23.838
227.369 -22.186
247.359 -41.041
233.157 -41.238
Pictor 5
199.115 -5.204
196.549 -5.314
190.277 -10.223
187.892 -6.886
181.859 -13.299
Pisces 30
276.084 -15.147
276.760 -13.373
283.165 -1.965
277.824 -5.444
287.819 5.104
277.923 2.647
284.761 9.075
292.714 18.557
275.728 5.436
280.618 10.596
284.273 15.764
291.602 21.582
273.667 7.181
270.057 5.224
288.083 21.157
280.421 17.307
276.573 15.617
273.154 14.509
267.381 10.808
269.460 14.019
263.563 11.435
294.064 -18.352
291.117 -16.513
287.818 -16.306
291.268 -12.413
288.534 -10.905
285.402 -13.291
282.129 -14.379
279.313 -13.299
285.935 -6.652
PiscesAustrinus 8
278.189 -58.674
274.140 -56.842
272.659 -51.571
277.649 -47.812
267.833 -47.693
271.890 -43.451
267.416 -41.162
260.978 -42.711
Puppis 9
184.580 3.817
182.079 -2.625
177.070 9.833
175.119 3.899
167.505 32.508
168.381 22.802
168.339 5.677
164.057 21.464
160.076 30.354
Pyxis 4
158.634 10.564
154.957 16.224
152.121 11.537
147.334 15.581
Reticulum 5
204.908 -22.855
201.994 -23.451
202.121 -20.347
199.887 -20.103
198.493 -20.590
Sagitta 3
349.566 -28.691
348.056 -27.420
345.286 -25.999
Sagittarius 25
48.012 -67.119
44.526 -72.258
28.519 -65.511
51.339 -78.206
32.619 -72.785
41.334 -77.820
23.740 -70.063
12.238 -71.480
5.559 -72.441
3.057 -67.672
356.728 -73.111
355.646 -67.730
351.935 -63.658
350.579 -60.563
262.868 -86.361
312.000 -84.491
337.993 -68.724
340.644 -61.337
339.682 -61.389
336.325 -63.392
282.888 -79.729
333.366 -58.963
302.710 -76.078
319.336 -69.154
268.021 -75.299
Scorpius 14
80.363 -49.004
74.835 -46.432
70.299 -45.175
73.601 -52.052
73.114 -54.227
74.595 -56.737
80.967 -62.586
89.217 -64.779
98.307 -69.868
77.481 -71.296
77.193 -71.890
89.403 -74.055
81.163 -74.348
83.072 -75.589
Sculptor 11
258.000 -26.547
249.899 -31.550
243.095 -27.647
248.893 -19.849
246.841 -20.340
240.080 -14.665
244.594 -9.531
260.749 -39.021
253.603 -38.949
257.110 -35.369
259.902 -31.592
Scutum 5
16.148 -59.376
11.653 -54.049
8.921 -55.461
8.156 -54.279
6.023 -49.906
Serpens 13
62.443 -19.751
53.456 -13.220
55.387 -23.131
49.361 -16.131
47.238 -14.241
60.461 -31.027
55.246 -25.667
47.088 -17.328
50.255 -33.010
39.013 -56.091
15.238 -46.901
11.969 -46.189
2.194 -42.577
SevenStars 7
40.483 50.729
48.968 50.637
50.421 42.796
44.855 40.960
43.493 35.637
42.111 31.430
44.997 25.256
Sextans 5
129.626 29.644
126.345 22.444
122.446 24.760
119.299 25.894
119.015 18.085
SummerTriangle 3
342.909 1.163
345.110 -36.796
5.063 -7.812
Taurus 27
250.893 31.722
250.982 32.632
252.943 35.539
241.685 27.325
261.126 45.412
244.002 33.045
260.593 45.877
260.194 46.146
245.956 40.306
239.935 35.811
254.646 47.658
250.907 46.787
258.577 51.508
239.262 40.001
244.242 45.761
245.368 47.668
245.642 49.782
239.805 47.440
240.886 49.021
246.413 54.695
238.949 53.205
238.548 57.087
240.905 65.777
226.104 57.692
225.532 61.707
217.863 59.965
227.613 69.046
Telescopium 6
99.632 -80.656
100.423 -83.483
175.148 -82.103
227.583 -82.622
206.443 -75.581
228.471 -76.495
Triangulum 5
285.165 28.434
288.118 34.349
285.904 35.093
280.102 34.723
286.401 38.875
TriangulumAustrale 6
148.672 -52.090
146.607 -54.162
142.070 -56.831
142.826 -59.157
156.860 -56.997
157.390 -58.985
Tucana 6
216.837 -42.185
208.705 -40.221
217.821 -35.934
223.308 -56.356
226.434 -48.712
215.737 -44.634
UrsaMajor 29
29.282 68.109
66.378 69.195
22.970 60.853
68.864 68.465
34.212 60.841
58.080 63.568
23.054 57.220
43.463 59.925
73.296 55.002
33.894 55.376
75.061 53.630
50.113 54.941
48.195 54.330
72.518 46.730
48.968 50.637
40.483 50.729
65.995 46.548
79.010 39.942
73.034 42.329
65.674 42.568
74.681 36.517
58.506 41.892
50.421 42.796
44.855 40.960
42.300 39.601
36.409 39.726
43.493 35.637
42.111 31.430
44.997 25.256
UrsaMinor 10
359.062 43.472
15.334 38.584
16.704 36.737
17.194 34.620
17.526 31.442
11.304 34.699
11.341 32.253
11.030 31.917
5.554 36.468
1.714 40.033
Vela 5
168.619 -1.071
164.855 -6.629
157.488 -0.252
160.372 -12.557
155.025 -13.588
Virgo 33
98.539 18.430
101.244 14.256
95.800 15.774
93.423 16.427
96.882 8.238
94.860 9.978
97.474 1.850
98.384 0.141
86.005 10.761
87.288 8.349
97.602 -4.270
88.734 3.618
92.116 -0.944
82.053 7.572
92.018 -4.372
83.466 1.036
100.540 -14.806
94.167 -11.471
94.253 -12.053
75.583 4.802
81.944 -3.198
84.072 -5.412
87.744 -9.129
88.703 -12.071
94.791 -18.290
95.548 -20.598
78.670 -9.609
85.118 -19.408
81.691 -17.430
86.326 -22.486
76.304 -16.663
75.459 -21.104
70.253 -17.188
Volans 6
181.087 -22.253
179.426 -22.704
178.481 -19.274
176.577 -24.804
171.114 -20.237
167.223 -21.251
Vulpecula 7
353.634 -21.875
350.153 -20.389
346.451 -17.791
342.107 -20.025
335.915 -21.936
334.725 -14.255
331.735 -19.292
WinterTriangle 3
165.368 51.176
207.400 51.262
184.960 31.381

Output for Sample Input

Cygnus
Lyra
SevenStars
SummerTriangle
WinterTriangle
Bootes
Camelopardis
Cancer
CanesVenatici
Cassiopeia
Cepheus
ComaBerenices
CoronaBorealis
Corvus
Crater
Cygnus
Delphinus
Draco
Hercules
Lacerta
Leo
LeoMinor
Libra
Lynx
Lyra
Ophiuchus
Sagitta
Scutum
Serpens
SevenStars
Sextans
SummerTriangle
UrsaMajor
UrsaMinor
Virgo
Vulpecula

Solution in Kotlin (judge verdict: Accepted)

import java.lang.Math.*

fun main(args:Array<String>):Unit {
    val pole = angleToPoint(.0, 43.2).toVector()
    val angleVelocity = (1 + 1 / 365.24) * PI * 2
    repeat(readLine()!!.trim().toInt()) {
        val (dateStr, timeStr) = readLine()!!.trim().split(' ')
        val date = Date(dateStr)
        val time = Time(timeStr)
        val constellation = Array(readLine()!!.trim().toInt()) {
            val (name, starSize) = readLine()!!.trim().split(' ')
            Constellation(name, Array(starSize.toInt()) {
                val (azimuth, elevation) = readLine()!!.trim().split(' ').map(String::toDouble)
                angleToPoint(azimuth, elevation)
            }.asIterable())
        }
        val q = Quaternion.screwLeft(pole, angleVelocity * (date.dayFromNewYear + time.time))
        println(
                constellation.filter{
                    it.rotate(q).isCanSee()
                }.joinToString("\n"){it.name}
        )
    }
}
data class Date(val month:Int, val day:Int){
    constructor(date:String):this(date.split('/').first().toInt(), date.split('/').last().toInt())
    val dayFromNewYear:Int
        get() = monthes.take(month).sum() + day - 1
    companion object {
        private val monthes:Iterable<Int> = listOf(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
    }
}
data class Time(val hour:Int, val minute:Int){
    constructor(time:String):this(time.split(':').first().toInt(), time.split(':').last().toInt())
    val time:Double
        get() = (hour + minute / 60e0) / 24
}
class Constellation(val name:String, private val mStars:Iterable<Point>){
    fun rotate(quaternion: Quaternion):Constellation {
        return Constellation(name, mStars.map{(quaternion * it.toQuaternion() * conjugate(quaternion)).toPoint()})
    }
    fun isCanSee():Boolean = mStars.all{it.z > 0}
}
fun angleToPoint(azimuth:Double, elevation:Double):Point {
    val azimuthQ = Quaternion.screwLeft(Vector(0e0, 0e0, 1e0), azimuth * PI / 180)
    val elevationQ = Quaternion.screwLeft(Vector(0e0, 1e0, 0e0), elevation * PI / 180)
    return (azimuthQ * elevationQ * Vector(1e0, 0e0, 0e0).toQuaternion() * conjugate(elevationQ) * conjugate(azimuthQ)).toPoint()
}
data class Point(val x:Double, val y:Double, val z:Double){
    constructor(x:Int, y:Int, z:Int):this(x.toDouble(), y.toDouble(), z.toDouble())
}
fun Quaternion.toPoint():Point{
    return Point(this.i, this.j, this.k)
}
fun Point.toQuaternion():Quaternion{
    return Quaternion(0e0, this.x, this.y, this.z)
}
data class Vector(val x:Double, val y:Double, val z:Double){
    val length:Double = sqrt(x * x + y * y + z * z)
    fun map(transformer:(Double) -> Double):Vector = Vector(transformer(x), transformer(y), transformer(z))
}
operator fun Vector.times(other:Double):Vector = this.map{it * other}
operator fun Vector.div(other:Double):Vector = this.map{it / other}
fun Vector.toQuaternion():Quaternion {
    return Quaternion(0e0, this.x, this.y, this.z)
}
fun Point.toVector():Vector{
    return Vector(this.x, this.y, this.z)
}
data class Quaternion(val real:Double, val i:Double, val j:Double, val k:Double){
    operator fun plus(that:Quaternion):Quaternion = Quaternion(real + that.real, i + that.i, j + that.j, k + that.k)
    operator fun times(that:Quaternion):Quaternion {
        return timesR(that.real) + timesI(that.i) + timesJ(that.j) + timesK(that.k)
    }
    private fun timesI(value:Double):Quaternion = Quaternion(-i * value, real * value, -k * value, j * value)
    private fun timesJ(value:Double):Quaternion = Quaternion(-j * value, k * value, real * value, -i * value)
    private fun timesK(value:Double):Quaternion = Quaternion(-k * value, -j * value, i * value, real * value)
    private fun timesR(value:Double):Quaternion = Quaternion(real * value, i * value, j * value, k * value)
    companion object {
        fun screwLeft(axis:Vector, radian:Double):Quaternion {
            val normalizedAxis = axis / axis.length * sin(radian / 2)
            return Quaternion(cos(radian / 2), normalizedAxis.x, normalizedAxis.y, normalizedAxis.z)
        }
    }
}
fun conjugate(quaternion: Quaternion):Quaternion {
    return Quaternion(quaternion.real, -quaternion.i, -quaternion.j, -quaternion.k)
}