QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#125187#2422. Inside informationdong_liu#100 ✓509ms96464kbC++204.2kb2023-07-16 04:22:372024-07-04 00:43:25

详细

Subtask #1:

score: 0
Accepted

Test #1:

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

input:

6 9
S 1 2
S 1 3
S 3 4
Q 5 1
S 4 5
S 1 6
Q 5 1
Q 1 5
C 1
C 2
C 3
C 4
C 5
C 6

output:

no
yes
no
6
6
5
3
2
2

result:

ok 9 lines

Subtask #2:

score: 2.5
Accepted

Dependency #1:

100%
Accepted

Test #3:

score: 2.5
Accepted
time: 23ms
memory: 20448kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #4:

score: 2.5
Accepted
time: 33ms
memory: 27468kb

input:

4000 120000
Q 181 3647
Q 1143 929
Q 1609 3524
Q 3039 2252
Q 922 687
Q 3285 3128
Q 2702 945
Q 1893 938
Q 3865 1495
Q 3610 2865
Q 2501 2342
Q 2291 3008
Q 1817 1028
Q 1684 783
Q 2119 1947
Q 2672 3869
Q 374 1611
Q 3734 2990
Q 954 165
Q 224 2413
Q 2154 2557
Q 3916 3443
Q 3714 2177
Q 1728 1500
Q 3101 1076...

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 120000 lines

Test #5:

score: 2.5
Accepted
time: 25ms
memory: 25168kb

input:

4000 120000
S 952 67
S 69 1647
S 2363 77
S 71 1701
S 2714 68
S 2393 69
S 1983 69
S 1396 64
S 559 66
S 220 64
S 71 1253
S 70 1903
S 71 2243
S 77 1733
S 71 1539
S 79 3483
S 1698 66
S 512 75
S 3579 69
S 275 293
S 3979 76
S 1051 77
S 77 853
S 625 76
S 78 1805
S 702 79
S 70 3481
S 71 2796
S 65 1380
S 260...

output:

yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
no
yes
yes
yes
no
yes
yes
no
yes
no
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
no
yes
yes
no
yes
yes
no
yes
yes
no
no
yes...

result:

ok 120000 lines

Test #6:

score: 2.5
Accepted
time: 31ms
memory: 27968kb

input:

4000 120000
Q 1589 2987
Q 826 2618
Q 2555 1787
Q 3049 2907
Q 3699 35
Q 3261 2447
Q 1092 818
Q 1981 2511
Q 59 1637
Q 2616 2458
Q 3868 3842
S 166 3447
Q 3587 1196
Q 1819 3511
Q 2951 3999
Q 3518 1586
Q 3374 2561
Q 541 3347
Q 1621 3468
Q 1730 291
Q 1505 161
Q 1262 3338
Q 1476 1554
Q 1385 1894
Q 2021 322...

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 120000 lines

Test #7:

score: 2.5
Accepted
time: 26ms
memory: 24304kb

input:

4000 120000
S 2048 2047
Q 2048 2048
S 1349 1350
Q 2048 2048
S 2019 2020
Q 2047 2047
S 500 499
Q 2047 2047
S 1499 1500
Q 1500 1499
S 1671 1672
Q 500 500
S 35 34
Q 500 500
S 2635 2636
Q 1349 1349
S 3549 3550
Q 499 500
S 1119 1120
Q 1120 1120
S 1839 1838
Q 499 499
S 726 725
Q 1499 1499
S 3494 3493
Q 34...

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 120000 lines

Test #8:

score: 2.5
Accepted
time: 31ms
memory: 21276kb

input:

4000 120000
S 1583 1
Q 1 1
Q 1583 1
Q 1 1
Q 1 1583
Q 1583 1583
Q 1583 1583
Q 1 1583
Q 1 1583
Q 1583 1
Q 1 1
S 1987 1
Q 1 1583
Q 1 1583
Q 1 1
Q 1987 1583
Q 1 1583
Q 1987 1987
Q 1 1987
Q 1987 1583
Q 1 1583
Q 1 1
S 1 3014
Q 1987 1
Q 1 1583
Q 3014 3014
Q 1 1987
Q 1 1987
Q 1987 3014
Q 1583 3014
Q 1 1
Q 1...

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
no
no
yes
yes
yes
no
yes
yes
yes
no
yes
no
yes
yes
no
yes
yes
yes
yes
no
no
yes
no
no
yes
yes
yes
yes
no
yes
yes
yes
yes
no
yes
yes
no
yes
yes
yes
no
yes
yes
no
no
yes
yes
yes
no
yes
no
no
yes
yes
yes...

result:

ok 120000 lines

Subtask #3:

score: 2.5
Accepted

Dependency #2:

100%
Accepted

Test #9:

score: 2.5
Accepted
time: 17ms
memory: 22716kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #10:

score: 2.5
Accepted
time: 25ms
memory: 23604kb

input:

4000 120000
C 2672
C 980
C 3449
C 2056
C 3107
C 2335
C 2635
C 2138
Q 1082 1801
C 1248
C 2262
Q 1647 3470
Q 3422 1093
Q 3712 2930
C 3066
Q 1132 3552
Q 1444 2312
C 1356
Q 3021 641
Q 1406 3948
Q 3991 3688
C 2889
C 56
C 1003
C 2978
C 422
Q 2876 714
Q 820 329
C 3111
C 3348
C 1972
C 2451
C 3524
Q 3704 630...

output:

1
1
1
1
1
1
1
1
no
1
1
no
no
no
1
no
no
1
no
no
no
1
1
1
1
1
no
no
1
1
1
1
1
no
1
no
1
1
1
1
1
1
1
no
no
1
no
1
1
no
1
no
1
1
no
1
1
1
1
no
no
no
1
1
1
no
1
no
1
1
no
1
1
1
no
no
1
no
no
no
no
1
no
no
no
1
no
1
no
1
no
no
1
1
no
1
no
no
1
1
no
no
no
no
no
no
no
no
no
1
no
no
no
1
no
no
1
1
1
no
no
1...

