QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#391579#7640. Colorful CyclesParsaGolestaniWA 7777ms152236kbC++201.8kb2024-04-16 17:15:332024-04-16 17:15:34

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 9836kb

input:

2
3 3
1 2 3
2 3 1
1 3 2
5 6
1 2 1
2 3 1
1 3 2
3 4 3
3 5 3
4 5 3

output:

Yes
No

result:

ok 2 token(s): yes count is 1, no count is 1

Test #2:

score: 0
Accepted
time: 247ms
memory: 9888kb

input:

100000
7 10
7 2 2
6 4 2
6 1 2
7 1 3
3 4 1
6 7 1
2 6 3
3 1 2
5 3 1
2 1 1
7 10
5 7 3
7 1 1
4 6 3
6 3 1
3 4 3
4 2 2
3 2 3
1 3 3
3 7 1
1 4 2
7 10
5 6 3
3 5 2
7 2 3
7 3 3
1 2 2
4 3 2
7 4 2
6 1 2
2 6 1
7 5 2
7 10
7 1 3
7 5 3
6 4 1
7 6 1
1 4 1
3 4 2
2 7 2
1 3 1
3 5 3
5 1 3
7 10
6 7 2
3 4 3
1 4 2
5 3 2
7 4 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
...

result:

ok 100000 token(s): yes count is 92314, no count is 7686

Test #3:

score: 0
Accepted
time: 96ms
memory: 9900kb

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Ye...

result:

ok 50000 token(s): yes count is 49364, no count is 636

Test #4:

score: 0
Accepted
time: 120ms
memory: 9908kb

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 50000 token(s): yes count is 49941, no count is 59

Test #5:

score: 0
Accepted
time: 106ms
memory: 9984kb

input:

1000
200 1000
42 68 2
101 170 2
79 159 2
65 106 3
82 28 2
92 196 3
28 37 1
5 103 1
93 183 1
117 119 3
48 127 3
139 70 2
68 100 2
95 104 1
123 134 1
65 142 2
54 69 3
45 63 1
38 60 3
142 130 2
117 36 3
43 89 2
41 143 2
49 47 1
91 130 2
151 7 1
194 149 1
24 85 2
157 41 2
177 132 2
145 40 3
124 138 2
11...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 1000 token(s): yes count is 1000, no count is 0

Test #6:

score: 0
Accepted
time: 112ms
memory: 10156kb

input:

1000
400 1000
372 17 2
321 365 2
357 136 3
185 231 1
359 328 1
142 164 1
75 280 2
55 6 2
37 329 3
259 302 3
222 304 3
70 130 1
114 120 2
314 291 1
396 41 2
77 111 2
35 275 3
348 145 3
346 2 2
351 158 2
173 172 2
68 122 1
147 11 3
160 391 1
30 360 2
120 174 3
145 296 3
170 311 1
107 313 1
282 211 1
3...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 1000 token(s): yes count is 1000, no count is 0

Test #7:

score: 0
Accepted
time: 1492ms
memory: 10028kb

input:

1000
400 1000
372 17 2
321 365 2
357 136 2
185 231 2
359 328 2
142 164 2
75 280 2
55 6 1
37 329 1
259 302 2
222 304 2
70 130 2
114 120 2
314 291 1
396 41 2
77 111 2
35 275 2
348 145 1
346 2 1
351 158 1
173 172 1
68 122 1
147 11 1
160 391 2
30 360 1
120 174 2
145 296 2
170 311 2
107 313 1
282 211 1
3...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 1000 token(s): yes count is 0, no count is 1000

Test #8:

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

input:

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

output:

No

result:

ok NO

Test #9:

score: 0
Accepted
time: 9ms
memory: 10332kb

input:

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

output:

No

result:

ok NO

Test #10:

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

input:

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

output:

No

result:

ok NO

Test #11:

score: 0
Accepted
time: 249ms
memory: 16812kb

input:

1
50002 80241
41804 9985 3
41015 531 1
32475 43357 1
27804 45331 1
37830 10818 1
9140 8762 1
3221 23343 3
28197 44388 3
12185 41625 1
44450 9756 2
38350 14775 1
9757 19481 1
20858 17104 1
7807 24256 3
32044 37846 3
46885 27385 1
39738 9906 1
44158 35304 3
16289 43980 2
23066 24757 1
42969 19561 3
46...

output:

No

result:

ok NO

Test #12:

score: 0
Accepted
time: 6148ms
memory: 65512kb

input:

