QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#861692#9983. Color-Balanced Treeucup-team2796#AC ✓55ms29268kbC++2310.5kb2025-01-18 19:17:552025-01-18 19:18:05

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3712kb

input:

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

output:

0 1 0 0 1 1
0 0 0 1 1 1
0 1 0 1 0 1 0 1
0 0 0 1 0 1 1 1 0 1

result:

ok correct! (4 test cases)

Test #2:

score: 0
Accepted
time: 20ms
memory: 3840kb

input:

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

output:

0 1 1 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 1 1
0 0 0 0 1 1 1 1
0 1
0 0 1 1
0 0 0 0 1 0 1 1 1 1
0 1 0 1 1 0
0 0 1 1 0 0 1 0 1 1 0 1
0 1 1 1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 0 1 0 1 0 1
0 1 0 0 1 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 1 0 0 1 1 1 0
0 1 0 1
0 1 1 0
0 0 1 1 1 0 1 0 0 1 0 1 1 1 1 1 0 0 ...

result:

ok correct! (10000 test cases)

Test #3:

score: 0
Accepted
time: 23ms
memory: 3968kb

input:

1000
78
10 6
62 1
60 77
133 19
94 64
3 112
22 31
37 81
79 130
56 68
111 145
96 66
43 95
142 39
90 115
60 90
83 51
45 111
108 134
75 40
74 15
36 64
128 69
41 44
24 4
59 54
39 58
107 135
108 2
120 39
71 110
13 95
4 139
93 28
24 3
143 150
76 83
8 127
124 50
5 66
30 51
113 132
123 109
84 50
72 17
46 73
...

output:

0 0 0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 0 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 1 1 0 1 1 ...

result:

ok correct! (1000 test cases)

Test #4:

score: 0
Accepted
time: 22ms
memory: 3968kb

input:

1000
52
87 38
3 71
95 12
40 65
93 51
49 71
16 51
82 50
12 15
23 76
17 32
62 75
44 98
70 62
47 58
19 27
79 7
72 25
14 46
45 56
73 43
104 85
93 28
69 21
87 29
77 93
63 75
86 94
18 89
14 59
65 78
88 71
30 16
64 100
5 86
44 67
61 11
18 102
77 1
6 70
61 7
76 82
63 24
17 64
57 62
11 98
10 65
58 79
68 78
9...

output:

0 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 1 0 1 0 1 1 1 1 1 0 0 0 1 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0
0 1 1 1 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 1 1 0 1 1 1 1 1 0 ...

result:

ok correct! (1000 test cases)

Test #5:

score: 0
Accepted
time: 23ms
memory: 4096kb

input:

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

output:

0 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 1 1 0 1 0 1 0 0 0
0 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 0
0 0 1 1 1 0 0 1 0 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 1 1 0 1 0 1 1 1 0 1 0 ...

result:

ok correct! (1000 test cases)

Test #6:

score: 0
Accepted
time: 23ms
memory: 4096kb

input:

1000
55
91 82
75 11
43 41
3 16
106 74
59 10
18 34
74 105
103 32
57 78
92 36
109 20
104 33
96 92
97 109
25 29
49 13
91 40
58 22
54 6
100 23
37 72
95 32
39 73
61 30
64 4
76 68
83 61
69 62
21 64
50 55
58 8
42 68
35 25
67 52
70 80
12 110
45 65
104 19
11 66
46 44
6 48
23 50
43 7
42 21
51 39
14 107
94 19
...

output:

0 1 1 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 1 1 0 1 1 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 0 1 0 0 1 0 1 1 0 0 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 1 1 0 1 1
0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 1 0 0 1 0 1 0 1 0 0 1 1 1 1 0
0 1 0 1 1 0 1 1 0 1 ...

result:

ok correct! (1000 test cases)

Test #7:

score: 0
Accepted
time: 22ms
memory: 3968kb

input:

1000
329
625 59
497 321
357 10
435 607
535 385
545 398
605 135
513 594
258 648
485 385
552 156
264 412
458 617
630 546
455 5
66 441
491 548
607 656
639 358
235 114
44 57
637 59
473 390
339 487
87 339
498 132
391 390
525 535
469 601
11 155
294 80
312 48
60 630
132 603
21 357
529 539
278 410
432 8
275...

output:

0 1 1 1 1 1 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 1 1 1 1 0 0 1 0 1 0 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 ...

result:

ok correct! (1000 test cases)

Test #8:

score: 0
Accepted
time: 15ms
memory: 4096kb

input:

1000
3
6 4
6 3
5 6
2 6
6 1
60
27 11
11 12
15 11
11 7
11 39
47 11
11 70
11 48
11 105
97 11
17 11
11 110
11 88
81 11
43 11
29 11
11 101
11 75
11 33
11 98
5 11
99 11
30 11
90 11
36 11
11 89
83 11
11 116
44 11
11 22
11 40
38 11
20 11
11 103
37 11
56 11
11 41
11 34
11 65
55 11
11 92
11 18
61 11
35 11
107...

output:

0 1 0 0 1 1
0 0 1 1 0 1 0 1 0 1 1 0 1 1 0 1 0 0 1 0 1 0 1 1 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 1 1 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 0 1 1 1 1 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 0 0 1 1 0 1
0 1 1 1 1 0 0 0 0 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 ...

result:

ok correct! (1000 test cases)

Test #9:

score: 0
Accepted
time: 23ms
memory: 3968kb

input:

1000
93
85 108
125 127
157 117
144 76
184 17
186 73
19 42
183 180
97 53
67 79
144 92
54 48
68 151
134 147
120 154
58 51
170 139
30 20
11 55
16 84
75 15
93 3
158 151
49 132
155 149
139 115
30 84
101 147
21 1
62 167
141 82
60 9
25 22
89 69
70 161
90 161
95 41
166 112
156 119
62 172
142 86
140 182
120 ...

output:

0 1 0 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 0 1 0 1 1 0 1 1 1 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 0 1 0 0 0 0 0 ...

result:

ok correct! (1000 test cases)

Test #10:

score: 0
Accepted
time: 22ms
memory: 4096kb

input:

1000
62
70 96
6 26
77 46
49 37
24 40
97 62
109 121
7 4
63 69
118 9
65 120
39 56
122 67
43 1
84 111
18 89
41 56
28 17
61 38
72 75
87 14
88 103
64 89
68 12
83 89
69 29
83 11
28 80
27 71
30 55
97 110
25 99
65 93
21 117
96 117
44 115
32 55
34 3
51 38
5 90
77 8
101 85
45 30
97 123
31 118
72 14
65 82
19 3...

output:

0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 0 0 1 0 1 1 0 1 1 0 0 1 0 1 1 0 1 1 1 1 1 1
0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 ...

result:

ok correct! (1000 test cases)

Test #11:

score: 0
Accepted
time: 24ms
memory: 4352kb

input:

100
1216
99 1840
254 1024
388 2415
1727 1100
1648 1427
490 1252
1314 230
1285 74
185 209
312 1557
2424 740
1182 1974
13 987
928 1487
1538 2032
1666 526
1358 1496
385 382
1762 2048
1574 1182
1601 259
729 158
2375 1513
866 1408
2014 1852
1479 475
1466 1532
535 1956
1204 1010
2276 1503
1492 1848
2024 4...

output:

0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 1 0 1 0 0 0 1 0 0 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 0 0 0 0 1 1 0 0 1 1 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 1 1 0 0 1 ...

result:

ok correct! (100 test cases)

Test #12:

score: 0
Accepted
time: 24ms
memory: 4480kb

input:

100
1401
342 1237
2058 1169
590 2800
1806 2272
1341 2653
1782 2278
488 2252
881 974
2660 678
2191 626
2437 2128
672 1718
378 1163
175 1170
1391 2737
1462 2086
953 1139
1983 221
19 2533
1759 415
2474 919
2261 1957
1856 482
178 1095
2732 1796
2773 1533
1306 760
2750 2146
2394 2687
1293 147
2157 57
992...

output:

0 1 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 1 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 0 1 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 0 0 1 0 0 ...

result:

ok correct! (100 test cases)

Test #13:

score: 0
Accepted
time: 22ms
memory: 4944kb

input:

100
322
456 442
239 211
471 26
324 205
41 274
333 119
315 453
641 164
571 190
133 606
93 151
209 280
249 541
527 373
617 309
482 418
404 222
495 420
235 585
324 455
169 495
129 260
70 45
99 6
523 432
571 349
72 418
466 528
262 635
518 26
270 457
551 412
36 605
495 94
216 329
634 24
303 217
526 23
53...

output:

0 0 0 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 0 0 1 1 0 1 0 0 0 0 1 1 1 1 0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 1 1 1 1 0 1 ...

result:

ok correct! (100 test cases)

Test #14:

score: 0
Accepted
time: 22ms
memory: 4720kb

input:

100
490
293 726
104 294
514 284
739 320
947 724
469 166
99 506
14 750
420 441
239 83
946 266
405 132
609 391
348 548
431 865
36 194
286 302
622 782
205 488
627 869
72 716
417 255
678 676
767 960
155 244
424 156
392 448
404 869
88 306
791 269
720 671
682 476
77 605
745 538
829 751
345 759
222 715
688...

output:

0 1 1 0 1 0 1 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1 0 0 1 1 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 ...

result:

ok correct! (100 test cases)

Test #15:

score: 0
Accepted
time: 21ms
memory: 4392kb

input:

100
2068
702 2788
4112 1833
60 323
544 3114
2845 3888
345 2310
3718 720
1648 2014
2825 1119
2628 51
2448 2661
3870 616
475 379
355 3542
186 3316
1603 1309
2704 883
1647 2266
1166 2509
2708 186
1025 358
931 2592
3617 3139
932 2799
3948 384
3336 1987
493 286
2799 1505
3596 492
3372 3539
1324 1006
707 ...

output:

0 1 0 1 1 0 1 1 0 0 0 0 0 1 0 0 1 0 0 1 1 0 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0 1 1 1 0 1 0 1 0 ...

result:

ok correct! (100 test cases)

Test #16:

score: 0
Accepted
time: 16ms
memory: 4744kb

input:

100
1977
293 3229
2448 293
909 293
293 2945
293 3356
276 293
293 2828
293 695
1322 293
2581 293
293 225
3685 293
293 80
3222 293
293 1165
3095 293
2905 293
503 293
1732 293
293 763
465 293
293 837
293 2099
293 103
3372 293
3059 293
293 3111
1697 293
476 293
293 2027
1698 293
293 2330
1457 293
293 26...

output:

0 0 0 1 0 0 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 0 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0 0 0 1 1 1 1 0 1 0 0 1 1 0 1 1 0 0 1 1 1 1 0 0 1 0 1 0 0 1 1 0 1 0 1 0 1 0 1 1 0 1 1 0 0 1 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 1 0 1 0 0 1 1 1 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 1 1 0 1 1 0 1 1 1 1 0 1 1 1 0 ...

result:

ok correct! (100 test cases)

Test #17:

score: 0
Accepted
time: 21ms
memory: 4384kb

input:

100
1976
3622 1394
1005 1417
3529 329
2435 1850
3405 3730
1481 81
111 2353
1672 341
3631 1991
1755 1710
1085 2468
316 2648
3646 300
1222 1267
3079 3669
505 1640
2622 3137
3529 311
1810 1157
1006 2681
2383 1734
3694 82
1369 1681
2115 518
2603 115
3607 305
384 2633
1608 2675
3390 1333
164 496
3211 163...

output:

0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 1 0 1 0 0 1 1 0 0 0 0 1 1 1 1 1 0 0 0 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 1 1 0 0 0 1 0 0 1 1 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 1 0 0 1 0 ...

result:

ok correct! (100 test cases)

Test #18:

score: 0
Accepted
time: 23ms
memory: 4480kb

input:

100
387
740 217
535 547
284 649
183 143
637 428
212 764
679 434
744 753
390 317
742 693
608 37
342 331
288 500
261 1
74 700
646 281
18 105
305 662
424 223
203 590
396 480
540 53
410 448
436 27
627 105
672 192
245 669
279 308
285 529
289 509
502 348
755 126
203 79
203 380
292 730
528 129
382 147
203 ...

output:

0 0 0 1 1 0 1 0 0 1 0 1 1 1 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 0 1 1 1 0 1 1 1 0 0 1 0 1 0 1 1 1 1 0 ...

result:

ok correct! (100 test cases)

Test #19:

score: 0
Accepted
time: 27ms
memory: 7012kb

input:

10
8465
1082 16734
10003 9298
15402 9306
11446 5343
6461 9548
9008 7298
8630 10743
4826 3029
13250 7844
16185 818
4323 6947
11983 4457
16645 7573
627 7075
15661 8929
3345 1317
7062 9777
645 9724
3354 995
6332 3943
1434 4343
11735 5780
7234 9622
3900 3328
10 330
3423 16733
10357 4771
15289 4321
9131 ...

output:

0 0 1 0 1 1 0 0 1 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 1 1 1 0 1 0 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 0 0 1 1 0 1 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 0 ...

result:

ok correct! (10 test cases)

Test #20:

score: 0
Accepted
time: 30ms
memory: 6732kb

input:

10
15569
7643 17419
20364 21130
26023 15319
15084 25562
5669 8521
14189 12845
7381 11779
21802 7736
14969 28274
28116 6560
25240 18126
11002 4242
20938 26939
1367 195
5256 20955
21304 11395
25217 30549
8582 16462
485 14540
25530 10921
22658 21550
21979 14934
10041 5931
2415 30917
26695 14882
9954 14...

output:

0 0 1 1 0 0 0 0 0 1 0 0 1 1 1 1 1 1 0 1 0 1 1 0 1 1 0 0 1 1 1 1 0 0 1 0 0 1 0 1 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 1 1 1 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 0 1 1 0 ...

result:

ok correct! (10 test cases)

Test #21:

score: 0
Accepted
time: 32ms
memory: 9088kb

input:

10
30182
50630 36298
45951 47040
15908 9974
51308 21454
59312 13490
25048 21564
26329 39833
13030 36903
49769 43867
8599 39713
59570 39577
40976 54649
30428 59353
34035 2559
9541 32680
36983 44158
52377 6262
56892 53473
24255 44896
21558 47072
30095 36344
9511 43941
53408 39951
52889 36227
52729 145...

output:

0 0 0 0 0 0 1 1 0 1 1 1 1 0 1 1 0 1 0 0 0 0 1 1 1 0 1 0 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 ...

result:

ok correct! (10 test cases)

Test #22:

score: 0
Accepted
time: 34ms
memory: 9660kb

input:

10
14256
22451 3907
15129 25301
14013 20289
14531 19602
912 4126
2287 7495
22958 20068
10743 16958
21824 23466
17526 20315
21358 22302
20059 10795
1559 1202
2915 4108
20562 2994
18563 24958
18053 11849
22642 27482
5331 19537
12990 11683
5467 19209
15280 20214
21052 4242
27357 9547
11059 3069
23681 1...

output:

0 1 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 0 0 1 1 0 1 1 1 1 1 1 1 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 0 0 0 0 1 1 1 1 1 1 0 1 0 1 ...

result:

ok correct! (10 test cases)

Test #23:

score: 0
Accepted
time: 24ms
memory: 7188kb

input:

10
13141
8642 8965
3110 22845
15429 10776
18862 19509
19875 17689
7953 6970
16727 5190
21832 3277
19750 9236
8702 21271
24502 24526
7331 8061
19052 24869
15823 10269
11642 1606
12971 21297
14100 10703
20628 21078
25490 6957
2392 14398
8833 16662
2416 19108
13055 18369
17575 13637
21611 8293
24893 86...

output:

0 1 1 0 0 0 1 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 1 1 1 1 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 0 0 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 0 1 0 0 0 1 0 0 1 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 0 ...

result:

ok correct! (10 test cases)

Test #24:

score: 0
Accepted
time: 23ms
memory: 7752kb

input:

10
8351
9380 7137
13550 7137
7137 12626
7137 3392
15747 7137
7137 13887
7137 4770
7137 7380
7137 15656
12962 7137
3012 7137
7137 11887
7137 7585
7137 289
4154 7137
11237 7137
10726 7137
3998 7137
7137 6303
7137 1827
7137 14573
7137 5891
7137 6848
7137 11548
8574 7137
13562 7137
4219 7137
8403 7137
7...

output:

0 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 1 1 1 0 0 1 1 1 1 ...

result:

ok correct! (10 test cases)

Test #25:

score: 0
Accepted
time: 32ms
memory: 6784kb

input:

10
25981
27937 47252
50396 38220
51359 23636
26936 20001
24183 31475
32860 20017
17786 21503
41504 28210
31971 11889
47860 29979
41700 51445
30479 37291
12903 8133
18899 15867
40594 11811
44833 21785
10628 49205
29934 14788
28153 3951
44555 49873
33689 28749
48016 35610
23866 23602
25069 13784
36155...

output:

0 1 0 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 0 1 1 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 0 1 1 1 0 0 0 1 1 0 1 0 1 0 0 1 1 1 1 1 1 0 1 1 0 ...

result:

ok correct! (10 test cases)

Test #26:

score: 0
Accepted
time: 29ms
memory: 7296kb

input:

10
356
42 635
7 537
506 398
677 170
105 501
58 227
189 628
224 635
582 404
96 474
265 601
606 458
301 307
635 540
390 439
461 421
29 668
40 147
223 550
491 460
32 64
211 461
442 84
567 704
443 529
32 299
124 252
140 220
128 291
597 276
46 72
556 212
24 119
422 399
696 601
473 320
436 404
593 452
511...

output:

0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 1 0 0 0 1 0 1 0 1 0 1 1 0 0 0 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 1 0 0 0 1 ...

result:

ok correct! (10 test cases)

Test #27:

score: 0
Accepted
time: 42ms
memory: 18380kb

input:

1
100000
105010 51386
84011 52592
70341 133719
18007 58914
196060 118037
67635 43567
142065 65652
116213 178131
80473 26781
196634 98067
198557 171689
191609 15236
100192 51619
145823 129181
39738 177639
161532 196355
152856 579
33709 39764
41336 168246
120648 62369
6334 142976
181771 98227
46862 10...

output:

0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 0 1 1 0 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 1 0 1 0 0 0 0 1 1 0 0 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 0 1 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 0 0 1 1 0 1 1 0 0 0 0 1 0 0 1 ...

result:

ok correct! (1 test case)

Test #28:

score: 0
Accepted
time: 45ms
memory: 16412kb

input:

1
100000
7085 91267
112460 113418
147560 161039
140986 159975
143019 16725
26780 47027
168184 55276
129453 79413
14543 138572
106577 140268
78161 142422
19330 181630
114962 5972
25332 42480
182841 60963
68681 73715
16822 66928
105814 159660
78564 175548
96066 19314
15459 43170
148797 35960
177020 16...

output:

0 1 0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 0 0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 0 0 1 1 ...

result:

ok correct! (1 test case)

Test #29:

score: 0
Accepted
time: 45ms
memory: 22556kb

input:

1
100000
8340 125924
174449 40706
39024 24042
66945 45222
102630 77873
95010 136065
57861 144450
197056 77661
127534 35521
112903 176573
182143 139090
33560 32732
137592 165085
86772 146970
14418 164045
185733 80254
165321 129987
170957 164645
118819 2847
6008 145124
118357 59385
119498 81764
25625 ...

output:

0 0 1 0 0 1 1 1 0 1 1 1 1 0 1 1 0 1 1 0 0 1 1 1 1 1 1 0 0 0 0 1 0 1 1 1 0 1 1 0 1 1 1 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 0 0 1 1 1 1 0 0 0 0 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 0 0 1 0 1 0 0 0 ...

result:

ok correct! (1 test case)

Test #30:

score: 0
Accepted
time: 55ms
memory: 29268kb

input:

1
100000
121454 18412
40319 147599
62930 33382
3503 33843
142732 113248
184372 65413
168784 69915
190997 119586
106487 139111
180957 59564
117091 9593
197127 80612
37687 24611
67884 198361
104165 191225
62797 164363
100053 73550
44668 26571
103358 19179
102817 163414
63764 148428
63091 171074
153052...

output:

0 0 1 0 0 0 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 1 1 1 1 1 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 1 0 0 0 0 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 1 0 1 1 0 ...

result:

ok correct! (1 test case)

Test #31:

score: 0
Accepted
time: 40ms
memory: 17616kb

input:

1
100000
31640 103047
82457 151591
80893 191385
126619 124354
151511 153213
20794 125868
30086 199249
178826 51657
59813 67203
27374 133001
40429 89404
95241 154761
131756 35447
69778 188877
20824 22636
9322 92044
77587 71834
112837 93886
54478 90126
125736 127306
147357 160715
175159 124866
158611 ...

output:

0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 0 0 1 0 1 0 0 0 1 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 1 1 0 0 1 0 1 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 1 1 0 0 1 1 1 0 ...

result:

ok correct! (1 test case)

Test #32:

score: 0
Accepted
time: 23ms
memory: 17540kb

input:

1
100000
52346 151387
52346 144044
52346 101633
90752 52346
83294 52346
52346 102635
21194 52346
52346 18467
172777 52346
52346 91444
52346 75196
187374 52346
154896 52346
52346 37599
175968 52346
117761 52346
52346 123703
52346 167625
52346 86991
65013 52346
52346 57861
31940 52346
132915 52346
681...

output:

0 1 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 0 0 0 1 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 0 1 0 1 0 0 0 1 ...

result:

ok correct! (1 test case)

Test #33:

score: 0
Accepted
time: 55ms
memory: 16080kb

input:

1
100000
16740 126225
168865 98992
111360 194174
188496 48534
18216 121096
101176 3238
123526 46576
148150 111932
96428 555
105482 148341
135402 142840
34451 178020
6395 131248
158106 190171
51703 191011
61808 190275
5571 11463
81592 5299
193498 10272
167585 138514
98532 115952
160288 172573
157788 ...

output:

0 0 1 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 0 0 1 0 0 0 0 1 0 1 0 1 1 0 1 0 1 1 1 0 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 1 0 1 0 0 1 0 1 0 1 1 1 1 0 0 0 1 1 1 ...

result:

ok correct! (1 test case)

Test #34:

score: 0
Accepted
time: 41ms
memory: 18220kb

input:

1
100000
80675 131812
168555 5460
164858 136237
129118 95036
132489 89060
34582 20226
168555 50198
110034 175866
167942 81230
161617 175637
116750 18326
148963 25127
51745 64410
65101 139479
121388 28528
298 31823
54982 127566
111180 123399
183051 103632
75637 111337
194355 136773
134968 159664
6805...

output:

0 0 1 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 0 0 1 1 1 0 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 0 0 0 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 1 1 1 1 0 1 0 0 0 0 1 0 1 1 1 1 0 1 1 1 0 0 0 1 1 ...

result:

ok correct! (1 test case)

Extra Test:

score: 0
Extra Test Passed