QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#246613#7770. 落日珊瑚flower100 ✓1480ms269140kbC++2017.4kb2023-11-10 23:08:012023-11-10 23:08:01

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 0ms
memory: 145184kb

input:

100 100 0 1
(](]()(](](][)()()[](][][)(][)(][][]()(]()(](](](][]()[][)()(][][](]()(][)[)(][)[)[)(](](]()[)()(](]
2 72 86
1 28 43
2 39 59
2 35 100
2 10 57
2 39 26
1 15 7
1 45 18
2 19 56
2 2 42
2 19 35
1 2 73
2 25 73
2 3 82
1 33 32
1 98 27
2 38 84
1 16 52
1 33 76
2 90 74
1 8 4
1 82 32
2 24 81
1 26 81
...

output:

50
73
389
786
28
373
458
51
723
3068
730
63
1437
48
64
843
1232
522
5
618
51
1006
1012
254
185
308
9
1170
298
53
5482
1043
46
1223
1672
2113
210
68
66
120
3
1842
1552
0

result:

ok 44 numbers

Test #2:

score: 0
Accepted
time: 4ms
memory: 143076kb

input:

100 100 0 1
])])])]))]])]]))]]]]]])))])]]]))]]]]]))])]]))]])])[[[[(((((([(([((([[[[[(([(([[[(([(((([[[([(([([[((
1 49 5
1 56 56
1 2 78
2 85 21
2 69 99
2 46 32
1 24 27
1 8 78
1 5 20
2 2 99
1 61 17
2 68 63
1 22 61
2 98 88
1 84 12
2 72 87
1 62 81
1 17 9
2 34 7
1 49 27
2 35 35
1 79 6
1 12 19
1 43 62
2 7...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 48 numbers

Test #3:

score: 0
Accepted
time: 10ms
memory: 143004kb

input:

100 100 0 1
[([(][[[])[][])])[[)()[([)]]()[][))([]][(])(]][)[]))()[][]([[)(]]([)[[(]][)))][]()])[]()[(]][[][((()
2 33 25
2 86 10
1 17 8
1 48 88
1 91 44
2 3 32
2 97 24
2 99 81
2 62 10
2 83 82
2 66 71
1 45 38
1 89 43
2 54 87
2 93 57
1 61 38
2 74 46
2 71 53
1 83 72
2 15 59
1 22 51
2 13 62
1 51 16
1 84 ...

output:

3
116
24
83
4
45
0
2
55
31
13
7
44
48
10
37
2
15
0
137
1
6
1
5
8
79
84
11
1
0
0
108
12
10
2
140
3
30
1
15
0
0
84
0
2
85
3
8
2
25
86
2
121
8
5

result:

ok 55 numbers

Test #4:

score: 0
Accepted
time: 4ms
memory: 143144kb

input:

73 100 0 1
][[([][(()((([])([[[[((((][(([([[]((]([[[][[()(((([(((](]))))[))][))))])(
2 36 1
2 21 67
2 23 28
1 73 10
1 66 50
1 22 30
1 33 57
1 18 54
1 8 71
1 33 65
2 19 33
1 35 27
1 63 43
2 47 21
1 34 7
2 6 69
2 7 8
2 27 47
1 72 73
2 5 42
2 1 61
1 59 29
2 27 22
1 39 55
1 73 61
2 3 23
2 68 21
1 23 13
...

output:

2
35
1
1
1
53
0
0
1
14
1
0
35
2
12
1
5
3
3
0
2
0
1
1
8
0
1
25
1
4
1
21
0
2
1
5
21
2
1
2
0

result:

ok 41 numbers

Test #5:

score: 0
Accepted
time: 8ms
memory: 143040kb

input:

94 100 0 1
)((([[[([)[[[[[((([(]()))[[[]((]((()[)]([)]][))))])][()(]]))[)]))[[))]])))()[[[](()[))])]]())[
2 92 36
1 90 10
2 68 37
2 41 87
2 51 85
1 31 70
1 40 60
2 51 19
2 34 72
2 88 67
2 33 43
1 34 11
2 39 39
1 23 46
1 22 3
1 12 58
1 26 61
2 64 89
1 93 53
2 16 15
2 50 93
2 1 59
2 68 12
1 50 58
1 36...

output:

19
9
16
10
34
10
9
7
0
11
0
15
87
95
52
1
5
10
29
5
63
1
49
1
10
212
102
0
0
158
28
6
0
2
171
0
215
21
9
9
0
0
60
35
8
17
2
0
103
6
7
2
6
14
23
1

result:

ok 56 numbers

Test #6:

score: 0
Accepted
time: 7ms
memory: 143036kb

input:

93 100 0 1
])[[(()[[(((])[[)[([)][(][][)]]([[))()))([]([)))]([](([))))))]((([(]()]][[)([])])([)))(]]([][
2 69 52
2 65 71
1 60 1
1 73 30
1 91 31
1 36 14
2 24 10
2 50 55
2 68 10
2 90 79
2 56 37
2 18 9
2 7 12
1 83 28
1 44 26
1 7 29
2 57 26
2 38 78
1 83 88
1 4 4
2 20 35
2 7 58
2 28 61
1 44 25
2 5 27
2 7...

output:

5
3
6
1
60
3
6
3
1
13
13
8
77
14
8
0
14
57
45
67
0
3
113
42
11
2
10
12
51
86
1
0
40
5
9
87
7
1
24
9
0
25
3
72
38

result:

ok 45 numbers

Test #7:

score: 0
Accepted
time: 8ms
memory: 145132kb

input:

93 100 0 1
))[[(([([][]][][((]]]][[[)][]())((]][]][))[(((])))((([)]]]([]()](()([(((]]())(])])(][)[)][)([
2 80 50
1 31 1
1 31 41
1 54 69
1 31 52
2 83 53
2 59 9
2 75 44
1 39 93
2 75 32
1 32 92
1 55 8
1 48 90
2 48 50
2 44 10
1 13 87
2 24 1
1 37 80
2 26 58
2 93 12
2 44 87
2 92 25
2 93 39
2 81 90
2 66 34...

output:

19
20
28
10
21
0
17
6
16
0
56
94
35
8
20
0
0
19
2
17
0
35
8
13
54
5
23
2
71
24
9
162
2
120
134
86
2
12
3
43
24
23
70
0
22
0
99
130
22
0
21
6

result:

ok 52 numbers

Subtask #2:

score: 5
Accepted

Test #8:

score: 5
Accepted
time: 7ms
memory: 143252kb

input:

6000 6000 0 2
[](][)(]()[)[)[)[][][)(][]()[][)(](](][)[)[][](]()[)[]()[][][]()(][]()(][]()[]()(](](]()(](]()[)[]()()[](][](][)(]()[]()()(](](](](]()[]()(][)(]()[][][]()[][]()[)()(](][]()[)[]()[][)(][)[]()[)(]()[)[][)(]()[)[]()(](]()[)[)(]()()[][][](][][)[][)()[][]()[][)()[)[)()()()(][]()[]()()[][)[]...

output:

161537054
577636035
5011797
13507669
15142021
10941510
112774918
118386867
91109
148376313
61635337
174999838
462400028
37702005
774657903
527741208
601849265
113218345
1283492
29095993
14869
709294116
1335226
55468540
3344719
152930
3483845
70125651
83405151
6542013
5072196
237830499
44990
35155291...

result:

ok 2778 numbers

Test #9:

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

input:

6000 6000 0 2
]))))])])])))))]]])]])]]])]]]])]))])])]))]))]]]])]))]))]])))]])))]))))]])))])]]))])]]]])])]]])))))])))))))]))]))])]])]]))]]])]])]))]))]]]])]]))]))]])]])])))]])])))]]]])]])]]])))]]]]]]])])]]))]]]]]])]))))))]))]]))])]]]])])]])])]])]))])]])]]])]]]]))])))]]]]]))))]])]]])])]))))]]))))])])])...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 2746 numbers

Test #10:

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

input:

6000 6000 0 2
])(]][)(()))]([)[()([))()])](())]((]]([))[([(((([[[[)([()[(]]]()(((]][[](]](([((][[][]]([((][))()][][])([(((()((][)](]]))]]))([(]]])])[[[[)[(([)(][[[]])[))]((])()))]]]](()(][()]()()(](((]])[]][]())[])((])[))))])][][[[[])())(]((([([[[([)]((()(((][)(([[((])]((((())()([][][(]())()[[]()[)(...

output:

442
3017
157
8291
4086
12607
20150
10213
1671
4152
40188
27186
6617
10666
20602
2924
5696
9699
13103
17538
21289
360
19555
4
33582
14734
12023
15192
46925
42130
8755
17265
20595
139
1658
32040
18213
30012
35325
19573
30983
515
167
18843
3798
331
3860
33714
16535
1692
388
12914
395
14082
4755
18127
1...

result:

ok 2800 numbers

Test #11:

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

input:

5990 6000 0 2
)([([([[[[[([])([([[)[(]([[)[()[([([(]][[([[([)([([(]((([(()[([[]]([([[]([)[[[[)[()[([[([[[[((](([[[[[))([(([]]([(([[(([][[)(()[(](()[[[)[(([[)([()[[[(([(([[]([[[[)(((([([[[(]]([[[][[(([[[(([]([[[([([[((([[[[(())([(]((((((][((((()[[[)[[[((][([([[()([[[[(([])[(([[(((([])[[[(](((([([[[[[...

output:

6327
17418
192153
15
110002
37450
37
84
203
101
25
127
225225
121
151
679028
358542
41
225150
2032
25
2193
95
201
697691
9
12139
7
174983
1520
148
27
32136
49166
512717
101
23
24362
148169
8942
8
65578
130676
2519
95
401909
16904
98
159
205119
34
91261
78185
46207
144
27
208952
21
19
199911
7025
125...

result:

ok 2786 numbers

Test #12:

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

input:

5992 6000 0 2
)()]((([)(()[[(](([([((]](]]([((]([[([))([][[()[(]()]][[((())][([[[))([[)[[]))[(([[]])[(([][[([()]([([()[([(((([))])]([[(][(([)])((](([]](([(]([]([)([(([[][[[)([[][[([()[()[)]([[[(](])[[(](][([[][()(((([)]][()[([[(])[)((([)([[(]](([]([([(]()))]][(([([([)([[([[())]])][(([]((([([([)[[(((...

output:

236
19761
43759
543
634
286
181689
3714
2393
142
20404
167
272
323
33718
239
100
19632
19679
96
88
4891
108
358
48
2503
117
8
266
418
25087
48372
548
53
15
469
247
4982
147
202
56
9
14851
115
113636
380
54
125472
256
2618
177
11406
83474
298
404662
142
156
23888
513
111438
572
11
493
76838
704058
23...

result:

ok 2798 numbers

Test #13:

score: 0
Accepted
time: 8ms
memory: 143416kb

input:

5987 6000 0 2
)([)([]([]))[[)))][(([([[()[(][])[]][(]]([[(((]][((([)([]]][(]][([[(([[][])(([[()[])[)]]][)))([)[[[]((())(([(([())(([][[((][[[[())]([)[[[((]([]][]]()][[(([(([(]]][[[[[(([[][[(()][))((()(])))(())[()())])][([)]]))))[[)([([)])[[())))])[]]((((][[)()])([[[[[[([((([))[][([]][(((]))))[[[)([(]...

output:

1676
621
3103
909
10534
2742
1628
347
29475
45217
27009
2062
2316
9317
507
106185
576
1319
97179
4503
814
853
97
1881
99
82103
239
34940
4378
4656
156431
2941
64234
3563
1111
18080
137339
45748
48646
64888
70333
78121
80687
30418
323
166044
23129
3060
2192
1202
596
2552
1821
21461
5743
94602
184052
...

result:

ok 2851 numbers

Test #14:

score: 0
Accepted
time: 12ms
memory: 145144kb

input:

5990 6000 0 2
][]]()[((][](]()(]][)][][]][([([]))((])[()))[[([)))])[()[[(()][[((])]))([()))[])][[[(()[)()))(])())(][]]((([((([([[])][]()](()))(()())(([]][[)])[[)])(])()([))[]][[[)(])(()((][)][][)]((])[)()[]](([([])[[(])[))(])([]))]())((([[(]][))((([(([](])])(([]]))[))[[(])([)))[([]][[)])[](()]]([(](...

output:

1398
6733
20224
11291
914
15438
21658
36648
2780
9987
29837
232
8309
33602
18260
28356
6428
16668
14882
18760
1153
19071
7020
6836
28221
3312
5662
5670
8671
15561
4571
17636
11798
7712
3502
2235
182
4653
12055
21702
151
5111
20195
31989
617
17717
3948
1030
2812
6404
33856
36584
1333
3260
2628
13828
...

result:

ok 2824 numbers

Subtask #3:

score: 5
Accepted

Test #15:

score: 5
Accepted
time: 203ms
memory: 152620kb

input:

100000 100000 0 3
[))()[))([))(][([[(])((()])(]())((][)()(])()])[())[][]]))]][[[()[[)[[[])](][]]]])))])]](([[[()))]([(]]][](]([](])]())]])]])(()[((()))[[([]))])](](][)(([[(])[(()[][[[][(]]]]][(])[]]]((([(][]])][)((])(([]((()([([)()][[((]((])]]][[))[(])][([]]((()([)[])()(()[[[]](((((()[([])[)](])]]](...

output:

2025178
811154
757819
2210202
1658364
692420
1369509
1050390
3727
62428
272623
1787186
176071
32812
552965
1330256
967939
63731
493815
1371424
364388
3324
2004608
17530
1011648
82305
695880
2313086
2018669
2793986
107206
16251
1162656
497933
3047202
102009
289328
853114
2449923
950429
2162
2012994
4...

result:

ok 46425 numbers

Test #16:

score: 0
Accepted
time: 214ms
memory: 150476kb

input:

100000 100000 0 3
](])()(])])()[])[[(][]]])()[(]])(()([(]]])]]](]])]((])))]])[)[](()])(()(()][[]]][()]()[][)[[[)(]))[[[[[)[((][[]]((()]]])[)]([[)][)((])]))[)[]]([()])[[[[[))]))))](])]]]()())))(()][[)][((]([[[[]([[)((([[]()[((]([)]([])())]))[](]])[)][(]][(((()([[)[[(]))(((([][(()])()[([(((]))))([[[])...

output:

642461
2660699
2230572
190147
36402
968213
31399
118460
1353186
95474
398005
219996
223824
126798
28872
370682
17930
103084
1531873
2412552
983107
1445743
350987
224642
85514
1551554
128949
576034
690473
11666
242664
2303975
852803
2095742
2557285
208636
136226
138168
261023
613087
2756376
976893
17...

result:

ok 46498 numbers

Test #17:

score: 0
Accepted
time: 196ms
memory: 148512kb

input:

100000 100000 0 3
[((())(([()[[]][[)[)((][)([][](([)()]]]]((]([)]()()([))())([()][)[[)]()))(]])[[)()[[[([))[]]][[)(([[(])][[()([[][]]][])](((]]])][[(]][]])]][)[]](]()[(])[]])(](][)([]]](()])([(]())])[)[)[(]([[[][([)()[)[)[)][)]([[)([))][))(((()])[(()()(([])([)])[]])[]([[[[[))[[)]))(][)[][)]([))])])(...

output:

857367
4791558
608934
1814384
452993
1488068
1978628
1822068
2022438
74510
608938
1172575
1469684
698044
2858980
400659
440439
426080
205527
248428
2906196
1936455
17558
1566347
1065002
315863
94798
1094351
220311
2113189
13179
3453877
327484
1983981
506724
739497
1303958
146892
2856064
1242945
4623...

result:

ok 46723 numbers

Subtask #4:

score: 5
Accepted

Test #18:

score: 5
Accepted
time: 343ms
memory: 155904kb

input:

200000 200000 0 4
[)(][)[]()[](][)()()(]()()[)()(][)()(]()[](]()[)()(]()(][)(][)()[]()[][](]()[)()()()()[][)[](][]()[)(][)()(][)[][]()[][]()[][]()[]()[](](]()(](]()(](][)(]()[)()[][)()[)[)[)[)[]()[][][)[][)()[](](][)[][)()[][][)[][](]()()[)(]()[][]()[](][](][)[][](][](][)()[][](][)[)[][][](]()[)(](]...

output:

3985512715
14894233536756
4744355312841
145882954250
344772643700
978161276096
9047156620049
4766800632
9709369915743
84192773804
8698429775589
3087124472447
15436547
8609018590232
7895556259234
261754581675
1702800777207
1325125455242
490365315745
124168842287
23098622070460
29601922868
19704482298...

result:

ok 200000 numbers

Test #19:

score: 0
Accepted
time: 116ms
memory: 193800kb

input:

200000 200000 0 4
]])))]))]]]]]])]]]]])]]])]]])])]])))))))))])]]]]])]))]]]]))]]))))))])]])])]]]]]]]]])]]]))]])]]])))]))))])]]]))]]))]]])])]]]]))]))))]))]]]))))))]])))]]))]])]])))))))]]])])]]]]])])]]]))])]]))]])]]]]])])))))]]))]]))))])))))])])])]])]))])]]))]]))))))])))))]]]]]))]]])))))))]))))])]]]]])...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 200000 numbers

Test #20:

score: 0
Accepted
time: 351ms
memory: 154048kb

input:

200000 200000 0 4
(][[]][[[(()])[[[[)]())[[)))))[(][[())(([]))([((([]]([))))[))(])))[]]()](][[))]())((()]())(])([))]](())((([([[])]]][[(][)][)]])]][)]()](((])]]))[]))[)[([])([())[][]]]])])(([][[))(([)]))])))([()[][)((]][][([[)()](()))[]()])(]([](]((][[)]])[(]]][))[]]]([(][([](([[]()[((](](((]()[)])(...

output:

179103
759888
6208760
390493
3325907
15579
4824204
5999186
894124
6115016
6036372
5596912
571360
2841797
1579166
1772895
849280
1809915
6624025
4066312
247799
2829545
720976
4849710
27386
1354007
3203225
5638660
3685030
888401
228038
388385
5542082
2073208
3395686
5902478
556724
401999
4092826
73270...

result:

ok 200000 numbers

Test #21:

score: 0
Accepted
time: 291ms
memory: 174896kb

input:

199994 200000 0 4
](((]([(([]][[[[[((([[[)[[(([[((((][([(]))([(([))[([[)[[[[()][[(((]([(([][[][(((([([(((([[(([([[](([[[()[[[)][([)((((()[(][(([[(((([[[[()[(][[([[[[[()))[([(([[]))[[((([[([[([()(([[(]]]([[[((])[[[[[[)[([]([[[([))(([([]((()((][([[][([(([(([]))([((()(()[[(((([())[((((([)[([((])[(([([[...

output:

17316635
253
2131906
135172
3836
6306
51181103
2027
210451596
1811
4095
2042551
133612389
541125430
6995
894
2860
2950
2530
1830
2922
420177838
870
7065
5751086
9385
831895543
8071
1068
1277
87568997
3090
878268
1319
2568846
2549
121834631
83796706
17020808
482509445
1970445
6205
6213
417
41396624
5...

result:

ok 200000 numbers

Test #22:

score: 0
Accepted
time: 326ms
memory: 167676kb

input:

199990 200000 0 4
)([(]())[(([[[[[(([][(]]][[((([))([[([[([[](([[(())[[[(())([[))([((([)]](([([)([[(]([[][(([()[)[[()(((](()[[((())[([((]])]][([[(([[]))[(([)[[([[([[((]][[[((((([(][[][((([([[([()))([[[]][((][([[[(((()([[)](()[)[[([[[]])(((([[[[[([[][([([)([]][(([)(([([]([(]](([]]([)([][[([)([[[((([]...

output:

2862
537505408
840
5408
102245780
44887264
276
23976834
68731006
658435288
10346
10666
90308384
37339767
4488
13793
51736501
103874052
45362280
20508
7089
25896966
5577
12396
7989
2884
226305998
66471024
55933259
4785
20520
8606
79557999
118443299
1300
876921253
11236
161135814
129113937
8665
11360
...

result:

ok 200000 numbers

Test #23:

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

input:

199991 200000 0 4
)((((([[[[[[(]()((((([())]]((][]]((([])])]))]])(((])]]])([))()[[[)([((](]])])))))[)([][]]]([])))(([][)()]]([][()((((](((][(])[(])]()]([([)((]((((]]([()])))(([([[][[[[)((([())[[)(((][(((]]()([][[(]]]])([[([[)](]]][([[([))([)(([]([([[)]))]]])])]))(([[[([[[[([(]])])[[(]([([)))]]()))])...

output:

9034154
56497
49737
631721
9838
12284
12958942
3905602
2134679
59816
6227
19453
66631
26028532
74770
76900004
131856903
129058390
35708134
108144
44170
59129
33182
112532512
226764259
82491
51002
41578
30730
20622
48128
43714
3806019
2414
9883209
18064
139159066
64430
66213206
6047857
15880
224474
6...

result:

ok 200000 numbers

Test #24:

score: 0
Accepted
time: 351ms
memory: 155708kb

input:

199986 200000 0 4
](]]][[[])(]]([(()](])()[])[][[(()([])[)[)]([)]))[([]]](]](([(]][]()](])(()[([[[)](]])[](](]()][()][[)][]](]([)))(()))(([(][[)()))][))([][))[[(]((]][)][]][]][([([[(([)]()]()][]]]([[()][]())((][])[[()](][])([]]][(](((])[)]][[[(])[[((]]])][))[[))((])[])(([[]((][]])]([]])(([]()[]][(](...

output:

353599
1062917
465453
56230
598214
1053965
1390111
766580
474981
267342
1351744
1177635
217668
80291
807441
939446
1238129
1472137
165572
658844
637242
33919
435739
150338
768886
80034
2107238
374532
1330782
2099160
1151390
124802
599193
717513
19243
1123488
1141101
1282648
1221920
809898
23274
1904...

result:

ok 200000 numbers

Subtask #5:

score: 5
Accepted

Test #25:

score: 5
Accepted
time: 227ms
memory: 155996kb

input:

200000 200000 0 5
()(]()()[][][][)()[)(][)[](][)[][)(](]()(](][)[)[](]()(][][][](]()()()(]()(][)[)()[][](]()[][)()[]()[]()()[)[][)(][](](][)[)[)[)(][)(][)[)(]()[)()(]()(][](][][]()[]()[](]()[][][)(][)[)()(](](]()(](](][][][]()(]()[][)(][)()[](][]()(][)[](][][)(](][)(]()()[](]()(](][](][)(][)(]()[)[]...

output:

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

result:

ok 100542 numbers

Test #26:

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

input:

200000 200000 0 5
(]())[([]]]](])(((([)[])]](]()]]](([]]))[][)(([]()(]()(([[)]]][([)(])([][))[)[]]])]([(])]))[([](]]([[[]([(((()[)(])]]]))][]([[[)())][[]()())[([[))](]][][][([[))][()])]([])()(]])])((([][)[))[][))])[][(()()]]))([[](][((([))()])])([[)[]]](][]])))([([())[](]))[]))]])]]()]]]][))[)])()[]...

output:

3085307
58458
18155
498540
2046130
33519
8212
1658
15989
77256
294392
2600523
5661
8558
31588
14359
11644
10973
33624
1246
25355
58671
19361
361
633
60641
1317590
102179
405892
1053344
84230
24590
72982
17021
13216
104359
25766
7004
77310
26269
673962
100617
2870
786127
24693
5410
109253
17712
38815...

result:

ok 100132 numbers

Test #27:

score: 0
Accepted
time: 291ms
memory: 172944kb

input:

199995 200000 0 5
)[([[[((][((]]((([)([[[](([(][(([[[)([((()[()(([]((()(([(][[(([[)]][([(]([](((([)([(([[([((()[[]([][[(()][[(((][[[[[[(([(((](((())(([[([[[(([)[[]([]((][([([)](([)[([])[[((]][[[[)[()[[][()(([)]([(](([[(]([[[([[]][[([[(([)(()([]([[((])[[[[[([([([()((((][((([([[((][(([[[[][((([)([)[((...

output:

1028987005
1105954813
1110483075
1141059360
1129513506
1096128237
1114437517
1120950323
1110901713
1136220591
1109374535
1137491793
1137167696
1140710104
1142558098
1142982851
1139786573
1129354758
1140934796
1109226791
1138211064
1099476892
1136356672
1141758969
1140310930
1138017724
1122116152
109...

result:

ok 99668 numbers

Test #28:

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

input:

199995 200000 0 5
][()([((]]())[[[[]]([[]((([](([[][[(][)(([]()(([[(][[[]](([()[[([([((((([[((]][[((][)([][(][[(][(([[([[([][[[((]))[[([][[)([)[(([[([((]])[([((([[))[([((])([][[[[()([[)[[([))([]((((])(][([[[()[[[[([((([[((()]]][((]((](([[(]()((([[[])([())[[(][[)[]([[[[])[()[(((([]]()((][[([[][[[((](...

output:

915061455
980309505
961888696
915402699
964874050
963553075
945378403
981174026
947711233
942945981
964154591
943946722
976707094
979888917
981158067
905751211
940629160
922459892
957722476
939787677
953769090
940142167
893465022
980812832
969643278
860500144
980456418
977509859
980245360
966225708
...

result:

ok 99561 numbers

Test #29:

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

input:

199995 200000 0 5
))[)[[())()]([()(([][[)][(([[])]]]])[[[())]])[[[((((((][([))[(]()](([(()])[([[[([)][[[[([)[[((((]](([()][[[[]((([[([[]([)])[[())[))]))(()()[]((]](]](]))))][)[](([(]([[[]([]]]](]]][]][][(([])(]]))))((())]][[(]()]()([)(((((((((()(([(((][[()]]]()))]([)[((]](((([([])]])))([((([()))]([[...

output:

414713507
363650255
374896568
380363311
385563321
430099819
421991449
411585513
387590323
438993716
376559203
342626011
426667112
421518810
396455887
405342985
354174634
410441630
328937153
423521415
398467718
394250219
390450596
413505456
432011698
436218244
387156837
421112725
419232765
384677075
...

result:

ok 99962 numbers

Test #30:

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

input:

199983 200000 0 5
])]])[)())((((](]))[))[(())[](]])[([(]][(][[[()])([))(((]])([])](][[)(])[))[(()]][(()[]))][)[)](]()[])[[(]((])())([)[()]]([)(([))])(]]([[([[)))[]()]()])()()[[]]](([(]([])(]()][[]][[))(](])((((((])[[))[())))(((((]])][]]()(](([)])(]]([]][[)()[])([[][(]][]]][)[]]((([]((())]))[[[[[[)]]...

output:

142
6182
1574
1986
48
13761
4027
5065
577
87
15223
727
70
1636
2911
1411
1649
36253
195
522
336
111781
55366
552
4306
161
11912
721
618
314
91
1185
348
6182
379
428
1024
211
2813
3451
181
241
549
2702
6078
339
338
884
170
367
213
1450
298
10318
895
2556
2153
1185
133
140
1649
2609
869
889
872
2043
1...

result:

ok 100262 numbers

Test #31:

score: 0
Accepted
time: 293ms
memory: 160784kb

input:

199990 200000 0 5
])]][[][([))))(([[[)[[[]]])[[][([((([])([([[]()[][)][)](((]]]]]]((((([[])[][([[[)[)()[([])[[))))))([(]])]))([])(])[))(]))([(])[()[(([)([[[](([(((()()](([([[)])])))))((([][(()))](()[[([[[(][([))(([][()([[(()[(())[(])][[]]])]))[(([])]])()(])([[[]][[)()([)([([[([)([)[([][)[[([[())([[]...

output:

9959684
14118791
86846
8606
1735253
40625101
17520712
21566935
8115514
29247460
50097216
35309474
37266337
10794116
24533411
46783417
705455
46646019
1715556
48451220
44889107
32093167
12329138
300018
8388537
17498454
14948039
50027868
7256815
22572937
109376
37767547
298905
28955909
48191092
159322...

result:

ok 99538 numbers

Test #32:

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

input:

199986 200000 0 5
)[)(]]([))])([))](([[[)[())[]]])]))[][((][[])))[]((()[[][][[[((((([(](]]((()][()([)]))))]()]])]]()))][[[]][)]]([(([()[()(()]]([([)(()(][(]([[[[([[))([)])][((](][[(([]))[[[)]][]][]))))([]](()[[])[(((](]]])])]([[[][(([[[(]([)][[[][))])[[(]]))(])([()()[[[[(([])])])[]]]]))]](])([)))[]]...

output:

581499
7386660
1494378
5436742
401594
17867419
963766
16837264
39758
27997168
13947010
1243755
11520276
7776117
3220455
29495262
5172446
360710
5453509
15203
96926
572821
147313
11725352
52800
15995
1965432
570812
5931622
231707
8820366
22091273
22215644
69135
250553
12826622
38206
140669
283676
229...

result:

ok 100187 numbers

Test #33:

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

input:

199986 200000 0 5
]))]][()](([[[[(])]]((]([]]](])][[)(]][]]][[][)][([[([[[[((])]])([(][)][()[(([((]](])[)])()]))(]]([)[[])]](((([()])))()]))))][(([[[(([]))[[]]()))([(([(([()(([])]([[([(([])]([)([()([][))]())(([[))[]][]]]))](([[[(])][((](()))[)]][))(]][(]([((])[(](([([((]]]])]))))))[[([((]([()[[][([[...

output:

366298
6074412
304259
15047
1574516
8773225
150509
15397207
29852
8920494
8494777
12191756
11676090
6371367
269162
131876
661184
5867476
43166
7041458
129887
14603122
5102479
9174600
8259
45699
50269
13824662
6241108
11712147
833088
931625
14502790
45079
12896373
1074491
12301515
2473
218765
160169
...

result:

ok 100251 numbers

Test #34:

score: 0
Accepted
time: 301ms
memory: 155876kb

input:

199990 200000 0 5
)](([(()])]()[[[([([]()[]))))[]]]][(([(]([([[([([[]([()[)][]))[[)])(([][[()((])[[([[[](((((][][))]))]])[])[]((([[(][])][)([(()((][)(]()))][(([[())))([())])]])))]][((]])]]([)])((([]((][([)([(])[(([[)][]](([](()[[]())])((([))[((][[[(([))]))[(([[))]]]))(][[)]](]](([)))[[[))(([][))((([...

output:

1055379
3952
702157
8255860
88761
40345
573335
296738
356807
2311915
59706
320967
10383856
115776
10639789
8710
1049115
6702590
281518
833262
605098
19648
598178
666649
464718
9722997
9638869
1022885
62480
7745366
545684
9841
536775
287554
9316110
973468
54437
607407
550989
443524
8091811
123196
103...

result:

ok 100136 numbers

Subtask #6:

score: 10
Accepted

Test #35:

score: 10
Accepted
time: 334ms
memory: 156012kb

input:

200000 200000 0 6
(][](][](]()[)[][][)(][)(](](][)()[)()()()[][]()[][]()(][)[]()[)()(][)(][]()[][][)()[][][)()[)()(](][)[][](][](](]()(]()(](](](](][)(]()()[](]()(](](](][)[)()()[)(][]()[][)(][][)()(](]()[)()[][](][)[][][][][)[]()[](]()[)[]()()(][)()()(][][][][)[)()[]()[]()(](][)[][)()[][)(]()()[]()...

output:

16263722770281
1575076157
40730166003
3644501920
5026595071566
13060325221456
15609073747453
1758734173008
18322653073792
2566647977709
1327355575606
219777219585
3672159847312
13114961286309
8791717874306
290445355310
245192793605
3609249567482
8950173816190
241954903688
96275826974
542078820
23813...

result:

ok 99957 numbers

Test #36:

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

input:

200000 200000 0 6
]))]))]]))]]))]])]]]]])))]))]))]]]]))]))]))]))]])]])])]))]])])))])))]))]))))]]]]))]))))]))))])))])]))))])])]]))))]]))])])]]]])])]]))]])]]])])])]))])))]]]]))]]]])]]])]]])]]]]]]]))])))])]]]))))])))))))]))))]))])))])]]))]]]]]])))))]]])))))])]])))]])))]]))))))))]))))]]]]])))]])])]])]))...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 99785 numbers

Test #37:

score: 0
Accepted
time: 437ms
memory: 155992kb

input:

200000 200000 0 6
[)[)[][]])]]((([([)())[[([)()))](]))]]])(])((][)[]])(][[](])[()[](])((](]))[(][)[()([)(]()(([((([(([([))()([][([][[][))]()])()](()[[[]([)([)))()[]]((()[(])([()[)][]])[()[]])]](](()[(][[)[[[)]()[([(])))()[]])[))])[))]])[(]]][([[[((]])]](])[))()))]]]]][]][[]]([()[])(()])(()[(()[)[([)...

output:

6430610
3432274
4304407
2857286
660627
137809
38124
1594836
837326
3785406
9178344
1759564
698615
100626
2461823
277629
4808228
1539642
495074
1911197
1130237
8839218
2842082
3301855
3083252
1388064
519025
75981
640040
1910575
717322
24679
35377
117090
7256166
6191900
870876
6807631
185215
9423380
3...

result:

ok 100025 numbers

Test #38:

score: 0
Accepted
time: 374ms
memory: 172956kb

input:

199977 200000 0 6
)][[[]([[[[]))([(([((]][((((](([([(((][[[)(([]](((((([([[[[([[])[([[([[([)[(][((([((([(](()([[]]((([]([((()[[([([))[[([)[[((())((()([)[[)((([(()))(([[[[[[]][((((((([()([([[)]([()(([](([[)([]((([[[)(([([([([(([[([)])][[([[)((([)(([[)((]([([[(](([[[([([())(([(][[()[[([[(()((]((([([((...

output:

279221119
103703237
3274
7832
1650
263119373
197654679
730716148
341350825
4309
571
905
1640
241419396
93320126
629170
2782
166421499
4855
3420
2930
8034868
8757
1539
1219
5918118
5791
137067722
466813427
3273
910
374221803
797
1248
366686
372
20067949
4796754
2728
375765627
948
3255
1165
28684391
3...

result:

ok 100111 numbers

Test #39:

score: 0
Accepted
time: 372ms
memory: 167884kb

input:

199989 200000 0 6
][(][][[([((])]([((([[[[][[]([[(](([)[(]([(((])[((([((([[])))([)[[[[([)(]([())([[()([[))[)([[(([())))([[([(([[[([(])](([[[[[[[[)())][([[[([[(]])(([([([())([)([[[(([[(]])))(((([]([[([(([[[[))](([(([((]())))]]](((([])([[[[(((()))())([(][(((([([])([[)((([))([[)[[[(]((((()][((][[[[])])...

output:

17990510
14001
4561
751690248
208321414
10666
5942
9009
327766
3145
9799
95379889
4811
1751
296399499
10060
19402
6082
534784181
20432005
6342
861800417
19707
26904335
70816637
1657209
371280923
10353
352455
28710796
4989
3495
87262937
40448381
5470
26895
9429
36431706
212465774
17776615
3851
285770...

result:

ok 99939 numbers

Test #40:

score: 0
Accepted
time: 384ms
memory: 157928kb

input:

199984 200000 0 6
)[[][()[(](([[(][[[([]([[[[([[[((([(())][((([[(([))[[)]]](()[][((([()[(]))[[)[(][(][[)[()]]()[])]))([)]])[))[[([[][[[[[]([))]]())]]]([([](((((([(([[)[([()[([(])[[[((([)(((([[(()[(][[]](((())[][(]())]]]][]]][]]][([([]))[([(([]]]))][())([]]][[[()](([()(()(([)([[](([)[((([])])((()]]][...

output:

141853173
56486
67566
149169605
50812
57229
7187
61561
13558
225434489
180773669
45254110
851
6900163
81767561
587833
2067
64001728
80784779
422926
11398
12470755
41913
55540
1087993
7482521
32229
78277
77459
17769
54090
48293
32284419
141881892
41987
28979
7089953
35947
170562422
24769
25334
33481
...

result:

ok 99870 numbers

Test #41:

score: 0
Accepted
time: 395ms
memory: 151592kb

input:

199984 200000 0 6
)(()(])[)((]](]][))()(((])[)[)[)](]()]([[()([]))(](]][([[)(]]((])[)]()][]]([[[)))(])[[)][])(([][([]]((]]([)[]])(][)((])][[[)()]()]([[[(])(]][[(]][)[[](])(])[[[])[(])(]][[[]))(])[)]([[)[]))((][)]][((((([]([)][)](]][](])([))([)[)]([)]](])((([()[])[[()))][))(][[))[))([]]([))(])([[[])(...

output:

1417553
1100282
508429
249146
176857
104644
355295
550168
909237
572406
160706
48631
660143
1246163
166346
18657
81878
1939137
629107
881403
576299
3245
1525472
2243727
475545
98966
106993
439514
17987
773016
6765
426305
4922
562932
815530
1165085
557420
1705217
109030
281073
399553
111112
322079
94...

result:

ok 99762 numbers

Test #42:

score: 0
Accepted
time: 404ms
memory: 160900kb

input:

199985 200000 0 6
])[])]]([(([]]))))(([[())]())(((((((([[[(]][(](])])))([)[[])]))[([][([)())](]])](([)])))]])(]][()(])([[[()()([[[[((][]]][[[([][[])[(]])))(][))[(([)[[(]([])]][(])](]))]([)))[(][(])([))[]])[[[])[(]]]]][[[(]]][)]]]))([([)([()((()]]]))][](])(])([)]([)[]][[([(][]][((([[((]]](((]])][([[(...

output:

18678
18083636
8953669
127507
65649
10425411
224178
18217095
10362738
5927193
14226843
936930
7464665
585105
27051
170671
3062
775825
4265572
4548163
215636
1592058
11283015
6301340
482691
67157
4026202
2693245
572022
701515
55652
51944
3432070
744783
2271228
347583
11267661
11103131
1159133
168612
...

result:

ok 99692 numbers

Test #43:

score: 0
Accepted
time: 387ms
memory: 152368kb

input:

199989 200000 0 6
)))[([)[)][][(]()(][[[))[]))])[(((])][((])]([][()([[]][]]]][(([[(([[[(())](])[[]]]][][[)])[[(([([[]]](]])])])](()])()))](((]]([)]])[[(((])[)][(((((()]])([[(()))])])(([(([](]]][[[])]])())([[[]][[])[[(()])())]((((()]))([[[()[[))()])[[(([()(())](()([])))]]))[())][[(])][[([[[)[(((()[](...

output:

1644152
1447717
435847
3356262
40853
180663
3206325
3873434
588030
879005
2860593
220878
115611
159103
709103
967388
80803
692637
29293
5748776
11859930
1154233
15695752
17493
470189
872554
43019
19364
463816
12658463
4740323
100764
71956
1855775
556945
45640
2538997
3238208
615896
1047861
178554
46...

result:

ok 100254 numbers

Test #44:

score: 0
Accepted
time: 388ms
memory: 154176kb

input:

199980 200000 0 6
])]([])])(([]][]])([(][[)[))])(]][[](([(])][([([([[])[()])[)([[)])])[(((]]]][([]])))]][[((](][()[((([(])[((][))]))])])))][((((][)))(]]]())[[)]][(((()((](][[[])[[(])(]])(((())[][[))([()][[)]]]]])[))[)[([[]]][([]))]))([([[][]]()]([(][)]))[([([[))])([(]([])))([(])()][([]][([[[[))][]])...

output:

291368
3539843
35931
504399
967639
3466931
8806100
4038673
1254471
4163435
4465888
4557621
1080954
1686952
3688778
16527020
813837
4875884
63905
2422710
3884085
1675971
2559872
371335
2380
486676
4365553
1757896
947234
16256137
7943863
168360
3355786
2189276
51644
240457
7951757
3684629
76796
247324...

result:

ok 99796 numbers

Test #45:

score: 0
Accepted
time: 434ms
memory: 152220kb

input:

199990 200000 0 6
]](([])](([[[([([))[((()]](([])))]]((([)([)])[))[[[([]]((](([([(]([[[[)((((([)(]])][[)[([()]])])))))[[[][[[((]]]((([([][)([][(][]])])[[[[][]])])]([([)])])[([)(])[[())))))])[[)[]()]][[)([[))([[([(([])]])]([(])))][([()](((([])([(())))])(]]]((])(([()([[(]([]]()())(][))][(])]())])]))))...

output:

279653
2077047
596784
345380
9350020
9102165
1664355
2206278
5463278
2594839
9093154
1486976
12255370
8997170
497714
9939071
332172
767119
366239
665990
2580120
887578
1113252
2512490
887974
285884
3210532
1311755
2826322
6808432
2662041
809453
2574403
119660
270677
3055590
146096
4122558
64741
1063...

result:

ok 100025 numbers

Subtask #7:

score: 10
Accepted

Test #46:

score: 10
Accepted
time: 211ms
memory: 153964kb

input:

200000 200000 0 7
[)()[)()[]()[)[](][][][](](][]()[][]()(][][][][][][)(][)[](](]()[](]()(](]()(][)(][]()()[][][)(][][)(](][][][)[)()()[)()[]()[][]()[)()[](]()[](]()()()()[)()[)()[][][](][)[][][][]()()(][)[][][)[]()()(][)[][](](][](][]()()()[)[](](]()[)(]()[)(]()[][)()(]()[)()()()[][](][][]()[)[)[][]...

output:

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

result:

ok 99871 numbers

Test #47:

score: 0
Accepted
time: 353ms
memory: 155932kb

input:

200000 200000 0 7
[)[())[)[))([))[((]])]]))[())[))([[][]([[][)())[)][)(()[))(][][]((]](((])([))[]))))((([)())[[)(]]](()()[]]([](]([()[)]](](()][)((])[])][]((]([[][)(())))][[([)([)[())])())[(()]][)([(]))](())][)([]()[]))(](]]())[()()][(]])][)((()][([)]][))](([()[))(([(]))()[)(]](()[))([][()[()]][])((...

output:

846255
5122
1143332
118504
13931
549853
487120
64233
861875
208094
290524
14625
227230
77515
365525
1992291
63432
7417
793539
128157
996183
22441
859317
202426
1590395
1803369
137350
186095
4572
83156
116986
1014390
15455
7119
636250
908217
157580
175836
123381
8729
952234
15491
12112
1211812
5050
1...

result:

ok 100044 numbers

Test #48:

score: 0
Accepted
time: 360ms
memory: 181016kb

input:

199987 200000 0 7
])])[[([[([([(([)((()[[([]]((((((])[(((((])((([[))][[([([[[([(([[[[[]([[(](([(]([()](([[[([([)([[](([[)(([((([)[(()[[[(]]]([[((]][(()[[)[(([(([][()[[)[[[[]([[((([(())[([)[(([()]][[(([()([)(([[(][[(((](([[[[()[[(([[))))(([[[)((([[[[[(([(]][[([[[]((([))][(((([[[])[[[(][[([[][[[(([([(...

output:

1125110684
1129421636
1133104892
1091843099
1102524519
1056134658
1112981588
1142851380
1134849699
1115564153
1134550611
1134219303
1110890561
1142322976
1102225287
1110838386
1121319901
1139153266
1118098684
1142609238
1075159367
1111827684
1140917323
1124530741
1080726868
1089134910
977015594
1136...

result:

ok 99607 numbers

Test #49:

score: 0
Accepted
time: 340ms
memory: 176136kb

input:

199993 200000 0 7
)[([(])]([[([](((([][]([((()][[[[((([[(()][[([((([[[([)[[[(](([[([(()([(([)[(()])]([)((([][(([)([([(]((]])])(()[([(([[(][[([[[[[)](([(][[([(]([)))[[[[[))([[[])([([())((([][[([][)[([[([(([[(])([((])([([[]([[)[[((([](]])]()([([[[])([][[]([()(])[[[[]((()[[[(()[([[[][(([[])[((([(((][[)...

output:

955041178
943123812
967134561
932367112
936780186
973414459
895808617
973738219
928620735
832168806
932639444
927726271
972545827
834964780
969158962
967404597
828244247
962699597
938575539
969414020
973792623
918004789
947596068
929953162
974082217
972787211
947697630
937980208
897879136
942226673
...

result:

ok 100576 numbers

Test #50:

score: 0
Accepted
time: 332ms
memory: 159960kb

input:

199993 200000 0 7
))[]((()([[)][)])(][(()[[[([[]]([]]))][([[[[[([[[[)[(([)()[[][]([]()((])))]][([[[[)(((((])((())]](([[(])([][[)[)])[])]()))][((()][([[[[][[)[[[()]((([[)[[](][[)(])][[[))([((([[())]([([[[]]]][[])))])[[]]([)][([))]]([))]))]([(])(([[)]((()([)[()[[[]([](]])())(([()[[)[[)]))[[[[]((][[()]...

output:

365783139
416735170
422137514
356895246
426513271
413746105
425524531
357098673
439794665
442892246
446440090
372003534
437597842
442682179
411147776
315125069
436403604
334013082
303854566
367603041
395631300
353915108
445975085
379372739
441372373
443614276
426323054
259508879
418691845
397931799
...

result:

ok 100177 numbers

Test #51:

score: 0
Accepted
time: 341ms
memory: 157656kb

input:

199986 200000 0 7
]((][)))(((](())[())[[])[]))[[[(](]())((][]])[])[))(([[()[][)]]([())[])())[[[([)][][]][[)))(])([][(]]]][[[([)(](]]][[(][]])[)]()(()]]][(([[((()]))(([)]][))[[)[[]]]([])[[[))[[])()]](()([][()][[([])]][])[(][])][([])[[]])[((](()]))](([((]]][((([[)]()](](]([))]([(]](()[])[)((][)(])][)(...

output:

2366
3113
852
323
12083
1148
629
2365
373
425
1430
1100
955
2176
6688
214
1539
2252
936
184
4544
48331
220
2479
2117
3768
1180
108226
2723
1005
210
1611
24676
6381
1988
1336
933
18130
957
193
110
694
1655
1386
158
361
192
7163
763
853
816
1655
172
556
1716
917
755
143
967
18678
1737
1519
2674
34377
...

result:

ok 99867 numbers

Test #52:

score: 0
Accepted
time: 338ms
memory: 152592kb

input:

199991 200000 0 7
])](([()][]]]((([[[(]][)([(((])([(((]([))]))]))(]([]]))](())[[)]][[[)()))(]]][[)(([([[()(](])(([(](([[(])[[[[([[([(]]([)][]]))])])][[])]])][][[[((()(([]((]][[[(][(])[[())([]([(()))(][][)])(][)]]][(((](())])[]()]([([(([()(]))]]]([[[]](((()(()[(([[()(][[]))(((]([]]([)])])(]])()([[])]...

output:

1658465
50944433
43243995
3458608
21356556
7970899
27045686
422559
99981
46262935
30626770
9631531
50760687
28553194
23803325
23771147
48411565
48655006
30353150
19517240
31240225
16850330
39167044
914692
21407626
47874438
28030955
43376811
11780333
44882077
2555013
1525186
45032735
28600819
3044328...

result:

ok 99961 numbers

Test #53:

score: 0
Accepted
time: 349ms
memory: 158512kb

input:

199994 200000 0 7
][()()]][[][()][(](])([)][([)]))([()[]]((]]([)]])([([]([(([[([[([[([((])[])([))([[[]][])](([[)))(([[])][))])])()]])))]]))](([)[)(]]][([)([]]]))[([)[(((((((]]())[)][)]]]])([)[))[](()((([))]]]([)]][[[()(()[[]]]](]([[[[(]])(](]])]][]](([[[)()(]])([))[[[[[)]][([))]][([]]])))][[(([)](([...

output:

2345844
20907653
642078
84321
12289282
991748
18020819
12013
292010
9229268
2604072
268793
35905
89258
57007
27203693
4104285
2948416
7260522
2087106
7259867
904513
20773
3315
236715
11525464
3954705
4457814
20646485
27037765
303767
3968686
9662549
2852140
12283688
6478765
18443931
359820
60033
1215...

result:

ok 99895 numbers

Test #54:

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

input:

199989 200000 0 7
)]][[]([]][((((((([))))]]])]](([((()((((()]]([))]][(([]](()))]((()(]][])(()))[))([)))][(([])(]([)])[[)[]]]([)([[([]([][)])([[([[[[()[]]]((((])(([))[)]))((]][]][[)[()][]])]][[[[)[)(])((()(([][))[[]))([([[]([)][)[(]((])[]][(]))))[]]])([[(([]]]][[))))))))[[[([]]]([(]((][(][])]][((]())...

output:

2391326
159810
35558
13839783
4626236
13118272
518989
3095178
9829589
3738242
342399
2568150
3527
2989080
41018
15756437
10813878
479444
555204
13534233
1314582
4663
736898
100322
4369444
367174
24366
412996
9592
1144678
367174
4505970
178472
149959
4472043
2924977
1204155
22012
439620
4154126
29950...

result:

ok 99532 numbers

Test #55:

score: 0
Accepted
time: 352ms
memory: 158356kb

input:

199989 200000 0 7
)(([)[[]]([[(][]([(])[[[[)[]]())))[([[(]])][[[[()][[]))]))))(()]])([[)]]([()][)]][]])((([(([])(])))([()]())]][)]]([())[[][)]]]((((([](([]])][[[[)()([()[](]]]])[[](][([[[((](()])])]]))([[[[)][(][]][]][)((([([([(([[[)]))])[]]])[])[([([)[)]))))])])][)()]([[[[()])(]](]([)())]))([()[[](...

output:

74193
949539
389306
89193
9968
1179415
3214174
1179415
1698
47426
106394
235633
2912575
38111
1884853
12620206
40831
1036870
27504
4112605
168047
1296715
1381273
1317956
162086
209404
1943
136391
348676
142971
28141
2093149
40167
44328
76224
895963
20519
7575
122441
134267
1061671
1121934
190345
391...

result:

ok 99804 numbers

Subtask #8:

score: 10
Accepted

Test #56:

score: 10
Accepted
time: 312ms
memory: 153964kb

input:

200000 200000 0 8
()[)[]()[][](](]()(][)()[)[)[]()(][](][)[][](][][)[)[](](]()[][)(][][][]()()()(]()()[][)()[)()()[][)()[)(]()(][)(]()[)()[][][]()[]()()[](][)[)[)()[)(][)()()()[](][](][)[]()()()()[][)[)[]()(]()(][)[)(][][](][)[)()()[][)[](][)[][)[)(](][][)[)()(][][)[]()[)[][](][)[)(](]()[][]()[][)(]...

output:

15633150444814
1109834573719
166004833
743111264133
18166567306952
176998341565
9264562315665
7887658
3938322845428
3163116107
1241558638
2251151142960
6740536540302
579386399392
323346039530
6266117594543
19747768557403
26971655635
15135528896
1381043258970
9827232871
1998709798862
947303643
835417...

result:

ok 93161 numbers

Test #57:

score: 0
Accepted
time: 393ms
memory: 193636kb

input:

200000 200000 0 8
]])]))))]))]]])))]])))]]))]))]])]]))))]]]])]]]])]])]])]]])])]]]]]))))))]]))]]))])])]))])]]])]))))]))]]]]))]]]]]])])))]))))]]])]])]]))]]]]]])]]]]]]]])])]])])))))]))))))))]])])]])]]))]]])])])]])]))))]]])]])))])])])))]])])]]]]])])])]]])]])]]]])))])])]))])))]]]]]]])]]))]]))])))]])))])]...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 93338 numbers

Test #58:

score: 0
Accepted
time: 476ms
memory: 154004kb

input:

200000 200000 0 8
[[)()]])[])[]((()](((]((]]][([(]][(([[)[))())[[[)[[](([()][)[((]([)]][)[]((](([))[(](([]][]))[))]]((()]][)]()]([]](]()])[(](]]()()(][]((][[([))(])[()])(([((]](])(]][)]][][)()[[(([)][))[([[()]()[)(](](]()])))[)])())[([)]((]()[(()]]][)[]]([]](])((][)[(])((]())[[]())([([)([(][]])[()((...

output:

668097
992312
1633325
3267336
1497359
4863035
2597670
76455
4216865
1376543
451572
97463
1922207
5028595
8635
1170753
567533
1733290
4884474
2643920
2507151
1427449
1921
52129
93301
3348347
760946
589
178045
1158581
1514997
2709877
3036412
3130327
3500562
1436019
1267829
2480750
1380461
1999807
1562...

result:

ok 93329 numbers

Test #59:

score: 0
Accepted
time: 441ms
memory: 174984kb

input:

199981 200000 0 8
]([(([[[[[)([(])((((])([[][(([([((([]][((][()((()(((][[[[[[())(([(((([[[[[(][([([([[(([((([)[[](([][([)][[((([((([([[[([)[[)[[[((][([)((()(([[[(][([)]((([(([([[(([[[((([)(([[)([)([[]([[(][(](((][(([([[]([[[[][([]([([([]((([]))[(([)[[(((([(]([)[(][([[[([[[([[]]([[([)[[(])([[([(([[()...

output:

38579195
1944
15384883
768
2188
377773794
105885819
11963190
939464
45842834
1067
100394483
2409
4190
2124
455271764
9873
345738281
10351
3537
20
2016
10249921
858
633
935
334672614
1276
4616362
534283627
49
11760691
2889
70196974
2874
7972
3704
41590
212583244
131553772
5286
14830
59
141429383
4155...

result:

ok 93183 numbers

Test #60:

score: 0
Accepted
time: 458ms
memory: 167872kb

input:

199989 200000 0 8
)]][[([([]()[()[[][([(((][])[([]([([()[(](()([]((([[[(([[(()[)]](([(([([(])[[][([[(()]([[([][[[(([((](([([]]])[([[(](([([]])](([[([((([[][)[()(][([)((][((()([(()))([[)))])]])[(([)([[[(([()][[)([([[[)())([[]([[[[([[())]](([(][[([]()[[[[(](([(][[(([[[[(([]]((([[[[[[[[])([[][[()]([[[]...

output:

255506661
451582432
10290
4255
7107
59158342
9767
8254
5751
506370134
31153142
621933279
4860
136056777
4704
84755
181389589
989
11086
127
249495737
11327
8133
59077938
2057
163965794
103
116390316
125074819
15640
80212750
507062648
166517556
350490
5121848
198589633
104446182
30672010
9720092
24587...

result:

ok 93400 numbers

Test #61:

score: 0
Accepted
time: 455ms
memory: 159980kb

input:

199974 200000 0 8
]()(([(][[[))]]([]])()])]][][)]])[]])([](((([]]]]])]))([[([))[)[[[[()[(][([[([((][[[))([([[[]()]))[[([])[[])(([([([(][]][()())(([])]])(]([[(]))]]((([(((([])([)[[((()))](([[)(([]))]]))[[[[([)))[]]]((])))]]()(]([[]]())(((([(][[[[(()](([())[(([[()[[(([()([(()[]]]]][))]())](([(][[[[([[...

output:

14758
88826610
80051
23947
39586
43572
28197
296846494
17617
53390
141721426
12509
31315
42088546
307584979
7110793
215601
4252147
331859495
52586155
327980052
40371715
1461
72098
16863027
1884
25668734
10841
87503
27424
16313477
26144
47011
65755
19862
32202493
9848537
73789
19150132
11180758
13047...

result:

ok 92831 numbers

Test #62:

score: 0
Accepted
time: 447ms
memory: 151428kb

input:

199980 200000 0 8
)[]][([]([][)])]((([()(]))[[((()][(]]()()]((]])[[[)])(()))[][()]()][[])[)]((]]]((([[()(())[]][[)][(([[])][[([[))()[)[))(()))[[)]](][(())[]]()()][[()((((()])[[]()))[[[(])[]))()][)[[])[](([())][]))][[()](])[[)][])[[[((]])()](()][(([[[)]]()])]((])(())(]())(([])((([]][])[()][])](][[([(...

output:

1209364
976721
135626
606007
741151
269068
2054473
1253634
85004
85251
801175
612281
87262
403217
1431918
254263
440008
92283
754388
265364
1299045
1319014
1323
2030608
657345
1204205
572495
95680
616877
857866
1849986
1451488
133761
195205
103065
30595
509492
1575407
319981
1257083
1149613
1687671
...

result:

ok 93422 numbers

Test #63:

score: 0
Accepted
time: 467ms
memory: 152460kb

input:

199992 200000 0 8
][[[[([((()][[[((]])([([))][([()])[[])))](((](())]]([))())]()(([([([(())](]))][(])]][)[([)([])[[(([([[()[()[([)(]]][[()()[)([()(()]][((([[[(((]][[][([[))]((([([[[)))))]])]]])))]]()][)]]][(][[[[[])((]]([[(](])[[])](])])]())][(]]))[]])[)]]())][)]))]]))(]](()[[((]]((([)[[[()([([[[[]])...

output:

21808
472565
5997
691613
239507
2710078
219882
9103896
11566834
106358
449396
442137
136887
18789707
21237790
732023
15065
31215417
234625
23324540
135101
6608294
872463
376087
609489
20042168
5538138
727711
950101
2450636
418762
329940
12619744
49118
137701
52474
272087
216734
101042
306045
3388340...

result:

ok 92911 numbers

Test #64:

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

input:

199984 200000 0 8
]))[([][[()[([[]([](]()])]((])[)]][[]]])]]][)())[[[(][()[[])[(]][((])((([])(]][](]]])]]((([)]()]))[[[][))))[(([][[[]]()))[([[][(])))(([[)()))][]])][(([][([[(](]]])(])]([[)]]]([)](()[[()]()([[]]([[]][(((((]][([[(])[(())))])[)([)]]((([()]])](([([][][]])())])[]]]))[(]])))[[[)][)([([[]...

output:

4610736
21634
122838
232951
20796
19324660
622576
5355688
89384
2601764
19268718
828997
660149
124368
2928370
270400
1838119
459319
19348759
2022731
14281663
10639
11653392
145407
154096
6215465
1863397
812893
942518
92442
1136
3511528
5952832
3296315
176170
642335
209586
46339
20371008
211097
58476...

result:

ok 93323 numbers

Test #65:

score: 0
Accepted
time: 467ms
memory: 155932kb

input:

199988 200000 0 8
)][[](([[([((]](((())[(][[([[[)])]]][[()[()]((((([[[((](([(]][([))(()([[][)](]())](]))]]))][]))[]][)(]())()[()(()])][())]([[][[()([)])]))[](])())])()[))]]][[]][([[([][(([([][[(([)(])]][[][(])][(()[)])))][[][])][(]))]]([]])[]][]][(]))][)))(])(()]])[(])[((][[([[([[]]((]]][(]])][))(](...

output:

12714
494820
3038843
663962
2656626
2172597
127143
3053886
3074601
3050715
145711
2730241
574981
83722
2305694
1020123
192911
246653
92123
4696199
153990
4120986
7117413
222148
2693848
2798290
9199213
16728187
4020307
7622760
5857772
4207019
4205915
513909
15641743
387971
3750819
3844893
3656979
424...

result:

ok 92870 numbers

Test #66:

score: 0
Accepted
time: 463ms
memory: 156308kb

input:

199989 200000 0 8
](])[(]([]](([[[))[]]][[([())])[)])[((](]()([][(())]][))[[[(((][()][]](()(])(((]()]())())](())[(([(((([])))()]]])]](())])(([[[(]))))[[([(([((([[()[(])]]])][]))(]][)])](([()))]][([]][(([[)[(]])[((])][[)(]))))([[(([[])]][[([([[)])([[([([([]][(([[]))]([([[[[]]][[([]([[)([[((([[]]]])([...

output:

162929
6775645
1822269
519987
2608760
719471
102577
1244683
1782721
366812
2417607
2091257
3048925
6493393
1246275
3121121
1025757
1504162
421047
608056
3132281
63726
1681039
4928416
3235300
1879916
1194772
1750430
664656
2629348
3852
459115
264720
240446
6909626
3299436
1351768
3545794
1379129
1870...

result:

ok 92827 numbers

Subtask #9:

score: 20
Accepted

Test #67:

score: 20
Accepted
time: 337ms
memory: 151508kb

input:

200000 200000 140644911 9
[)(][)[][](]()[][](](]()(][)()(]()(][)[)()[)(](][)[][)(][](][][)()[)()[)()[]()[)[)()(](](]()(][)(]()(]()[)[]()(](]()(][](][)()[)()()[)()[][](][][][](](](](][)(]()[][]()[)(][)(][)()[)[)(][)(][][)()[)[]()[][][][)()[)(](][][)()()[)[]()[]()[](](][)(]()(]()[]()(](][)[][)[)[)()[]...

output:

18697691819075
26498508085
429495221918
1435012224390
15557191723334
178288170263
38901757246
366395497565
9724384651179
6853450690273
9689783931507
152146872833
48565363837
9709644886297
6913016471167
1768718795
8421224619
2442185623274
599981476135
2910644455414
6772349579947
272876829695
63348745...

result:

ok 93023 numbers

Test #68:

score: 0
Accepted
time: 391ms
memory: 195900kb

input:

200000 200000 601556384 9
)))]])])])]])]]])]]]]])))]]))])))))))]))))]))])]])))]])))]]]))))])))]])))))])]])])]]]]])]]]))]]))])]))]]))]]))])))))]))))])))])])])))]])]])]])))])]])]]))])))]]))])]))]]])))]])]])]))]])))])]]))))))]))))))])]))]]])]))]))])]]]]]]])])])))))]]))))])]]]]]]]]])])))]])]]]])))))])))...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 92580 numbers

Test #69:

score: 0
Accepted
time: 471ms
memory: 153924kb

input:

200000 200000 46463662 9
[][])))]])])[[)[(((([[]])))[[(]]][[](][[)(]][()([][((]]([[(([][()(]))]])([(][)((()(][))))]([]]]()[)(]]][[[))[[()()[(()][)))][)][())[))(][))])(]]][(][((][])[]]))[)[(()((]]([]])]((([[([[()[)([[)]]][]][[)[[])[(()])[)(((()])])]([](])[)([([])))[(][]()]]([([)[()))([)[([))([]())][]...

output:

1574935
2234560
13556535
609296
17165635
1590783
1836952
164349
1185736
12534762
913079
732288
5475
12185679
11283949
219034
4672318
12229915
2046215
2269939
1508810
12535100
28379
397401
16802144
289756
698051
1041786
13438782
118773
3036094
18301
320390
796803
18254878
2565932
773007
349762
418758...

result:

ok 93349 numbers

Test #70:

score: 0
Accepted
time: 421ms
memory: 172892kb

input:

199985 200000 447123642 9
)](([[()([(]([[[[[()[([])[((][[)((([(()(([[])([()[[[([[((([[([([([][[()([[)]((()(([[(([(][([[[[[([[([([]])])([[[[[(([(])(([([[[([([[(]([]([)([[[[()[[[[([[[([([]][([(([[[[))[[[([[]((()((([((])[[(([[[((]([[([(]][([[(][([[[[(][[)(([[[[[([()]([[[[[[()])]))((((([[)[[([([[)[[[(][...

output:

1960179
985214602
252094265
2232
7487
9006578
56110506
2037
151633297
134
258517551
2497349
2790
189312402
17347558
5601789
182038287
118928611
422
43961814
71
7359
9726
1723
146
40211983
387357
309635963
5349970
3056
5634
12013087
520
238117706
3911
229
7578
4380
94364572
3520
2226
12713322
2031
28...

result:

ok 93459 numbers

Test #71:

score: 0
Accepted
time: 447ms
memory: 171660kb

input:

199996 200000 4571821 9
](([[[[])))(([))(([[()(((])[()][([[[([]([(([)((]]]([[[]([([((]]][[[([([((())]]][[[[(][[[[)]((][[((((][((([[[[[([[[[[[))([](((([([[][[[)[(([]([(([(])[[]([[([[]()]])][[[([][()([([][(([(((())[[((()(([(][]))[[]((([[([([)]](][[[[)()(((]]((([([[[)]]))[(([][[[[[[[[])))))[((]([[][[((...

output:

36741261
46029418
2404
597949805
9904
7824291
1533
439931947
14518
1276
433726163
8061
797368794
253911734
572
9619078
4534
26489298
5960
4208340
2762
502
10387
172552368
679
2485
3088677
129
184311261
20212
9716
12590424
98029233
35987225
1194
2616233
55113437
322
19134
530016975
9898
416399
187870...

result:

ok 93566 numbers

Test #72:

score: 0
Accepted
time: 450ms
memory: 159900kb

input:

199983 200000 301578106 9
)())())[([[)([][)((]([))([(](]]]]])]([)((](()])]][(([((])(([]]]]])]((([(([([()([(([[[[[[]](())))])[[)]([([([()][[(]][(])[]]()]]]][([(])]([[((][[(])](([]([))([[(])[[][(([[[])[(((([(]][)))[[(])])](()])[(])][[([[([))()]))([[[[(((]))()[[[][((])]])]][](]([[(])[(([()])))([][]]]])...

output:

43886
52058314
21716
8351795
15073
87691662
59784
45864520
7614565
127716771
22697477
17540327
1268479
5348366
31319
99578
9260548
19118284
30367652
293749247
3440407
13364
15242
7307
72582157
6338
34382
30770
23744
48135
184618139
43952
54017
63131551
13609
35140
54510
48925
37428085
54392
27170
52...

result:

ok 93159 numbers

Test #73:

score: 0
Accepted
time: 413ms
memory: 151436kb

input:

199988 200000 165352944 9
)[))([[][[[]][))[)))[))(([[))[[(])]((([[[(()))[[)[]])(([)]())()][[[)()]](((]][)][[][](]][([][))()]([)]]([][]()))()[([][]][)](]][()(((]]()())[)([))][])[(()]()(]()[])([[[(]]][(]])][][[))][[(](([][])(([])][[[])]([)]([)])([()[])(((]))[(]](]][[)]([[[]])](]()]((((]())[)[())(])[()...

output:

956695
718082
20131
310446
1677569
749081
202139
1735804
2115839
33084
1269909
2630
83125
781088
548955
1709662
490279
665391
1953665
241265
523396
2056435
1494934
207984
1341927
1762103
39940
687593
891236
1812776
132721
710758
1001670
793587
130016
1615127
18583
1319632
1021610
1438365
267734
1052...

result:

ok 93121 numbers

Test #74:

score: 0
Accepted
time: 420ms
memory: 154664kb

input:

199989 200000 648272145 9
)]]]([)()]]([[(]((())]([[[(][([[[[((])])((((])]))((]][)](([(())]())]))[)])][(][([]]())([(((([)(([()[([)][[))(([(((([([[[((([][[[[()(((][[())((((([())(((([))([[)))]]([[][]]])](])(])((()[[(()[[[[])[[((]])[([]([))]]]][][(([([][[)][)]()][]))(])])[)))](()[[(([)[)]])])]())[[)]]]]...

output:

257038
221441
494519
4657260
7098453
2257178
23521151
6096143
5860512
2123838
18419
5884615
10500480
12257572
294765
815194
735041
198491
648036
2580397
855321
5800710
1850534
4291660
493318
10285
47697903
19820161
20575943
20932044
18350784
636338
1566981
405799
61354
3441
273729
8969796
5985967
11...

result:

ok 93231 numbers

Test #75:

score: 0
Accepted
time: 425ms
memory: 152188kb

input:

199990 200000 498413771 9
][([(([[[[[[[[([([(([[]][[[))(])[[([[[[([)])))](]])[([([)))))]())][)))][(()][))()]]][)][[(]][))]])]]()[[]([]((][((([[)])]]))([[]))()])])][([[((][)])[([])]]))]]])][([)[([[])]()]][)(([[[(])]])[])])([)()[)][]([[]([[)[[[]()]]]]]](([[([))]](]]((]])[]()]((]))[[[[(])]((([[)[[[(())...

output:

497550
487813
1332692
959807
131673
1727932
1038993
32299
995019
3701803
1946160
43418
305230
1074103
252209
598038
351903
110693
144619
885404
7100703
26750
7715518
1691202
137953
298251
583825
316975
1221762
533788
9923830
18456
646365
582878
3545463
1209028
279160
26963
1219982
2573431
13605
3692...

result:

ok 93265 numbers

Test #76:

score: 0
Accepted
time: 447ms
memory: 152168kb

input:

199988 200000 275957053 9
))[)(]][[([((][])])(([[[))])))([]]))]([(()))[))]((()([(([)]]][[(()[]]]]][((()[]([((])]]]((]][[]][[][([[(()]())](]]][]))()]]([]([])][[()])([[(((()[(]))]()]([(]]((())())([)]))[))]()](([([()])()))[[([)]((())))[[(()[))[])[)))]]((((([(()](][[(]([[(]([)])][(((()[]][](][(]]))[[[(]...

output:

19315
2032288
14353
2600842
6164270
1655535
217643
3750401
1151773
740016
3859586
59559
2006982
2294295
1425150
7153194
3086159
272364
3576483
39165
36042
2769832
2315633
416
3634668
328103
853790
16859
256893
721355
2090993
12961785
4815191
2865750
1631464
74401
406921
4798326
7526649
305687
320555...

result:

ok 93485 numbers

Test #77:

score: 0
Accepted
time: 433ms
memory: 154152kb

input:

199990 200000 331642569 9
]([))([((((])(]]([[][])][[[](][])[[)]]][[([]]((([([]][]]]]()](])[([[]([)))[[)])(())[]])[([(])[)([))][([])([))][))[[[)))][[[([[(]([][(()](]([[[(](]]((])][[[()]]]](((][)]([[([[((([([)[[)))](]))]))])][))([]]])))(]()][((]][[((()))[[))]]]]]]](]])[[))([)]([]]]([[])[]][[][))[()[()...

output:

11994652
2070626
1214927
4401114
1726353
512114
486206
5558813
4662481
2325015
8222049
663320
740383
3187658
515068
772738
2203553
2338729
89249
7473666
293295
2238808
4217119
713514
3551928
5557334
1260761
744450
5496979
5199779
1093580
273600
360980
508169
1275043
1827711
910944
12271007
684089
22...

result:

ok 93241 numbers

Subtask #10:

score: 25
Accepted

Test #78:

score: 25
Accepted
time: 1328ms
memory: 170664kb

input:

499994 500000 310578674 10
][](]()(]()[][][)()(](][)()[)[)()[][]()(](][](][)[)()[]()[]()[][][)[](](][]()[)[)()[)[][](]()()[)(][)()[)[]()[)[][]()[)[](][)[)[)(]()[]()()(][)()()()()(]()()(](][)()[][)[][)[)[)[]()(][][)[)[][)(]()()()(]()[](][]()()()[)(](][]()(]()()()(][][)()(]()[][](][](][)[)(][][)(][)[]...

output:

5666953052
3898723050
1066754363
7550335810
2297041368
5165429746
11588390091
8189199941
8318362610
4223062767
2330857155
1270491655
540465757
6048619540
464381185
3738232474
5093932467
16107263318
3635567930
6624765932
3480296262
12071685675
6441199547
886293387
2571629578
5304167036
7347742390
895...

result:

ok 499935 numbers

Test #79:

score: 0
Accepted
time: 797ms
memory: 174480kb

input:

491982 500000 662804743 10
)])))))])]]]]]]])]]]])]]))]]]]])]))))]))))))))]])]]])]))]])]]]]])))))]])))]))]]])))]])]]])))]]]]]]]))]]]))]])]]]]))]]]]]]]]]]]))]]]]]])]))]])])])]]]])))])))]]]])))]]]])])])]]]]]))])))]))]])))))))]]))))]]))])]]]]))]]))])))]]]))])]])]]]]])]]))]])]))])]]]))])]]]]))])]]))])]))...

output:

68693743
13476709
112569914
7222566
79177898
77731193
2714866
110928099
25997247
93063572
70362658
36484393
111059407
34384351
35962165
1478201
10331675
229037
29825164
96752669
83158520
1058220
20893477
80749995
102263362
124898581
7272608
95432123
35549751
4488781
6391454
96369138
34158
36028799
4...

result:

ok 499948 numbers

Test #80:

score: 0
Accepted
time: 1134ms
memory: 170512kb

input:

499996 500000 816402420 10
](][][)(][)()()[)[]()(][][)()()[)[)(]()()[)[)[]()[][](](]()[)[][](][]()[)(]()()[][][]()[](][][][][]()()()[](]()()[)[](][]()[)()()(][][)()()()()(](]()()()(](][]()()(](][)(]()[)[)(](][)[)(][][][)[)(][][][][][](][)[]()[][)(](][)(][](][][][)(][]()()(]()[)(][]()[][)[][)()(]()()...

output:

1242058
367563355
2998539210
2833022334
878724464
3093499327
83931649
399423975
2007020354
6350245541
2349471356
2786216000
5071457763
756539177
2919755042
1095502386
337725187
1250347529
4015387532
75163352
2888274390
3452339258
4735346330
219551794
249455920
2132794630
85174479
916837109
255175876...

result:

ok 499939 numbers

Test #81:

score: 0
Accepted
time: 1066ms
memory: 168708kb

input:

499965 500000 109682061 10
)(]][()(]])[([][])(()[))))[([[)[])[[)(]])[[()(]]([)()))))[[([[)[]][[][]])(([)[]][()[]]]][([(]())([)[]))[[(]()][[)[))))])([[((()[]][[)(])](([]())((][]])](((()[))(()(]]]((()())([)(]))])(([[[](]]([][]]]([(][])([)[]]))[(([)(])[(][))]([(]())[[)[])))))][[[([[[)[))[[)())](((]()](...

output:

284052
1029253
84128
952088
31442
1334883
266255
200855
382118
450383
896401
90439
58399
575502
119338
128129
1208586
1226032
1171552
430241
1024469
808248
460909
569072
310364
292615
1187325
981237
157941
199319
604645
1450476
613370
1542242
272266
1126636
542808
669289
752366
379721
586193
107423
...

result:

ok 499938 numbers

Test #82:

score: 0
Accepted
time: 1367ms
memory: 167924kb

input:

499994 500000 678510410 10
][](][][)(]()(][][][][)[)(][)()[][)[)()(][)[][][)(][)(][](](]()()[)[][)[]()[]()[)[)()()()[)()[][][)(][]()(](](][)[)[](](][][)[]()()(](][)(]()()[](]()[][][][]()[)[)(][]()[](](][(]()[][]()()[)[)()[)[)[)[)(][)(][)[)[)[)()[](](](]()[][)(]()(]()[)[][)[)(][](](]()(][)[][][][)()(...

output:

1448049646
349638918
5136950296
1230322979
7241672369
6643013325
419010757
1298055153
41632862
7625826391
1737290251
225610607
12530107344
7186410453
3044717737
517326921
46376746
2235705210
269628493
7085847989
7979976025
5421457222
1003506055
10896446725
2085742308
904999513
5056706430
1059486416
...

result:

ok 52 numbers

Test #83:

score: 0
Accepted
time: 1480ms
memory: 173704kb

input:

491982 500000 954608059 10
]])]])])])]]]]]]))))))])]]]]]]]]))))))]])))))]]]]]]))]]]))))])]])]]]]]]]]]))]))]))]]))])])]]]]])]])]]])])]])])))])])]]]])))))))))))]))]))]])]]))]]))])])]])])])])))])]])])))]]))]])]])))))))))))])))))]]]])]]))]]))])))])])))]])]]]])]))))]]]]]]))])]])]))]))]]]))))])]]))))]]]))...

output:

71544955
66236105
56793998
13200609
17560309
25600936
75367570
94619922
31914332
129361433
130024665
87240653
38282049
47826532
113319088
44229255
10586620
71321275
105259448
32015033
13555445
103524798
8476949
261372
16415395
13318563
15150141
118920335
13220504
8390322
9751277

result:

ok 31 numbers

Test #84:

score: 0
Accepted
time: 1479ms
memory: 170964kb

input:

499996 500000 614268334 10
)[](](][)[][)[)()()[)[]()[)[)(][)()[][)()[)[)(][][](](]()(][](](][)[)[]()(][)[][)[)[)(][)()[][)[)[)[)()[]()[](]()()[](]()[)(](][)()[]()(]()[)(](][)([[(([([([([[[[(((([(((([[[(([[([(((((([[[[[([[[([[(([[((([([([[[[(([([[[([([[[[[([[([[[([(([([[[(((([(([([(([[[([[(([[((([([(...

output:

66983476
5054543086
171741482
4987226440
4624543710
381492801
874978245
914925863
621251234
335642592
1927724094
1525277442
536727030
5667508456
104413512
930265860
2024410013
4475468616
671500461
2196644
3084090219
2225425030
3995686705
1431052956
2176560676
2399123306
166422061
2171163054
11025860...

result:

ok 45 numbers

Test #85:

score: 0
Accepted
time: 1376ms
memory: 169424kb

input:

499965 500000 371096815 10
)(])[()(]])[[(]()](()[))))([([)[]](()(]))[[(][])[()[)))]][[[[()(]]((]()))[(()()](()(])]](([()[])[(](]))[[(](]]([)[]]])]]((((([)[))([)[]])[[(]())(()[))])[[[[](]](()[]])[((][]][()[)]])][[[(()[]][[]()])(((][)]([)()))][[[[)[)][[)[))][[()())[()[]])]]]][[(([[[](]]([)[)))[(()[]](...

output:

929339
212608
282361
109798
1255447
379822
626748
1052519
243766
247791
956887
106540
1255631
976871
1379240
52413
128047
1053412
759
562550
239842
806904
94914
161323
430477
1126936
1543888
352213
1178684
652652
820894
571997
526529
179392
858294
912581
28831
336476
188609
1468034
189119
59956
9858...

result:

ok 46 numbers

Test #86:

score: 0
Accepted
time: 961ms
memory: 165316kb

input:

500000 500000 760902024 10
[)(](](][][)[)[][)()[][](]()(][)()[)(](](]()()[][)(]()()(]()(](]()[]()[)()(][)[)()[](][][]()(](][)(]()(]()()(][)(]()(](]()(]()[](][)(]()(][)()(](][][](](][)[][](][](]()[)[)[)[)()()[][)[](][]()()(][)[][][)()[)[][][)[][)[)[)[)[](](][)()[]()(][)[](][)[]()[][)[)[)[](]()[)()[)[...

output:

15232494616
2939044799772
345407516089
301355577731091
21569042216
8413461999524
7336814975486
6898428141496
129506688359848
1473295162873
83922563178537
38976731440819
129947102761
18865404038420
91936264981477
224922925359
38767620807866
1508858658701
7844984471273
92263919438507
3791859960872
113...

result:

ok 233288 numbers

Test #87:

score: 0
Accepted
time: 1106ms
memory: 269140kb

input:

500000 500000 482921576 10
)))]))]])]])])]])))))]])))]))])])))])))]])]]])))]))]])))])]]]]))])])]])])]])]]]])])])]])]))])]))]))]))]])]]])]]))])))])]])])]]])]]]])]]])]]]]))))]))]]))))]]]]])])]]))])])])]]]]]])]]]]]))])))]])]]]]]))]])))))))]))])]))])]]])]])]]]))]]))]))])])]])))])))])))))))]))]))))]]]]))...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 232742 numbers

Test #88:

score: 0
Accepted
time: 1403ms
memory: 167860kb

input:

500000 500000 959272724 10
)[()]][))]]]]]][(]]((][)([())(]])[[(][(](][)(()((]([(]([[][()()(])((()]]([()([][)][[[((]])))))()(((([(][[(]])][(([[)))[][[]()([(([[[[([)](])](])((()][]][(])[]])](]](()[(([])(([(]([])]((])(()[[((()][([])[]]([[((([[[(])(]](][[)(][)]))()([)()((()]()])[(()(])]]((]]]]]](]()]))[...

output:

5440244
2139325
10509348
8018724
3541031
1811980
5090885
4154187
388483
5704562
29597457
10255041
6080406
5303430
39218177
3009364
668
4739012
4845175
37576417
35045875
42544824
1419460
2056102
3264454
3920446
9510903
1007434
12462254
4685152
3697512
15022702
249016
16011263
2001235
1533030
4854291
...

result:

ok 232691 numbers

Test #89:

score: 0
Accepted
time: 1334ms
memory: 224712kb

input:

499992 500000 557888985 10
]][[(][[([[([(([((([[](([[[([[([()((([([[([()))([[[[[[][([()[[)[(]((([([(((][[[][((((]((]([]((([([()([[])([(][[]([(((])]([[()([([]])[(([)(((()])([[[[[[[[][[((([([]([[[(((([[([(][[[(](([)]([(](([][[(()([]([[(([[]][[()[[][(((())(([[(([)]((([([([((((]]])(([([]((([[([())][[[[(...

output:

212458382
1247
191489229
4219
8620
1765134752
103
547
7953647
14839
7232
23887
11065
472154998
3294
12518
2517124648
11560
7368
3190488261
8182
6340
7136
371066258
256818694
14017664
24749616
641449291
9723
8460
368864295
1727909269
741290716
2032
17619416
3181287781
489733716
5019
1741491106
11906
...

result:

ok 232509 numbers

Test #90:

score: 0
Accepted
time: 1278ms
memory: 208440kb

input:

499993 500000 717592996 10
)[([])[([)((()([([(((([((([))])[[[[([[[([(]))[[[((](()[[[([)][)([(][((([[][[)]]([[](((()])((([(([()[(([[[()([()[[([[[(()]((([[()((](()([([))([[((])([[[))([][[([[[[(((((((([)(([(([([))[([]]((([([()[([)))][([([[((([[(][(])))[[([[](]))[[([[(()](])[[([)([([([((])[[())[[[[]](((...

output:

29445
3299
16971
43945
31548
32198504
867088751
2172
2056366174
4315868260
9796
2333941114
31201
11335
203446196
1361329488
174375388
1635763755
81353668
7334
2803789835
10488
50637
5801
404367669
3936022690
14257
26433612
13400
20805
32550
36436
146654126
6587
3285884994
2934996850
1149529706
18912...

result:

ok 232794 numbers

Test #91:

score: 0
Accepted
time: 1332ms
memory: 185344kb

input:

499991 500000 363800529 10
)[]([)[[(()[()[([))))])[[)(]]]]][[[(])[]]]([]([[[]()](][(][[((((])]))(([(]]([[[([((([]([[[[(([[)([([([))[(][]))]()][](])([]([][[[]])[))]])[)])[[([)[])]))[])])]](]](])][][(])[][)]))([((]]]([)(((][[([(([())][)([[[])))]][(()(]]([[[([)([([()[([]][[)([[(([()[][[()([(((]))))([[)...

output:

170600148
105766
17312
1387671263
28278
9644
169838
237401
666212541
137208679
34236
138425
228372211
17918961
229663214
1598318539
843210455
124589467
109430
2148329118
11218
722828
145869
92608
149434020
24688
82730
200177134
75313
16182
43520
116542160
240670504
1499658435
190958
673901970
140689...

result:

ok 233204 numbers

Test #92:

score: 0
Accepted
time: 1340ms
memory: 166560kb

input:

499982 500000 686974885 10
)[])([()]]]((([[()][]])([)[()[))()[])(])[[([()[)()(]][]([])])(([(])(]][))())([(([)]](([()[)]([[)][()]()[(][]))][)][])([[([)[()))()())()]())[[)]][[[(]]))([[)]([)]()](()[)()]([([()]))]([]()()][))([(]]][[((())(()])[[(]))()(][)))[[)](])(([[(()()[)](())[([)[(()]]])]([(())[()(()...

output:

677191
654452
49346
726430
3338816
890443
1255446
386039
3596066
4242706
2723585
2797764
4886210
1941120
2454197
2402354
760504
2258916
692982
2386681
2597244
504123
774594
2669348
2705926
1542543
1891148
1106299
5059658
759252
984526
1644563
2231282
5370861
965074
4385551
3367899
3503330
1643158
29...

result:

ok 233489 numbers

Test #93:

score: 0
Accepted
time: 1321ms
memory: 171956kb

input:

499987 500000 820009191 10
)[)]][]])(([)])[(()]])][[([(])(]]((]))[])[(([[(([())((([()]][[])]([(([(([(]([[([[([)][)))]([([[([(([)))(])((]]][][())]](][([((([])[([[)))])(((())]([][)])][((((]])[[()]([])([()[[[([((([[))]][)]))][[)][(]]))[[]][])([(([))(])))])]]]([[([(]([][)())])()())][))))]()])])]]][([)])...

output:

2535044
1904411
74597246
82920208
2727
46880532
1005171
1653367
40767
34602754
846078
1053741
493537
2322831
2432014
2111473
13726183
19920797
1682378
671674
27873527
26406154
2681905
420155
2051051
110385777
1880050
392765
2485998
1959947
1583483
5500339
1085454
1200767
19482169
2484243
1004002
282...

result:

ok 232956 numbers

Test #94:

score: 0
Accepted
time: 1412ms
memory: 172764kb

input:

499992 500000 537476402 10
)]([(]([([[))[([[)[)(]()]))]((((()(([[()][()))(((])([)]((([))[[(([(])[([[(((()]()](](]]))[]]][((()()(]]((]])]))][(([[())[[[()([[(]))(][[)([(([[[(]))]]([(])))))[([()))[])[(([])[[([([([((([(()([[(([])))(]][(]()[(()(([())(]]))]([[([([[)((([(][[[][])]())[[[]]((][(([)[]][))))]]...

output:

441511
62614774
26241633
125370
244072
2516059
4942637
1882803
4572493
3974491
5728609
534707
2307517
4156132
188735
1512771
72041317
818236
25626675
693457
67974950
1368053
463754
66639738
6129180
2977897
10234095
262581
115137613
572173
120649046
52996174
24145125
16384582
689961
13966182
1461233
...

result:

ok 233242 numbers

Test #95:

score: 0
Accepted
time: 1374ms
memory: 168820kb

input:

499990 500000 175938725 10
)((((]])())])))]([[)][])[[)[(([[]][))[[]][(](]([[()))((([[]](([[)][[())]([[[[((())](())]]](][)[([]]])]])](]][([]](())[((([[)(((]([)((([][[[]][([)([]))((])])]][(([])[))]])]]))([(([]([)(([([)[(([[([((([)]))][[)])])[)(([[[[[)())([([[(]]))(([]]([[)))][[)]][))]([([([)((([[]((]]...

output:

6707273
18370545
6144113
7060761
390288
953471
4009706
35491744
1279304
334232
28284287
8920814
600715
28983462
4164991
12661408
60753
3994111
7138893
3617893
14326678
16306105
41419045
1041099
9260346
4059829
30333099
226394
4783220
296205
96871803
8254879
360586
474429
24093863
75902976
11081256
6...

result:

ok 232320 numbers

Test #96:

score: 0
Accepted
time: 1370ms
memory: 172704kb

input:

499989 500000 577693735 10
)[([([(([]]](])[][[]))(][([[[([[([(()))]())]())((](]][]][)[[[[))])])][[[])[[([[)[)[((()(([)([)]])][)])]])])[[(]])])]([[[[)])[][[(])))[[([[[](())([)](][()[]))][()((([[][(])())([((((]]])(])[)]((([(]([[]([][])][]])][]))]]]]]]]]][[[)][]))((((]][])(([[[]][]]([)(([]]]]))))(]](([...

output:

15850699
10269442
6714668
11641675
3836154
9341455
6914917
6223815
14053666
6496215
31753670
3434015
70576899
37406793
19666110
21788275
20702203
41494414
339523
137088
26897420
1151542
9284884
10077554
438383
6579764
19870596
6210111
9165638
4948582
6459514
2516536
27110792
55184401
16416031
750553...

result:

ok 233046 numbers