1
455002 812001
313782 211383 2
408674 310967 1
3243 335360 3
401421 177274 3
308321 237341 2
96981 83503 3
72406 169080 3
33154 273727 1
213486 241588 3
45112 90708 1
445073 252383 1
337069 283893 1
183445 167972 1
147552 226440 1
139659 55742 3
237507 63881 1
315650 309664 1
25601 309502 3
103898 ...

output:

No

result:

ok NO

Test #13:

score: 0
Accepted
time: 7673ms
memory: 71568kb

input:

1
550002 960001
457067 193767 1
342478 12620 1
457744 335514 1
539768 376061 1
138263 362120 3
470645 351694 2
378812 275543 3
433382 61920 3
80042 190753 1
416842 239041 3
210707 333641 1
136495 292903 3
231177 488035 1
161882 335528 1
109575 231095 1
460301 391728 1
482079 202050 1
267924 42252 1
...

output:

No

result:

ok NO

Test #14:

score: 0
Accepted
time: 6273ms
memory: 66496kb

input:

1
460002 920000
320036 139429 1
135428 96743 3
275092 149008 3
209374 131707 1
209240 89841 1
233222 421629 2
299800 140778 1
23130 393279 2
238254 172231 3
357686 310469 1
150177 271638 1
243817 405084 1
6505 215324 3
209374 58689 1
76592 261906 1
212083 19077 3
166663 198182 3
315013 269131 1
4783...

output:

No

result:

ok NO

Test #15:

score: 0
Accepted
time: 6879ms
memory: 67084kb

input:

1
460002 920001
320036 139429 1
135428 96743 3
275092 149008 3
209374 131707 1
209240 89841 1
233222 421629 2
299800 140778 1
23130 393279 2
238254 172231 3
357686 310469 1
150177 271638 1
243817 405084 1
6505 215324 3
209374 58689 1
76592 261906 1
212083 19077 3
166663 198182 3
315013 269131 1
4783...

output:

No

result:

ok NO

Test #16:

score: 0
Accepted
time: 1419ms
memory: 33444kb

input:

1
46002 812001
35705 43426 3
34108 16494 1
41906 23632 2
10383 38713 3
21287 376 1
19192 42771 1
12929 39593 3
12445 41713 3
40539 10156 3
34068 1475 1
43112 27026 3
4848 22576 3
8555 27001 2
18061 591 2
9393 8636 2
11566 107 1
34515 38738 2
14051 30826 1
7051 21119 1
34094 44258 1
5265 26902 3
1810...

output:

No

result:

ok NO

Test #17:

score: 0
Accepted
time: 7626ms
memory: 112836kb

input:

1
950002 973221
432170 467373 1
313927 855724 1
535785 39167 3
511760 195368 1
540939 494584 1
675511 477904 2
749903 47829 1
815904 545905 2
234727 419470 1
471623 27706 1
733030 871395 3
367265 853892 1
713692 137647 3
517373 864580 1
173098 514005 1
603460 439442 3
252197 936650 3
696344 701263 1...

output:

No

result:

ok NO

Test #18:

score: 0
Accepted
time: 5800ms
memory: 57824kb

input:

1
305002 900601
234230 166160 3
26402 110441 1
260382 269800 2
71590 126859 3
86708 36255 3
62480 159002 1
254009 163584 2
99193 162990 2
216761 86741 1
132905 69651 3
107697 116171 3
167683 282132 1
245344 138538 2
95489 203036 3
123220 46895 3
6670 298595 1
207696 204780 3
213024 50207 3
203048 92...

output:

No

result:

ok NO

Test #19:

score: 0
Accepted
time: 357ms
memory: 47364kb

input:

1
305002 900602
234230 166160 3
26402 110441 1
260382 269800 2
71590 126859 3
86708 36255 3
62480 159002 1
254009 163584 2
99193 162990 2
216761 86741 1
132905 69651 3
107697 116171 3
167683 282132 1
245344 138538 2
95489 203036 3
123220 46895 3
6670 298595 1
207696 204780 3
213024 50207 3
203048 92...

output:

Yes

result:

ok YES

Test #20:

score: 0
Accepted
time: 522ms
memory: 63360kb

input:

1
500002 960002
113869 183432 2
196294 70838 2
67872 28519 2
382076 338251 1
18718 488743 1
328776 158876 3
84117 128660 3
129467 430532 3
290609 332064 2
107282 269274 2
86300 34853 1
298735 297069 3
417810 452318 3
484522 443788 2
192609 424418 1
340205 391642 1
301144 412588 1
394805 82253 1
4832...

output:

Yes

result:

ok YES

Test #21:

score: 0
Accepted
time: 788ms
memory: 66692kb