result:

ok 120000 lines

Test #11:

score: 2.5
Accepted
time: 21ms
memory: 27356kb

input:

4000 120000
S 3145 696
S 700 3785
S 692 2496
S 3615 1559
S 3467 688
S 696 672
S 800 696
S 697 1222
S 689 2362
S 675 1070
S 696 1237
S 691 640
S 691 2786
S 2692 700
S 2005 688
S 703 724
S 2519 688
S 2650 688
S 688 607
S 697 2799
S 3238 3615
S 1532 690
S 3158 693
S 691 3153
S 689 1748
S 692 2708
S 681...

output:

45
yes
319
yes
1
168
265
yes
no
464
307
yes
no
241
73
yes
47
yes
1
yes
73
yes
184
no
no
1
1
47
45
yes
246
45
no
182
1
yes
yes
yes
1
184
yes
yes
47
246
yes
1
1
231
yes
456
yes
307
yes
265
1
yes
yes
yes
168
yes
yes
no
yes
no
yes
184
no
265
no
yes
yes
no
465
244
168
168
yes
73
yes
yes
178
307
307
184
n...

result:

ok 120000 lines

Test #12:

score: 2.5
Accepted
time: 32ms
memory: 28056kb

input:

4000 120000
C 1693
C 2721
C 182
Q 1091 313
Q 1756 3693
C 3523
C 1219
C 581
C 2158
C 3613
Q 3005 3574
Q 1046 3849
C 3190
C 515
Q 411 2707
Q 2305 3849
C 3202
C 1928
C 3170
Q 2686 413
C 3402
Q 15 3848
C 2500
C 396
Q 2452 2156
C 2013
Q 1643 937
Q 1667 3374
C 1452
C 3677
Q 301 3539
C 1429
C 159
C 414
C 7...

output:

1
1
1
no
no
1
1
1
1
1
no
no
1
1
no
no
1
1
1
no
1
no
1
1
no
1
no
no
1
1
no
1
1
1
1
1
1
1
1
1
no
1
1
no
1
1
1
1
1
no
no
1
no
1
no
1
no
no
1
1
1
1
1
1
no
1
1
1
no
no
1
no
no
1
1
1
no
1
1
no
1
1
1
no
1
1
no
no
1
1
1
1
no
no
no
1
no
1
1
no
no
no
no
1
1
1
1
1
1
1
1
1
no
no
1
1
no
1
1
no
1
1
1
1
no
1
1
no
...

result:

ok 120000 lines

Test #13:

score: 2.5
Accepted
time: 36ms
memory: 23420kb

input:

4000 120000
S 3368 3367
C 474
S 177 176
Q 176 176
S 553 554
Q 176 176
S 2901 2900
Q 177 176
S 2043 2044
Q 3367 3368
S 2479 2478
Q 2044 2044
S 691 692
C 599
S 2795 2794
C 168
S 3515 3514
Q 2478 2478
S 1623 1624
Q 2794 2794
S 3363 3364
Q 1623 1623
S 2817 2818
C 2870
S 2478 2477
C 1086
S 3257 3258
C 36...

output:

1
yes
yes
yes
yes
yes
1
1
yes
yes
yes
1
1
1
yes
yes
yes
yes
yes
1
yes
yes
yes
yes
1
yes
yes
1
1
1
yes
1
yes
yes
1
yes
yes
yes
1
1
1
yes
1
yes
1
1
yes
1
1
1
1
1
1
1
yes
yes
1
yes
yes
1
1
yes
1
1
1
1
1
1
1
yes
1
yes
1
yes
1
1
yes
1
1
yes
yes
1
1
1
yes
yes
yes
yes
1
yes
1
yes
1
yes
1
yes
yes
1
1
yes
1
...

result:

ok 120000 lines

Test #14:

score: 2.5
Accepted
time: 27ms
memory: 21456kb

input:

4000 120000
S 1 3989
Q 1 1
Q 1 3989
Q 3989 1
Q 3989 1
C 3994
C 3995
Q 1 1
C 3992
C 3996
Q 1 3989
S 1 3997
Q 3997 3997
C 1
Q 1 3997
C 1
C 3998
Q 1 3997
C 3994
Q 3989 1
C 3993
Q 3997 3989
S 1176 1
C 3998
Q 1176 3989
Q 3997 1176
C 4000
Q 3989 3989
C 3999
Q 3989 1176
Q 1176 3997
Q 3997 1176
Q 1 1
S 1795...

output:

yes
yes
yes
yes
1
1
yes
1
1
yes
yes
3
yes
3
1
yes
1
yes
1
yes
1
yes
no
1
yes
1
no
yes
no
yes
1
1
yes
1
1
1
yes
yes
5
yes
1
no
1
yes
1
no
yes
yes
1
1
yes
yes
1
1
yes
1
no
no
no
yes
yes
1
7
yes
1
1
1
yes
1
1
1
1
1
no
9
8
no
1
yes
1
yes
10
yes
no
yes
1
yes
no
9
9
1
1
yes
no
1
1
yes
1
no
no
1
no
1
1
1
n...

result:

ok 120000 lines

Subtask #4:

score: 2.5
Accepted

Test #15:

score: 2.5
Accepted
time: 14ms
memory: 25012kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Subtask #5:

score: 2.5
Accepted

Dependency #4:

100%
Accepted

Test #16:

score: 2.5
Accepted
time: 125ms
memory: 53976kb

input:

120000 120000
S 1 62809
Q 62809 62809
S 1 97272
Q 1 1
S 1 92222
Q 1 62809
S 59613 1
Q 59613 62809
S 54674 1
Q 54674 54674
S 69849 1
Q 69849 62809
S 41129 1
Q 59613 62809
S 1 118677
Q 118677 118677
S 1 63457
Q 92222 92222
S 35594 1
Q 54674 54674
S 118786 1
Q 118677 63457
S 114837 1
Q 1 69849
S 23226 ...

output:

yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
no
no
yes
no
no
yes
yes
no
no
yes
no
no
no
yes
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
yes
no
no
no
yes
yes
yes
no
yes
yes
no
yes
yes
no
yes
no
no
yes
no
yes
yes
no
yes
yes
no
no
no
...

result:

ok 120000 lines

Test #17:

score: 2.5
Accepted
time: 107ms
memory: 53808kb

input:

120000 120000
S 57889 1
Q 57889 1
S 1 40293
Q 1 1
S 5799 1
Q 40293 5799
S 1805 1
Q 1805 1
S 64155 1
Q 40293 57889
S 1 55859
Q 5799 5799
S 76730 1
Q 5799 40293
S 97477 1
Q 76730 55859
S 19383 1
Q 97477 1805
S 1 96575
Q 1 1
S 1 75535
Q 5799 64155
S 110923 1
Q 5799 97477
S 3909 1
Q 57889 110923
S 1 717...

output:

yes
yes
no
yes
yes
yes
yes
yes
yes
yes
no
no
no
no
yes
no
no
yes
no
no
yes
yes
yes
no
no
no
yes
no
yes
no
no
no
no
no
no
yes
no
no
no
yes
no
yes
no
no
yes
no
no
no
no
yes
yes
yes
yes
no
no
yes
yes
yes
yes
no
no
yes
yes
no
no
no
yes
yes
yes
no
yes
yes
yes
no
yes
yes
no
yes
yes
no
yes
yes
yes
yes
yes
...

result:

ok 120000 lines

Test #18:

score: 2.5
Accepted
time: 19ms
memory: 21728kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #19:

score: 2.5
Accepted
time: 125ms
memory: 53896kb

input:

120000 120000
S 8084 1
Q 1 8084
S 1 119088
C 119997
S 1 10853
Q 119088 1
S 38441 1
C 1
S 61095 1
Q 61095 61095
S 1 107665
Q 61095 107665
S 44546 1
Q 8084 44546
S 61518 1
Q 61095 8084
S 106024 1
Q 8084 106024
S 1 75648
Q 61095 61518
S 1 110890
Q 10853 75648
S 5712 1
Q 10853 8084
S 1 64913
Q 75648 610...

output:

yes
1
yes
5
yes
no
no
yes
no
no
no
yes
yes
1
no
yes
no
yes
20
1
yes
yes
1
no
no
no
yes
1
yes
no
no
yes
yes
yes
yes
no
yes
yes
40
1
1
yes
yes
yes
yes
1
yes
1
no
no
yes
no
1
no
yes
yes
yes
yes
1
1
1
1
yes
1
no
yes
yes
no
1
yes
no
yes
no
1
1
no
no
yes
1
1
no
yes
yes
1
no
no
no
yes
1
yes
yes
no
yes
yes
...

result:

ok 120000 lines

Test #20:

score: 2.5
Accepted
time: 91ms
memory: 53924kb

input:

120000 120000
S 34896 1
C 1
S 89199 1
C 1
S 24778 1
C 1
S 12687 1
C 1
S 1 114581
C 1
S 1 119956
C 1
S 8466 1
C 1
S 57136 1
C 1
S 29467 1
C 1
S 68447 1
C 1
S 1 47487
C 1
S 71704 1
C 1
S 30202 1
C 1
S 60028 1
C 1
S 17274 1
C 1
S 1 82546
C 1
S 1 71247
C 1
S 1 91777
C 1
S 1 23552
C 1
S 1 86557
C 1
S 540...

output:

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
10...

result:

ok 120000 lines

Test #21:

score: 2.5
Accepted
time: 99ms
memory: 53956kb

input:

120000 120000
S 1 86966
C 1
S 1 80085
C 1
S 36141 1
C 120000
S 101731 1
C 120000
S 1 86227
C 120000
S 1 118170
C 120000
S 81928 1
C 1
S 1 19561
C 1
S 28769 1
C 1
S 69483 1
C 1
S 31572 1
C 1
S 107041 1
C 120000
S 1 48189
C 1
S 70714 1
C 1
S 1 107742
C 1
S 89349 1
C 1
S 1 94212
C 120000
S 113161 1
C 1...

output:

2
3
1
1
1
1
8
9
10
11
12
1
14
15
16
17
1
1
20
1
1
1
24
1
1
27
28
29
30
31
1
1
1
35
36
37
1
39
1
41
42
1
44
1
46
47
1
1
50
51
52
1
1
55
56
1
58
1
60
61
1
63
64
65
1
1
68
69
1
1
72
1
1
75
76
77
78
79
1
1
82
1
84
1
86
1
1
89
1
1
92
93
1
1
1
1
1
99
1
1
102
1
104
105
1
1
108
1
110
111
112
113
114
1
116
1...

result:

ok 120000 lines

Subtask #6:

score: 5
Accepted

Test #22:

score: 5
Accepted
time: 21ms
memory: 25268kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #23:

score: 5
Accepted
time: 382ms
memory: 87384kb

input:

120000 120000
S 21985 21984
Q 21985 21985
S 84348 84347
Q 84348 84348
S 71126 71125
Q 84347 84347
S 75146 75145
Q 21984 21985
S 53370 53369
Q 53369 53369
S 81516 81515
Q 84348 84347
S 75735 75736
Q 75146 75145
S 109337 109336
Q 109336 109336
S 104392 104393
Q 84347 84347
S 64192 64191
Q 21984 21985
...

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 120000 lines

Test #24:

score: 5
Accepted
time: 385ms
memory: 87572kb

input:

120000 120000
S 65025 65024
Q 65025 65025
S 116955 116954
Q 65024 65025
S 85383 85384
Q 85383 85384
S 118612 118613
Q 85384 85383
S 42670 42669
Q 116954 116954
S 100216 100217
Q 42669 42669
S 38417 38416
Q 116955 116955
S 117988 117987
Q 118612 118613
S 17014 17015
Q 17014 17014
S 38840 38841
Q 1179...

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 120000 lines

Test #25:

score: 5
Accepted
time: 253ms
memory: 96464kb

input:

120000 120000
S 119999 120000
Q 120000 120000
S 119998 119999
Q 119999 119998
S 119997 119998
Q 119999 119999
S 119996 119997
Q 119997 119999
S 119995 119996
Q 120000 119996
S 119994 119995
Q 119997 119998
S 119993 119994
Q 119999 119997
S 119992 119993
Q 119992 119998
S 119991 119992
Q 119992 11999...

output:

yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
no
yes
no
no
no
yes
no
no
yes
no
no
yes
no
no
no
no
yes
yes
no
yes
yes
no
no
no
yes
no
no
yes
no
no
yes
no
yes
yes
no
yes
yes
yes
yes
yes
no
no
no
yes
no
no
no
no
yes
no
no
no
no
yes
yes
yes
no
yes
yes
yes
no
yes
yes
no
no
yes
yes
yes
...

result:

ok 120000 lines

Subtask #7:

score: 5
Accepted

Dependency #6:

100%
Accepted

Test #26:

score: 5
Accepted
time: 9ms
memory: 20216kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #27:

score: 5
Accepted
time: 385ms
memory: 87392kb

input:

120000 120000
S 85374 85373
Q 85374 85374
S 95108 95107
C 73869
S 62494 62495
Q 62495 62495
S 633 634
Q 62494 62494
S 77315 77316
Q 95108 95108
S 49797 49796
C 3806
S 103055 103056
C 76152
S 44475 44476
Q 85373 85373
S 107461 107462
C 14708
S 79090 79089
Q 95108 95107
S 86668 86669
Q 79090 79090
S 5...

output:

yes
1
yes
yes
yes
1
1
yes
1
yes
yes
yes
1
yes
yes
yes
yes
1
yes
yes
yes
1
1
yes
yes
1
1
yes
yes
1
yes
yes
yes
yes
yes
1
1
1
yes
yes
1
1
1
yes
yes
yes
yes
yes
1
yes
yes
yes
yes
yes
1
yes
yes
1
1
1
yes
yes
1
1
yes
1
yes
1
yes
yes
1
1
yes
yes
yes
yes
yes
1
1
1
1
yes
yes
1
1
yes
1
yes
1
1
yes
yes
1
1
ye...

result:

ok 120000 lines

Test #28:

score: 5
Accepted
time: 273ms
memory: 95560kb

input:

120000 120000
S 119999 120000
C 74850
S 119998 119999
C 57336
S 119997 119998
C 83301
S 119996 119997
C 48639
S 119995 119996
Q 119999 119995
S 119994 119995
C 30023
S 119993 119994
C 115049
S 119992 119993
Q 119996 119994
S 119991 119992
C 69200
S 119990 119991
Q 119998 119996
S 119989 119990
Q 120...

output:

1
1
1
1
no
1
1
no
1
no
yes
1
1
1
1
no
1
yes
no
1
yes
no
yes
1
1
1
yes
1
yes
1
yes
yes
yes
1
1
1
yes
1
yes
1
no
1
yes
no
1
1
no
no
no
no
yes
1
1
yes
1
no
1
no
1
1
yes
1
no
1
1
1
1
1
yes
1
no
no
yes
no
no
yes
yes
no
1
1
yes
1
1
no
yes
1
1
1
yes
yes
1
yes
yes
yes
no
no
1
1
yes
1
1
1
1
yes
no
1
1
yes
1
...

result:

ok 120000 lines

Test #29:

score: 5
Accepted
time: 383ms
memory: 87204kb

input:

120000 120000
S 102161 102162
C 78431
S 28025 28026
C 108260
S 81559 81560
C 63933
S 10255 10256
C 87791
S 69370 69369
C 24754
S 52966 52965
C 51072
S 50804 50803
C 44576
S 94190 94191
C 113519
S 43364 43365
C 82291
S 92269 92268
C 55135
S 116461 116462
C 57573
S 7066 7065
C 1984
S 3237 3238
C 86845...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 120000 lines

Test #30:

score: 5
Accepted
time: 359ms
memory: 87276kb

input:

120000 120000
S 70692 70691
C 58905
S 117046 117045
C 84057
S 31339 31340
C 33902
S 29904 29905
C 16859
S 69187 69186
C 13664
S 47926 47925
C 111155
S 21091 21092
C 104512
S 115091 115090
C 46241
S 98498 98497
C 103068
S 81562 81563
C 1119
S 4964 4965
C 113276
S 13849 13848
C 93924
S 17540 17541
C 3...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
yes
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 120000 lines

Subtask #8:

score: 10
Accepted

Test #31:

score: 10
Accepted
time: 20ms
memory: 20452kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #32:

score: 10
Accepted
time: 198ms
memory: 84100kb

input:

120000 120000
S 98303 49151
S 98302 49151
Q 49151 98303
S 98301 49150
S 98300 49150
Q 98300 49150
S 98299 49149
S 98298 49149
Q 98302 49151
S 98297 49148
S 98296 49148
Q 49150 98300
S 98295 49147
S 98294 49147
Q 98297 98296
S 98293 49146
S 98292 49146
Q 98294 98294
S 98291 49145
S 98290 49145
Q 4915...

output:

yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
no
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
no
yes
yes
yes
no
yes
yes
yes
no
yes
yes
yes...

result:

ok 120000 lines

Test #33:

score: 10
Accepted
time: 297ms
memory: 78684kb

input:

120000 120000
S 58392 29196
S 28237 56475
S 109976 54988
S 59034 118068
S 58629 117258
S 104607 52303
S 21778 43557
S 13854 6927
S 88774 44387
S 58662 117324
S 80190 40095
S 41745 83491
S 111993 55996
S 60483 30241
S 65246 32623
S 8783 4391
S 108136 54068
S 89368 44684
S 47802 95605
S 29695 59391
S ...

output:

yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
no
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
no
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
ye...

result:

ok 120000 lines

Subtask #9:

score: 10
Accepted

Dependency #8:

100%
Accepted

Test #34:

score: 10
Accepted
time: 11ms
memory: 21840kb

input:

48 120000
Q 1 2
Q 1 3
Q 1 4
Q 1 5
Q 1 6
Q 1 7
Q 1 8
Q 1 9
Q 1 10
Q 1 11
Q 1 12
Q 1 13
Q 1 14
Q 1 15
Q 1 16
Q 1 17
Q 1 18
Q 1 19
Q 1 20
Q 1 21
Q 1 22
Q 1 23
Q 1 24
Q 1 25
Q 1 26
Q 1 27
Q 1 28
Q 1 29
Q 1 30
Q 1 31
Q 1 32
Q 1 33
Q 1 34
Q 1 35
Q 1 36
Q 1 37
Q 1 38
Q 1 39
Q 1 40
Q 1 41
Q 1 42
Q 1 43
Q 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 120000 lines

Test #35:

score: 10
Accepted
time: 231ms
memory: 84052kb

input:

120000 120000
S 98303 49151
S 98302 49151
Q 49151 98303
S 98301 49150
S 98300 49150
Q 98300 98300
S 98299 49149
S 98298 49149
C 57909
S 98297 49148
S 98296 49148
Q 98300 98300
S 98295 49147
S 98294 49147
Q 98301 98301
S 98293 49146
S 98292 49146
C 94185
S 98291 49145
S 98290 49145
C 107511
S 98289 4...

output:

yes
yes
1
yes
yes
1
1
1
yes
1
1
yes
1
yes
yes
1
yes
1
1
1
1
1
1
1
1
yes
1
yes
1
1
yes
1
1
1
1
no
yes
1
1
yes
yes
yes
1
1
yes
1
1
1
1
1
yes
1
1
yes
no
no
yes
1
1
yes
yes
yes
yes
yes
1
no
1
1
yes
yes
yes
1
yes
1
yes
yes
1
1
yes
1
1
1
yes
yes
yes
1
1
1
1
1
1
yes
yes
yes
no
1
1
no
1
1
1
1
1
1
1
yes
1
1
...

result:

ok 120000 lines

Test #36:

score: 10
Accepted
time: 333ms
memory: 78596kb

input:

120000 120000
S 55482 27741
S 34003 68006
S 118053 59026
S 100922 50461
S 2358 1179
S 30650 61301
S 1146 2292
S 44890 89780
S 98185 49092
S 41062 20531
S 8350 16701
S 38948 77897
S 68592 34296
S 17077 34154
S 100229 50114
S 1545 3091
S 11160 22321
S 43262 86525
S 88311 44155
S 49638 99276
S 57737 28...

output:

1
4
yes
yes
yes
2
3
no
3
yes
2
yes
yes
yes
yes
yes
5
2
yes
yes
5
yes
yes
2
1
1
yes
yes
yes
1
yes
yes
1
yes
yes
2
yes
yes
3
yes
yes
1
yes
1
yes
yes
no
yes
yes
yes
2
4
2
2
yes
yes
2
4
yes
1
2
yes
yes
1
yes
yes
1
yes
5
yes
3
3
1
no
yes
3
3
2
yes
3
2
6
yes
1
yes
yes
1
2
yes
yes
yes
yes
1
yes
yes
yes
yes...

result:

ok 120000 lines

Subtask #10:

score: 12.5
Accepted

Dependency #6:

100%
Accepted

Dependency #8:

100%
Accepted

Test #37:

score: 12.5
Accepted
time: 320ms
memory: 71756kb

input:

120000 120000
S 82313 93611
S 31255 93746
S 77664 96027
S 84345 91243
S 26332 69771
S 71575 39285
S 68397 60587
S 95585 14115
S 4035 83350
S 67011 48567
Q 93611 93611
S 87450 86352
S 94884 17111
S 82512 118565
S 96464 109861
S 96607 112663
S 73207 107621
S 73976 67110
S 67499 36373
S 87463 1137
S 88...

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 120000 lines

Test #38:

score: 12.5
Accepted
time: 352ms
memory: 74264kb

input:

120000 120000
S 7108 37529
Q 7108 37529
S 22156 71393
Q 7108 37529
S 21645 99486
Q 22156 71393
S 54911 12257
Q 37529 37529
S 31458 69147
Q 37529 7108
S 5945 44894
Q 31458 69147
S 12701 112147
Q 22156 22156
S 29035 14313
Q 71393 71393
S 117438 19793
Q 22156 71393
S 9692 19974
Q 44894 44894
S 19906 71...

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 120000 lines

Test #39:

score: 12.5
Accepted
time: 413ms
memory: 87360kb

input:

120000 120000
S 82304 119998
Q 82304 119998
S 92133 119996
Q 119996 92133
S 32093 119995
Q 32093 32093
S 84749 119994
Q 32093 119995
S 8025 119993
Q 8025 119993
S 105077 119992
Q 32093 32093
S 111206 119991
Q 105077 119992
S 95093 119987
Q 119991 111206
S 84058 119983
Q 119996 119996
S 18858 119981
...

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 120000 lines

Test #40:

score: 12.5
Accepted
time: 434ms
memory: 85304kb

input:

120000 120000
S 42457 120000
S 44649 119997
S 70485 119995
Q 44649 44649
S 38846 119990
S 112963 119989
S 45295 119987
Q 45295 45295
S 84858 119985
S 48868 119982
S 90552 119979
Q 119997 44649
S 101835 119978
S 37828 119976
S 54162 119972
Q 44649 119997
S 109402 119970
S 96304 119969
S 5727 119966
Q...

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 120000 lines

Subtask #11:

score: 12.5
Accepted

Dependency #10:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #9:

100%
Accepted

Test #41:

score: 12.5
Accepted
time: 342ms
memory: 72292kb

input:

120000 120000
S 31619 76332
S 98670 29881
S 17727 102197
S 43201 19452
S 90624 24740
S 25785 27275
S 15611 57768
S 115701 21929
S 31382 56326
S 80965 14549
C 106007
S 73484 17232
S 85499 15042
S 46824 26272
S 9875 33188
S 12152 87519
S 29998 8410
S 93358 28024
S 93331 29660
S 23312 70713
S 59085 24
...

