QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#255398#7750. Revenge on My Bossucup-team878#AC ✓348ms12616kbC++172.5kb2023-11-18 15:45:252023-11-18 15:45:25

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3540kb

input:

2
4
1 1 4
5 1 5
1 9 1
9 8 1
9
3 1 4
1 5 9
2 6 5
3 5 8
9 7 9
3 2 3
8 4 6
2 6 8
3 2 7

output:

1 3 2 4 
3 8 4 2 5 9 7 1 6 

result:

ok correct

Test #2:

score: 0
Accepted
time: 348ms
memory: 11004kb

input:

1
100000
581297 102863 1
742857 42686 1
676710 233271 1
443055 491162 1
442056 28240 1
769277 331752 1
8608 369730 1
495112 525554 1
787449 938154 1
441186 850694 1
84267 925450 1
740811 32385 1
834021 37680 1
257878 564126 1
90618 914340 1
239641 463103 1
40687 343062 1
587737 458554 1
103684 48666...

output:

70717 6151 48237 28851 35679 19561 94252 73342 13089 34865 69194 82763 50242 22597 3745 24913 97923 53671 77581 47428 82224 93567 61401 50007 4886 28731 54152 91278 99937 6691 26840 6048 46204 66044 60735 44469 20513 45842 18701 46818 27203 9261 50507 8020 72391 54368 86201 18839 64763 61758 40939 3...

result:

ok correct

Test #3:

score: 0
Accepted
time: 270ms
memory: 10980kb

input:

1
99999
30245 831673 1
495617 185056 1
53028 422589 1
503558 778900 1
636981 480008 1
966864 78785 1
644954 303138 1
153080 225499 1
876411 832264 1
758904 549009 1
945000 441995 1
83780 789901 1
883282 832556 1
300776 548075 1
806599 108342 1
354979 831549 1
152110 819163 1
613891 812479 1
856259 6...

output:

1 3 4 8 12 14 16 17 18 20 23 24 27 29 31 32 33 34 35 38 40 44 49 51 52 53 59 62 63 64 65 68 69 71 72 73 74 78 80 82 83 85 86 89 92 101 103 104 108 109 113 114 115 120 124 127 131 132 133 134 137 138 140 141 142 144 147 148 150 151 152 153 154 155 156 157 158 160 162 164 165 166 167 169 170 171 172 1...

result:

ok correct

Test #4:

score: 0
Accepted
time: 321ms
memory: 10440kb

input:

1
100000
361850 684411 2
188930 167748 2
676274 449963 1
970095 784305 1
412379 854673 1
208323 612179 1
296548 633970 1
560983 633064 2
848966 248363 2
741057 340814 1
393854 435721 2
302707 834494 1
229770 235051 2
875992 747523 2
314215 448795 1
531181 809914 2
786505 95721 1
86557 773136 1
44527...

output:

5 6 7 12 15 18 19 23 27 32 36 37 39 53 54 55 57 60 65 71 76 78 82 88 95 99 100 103 106 107 113 120 126 128 135 140 147 149 157 164 165 167 168 171 173 174 175 179 186 192 194 196 204 206 210 213 214 220 221 226 227 230 231 239 254 258 260 265 269 276 284 290 292 293 300 304 307 313 319 321 327 329 3...

result:

ok correct

Test #5:

score: 0
Accepted
time: 321ms
memory: 9716kb

input:

1
99999
810798 413222 2
974394 310117 1
987184 606577 2
30598 6635 1
607304 306441 1
438614 583404 1
932894 375890 1
994760 333009 2
937928 950984 2
58774 6426 1
287291 728073 1
421484 592009 1
470520 62631 1
918891 764176 2
997492 642796 1
679223 178361 2
865224 571822 2
112711 192469 1
165146 9387...

output:

6 11 12 18 22 28 29 47 59 66 67 68 72 86 94 95 99 106 110 111 115 117 126 128 132 137 144 146 149 158 159 160 162 164 166 170 175 178 181 182 184 185 186 189 197 198 202 203 206 209 216 224 226 227 234 235 241 244 245 254 276 288 289 290 291 302 304 306 315 318 323 327 331 336 340 343 352 354 357 35...

result:

ok correct

Test #6:

score: 0
Accepted
time: 299ms
memory: 11364kb

input:

1
100000
142404 976360 1
924602 517001 3
610429 601247 2
529839 44745 3
606894 456914 2
488586 84093 1
360297 674019 1
435366 740573 3
943187 591275 3
8223 87831 2
703441 689095 1
673115 893499 3
817008 689318 2
237211 187815 1
472404 15953 2
822721 932534 2
275427 591484 3
393890 928933 1
11058 141...

output:

1 7 10 16 18 25 27 32 33 35 39 41 42 55 56 58 59 60 61 64 67 68 75 76 79 80 82 83 87 88 89 92 93 97 98 103 109 116 119 123 124 125 129 136 138 140 143 145 146 147 149 153 154 163 165 170 176 178 185 187 190 192 194 195 205 210 215 217 221 223 225 227 228 230 231 234 235 238 239 242 244 245 247 251 2...

result:

ok correct

Test #7:

score: 0
Accepted
time: 297ms
memory: 11536kb

input:

1
99999
815544 929362 2
644659 659371 3
954043 790565 3
398854 42883 3
577627 875978 2
718877 831126 1
996643 640131 2
869143 249030 3
32149 261192 1
325941 753442 3
372686 238344 2
48789 426822 2
57757 260002 1
280109 237173 3
931489 242658 2
970763 300980 2
578337 100288 1
611532 282858 3
506737 2...

output:

1 5 6 9 12 13 23 24 25 32 43 47 48 49 57 67 69 74 76 81 87 88 91 92 98 99 102 106 107 110 111 112 115 116 120 121 122 123 127 128 130 131 133 135 138 140 143 144 148 153 154 156 157 161 162 163 164 165 166 168 174 175 176 177 179 183 184 188 199 200 201 204 206 215 216 221 222 223 225 228 231 232 23...

result:

ok correct

Test #8:

score: 0
Accepted
time: 286ms
memory: 10444kb

input:

1
100000
179854 525204 1
403379 866255 3
544585 817939 4
832686 337889 3
577217 283347 1
960336 331815 3
424045 970964 1
309749 591186 4
37408 677291 2
308093 545247 1
45732 199365 1
267715 728311 2
404245 919393 4
855325 436620 1
406400 774600 3
146965 279345 3
955837 376846 3
860006 276218 2
28724...

output:

1 2 7 9 10 11 12 15 16 19 20 21 24 27 33 35 36 40 42 43 44 45 46 48 51 52 55 56 61 63 68 71 72 73 75 76 77 82 84 85 92 94 100 102 103 105 106 110 112 113 114 117 122 123 128 132 137 140 144 157 159 164 166 167 168 171 173 176 179 183 186 187 194 195 201 204 206 212 214 215 221 222 223 225 229 232 23...

result:

ok correct

Test #9:

score: 0
Accepted
time: 289ms
memory: 9972kb

input:

1
99999
628802 478207 4
156140 784432 3
920902 198745 3
925893 336026 4
772142 702412 2
190627 335745 3
93095 937076 4
710822 356539 2
126370 604104 4
625811 243562 3
714977 524422 2
386493 485827 2
677699 522781 4
898224 453274 1
89677 777113 3
262303 647792 3
291451 852947 2
886160 662847 1
848327...

output:

2 6 12 15 16 17 20 21 22 27 28 30 31 36 37 39 41 42 45 46 47 48 50 51 53 54 55 57 62 75 77 79 81 83 84 85 87 90 93 98 99 100 102 104 105 111 113 118 119 124 125 126 127 129 133 134 136 140 148 151 152 153 155 160 168 173 176 178 182 189 190 191 193 194 195 199 201 202 203 206 210 212 214 215 218 220...

result:

ok correct

Test #10:

score: 0
Accepted
time: 306ms
memory: 9976kb

input:

1
100000
993111 41344 2
849452 991316 3
287252 969223 4
392430 565624 3
547540 852885 3
240598 836434 5
520498 11013 2
151428 698695 1
98926 987499 3
607963 259559 2
131127 518148 5
638124 530420 3
991483 116764 5
440736 876913 1
564589 309054 1
438505 593453 5
701654 872609 4
391530 399311 5
628832...

output:

2 4 5 8 9 14 19 22 23 31 34 35 36 42 45 46 62 63 64 67 68 78 82 83 85 97 107 108 112 113 117 120 128 130 131 134 135 139 148 155 156 160 161 163 164 165 168 171 179 180 181 185 190 199 203 206 209 210 213 219 221 222 223 225 228 232 234 236 250 259 260 265 266 271 274 275 280 282 285 286 287 288 289...

result:

ok correct