input:

1
500002 960002
113869 183432 2
196294 70838 2
67872 28519 3
382076 338251 1
18718 488743 1
328776 158876 3
84117 128660 3
129467 430532 3
290609 332064 2
107282 269274 3
86300 34853 1
298735 297069 3
417810 452318 3
484522 443788 3
192609 424418 1
340205 391642 1
301144 412588 1
394805 82253 1
4832...

output:

Yes

result:

ok YES

Test #22:

score: 0
Accepted
time: 497ms
memory: 64996kb

input:

1
365002 990026
297221 169644 2
324790 294481 1
311368 259468 1
68680 63215 1
293803 83376 1
189253 264951 2
15264 357829 2
233472 175890 2
321846 155907 3
262992 40940 3
267973 150362 1
51071 50300 3
234449 288932 1
152179 359396 2
12420 147592 1
22925 172093 3
321802 225482 3
81094 118143 2
98500 ...

output:

Yes

result:

ok YES

Test #23:

score: 0
Accepted
time: 1095ms
memory: 115756kb

input:

1
703102 907242
452857 588580 3
571875 132705 3
81309 273501 3
436277 26431 3
287126 405490 3
356124 344599 3
178172 218862 3
366603 458120 3
362090 413825 3
407972 54135 3
166718 220954 3
314851 422259 3
345337 126054 3
418392 599524 3
364564 340012 3
215679 156796 3
512028 297296 3
677500 666398 3...

output:

Yes

result:

ok YES

Test #24:

score: 0
Accepted
time: 1202ms
memory: 115412kb

input:

1
703102 907242
200723 109796 3
79161 191067 3
278934 373426 3
115228 507102 3
280088 177873 3
175112 154690 3
453374 649133 3
337832 430230 3
433387 554596 3
228668 631976 3
551078 667309 3
378868 359861 3
546859 398334 3
454352 401271 3
293328 460601 3
611023 58430 3
574354 291106 3
570153 84002 3...

output:

Yes

result:

ok YES

Test #25:

score: 0
Accepted
time: 643ms
memory: 108496kb

input:

1
703102 907242
313203 564643 2
172338 526504 3
558624 363884 2
318202 470844 1
66599 248897 2
89091 414680 2
131518 594746 2
342885 691732 2
178862 87191 2
291125 419468 2
315526 603657 2
452084 93932 2
408142 428811 2
527217 106504 2
177918 236288 1
668803 395920 2
369361 327624 2
25447 285136 2
5...

output:

Yes

result:

ok YES

Test #26:

score: 0
Accepted
time: 241ms
memory: 69056kb

input:

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

output:

Yes

result:

ok YES

Test #27:

score: 0
Accepted
time: 533ms
memory: 65884kb

input:

1
606002 912202
58494 9359 1
117049 336381 1
550062 174252 1
109803 15075 1
368512 545753 1
396151 600541 1
244945 531138 1
254774 210934 1
205413 496724 1
388871 193665 1
571489 219820 1
344242 4295 1
19138 364354 1
158852 392781 1
38424 563588 1
589177 467175 1
236248 242664 1
429730 463245 1
5299...

output:

Yes

result:

ok YES

Test #28:

score: 0
Accepted
time: 508ms
memory: 95116kb

input:

1
506002 912202
272178 281302 2
122546 36080 2
300255 245681 2
329254 262497 2
370115 271066 2
339538 33855 2
417517 500770 2
269381 425081 2
114262 210589 2
370642 141290 2
434941 344399 2
185721 200862 2
349936 191601 2
250077 7554 2
332765 412970 2
481232 302028 2
437827 243189 2
75492 308869 2
4...

output:

Yes

result:

ok YES

Test #29:

score: 0
Accepted
time: 380ms
memory: 72576kb

input:

1
505502 911102
62676 393998 3
132604 24978 3
326958 477610 3
263365 463302 3
216242 183065 3
368687 469939 3
435584 78101 3
30705 144437 3
157505 291736 3
197319 87575 3
496881 280211 3
50383 164695 3
222173 442785 3
304732 98835 3
139977 492951 3
327471 177924 3
230778 20215 3
218520 59782 3
90538...

output:

Yes

result:

ok YES

Test #30:

score: 0
Accepted
time: 2073ms
memory: 151696kb

input:

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

output:

No

result:

ok NO

Test #31:

score: 0
Accepted
time: 2562ms
memory: 128236kb

input:

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

output:

No

result:

ok NO

Test #32:

score: 0
Accepted
time: 7645ms
memory: 125160kb

input:

1
799999 1000000
647901 426820 3
118997 504898 2
660496 176495 2
275628 67692 2
56289 640043 2
651576 374013 2
1550 146735 2
374832 90894 2
531816 36800 3
545027 11761 2
277066 441979 1
112324 321405 2
304280 454565 2
473152 309503 2
22289 714368 1
532823 622847 3
624859 564290 3
739170 646043 1
350...

output:

No

result:

ok NO

Test #33:

score: 0
Accepted
time: 1017ms
memory: 64160kb

input:

1
400001 920002
41454 50731 2
373323 351526 2
223023 299253 1
279239 140351 1
364158 104342 3
93321 159513 3
383783 315644 2
200452 372500 2
117445 278286 1
234541 385316 1
334011 217233 1
258282 189973 1
6536 398621 1
271538 280897 1
104069 298675 3
94610 349306 1
41454 80444 1
217668 50178 3
10298...

output:

Yes

result:

ok YES

Test #34:

score: 0
Accepted
time: 1264ms
memory: 71296kb

input:

1
500001 912007
120761 83435 1
333763 256671 1
167491 187401 2
412320 326763 1
183572 372684 3
357353 341130 3
68766 13823 1
157335 492269 1
418458 235267 2
85078 304600 2
206784 127587 3
431133 55392 3
462347 121547 2
220543 423040 3
81431 206736 2
201802 255749 1
50755 437061 2
331900 443476 1
158...

output:

Yes

result:

ok YES

Test #35:

score: 0
Accepted
time: 549ms
memory: 67468kb

input:

1
500001 912007
120761 83435 1
333763 256671 1
167491 187401 2
412320 326763 1
183572 372684 3
357353 341130 3
68766 13823 1
157335 492269 1
418458 235267 2
85078 304600 2
206784 127587 2
431133 55392 3
462347 121547 2
220543 423040 3
81431 206736 2
201802 255749 1
50755 437061 2
331900 443476 1
158...

output:

Yes

result:

ok YES

Test #36:

score: 0
Accepted
time: 488ms
memory: 70168kb

input:

1
700001 940007
78570 404550 2
480464 514711 3
610354 281206 1
1874 483803 3
577060 221995 1
610354 181697 1
259724 150691 1
667348 670427 1
610354 51055 2
683768 657830 2
605966 633225 2
635578 124939 2
136231 258262 2
292774 353321 3
111290 416068 3
152903 130797 1
273230 52716 1
25803 453424 1
46...

output:

Yes

result:

ok YES

Test #37:

score: 0
Accepted
time: 459ms
memory: 81452kb

input:

1
860001 934007
709545 428712 2
443540 718567 1
151146 537057 2
432556 300233 1
35951 587972 1
799748 473501 2
441928 228669 2
701772 626562 1
400369 379244 1
283754 696199 2
347827 232387 2
817439 762831 2
818164 434840 1
542945 175131 1
777276 359758 2
126034 652798 1
761353 462925 1
667403 680961...

output:

Yes

result:

ok YES

Test #38:

score: 0
Accepted
time: 628ms
memory: 87356kb

input:

1
530001 958007
291830 347365 2
344719 16087 1
393995 401168 1
599 100119 1
468059 106186 1
390193 345648 1
295142 88196 1
124318 207884 1
516189 183949 1
184795 445753 1
457456 402663 1
115661 322909 1
508002 122444 1
202208 202188 2
336090 468104 1
382138 421426 1
348921 526606 1
184283 411558 1
2...

output:

Yes

result:

ok YES

Test #39:

score: 0
Accepted
time: 543ms
memory: 100320kb

input:

1
633001 941567
408761 234741 1
433317 555380 1
531617 381516 1
489864 79672 1
385641 250907 3
199353 333889 1
10978 15452 1
604218 106220 1
57852 522554 1
129485 246962 1
29864 85570 1
156079 526329 2
312289 229376 1
21262 91411 1
622004 603050 1
468850 354050 1
540879 328701 2
106038 495719 1
1661...

output:

Yes

result:

ok YES

Test #40:

score: 0
Accepted
time: 761ms
memory: 109380kb

input:

1
714501 939567
644466 33905 2
606351 584553 2
362510 134753 2
232928 157396 2
433020 301993 2
546626 585927 2
548858 681031 2
492956 93660 1
652488 155513 2
203171 324057 2
249199 663276 2
417206 504625 2
334367 408840 2
670618 250313 2
406613 269421 2
420524 86327 2
60007 405440 2
675143 332895 2
...

output:

Yes

result:

ok YES

Test #41:

score: 0
Accepted
time: 1306ms
memory: 114232kb

input:

1
710501 935567
134352 665232 2
369891 470931 2
671649 248724 2
492792 405869 2
83545 113302 2
314566 494269 2
683378 177646 2
73077 293614 2
358009 8709 2
692992 126345 2
116334 496263 2
690881 93517 2
420547 143441 2
35676 646212 2
570119 435751 2
246252 618785 2
200880 168574 2
192466 633457 2
33...

output:

Yes

result:

ok YES

Test #42:

score: 0
Accepted
time: 737ms
memory: 50560kb

input:

1
211001 970507
47094 119553 3
197842 150413 3
194930 39628 2
73373 208858 3
115540 14772 3
208245 104792 3
41435 86283 3
26828 92281 2
186013 59534 3
118713 60572 3
50322 187919 3
194471 168247 2
197491 149981 3
193781 21701 3
167409 116307 2
161507 54199 3
58413 57389 3
152925 68028 3
44139 95369 ...

output:

Yes

result:

ok YES

Test #43:

score: 0
Accepted
time: 3964ms
memory: 60560kb

input:

1
211001 970506
1102 119553 3
197842 150413 3
194930 33550 2
73373 208858 3
115540 11187 3
208245 104792 3
31488 86283 3
23246 92281 2
186013 59534 3
118713 60572 3
27536 187919 3
194471 168247 2
197491 149981 3
193781 21702 3
167409 116307 2
161507 54199 3
58413 57389 3
152925 68028 3
37324 95369 3...

output:

No

result:

ok NO

Test #44:

score: 0
Accepted
time: 7625ms
memory: 114436kb

input:

1
706001 932706
334572 193216 3
60163 309317 3
367642 220151 3
110431 225398 3
212113 84183 3
211509 46905 3
380667 402139 3
393936 409270 3
287434 180644 3
561044 460134 3
593123 591117 3
109664 183026 3
124458 630566 3
485003 298400 3
463607 181103 3
643660 143646 3
336535 368966 1
209066 455153 1...

output:

No

result:

ok NO

Test #45:

score: 0
Accepted
time: 5185ms
memory: 91584kb

input:

1
493001 866926
7652 263861 1
48238 155001 1
484618 350468 1
39864 279861 1
173609 25426 1
19712 128367 1
257135 28953 1
419864 100518 1
245102 447965 1
217821 478552 1
97524 407285 1
88931 469891 1
38985 165579 1
411148 325949 1
412851 144237 1
302743 96600 1
213387 299959 1
459482 437933 1
103762 ...

output:

No

result:

ok NO

Test #46:

score: 0
Accepted
time: 6554ms
memory: 102460kb

input:

1
592001 917506
427957 15318 1
332937 117544 1
441026 187658 1
515802 493658 1
499607 12969 1
251475 97684 1
308191 292781 1
315703 226355 1
350547 345911 1
1878 229496 1
20803 45849 1
38662 67515 1
375459 264856 1
186329 156009 1
320347 268589 1
353712 162847 1
152800 413282 1
72110 337593 1
297687...

output:

No

result:

ok NO

Test #47:

score: 0
Accepted
time: 7690ms
memory: 127032kb

input:

1
817001 890551
221306 499474 1
313111 161111 1
161200 357154 1
81531 140199 2
264863 379463 1
80320 484111 2
7464 215375 1
254134 80289 1
273235 213838 1
489547 677769 1
722978 363107 2
526171 441812 1
610389 73981 2
406670 102045 1
91738 24368 2
566106 181605 2
13516 728557 2
456767 399704 2
26572...

output:

No

result:

ok NO

Test #48:

score: 0
Accepted
time: 6744ms
memory: 75588kb

input:

1
608001 909701
556257 601849 3
184427 172887 3
263480 352306 1
416413 209662 1
505581 472806 1
46493 520949 1
493206 559803 1
384412 594674 1
519119 123336 2
604938 600514 1
469226 285378 1
33830 427939 1
509869 105331 1
234533 183318 2
594920 298131 1
530422 148209 3
553421 363990 3
558266 528427 ...

output:

No

result:

ok NO

Test #49:

score: 0
Accepted
time: 3711ms
memory: 55052kb

input:

1
368001 848501
163510 182887 2
96818 240351 1
235816 162152 3
99237 322545 3
73794 307668 3
167151 48163 1
99237 205304 3
239609 211462 3
314422 323504 1
99237 319546 2
20736 59459 1
205478 90143 3
56096 305615 3
142691 216112 3
209820 156223 2
197581 298210 1
238614 128092 2
193881 358346 3
99237 ...