output:

1
1
1
yes
1
1
1
1
1
yes
yes
yes
1
1
1
1
yes
1
yes
yes
yes
yes
1
yes
1
yes
1
yes
yes
1
yes
yes
1
yes
1
yes
yes
yes
1
yes
1
yes
yes
yes
1
1
1
yes
yes
1
1
yes
yes
yes
yes
1
1
1
1
1
1
yes
1
yes
1
yes
yes
1
1
1
yes
yes
1
1
1
1
1
1
yes
1
1
yes
yes
yes
yes
yes
1
yes
1
1
1
yes
yes
1
yes
1
1
1
1
1
yes
yes
1
...

result:

ok 120000 lines

Test #42:

score: 12.5
Accepted
time: 359ms
memory: 74536kb

input:

120000 120000
S 63636 95682
Q 63636 63636
S 52122 9739
Q 9739 9739
S 62983 55215
Q 55215 62983
S 72154 50543
C 85433
S 46746 65110
Q 46746 65110
S 63384 38103
Q 65110 65110
S 38643 1069
Q 38643 1069
S 24392 62023
C 76450
S 51560 89042
C 19183
S 70769 50553
Q 1069 38643
S 55291 16651
Q 9739 52122
S 1...

output:

yes
yes
yes
1
yes
yes
yes
1
1
yes
yes
yes
1
yes
yes
yes
yes
1
1
1
yes
yes
1
yes
yes
1
yes
yes
yes
yes
yes
1
1
yes
1
1
yes
yes
yes
yes
yes
1
1
1
1
yes
1
1
yes
1
yes
yes
yes
1
1
yes
1
yes
1
yes
1
yes
yes
yes
1
yes
yes
yes
1
1
1
yes
1
yes
yes
1
yes
1
yes
1
1
yes
yes
1
1
1
yes
yes
yes
1
1
1
yes
yes
yes
...

result:

ok 120000 lines

Test #43:

score: 12.5
Accepted
time: 449ms
memory: 87108kb

input:

120000 120000
S 35092 119999
C 3539
S 18387 119997
C 119538
S 69625 119996
Q 18387 119997
S 79533 119994
C 117356
S 65414 119993
C 82613
S 44183 119991
C 110041
S 6456 119990
C 112489
S 22731 119987
C 109126
S 103986 119985
C 43646
S 49687 119984
C 116266
S 67344 119983
C 118104
S 78437 119982
C 112...

output:

1
1
yes
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
yes
yes
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
yes
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
yes
1
1
...

result:

ok 120000 lines

Test #44:

score: 12.5
Accepted
time: 501ms
memory: 90688kb

input:

120000 120000
S 64598 119999
S 35938 83781
S 44644 35938
S 78476 44644
S 113990 119995
S 104584 78476
S 111879 104584
S 110087 111879
S 47128 119994
S 102204 110087
S 84958 102204
S 61263 84958
S 940 119991
S 92336 61263
S 6372 92336
S 97652 6372
S 87607 119990
S 61232 97652
S 72590 61232
S 11168 72...

output:

yes
yes
23216
yes
yes
yes
yes
yes
yes
yes
18927
13115
yes
45076
yes
1
1
1
30368
yes
yes
yes
39195
2
1
19797
1
22922
26598
17653
yes
yes
30901
41521
yes
yes
yes
yes
26979
yes
1
yes
yes
1
1
yes
7188
14952
3707
29004
4170
yes
yes
33931
yes
1
yes
yes
1
yes
yes
yes
41470
2
15769
yes
2611
476
yes
yes
yes
...

result:

ok 120000 lines

Test #45:

score: 12.5
Accepted
time: 509ms
memory: 89800kb

input:

120000 120000
S 15404 119998
S 108365 40217
S 20200 40216
S 46781 40215
S 99662 40209
S 90002 40208
S 46894 119997
S 51716 40207
S 4535 40206
S 11916 40204
S 87176 40194
S 65113 40193
S 113162 119996
S 21107 40192
S 47118 40191
S 74933 40189
S 11796 40187
S 108038 40186
S 22911 119995
S 11838 40183
...

output:

yes
yes
yes
yes
yes
yes
yes
yes
911
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
5928
yes
25951
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
20168
yes
yes
yes
yes
yes
yes
yes
1
yes
yes
yes
37253
yes
yes
yes
yes
yes
yes
13881
32758
yes
yes
yes...

result:

ok 120000 lines

Subtask #12:

score: 17.5
Accepted

Dependency #2:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #8:

100%
Accepted

Dependency #10:

100%
Accepted

Test #46:

score: 17.5
Accepted
time: 170ms
memory: 53944kb

input:

120000 120000
S 96321 104456
Q 96321 104456
S 23946 115013
Q 96321 96321
S 104456 8567
Q 8567 104456
S 52568 104456
Q 115013 115013
S 23946 39828
Q 52568 52568
S 104456 38354
Q 38354 96321
S 23946 33267
Q 8567 8567
S 29988 23946
Q 33267 23946
S 23946 28338
Q 33267 29988
S 104456 7349
Q 8567 52568
S ...

output:

yes
yes
yes
yes
yes
yes
yes
yes
no
no
yes
yes
yes
yes
no
no
yes
no
yes
yes
yes
yes
no
no
yes
no
no
no
yes
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
no
yes
no
no
yes
no
no
yes
yes
yes
yes
no
no
yes
no
yes
no
no
yes
yes
yes
yes
no
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
no...

result:

ok 120000 lines

Test #47:

score: 17.5
Accepted
time: 166ms
memory: 53980kb

input:

120000 120000
S 46173 68496
Q 68496 46173
S 68496 59579
Q 59579 68496
S 93519 117703
Q 93519 93519
S 33742 68496
Q 117703 93519
S 117703 94526
Q 68496 46173
S 117703 26777
Q 46173 68496
S 117701 20518
Q 68496 68496
S 68496 116137
Q 59579 59579
S 117701 95558
Q 116137 59579
S 68496 49616
Q 95558 9555...

output:

yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
no
yes
no
no
yes
yes
yes
yes
no
no
yes
no
no
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
no
no
no
no
yes
no
yes
no
no
yes
yes
no
yes
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
yes
no
no
yes
yes
yes
no
no
yes
no
yes
yes
yes
yes
yes
no...

result:

ok 120000 lines

Test #48:

score: 17.5
Accepted
time: 271ms
memory: 61640kb

input:

120000 120000
S 6177 53476
Q 53476 6177
S 6354 65954
Q 65954 65954
S 6176 49504
Q 6177 53476
S 6431 84590
Q 53476 53476
S 74092 6520
Q 49504 49504
S 99293 6192
Q 6176 49504
S 6175 77091
Q 6176 49504
S 111048 6177
Q 99293 99293
S 77339 6200
Q 6520 6520
S 107680 6371
Q 6200 6200
S 6354 68543
Q 6520 65...

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
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
y...

result:

ok 120000 lines

Test #49:

score: 17.5
Accepted
time: 282ms
memory: 61588kb

input:

120000 120000
S 15219 59564
Q 59564 15219
S 4984 14960
Q 14960 4984
S 58337 15071
Q 58337 58337
S 105913 14962
Q 15071 15071
S 15018 94376
Q 94376 94376
S 104535 15219
Q 15071 15071
S 107054 14857
Q 105913 14962
S 15113 7456
Q 15219 59564
S 15045 82035
Q 58337 15071
S 15188 48362
Q 15113 7456
S 2154...

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
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
y...

result:

ok 120000 lines

Test #50:

score: 17.5
Accepted
time: 390ms
memory: 74796kb

input:

120000 120000
S 23531 46113
Q 23531 23531
S 33964 24638
Q 24638 33964
S 79221 17426
Q 46113 46113
S 79221 29910
Q 24638 24638
S 79221 31652
Q 33964 24638
S 17526 55884
Q 33964 33964
S 81413 58949
Q 33964 24638
S 69855 66797
Q 17426 17426
S 71764 59579
Q 71764 71764
S 79221 69888
Q 59579 71764
S 2875...

output:

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
no
yes
yes
yes
yes
no
yes
yes
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
no
yes
yes
yes
yes
no
yes
yes
yes
yes
no
no
yes
yes
yes
yes
yes
y...

result:

ok 120000 lines

Test #51:

score: 17.5
Accepted
time: 305ms
memory: 68804kb

input:

120000 120000
S 99585 119999
S 83586 89278
S 60318 90774
S 14308 60318
S 90452 90771
S 50996 90770
S 84975 90767
S 12463 90766
S 72458 90764
S 62225 90759
S 57150 90756
S 40085 99585
S 61436 90753
S 22996 61436
S 96746 90752
S 90932 90751
S 15592 90932
S 45406 90750
S 106570 45406
S 29805 90747
S 87...

output:

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
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
y...

result:

ok 120000 lines

Test #52:

score: 17.5
Accepted
time: 297ms
memory: 68712kb

input:

120000 120000
S 36354 120000
S 62931 116730
S 83947 62931
S 49820 116727
S 17809 116724
S 60952 17809
S 49781 60952
S 71751 116721
S 100008 71751
S 75530 116719
S 117597 116718
S 108772 117597
S 107832 116717
S 18480 107832
S 49183 116716
S 98133 116714
S 113651 116713
S 33822 113651
S 62757 33822
S...

output:

yes
yes
yes
yes
yes
no
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
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
y...

result:

ok 120000 lines

Subtask #13:

score: 17.5
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Dependency #9:

100%
Accepted

Dependency #10:

100%
Accepted

Dependency #11:

100%
Accepted

Dependency #12:

100%
Accepted

Test #53:

score: 17.5
Accepted
time: 135ms
memory: 54096kb

input:

120000 120000
S 89037 110043
C 111624
S 44712 111624
C 110043
S 111624 116275
C 110043
S 84335 111624
C 110043
S 111624 98855
C 111624
S 861 111624
C 111624
S 38764 110043
C 110043
S 111624 95992
C 110043
S 110043 85248
C 111624
S 115561 111624
C 111624
S 111624 65360
C 110043
S 111624 97476
Q 84335...

output:

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

result:

ok 120000 lines

Test #54:

score: 17.5
Accepted
time: 99ms
memory: 53816kb

input:

120000 120000
S 58610 82193
C 13240
S 82193 116406
C 82193
S 82193 86621
C 13240
S 82193 29482
C 82193
S 107184 82193
C 120000
S 82193 92489
C 82193
S 82193 34466
C 82193
S 107371 82193
C 82193
S 82193 100782
C 120000
S 82193 100360
C 82193
S 82193 101175
C 13240
S 106075 82193
C 13240
S 82193 88435...

output:

1
3
1
5
1
7
8
9
1
11
1
1
1
15
16
1
1
1
20
21
1
1
1
25
1
1
28
1
1
31
1
33
1
1
1
37
1
1
1
1
1
43
1
45
46
1
1
1
1
1
1
1
54
1
1
57
58
1
1
61
62
63
1
1
1
1
1
1
1
1
72
73
1
1
1
1
1
1
80
81
1
83
1
no
1
1
1
1
1
1
92
1
94
1
96
1
1
99
100
101
102
103
1
1
1
107
1
1
1
1
1
1
114
1
1
117
1
1
1
1
1
1
124
125
126
1...

result:

ok 120000 lines

Test #55:

score: 17.5
Accepted
time: 92ms
memory: 53748kb

input:

120000 120000
S 9822 93155
C 9822
S 98238 9822
C 46529
S 36538 9822
C 9822
S 27553 9822
C 9822
S 10214 9822
C 46529
S 28420 9822
C 46529
S 46284 9822
C 9822
S 75927 9822
C 46529
S 29713 9822
C 9822
S 99072 9822
C 9822
S 72435 9822
C 46529
S 9822 90844
C 9822
S 4529 9822
C 9822
S 9822 108959
C 46529
...

output:

2
1
4
5
1
1
8
1
10
11
1
13
14
1
1
1
18
1
1
1
22
23
1
25
1
1
1
29
30
31
1
33
34
35
36
1
38
39
1
1
42
43
1
1
46
1
48
49
50
1
1
1
1
1
56
57
58
59
1
61
62
63
1
1
1
1
68
1
1
1
72
73
1
75
76
1
78
79
80
1
82
1
84
1
86
87
1
89
1
1
1
1
1
95
96
1
1
99
100
101
102
1
1
105
106
1
108
1
110
111
1
113
1
115
116
1
...

result:

ok 120000 lines

Test #56:

score: 17.5
Accepted
time: 95ms
memory: 53856kb

input:

120000 120000
S 107932 41015
C 107932
S 107932 76958
C 107932
S 41844 107932
C 107932
S 82239 107932
C 107932
S 107932 114753
C 107932
S 15755 107932
C 107932
S 119866 107932
C 107932
S 39062 107932
C 107932
S 107932 79897
C 107932
S 107932 45579
C 107932
S 107932 101748
C 107932
S 107932 119226
C 1...

output:

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
10...

result:

ok 120000 lines

Test #57:

score: 17.5
Accepted
time: 140ms
memory: 54008kb

input:

120000 120000
S 34344 3533
C 34344
S 34344 33133
C 34344
S 31196 86399
C 34344
S 31196 7733
C 34344
S 31196 64549
C 34344
S 31196 75546
C 34344
S 23039 34344
C 34344
S 106878 34344
C 34344
S 31686 31196
C 34344
S 24911 31196
C 34344
S 106443 34344
C 34344
S 31196 20496
C 34344
S 34344 57023
C 34344
...

output:

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

result:

ok 120000 lines

Test #58:

score: 17.5
Accepted
time: 269ms
memory: 62240kb

input:

120000 120000
S 119361 30925
Q 30925 30925
S 31073 52778
C 31102
S 4359 30858
Q 30925 30925
S 30827 99456
Q 30858 30858
S 7614 30785
Q 99456 99456
S 30851 59145
Q 30858 4359
S 30905 75542
C 31102
S 30748 27446
Q 30925 119361
S 30775 50692
C 31088
S 30739 4302
C 31080
S 72151 30840
Q 4302 4302
S 3091...

output:

yes
1
yes
yes
yes
yes
1
yes
1
1
yes
1
yes
1
yes
yes
1
1
1
1
yes
1
yes
yes
yes
1
yes
1
1
yes
yes
1
yes
yes
1
yes
1
yes
yes
1
1
yes
yes
1
1
1
yes
1
1
1
1
1
1
1
yes
yes
no
1
yes
yes
1
yes
yes
1
1
yes
yes
1
1
1
yes
yes
1
yes
yes
1
1
1
yes
no
yes
1
1
1
1
1
yes
1
yes
yes
1
yes
yes
yes
1
yes
1
yes
1
yes
no...

result:

ok 120000 lines

Test #59:

score: 17.5
Accepted
time: 362ms
memory: 75272kb

input:

120000 120000
S 114790 58633
C 117093
S 26993 15566
C 119998
S 117093 69437
C 119998
S 79725 117093
C 117093
S 80822 1391
C 119998
S 14914 117424
C 119998
S 65283 117093
C 117093
S 102549 23435
C 117093
S 117093 118483
C 119998
S 86122 92232
C 117093
S 117093 30246
C 117093
S 68902 50464
C 119998
S ...

output:

1
1
1
3
1
1
4
4
1
5
6
1
6
6
6
1
1
1
7
1
7
7
1
1
1
1
7
8
1
10
11
1
12
12
12
1
12
1
13
1
1
1
1
1
1
1
16
17
1
19
1
1
1
21
1
23
1
24
1
24
25
1
1
1
28
29
29
30
1
32
1
33
33
33
33
1
1
34
1
35
36
37
38
39
1
40
1
1
42
1
43
1
44
1
44
1
1
1
1
1
47
47
1
1
1
1
1
1
51
51
51
1
52
52
1
53
54
54
1
56
56
1
57
1
1
60...

result:

ok 120000 lines

Test #60:

score: 17.5
Accepted
time: 371ms
memory: 70060kb

input:

120000 120000
S 100568 120000
S 29994 59171
S 20984 59168
S 119625 20984
S 17630 59167
S 58298 119999
S 88994 59164
S 29892 59163
S 77406 29892
S 112170 59162
S 30814 119998
S 60468 112170
S 75371 59160
S 86909 59159
S 117831 59156
S 101783 30814
S 114968 59155
S 114208 59152
S 42193 114208
S 78792 ...

output:

1
39
41
43
yes
34
4
yes
1
23
yes
1
33
1
36
4
1
yes
1
1
yes
42
yes
1
1
yes
yes
30
1
4
5
38
41
40
1
yes
no
1
yes
38
39
yes
2
36
1
27
2
4
yes
41
37
yes
yes
42
1
1
yes
34
36
31
32
42
36
38
40
yes
36
38
yes
36
yes
1
44
40
39
4
37
36
42
1
38
4
yes
2
33
1
33
yes
40
46
33
34
1
1
40
yes
34
29
46
30
1
1
5
yes...

result:

ok 120000 lines

Test #61:

score: 17.5
Accepted
time: 335ms
memory: 68572kb

input:

120000 120000
S 37263 119997
S 33401 116607
S 67413 116604
S 108620 116602
S 117194 116599
S 92212 116598
S 70872 92212
S 109544 70872
S 17301 116597
S 83173 116595
S 45531 116594
S 59838 116592
S 67705 116591
S 52756 116590
S 1203 116589
S 114665 116587
S 93742 116586
S 16449 93742
S 32731 116583
S...

output:

yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
27
yes
yes
yes
yes
no
yes
34
yes
yes
yes
yes
32
yes
yes
34
no
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
yes
yes
yes
yes
yes
yes
36
yes
yes
yes
yes
yes
yes
32
yes
no
no
24
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
yes
no
y...

result:

ok 120000 lines