Test #11:

score: 0
Accepted
time: 309ms
memory: 10448kb

input:

1
99999
633547 770155 1
634916 133686 5
855058 382733 4
485637 596466 2
742466 271949 3
470889 583467 1
156844 977125 2
585205 464048 5
187887 690121 3
892977 925171 2
57268 34693 4
981093 255232 2
232232 977047 5
516338 893566 4
247866 311567 3
586547 994603 5
4565 348710 5
417684 977428 3
124510 7...

output:

1 4 6 7 9 10 15 18 24 25 33 34 40 42 47 49 51 61 69 75 78 80 83 88 90 92 96 109 111 116 123 127 132 144 145 147 156 158 164 166 170 172 174 181 183 184 186 197 200 205 206 207 208 209 217 227 232 243 248 254 256 262 263 266 271 272 274 279 280 285 286 287 290 291 298 299 305 313 319 322 324 327 329 ...

result:

ok correct

Test #12:

score: 0
Accepted
time: 300ms
memory: 11036kb

input:

1
100000
997857 590189 5
552421 307866 1
221408 153211 4
952174 826064 4
742055 646614 4
712348 116860 2
808438 307957 5
250004 806205 1
193147 297708 2
875130 941168 5
473418 995714 5
975828 556721 3
578721 379543 1
834658 317206 4
722778 876212 3
730045 972968 6
414768 657972 1
633455 746596 6
970...

output:

8 9 15 17 20 25 28 30 32 33 36 37 40 41 43 44 47 57 60 62 67 68 69 73 74 76 77 78 81 83 84 86 89 90 92 93 99 100 102 107 110 112 115 119 123 127 128 129 134 138 151 152 160 164 186 190 191 194 195 196 197 201 209 219 221 223 224 228 229 231 235 240 242 248 249 250 252 253 254 257 258 260 262 265 266...

result:

ok correct

Test #13:

score: 0
Accepted
time: 302ms
memory: 10676kb

input:

1
99999
414101 318999 4
305181 450235 4
789213 599425 5
12677 889610 6
936981 98382 2
942639 831190 3
444784 241365 4
683780 538854 3
314812 329 6
192848 447995 3
142664 320771 6
384205 90044 2
595278 174418 6
877557 109667 2
181863 102918 3
910791 341415 2
526191 134073 2
659609 133225 3
690293 561...

output:

2 10 23 30 31 38 39 40 43 48 54 57 58 61 63 66 71 73 75 80 83 84 89 90 96 104 108 111 113 114 116 117 118 120 126 128 133 135 136 138 143 145 148 149 151 153 154 156 157 163 165 168 172 178 180 182 183 185 187 188 191 196 199 200 201 204 205 207 208 213 214 215 217 234 235 242 243 248 250 255 258 26...

result:

ok correct

Test #14:

score: 0
Accepted
time: 309ms
memory: 10032kb

input:

1
100000
778411 171737 3
31198 657119 3
155563 369903 1
511917 119207 6
679674 248855 4
992610 588775 5
872187 572198 6
91683 913714 4
254664 416428 3
175000 463992 3
815710 281793 4
603132 358830 2
165958 576913 2
420069 533307 7
656775 410667 2
278481 287076 5
160586 153734 2
164979 126586 2
27930...

output:

2 3 8 9 10 13 25 30 33 35 38 40 47 54 61 65 69 70 71 73 74 75 80 87 91 95 101 104 105 114 122 123 127 134 137 148 150 155 160 161 173 176 177 179 185 192 193 196 198 202 204 208 214 216 218 224 226 230 232 234 237 239 240 241 243 245 250 254 258 263 271 276 279 283 288 291 292 293 306 307 315 318 32...

result:

ok correct

Test #15:

score: 0
Accepted
time: 308ms
memory: 10160kb

input:

1
99999
451551 900548 5
783958 575297 1
756073 750709 5
605124 150049 5
907304 667919 2
190198 335808 4
508533 538310 7
525460 422171 6
409034 310537 1
268526 129603 1
484955 798337 5
946101 116345 4
215220 404493 1
495671 549960 7
340051 637372 6
169627 688226 2
206600 629835 3
191133 480511 4
3188...

output:

6 13 16 17 18 20 29 30 33 36 40 46 50 51 53 57 62 66 67 73 75 86 88 89 91 92 93 94 101 103 105 107 109 113 116 121 126 140 145 148 154 155 159 160 168 172 173 174 177 179 180 185 188 189 193 196 199 203 207 214 215 224 225 226 231 232 238 239 240 243 244 246 252 255 257 258 260 262 263 264 274 286 2...

result:

ok correct

Test #16:

score: 0
Accepted
time: 305ms
memory: 10640kb

input:

1
100000
783156 687878 1
477270 782181 2
122423 521187 1
814765 379647 8
906893 42584 3
464361 836497 8
935935 677655 6
966066 829735 7
348885 726636 6
474870 178304 5
901105 792063 5
940836 193643 7
785900 806988 3
38183 973599 4
814963 945121 3
570021 666591 6
840996 939097 7
406903 216975 2
62090...

output:

2 3 13 14 15 20 21 22 27 31 34 36 38 41 44 48 50 52 55 59 61 62 65 66 68 70 72 77 79 80 83 84 90 94 100 102 108 110 114 117 122 124 126 127 128 133 135 137 146 149 153 155 156 159 173 180 183 184 189 190 192 193 194 198 200 203 208 215 218 219 220 225 229 230 235 242 245 250 252 257 259 260 262 264 ...

result:

ok correct

Test #17:

score: 0
Accepted
time: 295ms
memory: 10720kb

input:

1
99999
45362 965532 6
708808 306508 2
624384 151389 1
467716 670928 1
39438 96594 5
942210 88149 7
892926 875304 8
241522 637190 1
564772 772170 8
835563 334036 7
104129 627390 5
911109 785971 7
389695 864643 9
475004 239058 3
432237 738985 3
818115 349146 8
665532 910961 8
964582 950889 9
682361 7...

output:

1 4 5 8 11 15 26 32 33 34 36 37 40 43 47 50 51 52 58 64 66 70 71 76 77 79 82 85 86 87 89 90 92 93 95 96 102 103 104 106 108 111 114 116 117 119 120 125 126 128 135 137 146 147 149 157 158 163 165 167 175 190 195 200 203 211 214 217 221 224 226 231 234 235 237 238 239 246 247 250 254 256 260 269 270 ...

result:

ok correct

Test #18:

score: 0
Accepted
time: 294ms
memory: 10508kb

input:

1
100000
545343 214678 2
896330 34297 10
225650 145117 5
3539 141992 10
866014 337066 4
787360 33077 10
990193 565400 7
746446 687990 6
657093 370479 9
221001 777823 3
818490 795673 2
891597 771810 3
322069 291555 3
680477 429062 4
131032 471991 3
498884 709254 9
4962 615960 7
537100 173421 1
166345...

output:

10 15 17 19 27 30 31 32 37 41 42 43 46 51 53 57 62 68 72 74 77 85 88 89 92 98 99 100 101 107 112 115 120 122 129 130 134 137 140 141 143 145 147 154 156 159 162 165 167 168 169 174 176 182 183 185 187 195 198 200 203 206 209 214 223 225 226 229 233 239 243 247 255 256 257 258 259 261 262 264 265 268...

result:

ok correct

Test #19:

score: 0
Accepted
time: 300ms
memory: 10252kb

input:

1
99999
336110 764075 4
762927 765956 4
275286 70789 5
459972 469529 7
870966 316414 7
498229 41636 11
830500 307315 6
854475 488251 5
759873 905341 5
993842 970385 9
217019 809676 12
207189 933113 4
625602 520131 7
736635 340574 11
921162 795091 6
552353 769663 10
406594 84507 8
465432 768495 3
892...

output:

1 2 4 9 12 16 18 21 23 24 25 29 33 36 38 41 42 44 45 51 54 65 66 68 69 71 79 82 85 87 92 94 96 102 116 119 122 124 127 129 131 132 138 141 142 143 144 145 146 148 151 155 159 165 170 171 172 175 178 179 182 186 187 190 191 192 194 195 198 203 204 206 207 208 211 213 215 216 218 220 224 225 235 239 2...

result:

ok correct

Test #20:

score: 0
Accepted
time: 307ms
memory: 10696kb

input:

1
100000
108561 606864 17
350323 824178 19
354491 276661 2
386504 972995 8
126712 330871 13
27512 558033 16
821693 489290 10
531173 946706 11
851074 696984 13
215023 489278 3
550601 849390 9
18144 714207 18
493423 166694 1
682070 122973 15
480819 38485 4
803701 169413 20
175493 785397 12
948045 5586...

output:

4 5 8 10 11 17 20 21 22 28 42 44 48 51 53 79 80 85 86 87 94 99 103 104 108 109 113 116 117 119 122 126 127 129 130 131 133 135 137 138 144 146 147 149 150 151 157 160 163 164 167 169 173 174 175 178 179 182 187 188 189 192 197 198 201 209 211 215 217 218 219 224 225 229 230 240 243 244 246 247 249 2...

result:

ok correct

Test #21:

score: 0
Accepted
time: 298ms
memory: 10252kb

input:

1
99999
270178 61120 9
118244 697562 5
796784 638127 10
716782 572441 25
868171 877138 2
451141 273737 29
917860 184163 26
669039 916520 30
900920 422991 7
772136 494308 18
675065 814143 30
968370 228164 17
447803 120035 26
195744 975315 19
310881 998911 19
512798 212819 4
789254 622264 22
984709 59...

output:

2 5 14 15 19 22 27 28 30 31 33 37 42 46 47 48 50 52 55 60 63 66 82 87 90 97 98 99 100 101 104 111 113 116 118 119 120 121 123 129 131 133 134 138 139 142 145 146 147 154 156 159 160 166 168 169 172 175 177 182 183 185 188 189 191 195 199 203 212 216 219 220 224 228 237 239 245 246 247 251 252 256 25...

result:

ok correct

Test #22:

score: 0
Accepted
time: 298ms
memory: 10716kb

input:

1
100000
87815 816125 15
712301 586652 26
997911 895483 38
726884 50324 43
427717 312286 28
196351 258982 19
474976 452448 13
371565 914341 28
848695 643798 25
229795 39321 27
129910 753647 6
206296 219095 38
680062 142384 26
752256 980514 31
628293 803374 32
592071 806785 7
70061 583309 35
732498 3...

output:

1 6 8 11 14 15 16 20 25 26 27 30 32 33 36 38 41 45 46 53 57 60 61 62 63 67 71 75 76 77 79 82 84 89 90 97 98 99 100 102 103 105 113 120 121 126 131 136 137 138 139 147 148 154 158 163 165 166 168 171 173 175 177 179 180 187 188 190 191 197 198 200 202 203 207 209 210 212 222 223 229 233 235 236 237 2...

result:

ok correct

Test #23:

score: 0
Accepted
time: 303ms
memory: 10640kb

input:

1
99999
969047 371 41
853468 252554 79
784554 756858 19
945912 189669 56
28679 367615 21
745635 438170 93
394681 487499 76
986024 222074 12
796761 902579 3
934082 772826 5
848868 475664 57
928859 487080 17
447261 415165 48
324804 77833 94
513254 520849 43
811124 531448 22
414298 235550 92
662853 204...

output:

5 9 15 19 20 22 23 25 31 36 37 42 44 47 56 62 64 65 70 71 74 75 77 78 79 80 81 82 83 86 88 89 94 102 107 109 117 121 125 130 131 132 137 139 143 150 151 153 157 159 160 162 164 165 166 172 176 184 189 191 192 193 195 197 200 203 204 206 207 208 209 210 212 216 218 220 224 228 230 238 239 240 244 247...

result:

ok correct

Test #24:

score: 0
Accepted
time: 304ms
memory: 10060kb

input:

1
100000
14578 331976 83
739173 945866 58
769064 123208 197
657914 688910 162
63712 334500 95
112850 488141 182
673605 139094 109
8038 662680 177
139883 875134 102
240255 754978 10
139120 891814 83
967220 706007 107
811284 728949 43
749285 653050 130
42454 995761 196
897079 899138 87
585743 869946 6...

output:

1 2 5 9 10 11 16 17 19 22 29 32 34 40 44 45 47 49 51 52 54 57 61 63 71 73 76 80 82 86 90 92 99 102 106 107 108 115 117 119 120 121 122 126 129 133 144 145 150 151 152 161 165 166 172 188 189 194 196 201 202 221 223 224 225 228 229 235 236 238 241 244 254 256 259 267 268 273 274 283 284 285 287 288 2...

result:

ok correct

Test #25:

score: 0
Accepted
time: 302ms
memory: 10056kb

input:

1
99999
776558 379481 222
389786 326445 297
33988 301992 167
922081 171748 27
44539 631883 366
435819 942194 271
728896 223581 455
306860 878391 458
944588 214055 460
459371 939603 266
655301 555228 355
491970 417096 153
318104 764115 348
829143 260691 86
14484 737924 368
508188 763016 368
738889 88...

output:

3 6 10 18 23 24 27 28 30 34 36 37 38 40 41 43 44 45 47 48 59 60 61 64 65 66 71 74 81 83 84 85 88 89 101 109 113 115 117 118 123 126 130 134 142 143 144 146 149 156 160 163 165 166 167 169 175 179 180 181 182 184 185 189 191 193 194 195 203 212 214 225 228 232 234 235 240 241 246 247 248 250 251 256 ...

result:

ok correct

Test #26:

score: 0
Accepted
time: 306ms
memory: 10180kb

input:

1
100000
953776 515469 53
574495 620563 408
331343 705288 552
307179 689650 745
108389 820839 791
831194 34474 881
928795 832739 27
162288 848143 103
438197 683261 522
872355 234923 123
275412 349154 731
403641 327600 231
642668 821247 651
639908 457535 877
184578 621090 792
483486 866841 827
382761...

output:

2 3 8 9 13 23 24 26 27 29 32 33 37 41 47 52 53 54 63 65 68 69 73 74 78 81 85 88 91 92 95 96 98 99 100 102 103 105 106 112 114 115 117 118 119 120 122 128 130 132 134 136 138 143 144 149 157 158 160 162 164 165 166 169 170 172 173 174 178 179 180 185 186 188 189 193 194 196 198 199 200 204 205 214 22...

result:

ok correct

Test #27:

score: 0
Accepted
time: 310ms
memory: 10980kb

input:

1
99999
128495 399445 763
873699 750462 2051
771645 791001 3841
668391 425718 3815
274257 54791 3769
572299 402750 3749
622972 357997 1273
354814 50592 1657
409819 763434 3342
941450 774102 2301
705607 604543 3333
441889 400571 2267
563457 738075 3090
751849 8690 1656
524888 757409 1699
294794 33160...

output:

1 13 15 16 19 26 27 36 38 39 42 47 48 51 54 56 62 65 67 69 70 72 74 81 83 84 91 93 94 98 99 101 106 107 109 112 115 118 119 121 123 126 128 131 132 137 139 146 148 149 152 153 154 155 157 160 167 170 173 175 176 177 193 197 198 207 210 216 217 221 223 224 228 229 230 231 233 236 240 241 242 243 244 ...

result:

ok correct

Test #28:

score: 0
Accepted
time: 315ms
memory: 9860kb

input:

1
100000
722958 355226 2094
266625 467230 8712
979360 944520 2487
295170 735423 2727
722419 313725 3199
789942 961946 9194
700692 559861 7780
649116 795879 2218
690710 741191 3253
493019 510759 8703
230105 693648 3581
776356 568494 6123
384478 553056 8000
262437 617457 2646
944585 4132 9669
239024 3...

output:

4 8 9 11 14 19 20 36 37 39 40 41 43 45 49 50 54 56 57 58 62 69 72 74 75 83 84 85 87 92 93 94 97 101 103 104 113 117 119 120 124 126 131 133 135 137 142 144 146 151 152 153 156 157 158 159 162 164 167 169 174 179 180 183 185 186 188 189 191 192 196 198 204 210 212 214 216 220 221 223 224 226 227 231 ...

result:

ok correct

Test #29:

score: 0
Accepted
time: 315ms
memory: 11444kb

input:

1
99999
846662 746684 27049
416087 114018 39556
827768 480922 19619
538880 640896 35309
974134 999365 37801
462745 682933 806
606482 571441 8720
401083 408557 32312
797890 970757 39099
378069 473292 33198
452952 185965 42390
524236 671077 29109
746622 849987 48916
692368 638905 26915
476085 504542 1...

output:

6 8 10 12 15 16 22 23 33 35 37 45 46 49 51 59 66 67 71 72 82 83 85 86 89 91 96 102 108 110 121 130 131 142 143 144 151 152 156 162 163 164 166 172 179 181 183 188 193 198 200 204 211 215 216 218 219 220 221 224 230 231 232 234 243 248 260 268 270 271 272 278 283 285 288 289 295 297 302 304 305 308 3...

result:

ok correct

Test #30:

score: 0
Accepted
time: 318ms
memory: 10552kb

input:

1
100000
971466 923902 13036
178471 298728 9482
405999 2470 22915
603996 25994 53211
456448 30511 11349
18316 78308 17277
863127 738636 42069
857249 263985 26256
617839 464366 58305
395945 918980 28518
969530 806076 36316
806039 806940 96509
282118 141847 56048
595896 449670 41054
190736 674636 4589...