output:

No

result:

ok NO

Test #50:

score: 0
Accepted
time: 6931ms
memory: 72952kb

input:

1
600003 997002
225384 372825 2
277523 151308 1
494142 139664 3
581150 570029 1
537943 63207 2
492375 448285 1
29018 309529 1
42004 575732 3
87723 344070 3
278477 506561 2
277704 256891 1
190709 103657 1
595623 355653 2
212001 362256 2
81494 403099 2
155833 487780 2
486638 386425 1
281282 159465 3
9...

output:

No

result:

ok NO

Test #51:

score: 0
Accepted
time: 2099ms
memory: 47068kb

input:

1
180003 922652
14825 205 1
108206 5586 1
171289 78672 1
118683 38841 1
28360 62941 1
44131 9347 1
61489 168072 1
40293 97999 1
116541 127917 1
150097 71239 1
130363 112647 1
160032 174277 1
77688 49268 1
43287 83728 1
156667 129090 1
34128 156205 3
3191 32841 1
106603 130431 1
112785 72128 1
60734 ...

output:

No

result:

ok NO

Test #52:

score: 0
Accepted
time: 6357ms
memory: 99908kb

input:

1
580003 992652
118455 48665 2
450015 63073 2
173041 68740 1
185013 440310 1
24551 202909 2
109336 258057 2
340992 300127 2
75897 473164 2
286500 189075 2
391859 399288 1
560008 465455 2
396696 431252 2
375609 54915 2
204253 25796 2
233896 332237 2
50771 95969 2
550717 84438 1
395647 272294 1
509714...

output:

No

result:

ok NO

Test #53:

score: 0
Accepted
time: 3892ms
memory: 78560kb

input:

1
375003 984652
124802 208707 3
5973 226386 3
287566 325184 2
190942 151675 3
127483 239736 1
346743 320828 3
119882 61221 3
122288 68248 3
38489 216863 1
369744 130766 3
316226 106522 3
248827 312746 3
98829 243936 3
63894 218990 1
7316 116687 3
212438 205783 3
85463 293118 3
323425 116239 3
28233 ...

output:

No

result:

ok NO

Test #54:

score: 0
Accepted
time: 5200ms
memory: 86692kb

input:

1
470003 976652
469370 337450 3
208722 319153 3
270896 272024 1
192864 127221 3
123877 264055 3
304652 128152 3
336337 72969 3
380669 55435 3
48009 30371 3
60289 393906 3
105215 226952 1
288691 346380 3
344428 299751 3
24306 50163 3
312160 19084 3
159744 352949 3
283660 392735 3
101408 224604 3
3270...

output:

No

result:

ok NO

Test #55:

score: 0
Accepted
time: 7777ms
memory: 123400kb

input:

1
806003 999940
635676 715540 2
3628 784774 2
112602 317346 2
453895 710325 2
656768 83258 2
147882 697247 2
567164 712043 2
363852 65455 1
729243 212820 2
317948 300090 2
605315 753038 3
579357 15804 1
301325 403307 2
329322 284404 2
776686 403142 2
732544 146799 3
747836 508822 3
386951 423229 3
2...

output:

No

result:

ok NO

Test #56:

score: 0
Accepted
time: 6208ms
memory: 99532kb

input:

1
590003 906940
258172 13774 1
41725 503336 1
167786 429035 1
553058 461790 3
207128 556371 1
26627 151143 3
159646 567088 1
246519 573523 1
34571 538027 1
441866 291928 3
343719 206335 3
523415 269891 3
88995 325058 3
248226 367733 1
342160 436755 1
565870 65726 1
80071 292485 1
63474 305768 3
4456...

output:

No

result:

ok NO

Test #57:

score: 0
Accepted
time: 336ms
memory: 90356kb

input:

1
590003 906941
258172 13774 1
41725 503336 1
167786 429035 1
553058 461790 3
207128 556371 1
26627 151143 3
159646 567088 1
246519 573523 1
34571 538027 1
441866 291928 3
343719 206335 3
523415 269891 3
88995 325058 3
248226 367733 1
342160 436755 1
565870 65726 1
80071 292485 1
63474 305768 3
4456...

output:

Yes

result:

ok YES

Test #58:

score: 0
Accepted
time: 249ms
memory: 51600kb

input:

1
194003 987953
127774 124164 3
151122 18695 3
70153 80208 3
14458 30963 3
160471 173040 3
91527 1230 3
51670 71635 3
106364 91107 1
124894 116161 3
142418 109184 3
49753 7229 3
109026 87939 3
18002 167895 3
62858 88312 3
20565 103322 3
27145 181172 3
50099 91982 3
101483 47301 3
18137 48688 3
75046...