output:

2 6 10 15 19 20 28 30 39 41 43 47 48 49 55 58 59 62 63 69 72 75 84 89 92 96 99 104 107 111 114 116 118 119 121 125 128 130 131 134 135 136 144 145 146 147 155 158 160 161 163 165 166 172 176 180 181 185 186 187 193 194 197 198 200 202 214 217 218 221 228 230 231 232 234 235 237 243 244 245 250 252 2...

result:

ok correct

Test #31:

score: 0
Accepted
time: 317ms
memory: 10544kb

input:

1
99999
932826 868158 836741
757509 147472 90812
420972 457136 757627
569138 433050 395584
828836 391573 506718
940415 3167 875552
397212 243182 713853
389349 453435 165834
612841 415193 497972
43233 799293 174303
652096 485581 690886
929649 7236 344171
963593 933013 38136
677458 266199 985380
12930...

output:

8 10 15 18 19 25 30 31 33 35 42 43 45 54 56 69 70 73 74 79 85 86 88 89 95 98 99 104 107 111 114 119 120 125 127 128 129 132 133 137 139 140 141 143 155 158 162 163 164 170 175 176 181 182 189 191 193 194 195 196 198 201 203 204 205 220 224 225 228 232 234 236 239 240 248 249 258 259 260 263 264 268 ...

result:

ok correct

Test #32:

score: 0
Accepted
time: 115ms
memory: 12616kb

input:

1
100000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
1000000 1000000 1000000
100...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok correct

Test #33:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

1
10
2 10 1
8 10 6
4 4 9
6 7 5
5 6 4
7 10 9
7 7 7
4 9 6
4 5 7
1 1 7

output:

1 2 4 5 8 9 10 6 3 7 

result:

ok correct

Test #34:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

1
10
485566 661308 221125
602000 2 6
714165 6 3
7 596643 587186
7 985484 2
197190 2 2
7027 8 5
10 5 8
621058 1 688117
10 633379 164945

output:

1 5 10 4 9 8 2 7 3 6 

result:

ok correct

Test #35:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

1
500
229 232 88
36 27 60
158 1 343
356 247 333
440 3 271
420 78 50
181 212 302
384 444 209
284 184 393
416 482 51
242 373 331
355 470 251
382 151 262
206 32 237
483 310 124
275 93 258
212 154 247
379 62 28
456 185 159
454 82 476
168 46 144
17 312 499
10 77 276
339 173 69
330 373 17
256 448 498
223 ...

output:

1 7 8 10 11 12 23 25 27 28 29 31 33 37 39 41 48 53 54 56 61 62 63 64 68 69 70 73 80 85 86 87 89 91 93 94 97 98 100 102 103 105 109 114 118 119 122 126 129 130 131 134 139 140 141 146 147 150 151 152 153 159 166 170 173 174 178 179 185 187 189 191 198 199 202 205 206 208 210 211 212 217 221 225 227 2...

result:

ok correct

Test #36:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

1
500
20004 38 372
100 16 181
149374 35468 294245
126267 486 452
286 412 200
747456 213887 767656
117 847144 226
308111 342 520765
304 80 110121
49258 561097 546419
63074 509481 733960
126 775895 373701
339 365928 385
30 199 318
134197 411 103412
5333 220 336
87 489 25508
166200 987909 511327
476 35...

output:

5 7 13 14 17 26 31 32 33 39 41 50 51 53 58 63 67 70 71 72 75 77 86 90 91 92 93 94 95 97 99 104 105 111 122 125 128 135 138 144 146 151 155 156 163 164 177 180 181 182 183 188 197 198 201 202 205 207 208 209 213 214 219 226 227 229 230 235 236 237 238 241 244 251 256 258 260 267 270 271 273 276 277 2...

result:

ok correct

Test #37:

score: 0
Accepted
time: 0ms
memory: 3760kb

input:

1
1
1 1 1

output:

1 

result:

ok correct

Test #38:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

1
1
796328 1 719733

output:

1 

result:

ok correct

Test #39:

score: 0
Accepted
time: 313ms
memory: 10224kb

input:

1
100000
61850 84411 46680
88930 67748 47416
76274 49963 99253
70095 84305 34027
12379 54673 14197
8323 12179 31657
96548 33970 69265
60983 33064 76580
48966 48363 63608
41057 40814 26167
93854 35721 27144
2707 34494 18821
29770 35051 54832
75992 47523 9044
14215 48795 25989
31181 9914 69544
86505 9...

output:

1 4 5 6 12 13 15 17 19 24 25 31 33 34 36 38 41 42 49 50 51 55 56 58 61 62 63 66 69 70 71 72 73 77 80 82 83 84 88 90 92 95 97 99 102 103 107 110 111 113 115 116 120 124 126 127 129 133 137 146 152 155 159 160 161 162 167 172 176 177 179 182 184 186 187 188 189 190 192 194 195 196 203 210 211 213 215 ...

result:

ok correct

Test #40:

score: 0
Accepted
time: 314ms
memory: 10512kb

input:

1
100000
924602 76894 76360
529839 605505 1247
488586 3766 456914
435366 724358 674019
8223 142516 591275
673115 962254 689095
237211 66450 89318
22721 63332 15953
393890 854351 591484
17037 15993 141132
11900 8268 23752
2906 528321 54437
93877 9808 79501
959623 40054 54992
86687 65830 886221
160821...

output:

2 8 12 25 26 28 29 31 32 36 37 41 44 46 47 53 60 72 74 79 82 84 85 86 89 91 92 94 97 106 107 110 113 122 123 128 131 137 145 146 147 150 152 155 156 161 165 167 169 170 174 175 181 187 193 195 197 209 218 219 223 224 226 228 229 232 234 235 238 244 251 252 253 256 266 270 271 278 279 280 281 282 283...

result:

ok correct

Test #41:

score: 0
Accepted
time: 243ms
memory: 9136kb

input:

2
69821
88401 742421 1
794466 913634 1
103831 780090 1
194366 83442 1
891069 901851 1
14782 827286 1
629158 268122 1
511572 261569 1
64650 726005 1
435161 580063 1
108579 365076 1
257108 490883 1
723162 813583 1
816841 933459 1
333041 428483 1
211846 962418 1
723314 157335 1
837290 54766 1
138584 58...

output:

1 2 3 5 6 9 10 11 12 13 14 15 16 20 21 22 24 26 28 30 31 35 37 38 39 41 42 43 45 53 54 56 57 58 62 63 65 66 68 69 70 73 76 81 84 85 88 91 92 95 98 101 102 103 104 107 108 109 114 115 116 119 121 122 123 128 129 130 131 136 138 139 144 146 148 149 150 151 153 155 158 160 162 163 165 170 175 177 180 1...

result:

ok correct

Test #42:

score: 0
Accepted
time: 85ms
memory: 3704kb

input:

300
253
830133 947891 1
363214 158400 1
678623 525243 1
557424 435477 1
140409 99787 1
957753 183966 1
626409 249098 1
710920 607523 1
15679 17828 1
876419 80539 1
167749 400048 1
269258 222458 1
150536 140001 1
666204 606142 1
46951 206706 1
655815 806710 1
258588 306955 1
735893 932947 1
841224 14...

output:

180 9 159 174 58 135 68 67 164 240 111 225 15 179 32 224 153 23 194 186 108 119 70 199 253 243 242 223 109 237 53 244 38 72 104 140 247 234 229 11 125 115 35 129 122 86 69 137 178 219 142 65 249 50 207 105 128 60 17 27 56 75 91 200 37 235 107 166 28 124 29 59 123 103 126 221 98 155 156 136 187 154 1...

result:

ok correct

Test #43:

score: 0
Accepted
time: 66ms
memory: 3560kb

input:

10000
1
425023 723812 1
13
836095 863384 1
233225 596397 1
566137 236643 1
268085 280508 1
223291 393445 1
809612 382630 1
151088 862073 1
173393 927632 1
17049 195961 1
677649 745628 1
36991 667660 1
298669 836826 1
362975 372403 1
1
963621 249133 1
6
3536 279568 1
587752 487419 1
83384 748663 1
58...

output:

1 
9 11 7 8 5 2 4 12 13 10 1 6 3 
1 
1 3 4 6 2 5 
4 7 1 2 6 5 8 3 9 
1 
1 2 3 4 6 5 
7 6 1 5 3 2 4 
12 19 8 18 16 14 11 5 1 15 20 2 9 23 6 17 10 13 7 4 3 24 21 22 
4 5 6 8 11 9 7 2 12 3 10 1 
8 25 16 9 15 17 18 10 21 6 7 4 11 14 12 13 2 3 23 1 5 24 19 22 20 
2 7 8 11 3 13 10 9 6 5 4 1 12 
1 4 7 8 9 ...