output:

Yes

result:

ok YES

Test #59:

score: 0
Accepted
time: 292ms
memory: 55148kb

input:

1
359003 868803
261641 4679 3
38294 253118 2
99011 88293 1
273852 282771 1
248105 217740 2
701 133752 1
15480 36933 3
174431 304814 1
293608 29755 1
104106 270724 2
90710 121811 3
331000 97839 3
1913 49709 1
125627 183984 3
257898 265453 3
60648 343120 2
7483 235728 1
153933 21195 2
256495 296930 2
...

output:

Yes

result:

ok YES

Test #60:

score: 0
Accepted
time: 931ms
memory: 65812kb

input:

1
590003 868803
278174 128411 1
22315 206635 1
412503 457479 1
397589 503064 1
231026 560991 1
237467 337042 3
303838 112360 2
249141 6295 2
313717 375165 2
359957 186807 3
396534 302121 1
472944 543065 3
319619 194480 2
237853 270331 1
224090 301315 3
70521 478166 1
530543 319915 1
281713 457121 1
...

output:

Yes

result:

ok YES

Test #61:

score: 0
Accepted
time: 1531ms
memory: 108688kb

input:

1
654903 977091
64291 114592 2
212895 312953 2
398474 66378 2
346431 283812 2
443471 49631 2
473901 441871 2
320012 458922 2
572621 113093 2
174477 200188 1
435606 579180 2
277458 99801 2
209510 182744 1
314228 393191 2
144825 557162 2
280657 84767 1
414911 599696 2
645392 411731 1
484076 57532 1
13...

output:

Yes

result:

ok YES

Test #62:

score: 0
Accepted
time: 346ms
memory: 85276kb

input:

1
659403 884391
42239 226212 3
658348 587943 3
371291 33621 3
553390 89344 3
627569 464010 3
249506 409296 3
456811 343674 3
260019 589263 1
406583 552698 3
562256 106927 3
55963 366134 3
59769 652913 3
338157 332746 1
511160 128086 3
120099 124533 3
307774 174912 1
332622 397895 1
380718 625737 3
1...

output:

Yes

result:

ok YES

Test #63:

score: 0
Accepted
time: 261ms
memory: 56788kb

input:

1
459503 890693
19748 114223 3
364316 157600 3
339341 341475 3
57381 252873 3
96945 161930 1
265454 20678 1
119368 251401 1
245494 283837 3
234343 129332 3
369811 442742 3
136688 293230 1
217393 139812 1
293482 250551 3
197851 79851 3
422031 421215 1
227148 216134 3
408771 197817 1
200039 189573 1
4...

output:

Yes

result:

ok YES

Test #64:

score: 0
Accepted
time: 449ms
memory: 85072kb

input:

1
459503 890693
19748 114223 3
364316 157600 3
339341 341475 3
57381 252873 3
96945 161930 1
265454 20678 1
119368 251401 1
245494 283837 3
234343 129332 3
369811 442742 3
136688 293230 1
217393 139812 1
293482 250551 3
197851 79851 3
422031 421215 1
227148 216134 3
408771 197817 1
200039 189573 1
4...

output:

Yes

result:

ok YES

Test #65:

score: 0
Accepted
time: 363ms
memory: 69204kb

input:

1
604003 905298
454512 264187 2
12938 592457 2
392172 303301 1
167594 36304 1
601642 151026 1
353628 103430 1
558117 249421 1
493741 314328 2
41824 398876 1
43696 139505 1
461064 541972 1
64328 72675 1
29300 169841 2
349556 90479 2
19083 199293 1
190511 119110 1
405402 22382 1
253339 94947 1
280479 ...

output:

Yes

result:

ok YES

Test #66:

score: 0
Accepted
time: 330ms
memory: 73200kb

input:

1
653003 802898
415787 467077 2
124367 611295 1
303533 438234 2
514910 56618 2
625732 45251 1
471318 92597 2
382948 213095 1
276864 260409 1
199735 217099 2
404664 238195 1
445833 444642 2
190474 630229 2
383493 536110 1
214463 50458 3
226067 152589 1
629156 99130 2
390577 540954 1
332306 550053 2
6...

output:

Yes

result:

ok YES

Test #67:

score: 0
Accepted
time: 1149ms
memory: 72684kb

input:

1
653003 802898
415787 467077 2
124367 611295 1
303533 438234 2
514910 56618 2
625732 45251 1
471318 92597 2
382948 213095 1
276864 260409 1
199735 217099 2
404664 238195 1
445833 444642 2
190474 630229 2
383493 536110 1
214463 50458 3
226067 152589 1
629156 99130 2
390577 540954 1
332306 550053 2
6...

output:

Yes

result:

ok YES

Test #68:

score: 0
Accepted
time: 556ms
memory: 96536kb

input:

1
553503 914898
450592 474761 3
106845 415101 1
350102 485573 1
188451 405719 1
478891 481282 1
536285 72658 1
27857 326993 1
275437 10459 1
168881 498142 1
547913 440025 1
292393 310821 1
339949 473549 1
512543 308405 1
344073 496779 1
468213 143377 1
149759 116713 1
496329 315968 1
41644 95438 1
2...

output:

Yes

result:

ok YES

Test #69:

score: 0
Accepted
time: 672ms
memory: 92312kb

input:

1
544003 795698
272294 328376 3
199316 537059 3
527922 219924 3
445704 35807 3
460753 40803 3
187429 427003 3
455005 9896 3
377157 113736 3
253400 272445 3
78348 330535 3
112032 398928 3
351691 70453 3
120786 285790 3
269049 231719 3
332560 279257 3
342227 1915 3
127666 190172 3
306199 95213 3
25811...

output:

Yes

result:

ok YES

Test #70:

score: 0
Accepted
time: 2ms
memory: 9836kb

input:

2
2 1
1 2 3
2 1
1 2 3

output:

No
No

result:

ok 2 token(s): yes count is 0, no count is 2

Test #71:

score: 0
Accepted
time: 2ms
memory: 9896kb

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes

result:

ok 10 token(s): yes count is 10, no count is 0

Test #72:

score: 0
Accepted
time: 1960ms
memory: 9964kb

input:

500000
2 1
2 1 2
2 1
2 1 3
2 1
2 1 2
2 1
2 1 2
2 1
2 1 1
2 1
2 1 2
2 1
2 1 3
2 1
2 1 2
2 1
2 1 2
2 1
2 1 2
2 1
2 1 1
2 1
2 1 2
2 1
2 1 1
2 1
2 1 1
2 1
2 1 1
2 1
2 1 3
2 1
2 1 3
2 1
2 1 3
2 1
2 1 1
2 1
2 1 2
2 1
2 1 1
2 1
2 1 2
2 1
2 1 1
2 1
2 1 2
2 1
2 1 3
2 1
2 1 3
2 1
2 1 3
2 1
2 1 1
2 1
2 1 2
2 1...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 500000 token(s): yes count is 0, no count is 500000

Test #73:

score: 0
Accepted
time: 1555ms
memory: 9904kb

input:

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

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
...

result:

ok 100000 token(s): yes count is 0, no count is 100000

Test #74:

score: 0
Accepted
time: 1091ms
memory: 9988kb

input:

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

output:

Yes
No
Yes
No
No
No
Yes
Yes
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
Yes
No
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
No
No
No
No
Yes
No
No
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
Yes
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
N...

result:

ok 100000 token(s): yes count is 44253, no count is 55747

Test #75:

score: 0
Accepted
time: 1996ms
memory: 152236kb

input:

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

output:

No

result:

ok NO

Test #76:

score: 0
Accepted
time: 1196ms
memory: 10052kb

input:

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

output:

Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
Yes
Yes
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
No
No
No
No...

result:

ok 23256 token(s): yes count is 6232, no count is 17024

Test #77:

score: 0
Accepted
time: 1182ms
memory: 9844kb

input:

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

output:

Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
Yes
No
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No...

result:

ok 25000 token(s): yes count is 5949, no count is 19051

Test #78:

score: 0
Accepted
time: 565ms
memory: 10104kb

input:

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

output:

Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
No
No
Yes
No
No
No
Yes
No
No
Yes
No
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
No
Yes
Yes
No
No
Yes
No
No
Yes
No
No
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
No
No
No
Yes
No
No...

result:

ok 22222 token(s): yes count is 11103, no count is 11119

Test #79:

score: -100
Wrong Answer
time: 3248ms
memory: 58212kb

input:

1
400026 800023
65030 146057 3
352225 342416 3
103378 152668 1
342416 106501 3
110509 325347 2
79070 392741 3
379561 342416 3
363373 16095 3
64288 65030 3
371902 341968 3
316294 57971 3
170534 128862 3
142244 317950 1
341455 342416 3
8213 316294 3
342416 149894 3
41474 209928 3
116278 160899 1
34241...

output:

No

result:

wrong answer expected YES, found NO [1st token]