result:

ok correct

Test #44:

score: 0
Accepted
time: 126ms
memory: 6276kb

input:

2
4037
464131 318220 1
90991 541050 2
766311 591558 1
742307 17787 1
781261 488145 1
357957 347184 1
633182 301261 1
94682 843291 1
631637 529027 2
82521 704473 1
437456 276755 2
778263 51432 1
786584 977440 1
833333 648570 1
552303 601466 2
938184 44857 1
794073 277387 1
994953 290395 1
935853 1864...

output:

8 10 13 22 29 30 31 43 45 46 48 51 61 64 65 69 79 81 84 90 92 106 113 115 116 121 123 124 130 133 135 138 139 151 153 163 165 167 168 176 177 178 179 182 186 188 189 190 191 194 195 201 203 205 211 212 214 215 216 224 231 232 234 236 237 243 251 256 262 263 270 274 280 281 288 290 291 306 313 314 31...

result:

ok correct

Test #45:

score: 0
Accepted
time: 77ms
memory: 3776kb

input:

300
134
36059 286818 2
455971 795720 2
74275 63495 1
75077 509010 2
503679 169175 2
11185 421244 1
437281 322883 2
869878 384461 1
191807 672570 1
288040 312855 1
660008 723414 2
221648 416391 2
624391 145096 1
411858 695660 1
578102 665090 2
890142 668549 1
608518 448483 2
113307 706064 1
283662 63...

output:

6 9 10 14 18 19 23 24 25 28 29 32 36 40 43 45 50 62 67 71 77 79 84 87 89 90 91 92 97 98 99 104 109 110 112 113 117 123 127 133 64 1 63 80 4 22 41 132 122 12 54 129 68 108 78 102 61 72 33 128 55 2 70 15 107 101 11 52 31 38 37 88 51 103 131 121 130 17 76 111 56 39 60 114 134 7 94 57 48 65 46 105 5 74 ...

result:

ok correct

Test #46:

score: 0
Accepted
time: 64ms
memory: 3652kb

input:

10000
2
525139 532331 2
923628 228718 1
6
234983 515915 1
705263 115904 2
902643 575572 1
90796 310572 1
191007 876742 1
926631 224132 2
1
363621 733700 1
16
617390 281024 2
354701 28586 2
902129 562488 1
711461 107434 1
714910 223331 2
835971 497838 1
118657 220815 2
375999 800233 1
180250 455648 2...

output:

1 2 
1 4 5 6 2 3 
1 
7 8 9 10 12 16 15 1 5 11 2 14 3 6 13 4 
4 5 2 1 3 
1 
1 5 4 3 2 
5 8 6 3 7 1 4 9 2 
1 
1 2 
3 11 12 14 6 15 13 10 5 1 4 7 9 8 2 
2 1 
4 5 8 20 22 25 27 6 1 17 12 19 14 13 2 23 7 21 18 10 16 26 9 11 24 3 15 
1 4 9 12 11 3 5 7 10 6 2 8 13 
2 1 
10 11 13 23 26 27 12 17 6 2 15 28 3 ...

result:

ok correct

Test #47:

score: 0
Accepted
time: 3ms
memory: 3612kb

input:

2
1389
643295 305353 1
17366 456325 2
596129 942726 1
830936 621567 2
604681 76325 1
774761 275083 3
176002 127294 2
580914 456741 3
634013 437706 1
24737 134880 1
556648 720413 2
801133 640387 2
9231 991784 3
966796 684261 1
847283 768303 2
804657 879431 2
288649 139591 3
511819 701938 1
27061 5639...

output:

2 3 10 11 16 18 19 21 24 25 28 30 31 33 45 46 49 55 56 57 59 63 64 68 69 70 72 74 79 81 84 85 88 92 93 97 98 99 104 108 112 117 119 121 123 125 126 128 136 142 144 148 151 154 155 156 158 160 161 166 167 174 177 180 181 182 183 185 190 191 196 201 202 204 210 214 218 226 230 232 234 240 242 243 245 ...

result:

ok correct

Test #48:

score: 0
Accepted
time: 78ms
memory: 3648kb

input:

300
251
789119 100187 2
697580 571877 2
686584 10582 2
418190 372990 2
788026 231797 3
985515 398910 3
237323 766683 2
364345 244638 2
629965 746778 3
442153 340088 3
998666 429796 1
755218 985359 3
840002 539125 1
373406 54563 3
638707 859838 2
656500 817395 3
899880 742356 1
90021 71315 1
883077 9...

output:

7 15 23 24 25 26 28 37 40 47 51 56 57 60 61 62 63 67 70 72 81 82 84 88 90 97 102 104 111 114 115 121 122 124 125 128 131 133 136 138 139 148 152 153 157 158 163 164 166 167 169 174 176 178 180 182 183 188 191 192 193 194 196 200 202 205 206 207 208 210 215 217 218 224 225 227 228 232 234 238 243 244...

result:

ok correct

Test #49:

score: 0
Accepted
time: 64ms
memory: 3556kb

input:

10000
9
340849 332736 2
337156 473580 3
725034 883073 1
219356 12503 2
936044 549719 3
227698 971858 2
370855 568407 1
618895 291761 2
507065 78488 2
8
333383 660664 1
344247 932637 3
200420 429670 2
536827 573382 1
106963 127237 2
713838 866936 2
162062 279088 1
145752 929994 1
4
905737 522662 1
53...

output:

3 6 7 2 5 1 8 9 4 
1 3 4 5 7 8 6 2 
4 3 2 1 
1 3 5 4 6 2 7 
1 3 4 5 6 10 13 16 2 9 15 7 11 8 12 14 
1 2 3 
1 
2 1 
1 3 2 
1 3 4 2 5 
1 2 3 5 10 8 13 4 12 7 6 14 11 15 9 
3 2 1 4 
2 1 
2 4 5 13 14 15 16 19 23 25 27 28 29 24 21 8 10 7 31 30 1 17 20 32 26 11 9 18 12 22 6 3 
1 2 7 6 8 10 14 12 3 11 5 13...

result:

ok correct

Test #50:

score: 0
Accepted
time: 170ms
memory: 7548kb

input:

2
2795
297292 539767 8
734875 511215 9
667232 536489 8
634005 856493 3
580380 622144 4
581010 98539 9
919508 825607 6
524199 860110 5
802059 591467 8
885913 685100 5
565378 910253 9
490311 943067 1
567041 155343 7
328533 943487 1
154277 487096 1
812892 214739 10
113962 103658 5
687184 187384 6
83481...

output:

4 5 8 12 14 15 19 22 26 29 33 36 37 38 39 40 41 42 46 51 53 62 64 75 80 84 88 89 90 96 97 99 102 108 110 113 115 116 118 125 128 131 132 137 140 143 144 151 153 156 158 160 162 168 174 175 182 183 184 187 189 190 194 197 199 202 204 212 213 214 215 216 219 233 234 235 237 247 252 253 256 260 261 264...

result:

ok correct

Test #51:

score: 0
Accepted
time: 79ms
memory: 3684kb

input:

300
313
181024 742572 1
847307 106677 9
375980 457310 10
944809 442603 4
570686 894299 8
124371 282741 6
44756 196447 1
312495 303886 8
855637 365548 2
972108 981965 9
657516 19589 9
184806 920191 8
29602 361256 6
752410 616901 2
758651 50575 9
571691 387695 5
601171 137962 8
707125 753434 5
644216 ...

output:

1 6 7 13 18 20 21 24 26 28 29 43 44 48 49 51 56 57 62 65 68 70 72 74 75 88 89 90 97 103 107 109 111 116 120 122 126 129 130 135 144 146 156 157 164 167 169 171 172 173 179 181 182 189 190 195 203 206 211 213 220 221 226 227 228 230 231 232 234 236 243 244 246 247 250 252 255 257 259 263 265 269 276 ...

result:

ok correct

Test #52:

score: 0
Accepted
time: 69ms
memory: 3852kb

input:

10000
17
780658 578371 3
47635 686616 8
318753 263312 2
655616 417338 1
224671 828602 9
230974 643576 4
874831 202616 2
177657 47352 1
619169 180834 6
337414 98608 8
14938 561758 2
190162 790130 8
422120 130445 3
907851 740409 5
310886 389878 7
659021 276403 7
973677 834994 7
11
229775 712783 3
6087...

output:

6 11 15 2 12 5 10 17 16 9 14 1 13 3 7 4 8 
1 3 4 10 5 8 11 6 7 2 9 
4 5 3 7 1 2 6 
4 5 7 9 18 22 15 24 1 13 17 23 19 6 14 12 21 20 3 8 10 11 16 2 
4 8 1 7 3 2 9 5 6 
1 
1 2 4 5 6 7 3 
4 7 10 11 12 13 14 15 23 24 25 29 31 20 28 17 32 33 3 16 6 18 1 9 21 26 8 19 30 27 2 5 22 
1 
1 2 7 4 3 6 5 
9 11 12...

result:

ok correct

Test #53:

score: 0
Accepted
time: 244ms
memory: 6836kb

input:

2
48688
685632 618517 40
946415 334447 43
752761 979212 40
433885 69891 33
569670 946047 93
555989 124478 93
274327 869785 90
485360 45389 42
23642 844669 87
140871 587747 87
869963 693679 53
676186 65537 42
881980 192065 40
873410 311493 61
534245 627841 18
244185 178870 82
499887 451233 95
57767 1...

output:

3 15 21 30 38 41 46 47 51 53 59 63 65 77 86 87 88 89 90 91 95 99 100 103 105 106 108 111 112 114 115 117 119 120 122 125 129 133 141 145 148 149 171 173 174 175 176 178 186 188 196 202 203 207 208 209 210 212 213 230 233 234 239 242 243 245 251 257 259 266 274 275 280 284 285 286 288 290 291 295 297...

result:

ok correct

Test #54:

score: 0
Accepted
time: 78ms
memory: 3992kb

input:

300
420
669837 320560 61
258799 886730 73
164105 746610 57
84838 703770 100
636583 273782 59
825002 115141 78
369165 503638 51
53323 943414 79
179758 717391 39
255236 708325 60
241304 628458 67
884196 464104 76
930360 853422 67
337726 677439 64
580974 613764 10
122706 882972 69
57560 259562 36
45657...

output:

3 7 9 10 14 15 17 22 32 35 36 45 46 50 53 55 56 57 58 74 75 79 84 85 86 93 94 98 102 104 107 109 110 117 123 124 127 132 133 142 146 150 153 154 156 166 170 172 176 180 184 193 196 197 203 204 214 215 218 223 225 227 228 230 238 239 244 246 249 251 256 258 259 260 269 273 275 276 279 280 284 290 297...

result:

ok correct

Test #55:

score: 0
Accepted
time: 65ms
memory: 3844kb

input:

10000
23
973684 7831 94
537048 731681 14
882601 751411 72
431976 93550 32
816227 731555 4
7075 314732 17
268202 295472 66
798245 717683 68
660640 145985 83
243308 363161 59
498791 751204 31
621033 843418 6
970638 854301 50
968200 810305 100
401858 497645 91
320766 661915 35
832051 354020 26
871379 8...

output:

2 6 7 10 11 12 16 19 20 23 15 22 14 1 9 3 8 13 4 17 18 21 5 
1 3 6 8 10 14 16 19 11 5 17 2 9 12 4 18 13 7 15 
1 
1 
1 5 6 7 9 12 13 16 11 14 3 8 4 10 2 15 17 
5 7 1 2 3 4 6 
2 3 1 5 6 4 7 
2 5 3 8 4 6 1 7 
1 4 9 14 15 16 23 21 11 17 5 2 12 8 7 6 19 22 10 18 3 13 20 
5 7 8 12 13 21 22 9 17 19 24 11 6...

result:

ok correct

Test #56:

score: 0
Accepted
time: 68ms
memory: 3620kb

input:

20000
5
564336 480387 1
430553 699081 1
278563 238435 1
419891 873247 1
776080 588695 1
5
970707 986491 1
988325 837799 1
616860 966847 1
927749 400769 1
793152 488151 1
5
217283 631630 1
967252 903221 1
354591 389526 1
62194 938123 1
835140 509270 1
5
510932 530250 1
959618 144352 1
770415 705305 1...

output:

4 2 5 1 3 
1 3 2 5 4 
4 1 3 2 5 
1 5 3 4 2 
1 3 5 2 4 
1 2 5 4 3 
2 1 5 4 3 
1 2 3 5 4 
2 5 1 3 4 
4 2 5 1 3 
2 4 3 5 1 
2 4 3 5 1 
5 4 3 2 1 
4 3 2 1 5 
2 5 1 4 3 
2 1 3 4 5 
1 4 5 3 2 
3 2 5 1 4 
2 4 5 3 1 
5 4 2 3 1 
5 3 4 2 1 
4 2 5 3 1 
4 5 1 3 2 
1 2 4 5 3 
3 5 4 1 2 
4 3 5 2 1 
1 2 4 3 5 
1 2...

result:

ok correct

Test #57:

score: 0
Accepted
time: 60ms
memory: 3632kb

input:

10000
10
246428 90732 1
303821 684428 1
301599 422756 1
515216 177567 1
321822 555733 1
994857 742288 1
371128 250193 1
31645 742720 1
783257 82443 1
830750 747553 1
10
461123 817287 1
199478 259329 1
726303 791746 1
27694 235096 1
859908 373085 1
644286 804111 1
225287 406992 1
847610 747793 1
9096...

output:

8 3 2 5 10 6 7 4 1 9 
1 2 3 4 6 7 8 9 5 10 
1 3 9 7 5 4 2 8 6 10 
2 10 7 3 9 5 4 1 8 6 
3 4 7 6 2 1 8 5 9 10 
2 9 6 10 3 1 8 7 4 5 
1 8 6 9 3 5 2 10 7 4 
2 4 7 5 8 9 6 1 3 10 
3 4 8 6 7 1 9 10 5 2 
2 10 8 7 9 1 5 4 3 6 
3 4 5 6 8 1 10 2 9 7 
3 4 6 1 2 8 10 5 7 9 
1 3 8 4 5 10 2 7 6 9 
5 9 3 8 2 6 10...

result:

ok correct

Test #58:

score: 0
Accepted
time: 57ms
memory: 3508kb

input:

5000
20
875906 903989 1
75804 163205 1
605781 389616 1
315307 704607 1
769739 526056 1
425579 22550 1
294714 313941 1
345502 617103 1
208118 176664 1
349977 14719 1
437260 126874 1
66912 821226 1
259518 411687 1
969283 629018 1
677888 307082 1
334904 95651 1
668531 120105 1
807802 22421 1
989024 435...

output:

1 2 4 7 8 12 13 20 14 5 3 15 9 11 17 16 19 6 18 10 
15 13 2 5 14 6 20 18 19 10 12 16 17 11 9 7 1 8 4 3 
1 6 7 9 11 14 15 16 17 18 19 4 5 8 12 2 10 13 20 3 
1 4 7 8 9 12 15 20 19 11 5 3 17 14 6 10 16 13 18 2 
1 9 12 13 14 16 8 4 17 7 3 18 6 5 11 10 15 19 2 20 
1 7 8 13 17 18 20 19 2 11 6 15 16 14 3 9...

result:

ok correct

Test #59:

score: 0
Accepted
time: 62ms
memory: 3776kb

input:

2000
50
988531 726738 1
872842 823728 1
518328 224786 1
715577 126942 1
146194 885409 1
652337 989417 1
546559 762083 1
352481 431741 1
706893 426624 1
99143 881626 1
300261 929556 1
827997 156642 1
340250 173400 1
532034 226466 1
361138 590160 1
149862 2975 1
549878 67959 1
562298 327394 1
128887 2...

output:

5 6 7 8 10 11 15 21 22 25 27 28 29 30 31 32 37 42 44 46 48 2 1 20 49 40 23 47 34 36 38 9 18 24 14 3 26 13 12 50 39 4 41 17 45 43 35 16 19 33 
5 11 12 15 17 18 19 20 21 23 25 32 35 37 39 40 43 47 50 4 22 42 29 1 13 41 2 48 36 8 9 45 49 44 10 31 24 14 34 27 6 3 30 38 28 7 26 33 46 16 
14 4 11 45 22 30...

result:

ok correct

Test #60:

score: 0
Accepted
time: 67ms
memory: 3828kb

input:

20000
5
569082 996527 2
133522 791438 2
212718 422423 2
946931 133687 2
970595 415128 1
5
475161 234214 1
276266 910552 2
458540 817460 2
21970 710977 2
60318 202464 1
5
335382 950413 1
370364 738034 1
941829 619601 2
680309 154224 2
993329 267917 1
5
835176 877061 2
672732 705523 2
301939 52590 2
3...

output:

2 3 1 4 5 
5 4 2 3 1 
1 2 3 4 5 
4 2 1 5 3 
1 3 5 4 2 
1 3 4 2 5 
2 3 1 4 5 
3 4 5 2 1 
3 5 4 1 2 
2 4 1 5 3 
1 2 5 3 4 
2 3 1 4 5 
1 2 3 5 4 
1 2 3 4 5 
2 5 3 1 4 
5 3 4 2 1 
1 5 2 4 3 
1 2 3 5 4 
1 2 5 3 4 
4 5 2 3 1 
1 3 4 2 5 
4 1 3 2 5 
5 4 1 2 3 
2 4 1 3 5 
3 5 4 1 2 
1 2 3 5 4 
2 5 3 4 1 
4 3...

result:

ok correct

Test #61:

score: 0
Accepted
time: 60ms
memory: 3632kb

input:

10000
10
26982 672280 1
782598 809490 2
235754 606744 1
42256 438007 1
292145 382166 2
466607 990010 1
434877 547137 1
873324 850229 2
844774 425355 1
130621 429161 1
10
579222 103366 2
826782 61438 2
313541 21820 2
388912 451197 1
18097 940244 1
935826 118218 2
938400 902754 1
122238 870886 1
25129...

output:

1 3 4 6 7 10 5 2 8 9 
4 5 8 9 10 6 1 2 3 7 
1 8 9 2 3 7 5 4 6 10 
6 7 1 9 5 2 8 3 4 10 
1 9 10 3 2 6 8 4 7 5 
9 3 6 2 1 4 8 5 10 7 
2 3 4 5 10 6 8 9 1 7 
1 2 4 8 6 10 9 3 5 7 
1 2 5 10 4 6 7 9 8 3 
7 8 10 1 5 3 2 9 6 4 
2 6 3 8 1 10 9 7 5 4 
6 7 4 10 3 8 5 9 1 2 
6 10 3 9 2 1 8 7 5 4 
1 3 9 10 8 6 7...

result:

ok correct

Test #62:

score: 0
Accepted
time: 58ms
memory: 3620kb

input:

5000
20
656459 452834 1
778773 545163 2
572641 540900 1
842346 965047 1
740062 319785 1
897329 270273 1
582655 610886 2
219885 724612 1
302339 486873 2
617143 729032 1
522655 412953 2
661512 656038 1
846755 641762 1
587397 69311 2
611884 874240 1
626444 442462 1
190156 648572 1
115134 369706 2
29791...

output:

4 8 10 15 17 18 9 7 2 11 19 14 12 13 3 1 16 5 6 20 
4 11 14 17 8 5 12 9 16 18 3 10 1 7 13 6 2 15 20 19 
1 2 12 20 5 10 4 13 19 3 7 11 18 17 15 16 9 8 14 6 
4 6 9 16 17 3 20 13 2 8 7 19 14 15 18 12 5 10 11 1 
1 3 5 6 8 9 14 15 18 19 10 2 16 4 17 7 11 13 20 12 
5 9 17 18 10 7 12 14 6 15 13 16 19 8 3 1...

result:

ok correct

Test #63:

score: 0
Accepted
time: 62ms
memory: 3644kb

input:

2000
50
801788 51391 2
351619 948789 1
452484 408774 1
51129 420086 2
308005 487650 1
124087 526739 1
834500 59027 2
194160 315058 1
801114 736832 2
399013 371746 2
385656 182930 2
165701 991455 1
960191 403475 2
893252 666759 2
519327 124615 2
408698 349786 2
71504 787913 2
28414 641975 2
694670 33...

output:

2 5 6 8 12 30 33 42 43 46 18 4 17 27 24 45 31 34 36 9 14 35 50 39 13 10 16 29 38 44 11 15 20 49 7 1 21 40 48 22 23 3 19 28 37 47 25 41 32 26 
1 3 4 9 11 15 20 22 24 25 28 32 42 50 37 10 47 30 26 35 49 13 43 36 34 48 29 8 21 5 39 19 18 14 33 44 46 17 12 45 27 40 23 6 7 41 2 16 31 38 
1 2 4 10 11 16 2...

result:

ok correct

Test #64:

score: 0
Accepted
time: 67ms
memory: 3608kb

input:

20000
5
349635 545372 3
579595 140692 1
179577 639115 1
506674 394126 2
940918 984665 1
5
722719 738832 1
340014 207497 2
332923 924970 1
83487 862401 1
360189 725288 3
5
644969 427979 1
932260 540143 1
529066 41164 3
41527 594517 2
151518 802371 3
5
159420 223873 1
418549 425477 2
543863 175684 3
3...

output:

3 5 1 4 2 
1 3 4 5 2 
4 5 3 2 1 
1 2 3 4 5 
2 4 3 5 1 
4 1 5 3 2 
1 3 4 2 5 
1 3 4 2 5 
1 3 4 2 5 
5 3 1 4 2 
2 3 4 5 1 
3 5 4 2 1 
4 1 3 5 2 
3 5 2 1 4 
1 3 4 2 5 
1 2 4 3 5 
2 4 5 1 3 
5 4 1 3 2 
2 3 5 1 4 
1 2 5 4 3 
1 4 3 5 2 
1 2 3 5 4 
1 3 2 5 4 
2 5 4 3 1 
3 4 2 5 1 
1 5 3 4 2 
1 3 5 4 2 
4 5...

result:

ok correct

Test #65:

score: 0
Accepted
time: 61ms
memory: 3768kb

input:

10000
10
31727 221125 2
485566 191447 2
202614 823436 1
602000 665743 2
262468 951703 2
714165 270437 2
531329 587186 1
747707 733546 1
938995 511372 1
397787 143474 2
10
888810 580932 3
197190 87739 2
900778 251895 1
7027 924193 1
176286 474698 1
260070 240838 1
651514 688117 1
621058 218171 1
5601...

output:

3 7 1 5 4 6 2 10 8 9 
4 5 7 1 9 2 10 3 6 8 
2 4 6 8 9 1 3 5 10 7 
2 5 6 7 3 9 10 4 1 8 
1 3 4 6 8 2 10 9 7 5 
1 2 5 10 7 8 6 4 9 3 
7 6 3 10 4 9 5 1 2 8 
2 3 5 6 7 4 8 9 10 1 
8 9 10 7 5 6 3 2 4 1 
1 7 2 8 10 3 9 6 4 5 
7 10 2 9 5 3 4 6 1 8 
4 5 7 9 2 3 10 6 8 1 
3 8 9 7 6 5 1 10 4 2 
2 3 7 8 6 10 5...

result:

ok correct

Test #66:

score: 0
Accepted
time: 60ms
memory: 3804kb

input:

5000
20
693909 1678 3
224846 670224 1
506796 757592 2
402090 258190 3
934577 146219 3
144887 742187 3
646403 875127 3
61564 799418 2
396560 572889 1
917013 219152 1
864946 955927 3
31920 458147 1
466697 839133 3
205512 285412 1
770073 632887 2
917984 565082 1
870566 368527 2
613954 492800 3
606798 4...

output:

2 3 8 9 12 14 20 6 13 7 11 18 19 4 5 1 15 17 16 10 
3 4 8 9 10 12 14 18 5 17 16 6 1 11 20 13 2 7 19 15 
9 11 12 13 15 6 7 1 5 19 18 17 3 14 10 8 20 4 16 2 
2 3 7 10 15 1 9 5 13 8 6 18 20 14 11 4 19 16 12 17 
4 9 10 11 12 13 15 17 18 1 5 8 14 6 7 3 16 19 2 20 
2 5 6 12 15 18 1 20 10 8 14 4 7 9 19 13 ...

result:

ok correct

Test #67:

score: 0
Accepted
time: 61ms
memory: 3548kb

input:

2000
50
615046 600235 1
797692 265339 2
419343 592762 2
578169 647821 1
311033 281380 2
404349 774462 1
898248 323268 3
68543 389863 1
895335 47040 1
666180 53355 1
695243 693200 3
568813 793564 3
514725 600846 1
511367 882859 3
453324 659069 2
957134 696598 2
784617 349084 2
335747 765069 3
3557 65...

output:

3 4 6 8 13 15 25 26 27 30 32 34 40 42 43 45 19 23 20 21 49 18 36 14 12 31 11 7 35 50 46 39 16 28 17 5 2 41 22 47 1 44 29 48 37 33 24 38 10 9 
1 2 4 5 8 11 12 13 18 21 24 28 31 41 44 46 50 27 3 36 33 40 14 25 38 48 39 6 23 20 32 15 49 17 29 37 19 22 9 16 35 26 45 10 47 7 30 42 34 43 
2 7 20 23 24 25 ...

result:

ok correct

Test #68:

score: 0
Accepted
time: 68ms
memory: 3716kb

input:

20000
5
176714 866987 8
970424 587123 8
543873 900795 2
303735 987914 7
206471 672631 8
5
210436 849621 3
318549 305954 10
364088 427550 7
677022 911826 1
812166 209585 1
5
964959 657626 9
777446 86692 1
667433 482872 3
116227 897704 10
248172 660801 5
5
210984 419727 8
401670 717513 2
2280 924253 5...

output:

3 4 1 5 2 
1 4 3 2 5 
5 4 1 3 2 
2 3 5 1 4 
4 3 1 5 2 
1 4 5 2 3 
2 5 3 4 1 
3 5 1 4 2 
3 4 5 2 1 
1 2 5 4 3 
1 4 2 5 3 
1 4 3 5 2 
4 5 2 1 3 
1 2 5 3 4 
4 2 3 5 1 
1 2 5 3 4 
2 3 4 5 1 
1 5 3 2 4 
3 4 5 1 2 
2 3 5 4 1 
3 5 1 4 2 
3 2 4 1 5 
5 2 4 3 1 
2 5 3 4 1 
1 5 3 4 2 
3 4 5 1 2 
5 1 2 3 4 
3 4...

result:

ok correct

Test #69:

score: 0
Accepted
time: 63ms
memory: 3616kb

input:

10000
10
654597 1459 1
923894 64902 6
262691 89248 7
358150 529230 3
901567 123793 5
980560 157661 6
959273 29856 6
325206 172317 3
949939 807372 2
838311 199219 4
10
233366 644854 1
190169 67417 7
501578 335259 6
659916 99903 7
932832 768340 8
532637 341539 2
933923 478859 10
860009 41454 1
838192 ...

output:

4 3 6 2 7 5 10 8 9 1 
1 10 7 5 4 2 9 3 6 8 
5 8 9 10 7 6 1 3 2 4 
4 9 1 2 6 5 7 3 10 8 
3 5 7 1 4 9 10 8 2 6 
1 2 8 3 5 10 4 9 7 6 
3 7 8 9 2 4 10 1 6 5 
1 2 3 10 7 4 6 8 5 9 
2 8 10 7 9 1 4 6 5 3 
2 6 3 4 10 9 7 5 8 1 
2 3 4 6 7 8 10 9 5 1 
6 7 9 8 1 10 5 2 4 3 
3 6 9 10 1 2 7 4 8 5 
4 7 9 2 3 6 5 ...

result:

ok correct

Test #70:

score: 0
Accepted
time: 64ms
memory: 3548kb

input:

5000
20
766765 821573 7
47152 486191 5
741809 250793 2
494657 103682 2
520073 351787 1
370366 397813 2
791833 85547 6
252430 700149 5
183656 1352 8
475996 193241 2
42735 344261 7
437697 193963 10
846433 698102 1
368303 134199 2
14203 150831 2
781792 422164 10
257358 840878 1
228671 452400 4
994250 6...

output:

1 2 6 8 11 15 17 18 16 12 9 7 19 20 3 10 14 4 13 5 
2 3 4 11 13 14 16 17 5 19 12 15 20 7 1 8 6 10 18 9 
4 10 12 13 15 19 9 3 8 16 14 5 1 18 2 17 6 7 20 11 
3 5 15 16 17 13 14 20 4 8 11 2 10 12 1 19 7 9 18 6 
2 6 7 8 11 12 17 19 18 10 4 9 16 14 13 1 20 15 5 3 
4 5 9 17 19 20 15 3 6 8 1 16 12 18 7 14 ...

result:

ok correct

Test #71:

score: 0
Accepted
time: 63ms
memory: 3552kb

input:

2000
50
551654 768124 8
1249 880873 9
594844 861509 4
62962 285279 1
473702 685496 2
955461 566652 1
387626 514638 4
389108 797436 3
365897 998974 5
683773 983820 8
246649 732082 10
956088 382116 10
563431 660549 5
367385 171681 8
66828 522496 7
594665 210534 6
68879 735446 5
558849 428341 7
462426 ...

output:

3 4 5 7 8 9 13 17 20 23 24 27 29 41 46 48 50 15 49 39 33 1 10 2 40 25 42 32 11 35 31 12 21 14 30 26 18 37 16 47 45 38 34 43 44 19 22 28 36 6 
4 7 8 9 14 16 17 18 31 32 39 41 43 44 45 25 10 22 27 19 5 42 3 30 1 48 34 11 46 47 2 15 50 6 20 21 13 33 23 40 28 29 35 12 26 24 36 49 37 38 
5 16 25 27 29 30...

result:

ok correct

Test #72:

score: 0
Accepted
time: 68ms
memory: 3636kb

input:

20000
5
669470 534462 55
468298 187490 100
206893 758201 69
258186 362898 8
533447 698201 12
5
206835 442012 95
883357 22359 38
289734 685854 60
377434 953917 12
563132 774370 51
5
76922 747947 92
275788 403255 42
514858 886474 19
715680 871956 43
223330 516686 67
5
779987 911593 14
190719 43058 93
...

output:

3 4 5 2 1 
4 5 3 1 2 
2 3 4 5 1 
1 3 2 5 4 
1 2 4 5 3 
4 1 3 5 2 
3 2 1 4 5 
5 2 1 3 4 
2 4 3 5 1 
4 5 1 3 2 
1 2 3 4 5 
1 5 4 3 2 
3 1 2 5 4 
1 3 2 4 5 
3 5 1 4 2 
1 3 4 5 2 
2 3 1 5 4 
1 3 5 4 2 
4 5 1 2 3 
2 4 1 3 5 
4 3 2 1 5 
2 5 1 3 4 
3 4 2 1 5 
5 1 3 4 2 
4 3 2 1 5 
1 3 4 5 2 
5 3 2 1 4 
1 2...

result:

ok correct

Test #73:

score: 0
Accepted
time: 63ms
memory: 3644kb

input:

10000
10
536810 992362 99
761609 28053 47
155415 748533 83
494319 201328 24
91475 19752 47
405485 466162 99
655008 213674 23
444509 133342 33
525286 809425 82
613071 844672 49
10
666397 767595 49
297808 635481 42
221693 225482 46
315261 837455 15
565352 574158 82
267913 12243 79
862997 308727 33
131...

output:

10 3 9 6 1 2 5 8 4 7 
1 2 3 4 8 5 9 10 6 7 
5 7 9 10 2 4 6 8 3 1 
2 3 5 6 7 8 9 1 10 4 
3 4 5 9 2 7 8 1 10 6 
3 6 8 9 10 2 4 7 1 5 
4 6 8 1 3 5 10 7 2 9 
1 5 6 9 3 2 4 10 7 8 
3 5 9 10 8 1 4 7 2 6 
1 6 9 7 4 10 2 8 3 5 
1 5 6 2 8 4 3 9 7 10 
2 3 5 7 4 10 8 9 6 1 
3 9 10 2 6 5 7 1 4 8 
2 5 7 8 10 4 6...

result:

ok correct

Test #74:

score: 0
Accepted
time: 60ms
memory: 3576kb

input:

5000
20
886064 846032 53
945597 832741 20
224366 85420 50
96560 34122 68
339197 691861 74
702430 864180 54
762518 137259 72
530525 447199 16
272302 234286 4
899149 331194 15
468506 711028 40
527883 470211 47
470498 791400 84
882420 970532 37
655267 135242 83
796380 478669 23
986091 751971 47
491854 ...

output:

5 6 11 14 13 19 15 7 4 1 3 17 12 18 16 2 8 10 9 20 
1 3 6 19 20 4 8 9 16 10 7 14 18 15 2 13 17 5 11 12 
1 3 4 7 12 14 16 18 19 9 5 2 13 17 8 10 6 11 20 15 
1 7 9 11 14 17 18 20 13 5 16 6 19 10 12 15 3 4 8 2 
1 6 14 18 3 2 5 9 20 7 16 4 17 11 15 10 12 19 8 13 
9 10 11 12 13 17 20 16 4 15 3 7 2 5 14 1...

result:

ok correct

Test #75:

score: 0
Accepted
time: 61ms
memory: 3628kb

input:

2000
50
709633 767169 14
530265 372883 38
38389 997966 21
286260 434393 3
339261 68316 31
303664 123642 20
828150 356401 13
526558 421474 50
934152 733061 67
205768 145769 22
131728 606733 18
218108 7104 59
567184 872132 96
518487 276387 85
695702 75389 61
830164 485115 47
836458 633318 88
282069 12...

output:

1 3 4 11 22 25 27 30 33 35 40 41 43 47 49 50 36 34 29 13 18 17 32 14 48 42 37 21 9 39 15 38 12 19 8 28 16 24 45 2 5 20 31 10 46 6 23 44 7 26 
7 12 14 16 17 22 24 25 26 27 39 44 47 34 42 19 29 8 50 36 23 15 38 6 37 43 30 31 49 4 32 21 48 45 41 3 40 18 13 10 1 35 33 2 11 20 5 28 46 9 
3 12 14 15 22 23...

result:

ok correct

Extra Test:

score: 0
Extra Test Passed