QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#295427#4824. Bracket-and-bar Sequencesucup-team2045#AC ✓7ms3556kbC++142.9kb2023-12-31 06:10:592023-12-31 06:11:00

详细

Test #1:

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

input:

encode
3
1
(|)
4
((((|)|)|)|)
5
(|(|))((|(|))|)

output:

0
70
162

input:

decode
3
1
0
4
70
5
162

output:

(|)
((((|)|)|)|)
(|(|))((|(|))|)

result:

ok 3 lines

Test #2:

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

input:

encode
1
1
(|)

output:

0

input:

decode
1
1
0

output:

(|)

result:

ok single line: '(|)'

Test #3:

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

input:

encode
3
2
((|)|)
1
(|)
2
(|(|))

output:

3
0
2

input:

decode
3
2
3
1
0
2
2

output:

((|)|)
(|)
(|(|))

result:

ok 3 lines

Test #4:

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

input:

encode
1000
3
(|)(|)(|)
3
(|)(|(|))
3
(|)((|)|)
3
(|(|))(|)
3
(|(|)(|))
3
(|(|(|)))
3
(|((|)|))
3
((|)|)(|)
3
((|)|(|))
3
((|)(|)|)
3
((|(|))|)
3
(((|)|)|)
4
(|)(|)(|)(|)
4
(|)(|)(|(|))
4
(|)(|)((|)|)
4
(|)(|(|))(|)
4
(|)(|(|)(|))
4
(|)(|(|(|)))
4
(|)(|((|)|))
4
(|)((|)|)(|)
4
(|)((|)|(|))
4
(|)((|)...

output:

4
7
8
5
9
10
11
6
12
13
14
15
16
28
29
19
34
35
36
20
37
38
39
40
17
30
31
21
22
23
41
44
45
42
46
47
48
43
49
50
51
52
18
32
33
24
53
54
55
25
26
27
56
57
58
59
62
63
60
64
65
66
61
67
68
69
70
71
126
127
83
150
151
152
84
153
154
155
156
74
132
133
89
90
91
171
174
175
172
176
177
178
173
179
180
...

input:

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

output:

(|)(|)(|)
(|)(|(|))
(|)((|)|)
(|(|))(|)
(|(|)(|))
(|(|(|)))
(|((|)|))
((|)|)(|)
((|)|(|))
((|)(|)|)
((|(|))|)
(((|)|)|)
(|)(|)(|)(|)
(|)(|)(|(|))
(|)(|)((|)|)
(|)(|(|))(|)
(|)(|(|)(|))
(|)(|(|(|)))
(|)(|((|)|))
(|)((|)|)(|)
(|)((|)|(|))
(|)((|)(|)|)
(|)((|(|))|)
(|)(((|)|)|)
(|(|))(|)(|)
(|(|))(|(|)...

result:

ok 1000 lines

Test #5:

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

input:

encode
1000
6
(|((((|)|)|)|)(|))
6
(|((|)(|)(|)|(|)))
6
(|((|)(|(|))|(|)))
6
(|((|)((|)|)|(|)))
6
(|((|(|))(|)|(|)))
6
(|((|(|)(|))|(|)))
6
(|((|(|(|)))|(|)))
6
(|((|((|)|))|(|)))
6
(|(((|)|)(|)|(|)))
6
(|(((|)|(|))|(|)))
6
(|(((|)(|)|)|(|)))
6
(|(((|(|))|)|(|)))
6
(|((((|)|)|)|(|)))
6
(|((|)(|)(|)(...

output:

1098
1250
1253
1254
1251
1255
1256
1257
1252
1258
1259
1260
1261
1262
1274
1275
1265
1280
1281
1282
1266
1283
1284
1285
1286
1263
1276
1277
1267
1268
1269
1287
1290
1291
1288
1292
1293
1294
1289
1295
1296
1297
1298
1264
1278
1279
1270
1299
1300
1301
1271
1272
1273
1302
1303
1304
1305
1308
1309
1306
...

input:

decode
1000
6
1098
6
1250
6
1253
6
1254
6
1251
6
1255
6
1256
6
1257
6
1252
6
1258
6
1259
6
1260
6
1261
6
1262
6
1274
6
1275
6
1265
6
1280
6
1281
6
1282
6
1266
6
1283
6
1284
6
1285
6
1286
6
1263
6
1276
6
1277
6
1267
6
1268
6
1269
6
1287
6
1290
6
1291
6
1288
6
1292
6
1293
6
1294
6
1289
6
1295
6
1296
6...

output:

(|((((|)|)|)|)(|))
(|((|)(|)(|)|(|)))
(|((|)(|(|))|(|)))
(|((|)((|)|)|(|)))
(|((|(|))(|)|(|)))
(|((|(|)(|))|(|)))
(|((|(|(|)))|(|)))
(|((|((|)|))|(|)))
(|(((|)|)(|)|(|)))
(|(((|)|(|))|(|)))
(|(((|)(|)|)|(|)))
(|(((|(|))|)|(|)))
(|((((|)|)|)|(|)))
(|((|)(|)(|)(|)|))
(|((|)(|)(|(|))|))
(|((|)(|)((|)|)...

result:

ok 1000 lines

Test #6:

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

input:

encode
1000
7
((|)(|(|(|)(|)))|(|))
7
((|)(|(|)(|)(|))(|)|)
7
(|(|(|)((|)|))(|(|)))
7
((|(|))|(|))(|(|))(|)
7
(|)((|(|)((|)|)(|))|)
7
(((|(|)(|))|((|)|))|)
7
((|)((|(|))(|(|))|)|)
8
(|)(|)(|(|))((|((|)|))|)
7
((|)|)((|)|)(((|)|)|)
7
(|)((|)|)(((|)|(|))|)
7
(|((|)|(|)))(|(|)(|))
7
((|)|(|(|)((|)|))(|...

output:

7928
8196
5979
2127
5509
9177
8755
22428
3871
4277
3977
7105
18049
2140
5933
6661
2479
4110
6610
7348
6199
2709
8693
9296
9000
4834
3423
3271
8642
5354
3741
6149
3086
3330
7025
8486
9493
2570
9120
5124
3982
5200
3570
6364
6277
5763
3178
6691
4724
6918
8087
4872
7172
2295
2341
9326
7556
7201
5903
762...

input:

decode
1000
7
7928
7
8196
7
5979
7
2127
7
5509
7
9177
7
8755
8
22428
7
3871
7
4277
7
3977
7
7105
8
18049
7
2140
7
5933
7
6661
7
2479
7
4110
7
6610
7
7348
7
6199
7
2709
7
8693
7
9296
7
9000
7
4834
7
3423
7
3271
7
8642
7
5354
7
3741
7
6149
7
3086
7
3330
7
7025
7
8486
7
9493
7
2570
7
9120
7
5124
7
3982...

output:

((|)(|(|(|)(|)))|(|))
((|)(|(|)(|)(|))(|)|)
(|(|(|)((|)|))(|(|)))
((|(|))|(|))(|(|))(|)
(|)((|(|)((|)|)(|))|)
(((|(|)(|))|((|)|))|)
((|)((|(|))(|(|))|)|)
(|)(|)(|(|))((|((|)|))|)
((|)|)((|)|)(((|)|)|)
(|)((|)|)(((|)|(|))|)
(|((|)|(|)))(|(|)(|))
((|)|(|(|)((|)|))(|))
(|)(|)(|)((|)|(|))((|)|)
((|)((|)...

result:

ok 1000 lines

Test #7:

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

input:

encode
1000
7
(|(|)(|)(|(((|)|)|)))
7
(((|)|)((|)|)(|(|))|)
7
(|(|))((|)(|)|(|(|)))
7
(|)(|((|((|(|))|))|))
7
(|((|)|(|))(|((|)|)))
7
(|)((|(|)(|(|)))(|)|)
7
(((|)(|)(|)|)|(|(|)))
7
((|(|))|)((|)|)(|(|))
7
(|)(|(|((|)(|)|(|))))
7
(((|)(|)|)|(|))(|)(|)
7
(|)(|(|(|)((|)|))(|))
7
((|)(|)|(((|)|)|(|)))
...

output:

6126
8403
4702
5173
6089
5403
7788
3352
5090
1987
4949
7391
9997
11063
4784
1953
3951
3126
22419
12292
2995
5681
8765
8478
3644
2753
6801
4660
4281
9459
4424
6028
4594
9090
8370
7600
6367
7385
5061
3495
5109
7462
3797
5771
8089
7034
6767
7611
5582
4177
7125
5087
4699
4609
6267
7817
9107
3287
5159
63...

input:

decode
1000
7
6126
7
8403
7
4702
7
5173
7
6089
7
5403
7
7788
7
3352
7
5090
7
1987
7
4949
7
7391
8
9997
8
11063
7
4784
7
1953
7
3951
7
3126
8
22419
8
12292
7
2995
7
5681
7
8765
7
8478
7
3644
7
2753
7
6801
7
4660
7
4281
7
9459
7
4424
7
6028
7
4594
7
9090
7
8370
7
7600
7
6367
7
7385
7
5061
7
3495
7
510...

output:

(|(|)(|)(|(((|)|)|)))
(((|)|)((|)|)(|(|))|)
(|(|))((|)(|)|(|(|)))
(|)(|((|((|(|))|))|))
(|((|)|(|))(|((|)|)))
(|)((|(|)(|(|)))(|)|)
(((|)(|)(|)|)|(|(|)))
((|(|))|)((|)|)(|(|))
(|)(|(|((|)(|)|(|))))
(((|)(|)|)|(|))(|)(|)
(|)(|(|(|)((|)|))(|))
((|)(|)|(((|)|)|(|)))
(|)(|)(|(|(|(|))))(|)(|)
(|)(|)(|)(|...

result:

ok 1000 lines

Test #8:

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

input:

encode
1000
7
(((|)|(|)(|)(|)(|))|)
7
(|)(|(|(|)))((|(|))|)
7
((|)|)(|((|)|))(|(|))
7
(|(|(|)))((|(|(|)))|)
7
(((|)(|)|)|(|(|)))(|)
7
((|)((((|)|)|)|)|(|))
7
(|((|((|)|(|))(|))|))
7
((|)(((|)(|)(|)|)|)|)
8
(|)(|)(|)(|(|))((|)|(|))
7
(|(|(|))(|)((|(|))|))
7
((((|(|))|)(|)(|)|)|)
7
(|(|))((|)(|)|)((|)...

output:

9069
3884
3390
4335
2864
7952
6941
8784
20520
6043
9261
3381
4217
9149
4469
5462
6155
7635
7731
3166
7047
4218
3537
2669
2371
9478
5048
4446
5634
5942
6226
7145
1906
2038
4865
11113
7129
7519
3122
2976
5769
7179
8064
5673
8477
1887
4876
2698
6452
3577
9054
3269
6094
5881
2593
9304
5843
3643
2913
439...

input:

decode
1000
7
9069
7
3884
7
3390
7
4335
7
2864
7
7952
7
6941
7
8784
8
20520
7
6043
7
9261
7
3381
7
4217
7
9149
7
4469
7
5462
7
6155
7
7635
7
7731
7
3166
7
7047
7
4218
7
3537
7
2669
7
2371
7
9478
7
5048
7
4446
7
5634
7
5942
7
6226
7
7145
7
1906
7
2038
7
4865
8
11113
7
7129
7
7519
7
3122
7
2976
7
5769...

output:

(((|)|(|)(|)(|)(|))|)
(|)(|(|(|)))((|(|))|)
((|)|)(|((|)|))(|(|))
(|(|(|)))((|(|(|)))|)
(((|)(|)|)|(|(|)))(|)
((|)((((|)|)|)|)|(|))
(|((|((|)|(|))(|))|))
((|)(((|)(|)(|)|)|)|)
(|)(|)(|)(|(|))((|)|(|))
(|(|(|))(|)((|(|))|))
((((|(|))|)(|)(|)|)|)
(|(|))((|)(|)|)((|)|)
((|)|)(|)(((|)|(|))|)
((((|)|)|(|...

result:

ok 1000 lines

Test #9:

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

input:

encode
1000
7
((|(|)(|(|)))|)((|)|)
7
(|(|))((|(|(|(|))))|)
7
(|)(|(|((|)(|)|)))(|)
8
(|)(|)(|(|)(|))(|(|(|)))
7
(|((((|(|))|)|(|))|))
7
(((|(|))|)|)(|)((|)|)
7
((|(|))((|)|)|((|)|))
7
(((|(|))(|)|)(|)(|)|)
7
(|(|))(|(|)(|)(|)(|))
7
(((|)((|)|)|(|))(|)|)
7
((|(|)((|(|))|))(|)|)
7
(|)((|(|))(|)|((|)|...

output:

3693
4753
2363
20686
7019
3307
7705
8140
4634
8306
8249
5289
2979
4689
7591
3640
5321
7712
8888
12280
3557
2469
2510
18054
7677
6169
5319
3295
5387
3457
12297
5779
9517
4282
23714
2147
5593
5695
2430
4083
7787
23763
3219
7357
6297
8852
7616
7959
2687
7726
5795
6582
4411
2626
11503
7314
6296
3354
237...

input:

decode
1000
7
3693
7
4753
7
2363
8
20686
7
7019
7
3307
7
7705
7
8140
7
4634
7
8306
7
8249
7
5289
7
2979
7
4689
7
7591
7
3640
7
5321
7
7712
7
8888
8
12280
7
3557
7
2469
7
2510
8
18054
7
7677
7
6169
7
5319
7
3295
7
5387
7
3457
8
12297
7
5779
7
9517
7
4282
8
23714
7
2147
7
5593
7
5695
7
2430
7
4083
7
7...

output:

((|(|)(|(|)))|)((|)|)
(|(|))((|(|(|(|))))|)
(|)(|(|((|)(|)|)))(|)
(|)(|)(|(|)(|))(|(|(|)))
(|((((|(|))|)|(|))|))
(((|(|))|)|)(|)((|)|)
((|(|))((|)|)|((|)|))
(((|(|))(|)|)(|)(|)|)
(|(|))(|(|)(|)(|)(|))
(((|)((|)|)|(|))(|)|)
((|(|)((|(|))|))(|)|)
(|)((|(|))(|)|((|)|))
((((|)(|)|)|)(|)|)(|)
(|(|))((|)|...

result:

ok 1000 lines

Test #10:

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

input:

encode
1000
7
((((|)|(|)(|))|)(|)|)
7
(((|)(|)|)(|)(|(|))|)
7
(|)(|((|(|)(|))(|)|))
7
(|(|)(((|)|)|(|))(|))
7
(|)((|(|))|(|(|(|))))
7
((|(|)(|)(|)(|))|)(|)
7
(|((|)(|(|)((|)|))|))
7
(((|)|(|))|)((|)|)(|)
7
(|)(((|(|))|(|))|(|))
7
(|(|))(|((|)|))(|(|))
7
(|(|)(|))(|(|((|)|)))
7
((|(|)(|))|(|))(|)(|)
...

output:

8351
8387
5143
5765
5266
3057
6907
2148
5361
3376
4288
1983
5362
4801
1863
2643
8308
4003
6572
1967
11896
3386
8501
6109
23705
3264
4858
3615
7575
3075
4655
8360
2511
8714
3005
7042
3589
5079
2916
6022
2394
5152
6130
3138
8753
8804
6771
7502
11583
7966
3447
5775
2171
5265
6946
3929
5139
7268
2075
58...

input:

decode
1000
7
8351
7
8387
7
5143
7
5765
7
5266
7
3057
7
6907
7
2148
7
5361
7
3376
7
4288
7
1983
7
5362
7
4801
7
1863
7
2643
7
8308
7
4003
7
6572
7
1967
8
11896
7
3386
7
8501
7
6109
8
23705
7
3264
7
4858
7
3615
7
7575
7
3075
7
4655
7
8360
7
2511
7
8714
7
3005
7
7042
7
3589
7
5079
7
2916
7
6022
7
2394...

output:

((((|)|(|)(|))|)(|)|)
(((|)(|)|)(|)(|(|))|)
(|)(|((|(|)(|))(|)|))
(|(|)(((|)|)|(|))(|))
(|)((|(|))|(|(|(|))))
((|(|)(|)(|)(|))|)(|)
(|((|)(|(|)((|)|))|))
(((|)|(|))|)((|)|)(|)
(|)(((|(|))|(|))|(|))
(|(|))(|((|)|))(|(|))
(|(|)(|))(|(|((|)|)))
((|(|)(|))|(|))(|)(|)
(|)((((|)|)|(|))|(|))
((|)|)(|(|)(((...

result:

ok 1000 lines

Test #11:

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

input:

encode
1000
7
(|((|)(|)|(|))(|(|)))
7
(|(((|)|)(|((|)|))|))
7
(|)((|)((|)|)|)(|)(|)
7
(|(|))(|)(((|)(|)|)|)
7
(|(|(|((|)|(|)))))(|)
7
((|)(|(|))|(|))((|)|)
7
(|)((|)(|)|)(|(|))(|)
7
(|(((|)|(|(|)))|(|)))
7
(((|)((|)|)(|)|)|)(|)
7
((|)|)((((|)(|)|)|)|)
7
(((|)|(|)(|))|)((|)|)
7
(|(((|)(|)|)|(|(|))))
...

output:

6001
6898
1894
4188
2635
3619
2089
6786
3149
4917
3711
6740
2956
3645
23762
3106
6561
2014
9335
9378
8684
8152
3162
6999
3048
4628
23786
9028
8720
9406
7605
2865
8613
5918
4074
4912
2352
4484
5735
6067
2664
3954
5761
5838
5282
5864
7249
5597
6049
5513
4075
1942
5340
2843
2447
9051
5013
23816
2003
78...

input:

decode
1000
7
6001
7
6898
7
1894
7
4188
7
2635
7
3619
7
2089
7
6786
7
3149
7
4917
7
3711
7
6740
7
2956
7
3645
8
23762
7
3106
7
6561
7
2014
7
9335
7
9378
7
8684
7
8152
7
3162
7
6999
7
3048
7
4628
8
23786
7
9028
7
8720
7
9406
7
7605
7
2865
7
8613
7
5918
7
4074
7
4912
7
2352
7
4484
7
5735
7
6067
7
2664...

output:

(|((|)(|)|(|))(|(|)))
(|(((|)|)(|((|)|))|))
(|)((|)((|)|)|)(|)(|)
(|(|))(|)(((|)(|)|)|)
(|(|(|((|)|(|)))))(|)
((|)(|(|))|(|))((|)|)
(|)((|)(|)|)(|(|))(|)
(|(((|)|(|(|)))|(|)))
(((|)((|)|)(|)|)|)(|)
((|)|)((((|)(|)|)|)|)
(((|)|(|)(|))|)((|)|)
(|(((|)(|)|)|(|(|))))
((|(|)((|)|))(|)|)(|)
((|)((|)|)(|)|...

result:

ok 1000 lines

Test #12:

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

input:

encode
1000
7
(|(|(|(|)(|)(|(|)))))
7
(|(|(|(|(|)))(|)))(|)
7
(|(((|)(|(|))|)|)(|))
7
(|((|)(|(|(|))(|))|))
7
(|)((|)(|)|(((|)|)|))
7
((|(|))(|)(|)(|)(|)|)
7
(((|(|))|)|)((|(|))|)
7
((|(|(|))((|)(|)|))|)
7
(|(|)(|(|(|))(|))(|))
7
(|((|)|(|)(|(|)))(|))
7
(|((|)|(|)(|)(|(|))))
7
((|)|((|)(|(|(|)))|))
...

output:

6490
2608
5912
6904
5259
8097
4122
8886
5749
5836
6633
7313
5612
8715
11895
8610
3199
6325
7829
7257
4645
4255
5604
5690
7887
8734
7897
2151
7116
2752
6526
1875
8005
8661
3540
5010
6225
9485
7657
6507
3203
4800
7661
2997
2621
4203
4117
2776
4337
1992
3117
7189
8326
23772
7581
3151
4650
7637
7531
555...

input:

decode
1000
7
6490
7
2608
7
5912
7
6904
7
5259
7
8097
7
4122
7
8886
7
5749
7
5836
7
6633
7
7313
7
5612
7
8715
8
11895
7
8610
7
3199
7
6325
7
7829
7
7257
7
4645
7
4255
7
5604
7
5690
7
7887
7
8734
7
7897
7
2151
7
7116
7
2752
7
6526
7
1875
7
8005
7
8661
7
3540
7
5010
7
6225
7
9485
7
7657
7
6507
7
3203
...

output:

(|(|(|(|)(|)(|(|)))))
(|(|(|(|(|)))(|)))(|)
(|(((|)(|(|))|)|)(|))
(|((|)(|(|(|))(|))|))
(|)((|)(|)|(((|)|)|))
((|(|))(|)(|)(|)(|)|)
(((|(|))|)|)((|(|))|)
((|(|(|))((|)(|)|))|)
(|(|)(|(|(|))(|))(|))
(|((|)|(|)(|(|)))(|))
(|((|)|(|)(|)(|(|))))
((|)|((|)(|(|(|)))|))
(|)(((|)(|(|(|)))|)|)
((|)((|)|(|((|...

result:

ok 1000 lines

Test #13:

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

input:

encode
1000
7
(|(|((|)|))(|))((|)|)
7
((|)(|)|)(|)(|(|(|)))
7
((((|(|))|(|(|)))|)|)
8
(|)(|)(|)(|(((|)|)|)(|))
7
((((((|)|)|)|)|)|(|))
7
(((|((|)|)((|)|))|)|)
7
(|(|((|)|))(|)((|)|))
7
((|)(|)|(|((|(|))|)))
7
(|(|(|(|)(|)(|)))(|))
7
(|(|)((|)|(((|)|)|)))
7
((((|((|)(|)|))|)|)|)
7
(|(|))(|(|)(|))(|(|...

output:

3475
3810
9452
23704
8095
9398
5936
7384
5803
6271
9503
3372
7940
2838
6472
2969
6673
8666
9482
3992
3916
5584
5610
7633
2436
2214
7704
4936
3482
7755
4059
3300
5348
3501
6662
2270
3602
6742
25471
5256
2665
5655
4658
8223
5062
8845
5270
8367
5835
6254
23740
23828
2187
8105
4747
25494
6249
2067
4880
...

input:

decode
1000
7
3475
7
3810
7
9452
8
23704
7
8095
7
9398
7
5936
7
7384
7
5803
7
6271
7
9503
7
3372
7
7940
7
2838
7
6472
7
2969
7
6673
7
8666
7
9482
7
3992
7
3916
7
5584
7
5610
7
7633
7
2436
7
2214
7
7704
7
4936
7
3482
7
7755
7
4059
7
3300
7
5348
7
3501
7
6662
7
2270
7
3602
7
6742
8
25471
7
5256
7
2665...

output:

(|(|((|)|))(|))((|)|)
((|)(|)|)(|)(|(|(|)))
((((|(|))|(|(|)))|)|)
(|)(|)(|)(|(((|)|)|)(|))
((((((|)|)|)|)|)|(|))
(((|((|)|)((|)|))|)|)
(|(|((|)|))(|)((|)|))
((|)(|)|(|((|(|))|)))
(|(|(|(|)(|)(|)))(|))
(|(|)((|)|(((|)|)|)))
((((|((|)(|)|))|)|)|)
(|(|))(|(|)(|))(|(|))
((|)(((|)|)|(|))|(|))
((|)(|)(|)|...

result:

ok 1000 lines

Test #14:

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

input:

encode
1000
8
(|(|((|)|)))(|(|)((|)|))
8
(|)(|(|)((|)(|)(|)|)(|))
8
(|)((|(|(|)(|))(|(|)))|)
8
(|)((|(((|)|)|))(|)|)(|)
8
(|((|)(|(|)(|(|)(|)))|))
8
(((|)|(|))(|((|)|(|)))|)
8
((|)(((|(|))(|)|)(|)|)|)
8
((|)((|)|)((|)(|)|)(|)|)
8
((|)|)(|(|(|)((|)|)(|)))
8
(|(|))(|((|)|(|((|)|))))
8
((((|)(|)(|)|(|)...

output:

23007
27711
30806
13163
38368
47642
48682
45450
26999
26329
52423
41401
33366
12833
37524
20797
24174
41408
17947
19832
42201
29092
31783
15543
35336
12885
10151
44164
17208
28350
35479
42273
31495
51084
49586
33691
38121
16562
9705
23301
31198
26388
38362
14946
12958
18202
29117
23348
32752
11810
1...

input:

decode
1000
8
23007
8
27711
8
30806
8
13163
8
38368
8
47642
8
48682
8
45450
8
26999
8
26329
8
52423
8
41401
8
33366
8
12833
8
37524
8
20797
8
24174
8
41408
8
17947
8
19832
8
42201
8
29092
8
31783
8
15543
8
35336
8
12885
8
10151
8
44164
8
17208
8
28350
8
35479
8
42273
8
31495
8
51084
8
49586
8
33691
...

output:

(|(|((|)|)))(|(|)((|)|))
(|)(|(|)((|)(|)(|)|)(|))
(|)((|(|(|)(|))(|(|)))|)
(|)((|(((|)|)|))(|)|)(|)
(|((|)(|(|)(|(|)(|)))|))
(((|)|(|))(|((|)|(|)))|)
((|)(((|(|))(|)|)(|)|)|)
((|)((|)|)((|)(|)|)(|)|)
((|)|)(|(|(|)((|)|)(|)))
(|(|))(|((|)|(|((|)|))))
((((|)(|)(|)|(|)(|))|)|)
(((|)|)|((|)(|)(|)|(|)))
...

result:

ok 1000 lines

Test #15:

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

input:

encode
1000
9
((|)((|((|)(|)|(|(|))))|)|)
9
((((|)(|(|))|(((|)|)|))|)|)
9
(|((|((|)(((|)|)|)|))|(|)))
9
(((((|)|)|)((|)(|)|)(|)|)|)
9
(|)(((|(|))(|(|))|)(|)|(|))
9
(|)(|((|)|)(|)(|)(|)((|)|))
9
((((|)(|(|))|)(|)|)(|(|))|)
9
(|(|))(((|)(|)|(|(|))(|))|)
9
(|(((|)|(|))|(|)((|)|))(|))
9
(((|(|)((|)(|)|)...

output:

277614
297499
214312
292174
170339
159402
266353
153694
185129
263245
214080
142693
294269
237338
186890
198911
117678
54602
56094
272335
215387
120502
178487
113396
53413
166066
234212
54161
172643
229367
262878
189060
218697
232325
55171
220990
74393
192146
153869
158764
105251
207696
118882
13613...

input:

decode
1000
9
277614
9
297499
9
214312
9
292174
9
170339
9
159402
9
266353
9
153694
9
185129
9
263245
9
214080
9
142693
9
294269
9
237338
9
186890
9
198911
9
117678
9
54602
9
56094
9
272335
9
215387
9
120502
9
178487
9
113396
9
53413
9
166066
9
234212
9
54161
9
172643
9
229367
9
262878
9
189060
9
21...

output:

((|)((|((|)(|)|(|(|))))|)|)
((((|)(|(|))|(((|)|)|))|)|)
(|((|((|)(((|)|)|)|))|(|)))
(((((|)|)|)((|)(|)|)(|)|)|)
(|)(((|(|))(|(|))|)(|)|(|))
(|)(|((|)|)(|)(|)(|)((|)|))
((((|)(|(|))|)(|)|)(|(|))|)
(|(|))(((|)(|)|(|(|))(|))|)
(|(((|)|(|))|(|)((|)|))(|))
(((|(|)((|)(|)|)(|))|)(|)|)
(|((|((|(|))|)(|)(|)...

result:

ok 1000 lines

Test #16:

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

input:

encode
1000
10
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
10
((((((((((|)|)|)|)|)|)|)|)|)|)
10
(|(|(|(|(|(|(|(|(|(|))))))))))
10
((|)|)((|)|(((|)|)|)(|((|)|)))
10
(|)((|)|((|((|)(|((|)|))|))|))
10
(|)(((|)|)((|(|))((|)|)(|)|)|)
10
((|)(|((|)|))(|)((|(|))|(|))|)
10
(((((((|(|(|)))|)|)|)(|)|)|)|)
10
(((|)|((|)|))...

output:

299462
1730176
1192669
906208
969837
1014035
1552881
1723847
634466
892668
1309944
614414
712624
1032357
713723
838131
839673
1052594
1299847
1395308
1146629
1357663
1513223
1630340
863305
630803
490471
1310066
1683748
1697818
565954
922558
544009
1112476
987907
1709479
390910
1172550
1179158
832637...

input:

decode
1000
10
299462
10
1730176
10
1192669
10
906208
10
969837
10
1014035
10
1552881
10
1723847
10
634466
10
892668
10
1309944
10
614414
10
712624
10
1032357
10
713723
10
838131
10
839673
10
1052594
10
1299847
10
1395308
10
1146629
10
1357663
10
1513223
10
1630340
10
863305
10
630803
10
490471
10
1...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
((((((((((|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|))))))))))
((|)|)((|)|(((|)|)|)(|((|)|)))
(|)((|)|((|((|)(|((|)|))|))|))
(|)(((|)|)((|(|))((|)|)(|)|)|)
((|)(|((|)|))(|)((|(|))|(|))|)
(((((((|(|(|)))|)|)|)(|)|)|)|)
(((|)|((|)|))|)(|)(|)((|)(|)|)
(|(|))(((|)|)(|)(|(|(...

result:

ok 1000 lines

Test #17:

score: 100
Accepted
time: 4ms
memory: 3488kb

input:

encode
1000
11
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
11
(((((((((((|)|)|)|)|)|)|)|)|)|)|)
11
(|(|(|(|(|(|(|(|(|(|(|)))))))))))
11
((|)|)((|(|))(|)(|)(|)|((|)(|)|))
11
(|((((|)|)|)|((|(|(((|)|)|)))|)))
11
((|)|(((|)|(|((|((|)|))|)(|)))|))
11
(((|)|)|)((|(|)(((|)|)|))(|(|))|)
11
((|)((|)|)|((|)((|)|)|(|(|...

output:

1730177
10144816
7006009
5363558
7183050
7777376
5055571
7956785
8049066
7730195
4292861
2743157
8355603
4066696
8052389
2508115
1869225
5894241
8121362
6085229
6466922
9874281
1981540
2132687
3818528
4184437
9838515
10107023
5598311
3514361
8296113
3698754
6525112
7084678
10127732
5529406
7725606
3...

input:

decode
1000
11
1730177
11
10144816
11
7006009
11
5363558
11
7183050
11
7777376
11
5055571
11
7956785
11
8049066
11
7730195
11
4292861
11
2743157
11
8355603
11
4066696
11
8052389
11
2508115
11
1869225
11
5894241
11
8121362
11
6085229
11
6466922
11
9874281
11
1981540
11
2132687
11
3818528
11
4184437
1...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
(((((((((((|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|)))))))))))
((|)|)((|(|))(|)(|)(|)|((|)(|)|))
(|((((|)|)|)|((|(|(((|)|)|)))|)))
((|)|(((|)|(|((|((|)|))|)(|)))|))
(((|)|)|)((|(|)(((|)|)|))(|(|))|)
((|)((|)|)|((|)((|)|)|(|(|(|)))))
((|(|)(|)(|))|((|(|))(|)|)(|...

result:

ok 1000 lines

Test #18:

score: 100
Accepted
time: 4ms
memory: 3476kb

input:

encode
1000
12
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
12
((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)
12
(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))
12
((|)|)((|)(|(|))(|(|))(|)((|)(|)|)|)
12
(((|(|((|)|))(|))(|)|)|)(((|)|)|(|))
12
((|)|)(|(|)((|(|((|)(|)|)))(|(|))|))
12
((|(|((|)|(|))(|)((|)|)(|)(|)(|)))|)
12
(|((|...

output:

10144817
60211924
41646277
32150953
24406789
31768244
56920225
36569541
45095076
11718839
58282811
40067167
29455135
33883495
47387231
34062405
27919547
42722779
16517847
14977694
50088891
17488845
41637559
29046115
16419992
17008013
28686410
57170474
59718427
13828218
31590921
50126872
35733708
453...

input:

decode
1000
12
10144817
12
60211924
12
41646277
12
32150953
12
24406789
12
31768244
12
56920225
12
36569541
12
45095076
12
11718839
12
58282811
12
40067167
12
29455135
12
33883495
12
47387231
12
34062405
12
27919547
12
42722779
12
16517847
12
14977694
12
50088891
12
17488845
12
41637559
12
29046115
...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))
((|)|)((|)(|(|))(|(|))(|)((|)(|)|)|)
(((|(|((|)|))(|))(|)|)|)(((|)|)|(|))
((|)|)(|(|)((|(|((|)(|)|)))(|(|))|))
((|(|((|)|(|))(|)((|)|)(|)(|)(|)))|)
(|((|)((|)|(|(|))((|)|))|(|))(|)(|))
((|)...

result:

ok 1000 lines

Test #19:

score: 100
Accepted
time: 4ms
memory: 3512kb

input:

encode
1000
13
(((|)|(|((|)|)(|))(|)((|)|))(|((|)|))|)
13
(|((|)((|)|)((((|)|)((|)|)|)(|)|(|))|))
13
(|(|(|(|))(|)(|)(|(|((|)|)))(|(|))))(|)
13
((|(((|)|)(|(|))|((|)|(|))))((|(|))|)|)
13
(|)(((((|)|)|)(|)(|)(|(((|)|)|(|)))|)|)
13
((|((|)(|)(|)((|)|)|))|)(|)(|((|)(|)|))
13
(|(|)(|)((|(|(|(|)))(|))(|(...

output:

323450183
263369512
91091965
323366592
217545010
138341267
239077662
147143015
245572150
281031788
161839199
179550831
171537834
128962682
319603516
154771516
218146681
238701680
129363098
172157816
238403835
243383395
96978882
140083772
315353808
189894612
336609174
119096009
297456316
163793875
32...

input:

decode
1000
13
323450183
13
263369512
13
91091965
13
323366592
13
217545010
13
138341267
13
239077662
13
147143015
13
245572150
13
281031788
13
161839199
13
179550831
13
171537834
13
128962682
13
319603516
13
154771516
13
218146681
13
238701680
13
129363098
13
172157816
13
238403835
13
243383395
13
...

output:

(((|)|(|((|)|)(|))(|)((|)|))(|((|)|))|)
(|((|)((|)|)((((|)|)((|)|)|)(|)|(|))|))
(|(|(|(|))(|)(|)(|(|((|)|)))(|(|))))(|)
((|(((|)|)(|(|))|((|)|(|))))((|(|))|)|)
(|)(((((|)|)|)(|)(|)(|(((|)|)|(|)))|)|)
((|((|)(|)(|)((|)|)|))|)(|)(|((|)(|)|))
(|(|)(|)((|(|(|(|)))(|))(|((|)|))|(|)))
(|)(|((|(|(|)(|)))|)...

result:

ok 1000 lines

Test #20:

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

input:

encode
1000
14
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
14
((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)
14
(|(|(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))))
14
((|)|(|))(|((|)|))((|)((|)|(|)(|(|)))(|)|)
14
(|((|)|(|)((((|)|)|)(|)(|)|(|(((|)|)|)))))
14
(((|)|(|))|(|(|)(|))(|(|)))(|(((|)|(|))|))
14
(|)(|)(|(...

output:

361042497
2183809016
1514126437
970063375
1536730006
890150130
431847428
1868818794
757414899
1738884591
1406556280
1867974600
534296697
1871409452
1597700839
885888191
1421813038
404873528
1354177670
532848822
778311129
1013636263
485684193
923596275
1201406747
1478959331
835150475
1674134826
18157...

input:

decode
1000
14
361042497
14
2183809016
14
1514126437
14
970063375
14
1536730006
14
890150130
14
431847428
14
1868818794
14
757414899
14
1738884591
14
1406556280
14
1867974600
14
534296697
14
1871409452
14
1597700839
14
885888191
14
1421813038
14
404873528
14
1354177670
14
532848822
14
778311129
14
1...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))))
((|)|(|))(|((|)|))((|)((|)|(|)(|(|)))(|)|)
(|((|)|(|)((((|)|)|)(|)(|)|(|(((|)|)|)))))
(((|)|(|))|(|(|)(|))(|(|)))(|(((|)|(|))|))
(|)(|)(|(|)(|(|))((|)(|)(|)|))(|((|)|))(|)...

result:

ok 1000 lines

Test #21:

score: 100
Accepted
time: 5ms
memory: 3552kb

input:

encode
1000
15
((|(|))|(|(|((|((|)(|)|)(|(|)))|)))((|)|(|)))
15
(|)(|)(|(|(|)(|((|)(|((|)|))|)(|)))((|)(|)|))
15
((|)|)((|)(|)(|(|(|)(|)(|))((|)|))(|)|(|(|)))
15
(|(|)((|)|(((|)|)(|)(|)(|)|(|)))((|)|))((|)|)
15
((|(|(|)((|)|)((|)|((|(|))(|)|))))|)(|(|))(|)
15
(|)((|)|(|(|)))(((|)((|)|)|)|(|(|)(|((|)...

output:

10269329724
6808578384
7161292479
4342745244
2578365919
6178262987
7538796085
5098430511
12377093228
12746607310
6164913844
13131377907
9904857170
9625104121
10356530853
12118858494
8186048622
11311843663
4351224154
12978056510
6165957732
7915388899
10578040295
4501997605
6742815468
11006620482
1131...

input:

decode
1000
15
10269329724
15
6808578384
15
7161292479
15
4342745244
15
2578365919
15
6178262987
15
7538796085
15
5098430511
15
12377093228
15
12746607310
15
6164913844
15
13131377907
15
9904857170
15
9625104121
15
10356530853
15
12118858494
15
8186048622
15
11311843663
15
4351224154
15
12978056510
...

output:

((|(|))|(|(|((|((|)(|)|)(|(|)))|)))((|)|(|)))
(|)(|)(|(|(|)(|((|)(|((|)|))|)(|)))((|)(|)|))
((|)|)((|)(|)(|(|(|)(|)(|))((|)|))(|)|(|(|)))
(|(|)((|)|(((|)|)(|)(|)(|)|(|)))((|)|))((|)|)
((|(|(|)((|)|)((|)|((|(|))(|)|))))|)(|(|))(|)
(|)((|)|(|(|)))(((|)((|)|)|)|(|(|)(|((|)|))))
(|)((|)|((|)((|(|)((|)(|...

result:

ok 1000 lines

Test #22:

score: 100
Accepted
time: 5ms
memory: 3508kb

input:

encode
1000
16
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
16
((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
16
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))))))
16
((|)|(|(|)))(|)((|)(|(|(|(|))))((|)|(|))(|(|))|)
16
((((|)|)(|)|(|)(|)(|(|)((|)((|)|)|))(|))(|)|(|))
16
(|(|))(|((|)|(|((|)(|(|(|...

output:

13308564681
81637319639
56706222686
37883916774
68911412586
42920343755
59943506835
72044276665
17353768702
41835972894
13511118211
54446910929
77513741636
67936554829
35816697457
75948632628
64393283471
19928926993
46573996085
43070784181
28357771368
59799968044
15016186803
54880210960
23693312640
...

input:

decode
1000
16
13308564681
16
81637319639
16
56706222686
16
37883916774
16
68911412586
16
42920343755
16
59943506835
16
72044276665
16
17353768702
16
41835972894
16
13511118211
16
54446910929
16
77513741636
16
67936554829
16
35816697457
16
75948632628
16
64393283471
16
19928926993
16
46573996085
16
...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))))))
((|)|(|(|)))(|)((|)(|(|(|(|))))((|)|(|))(|(|))|)
((((|)|)(|)|(|)(|)(|(|)((|)((|)|)|))(|))(|)|(|))
(|(|))(|((|)|(|((|)(|(|(|)))|))((|)(|)|(|(|)))))
(|((|(...

result:

ok 1000 lines

Test #23:

score: 100
Accepted
time: 4ms
memory: 3508kb

input:

encode
1000
17
(((((|)(|(((|)|)|))|((|)|))(|(|(|))(|))|(|(|)))|)|)
17
((|((|((|((|)|))|(|)))|))|(|(((|)|)|)((|)|))((|)|))
17
((|)(|)|)(|)((|(|(|)((|(|))|))(|(|)((|)(|)|)))(|)|)
17
((((|)|)((|(|((|(((|)|)(|)|))|)(|(|)(|))(|)))|)|)|)
17
(((|)|)|(|(|((|(|(|(|))(|)(|)))((|)(|)|)|)((|)|))))
17
(|(|(((|)|...

output:

501436098858
405520737654
242288948089
497563694253
390951815192
312994446653
403804894697
189824292368
162078186917
353622412857
149273276181
182911048497
353421294450
384231009466
340493352320
202982636567
250285110110
102658480816
328704048817
176437112187
198340773241
414557595903
217249232624
4...

input:

decode
1000
17
501436098858
17
405520737654
17
242288948089
17
497563694253
17
390951815192
17
312994446653
17
403804894697
17
189824292368
17
162078186917
17
353622412857
17
149273276181
17
182911048497
17
353421294450
17
384231009466
17
340493352320
17
202982636567
17
250285110110
17
102658480816
...

output:

(((((|)(|(((|)|)|))|((|)|))(|(|(|))(|))|(|(|)))|)|)
((|((|((|((|)|))|(|)))|))|(|(((|)|)|)((|)|))((|)|))
((|)(|)|)(|)((|(|(|)((|(|))|))(|(|)((|)(|)|)))(|)|)
((((|)|)((|(|((|(((|)|)(|)|))|)(|(|)(|))(|)))|)|)|)
(((|)|)|(|(|((|(|(|(|))(|)(|)))((|)(|)|)|)((|)|))))
(|(|(((|)|)(|)|(|(|((|)|(|))(|)(|(|)))))...

result:

ok 1000 lines

Test #24:

score: 100
Accepted
time: 5ms
memory: 3492kb

input:

encode
1000
18
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
18
((((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
18
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))))))))
18
((|)|((|(|))|(|)))(((|)|)((|)|)|)((|)|)(|(|))((|)|)(|)
18
((|)((|)|(|((|)|))((|(|))((|)(((|)|)|((|)|))|(|))|))|...

output:

503667864975
3123298907639
2172580169967
575863257995
2906224661624
2423740869387
763068528727
615862009529
739470312078
2031029641777
1217845408301
1384834858175
2093264242850
1213487768802
2188785418677
649769475427
3081414339950
2208355581745
649545738963
2128612771747
1853480825801
2393778670693...

input:

decode
1000
18
503667864975
18
3123298907639
18
2172580169967
18
575863257995
18
2906224661624
18
2423740869387
18
763068528727
18
615862009529
18
739470312078
18
2031029641777
18
1217845408301
18
1384834858175
18
2093264242850
18
1213487768802
18
2188785418677
18
649769475427
18
3081414339950
18
22...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
((((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|))))))))))))))))))
((|)|((|(|))|(|)))(((|)|)((|)|)|)((|)|)(|(|))((|)|)(|)
((|)((|)|(|((|)|))((|(|))((|)(((|)|)|((|)|))|(|))|))|)
(((|)|)|(|(|(|(|)(((((|)|...

result:

ok 1000 lines

Test #25:

score: 100
Accepted
time: 4ms
memory: 3436kb

input:

encode
1000
19
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
19
(((((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
19
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|)))))))))))))))))))
19
((|)|((|(|))|)((|)|(|)))(|)(|(((|)(|)(|)|(|(|))(|))|))(|)
19
(|((((|)(|)|)|)((|(((|)|)(|)|))|)|((|)|)(...

output:

3123298907640
19456221197939
13541991011007
3960749679600
11926241889069
9925878482315
13319006458144
17261471393831
12518027800177
7451627368213
6520798526277
16157040236499
6179153885427
18248917251980
15571643882181
16562752282689
18864794128235
4402471761967
12576365307728
11747882783909
1766155...

input:

decode
1000
19
3123298907640
19
19456221197939
19
13541991011007
19
3960749679600
19
11926241889069
19
9925878482315
19
13319006458144
19
17261471393831
19
12518027800177
19
7451627368213
19
6520798526277
19
16157040236499
19
6179153885427
19
18248917251980
19
15571643882181
19
16562752282689
19
188...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
(((((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|)))))))))))))))))))
((|)|((|(|))|)((|)|(|)))(|)(|(((|)(|)(|)|(|(|))(|))|))(|)
(|((((|)(|)|)|)((|(((|)|)(|)|))|)|((|)|)((|)|(|)))(|)(|))
(|((|)|))(...

result:

ok 1000 lines

Test #26:

score: 100
Accepted
time: 5ms
memory: 3512kb

input:

encode
1000
20
(|(|(|)))(|((|)|(((|(|(|)))|(|(|))(|(|)))(|)|)(|(|))(|)))(|)
20
((|)|)((((|)|(|))|((|((|)(|)|))(((|)|)(|)(((|(|))|)|)|)|))|)
20
(((((|)|)((((|)|)|)|((((|(|)(|(|)))|)|(|))|))(|)|(|(|)))|)|)
20
(((|((|)|(|))((((|(|)((|(|))(|)((|(|))|)|))|)|)|(|))(|))|)|)
20
((|)((|)(((|(|(|((|)|))))|)|)...

output:

26211789949908
66638363840018
121175021568877
120505195350639
32643876666412
52570607947098
38612259818321
40364570500789
51351997074859
66679329140972
33125123694360
40734606987102
84083153753659
39298417523106
56756026053760
62170446230787
53620533896083
112414780947388
41237860458929
508927743476...

input:

decode
1000
20
26211789949908
20
66638363840018
20
121175021568877
20
120505195350639
20
32643876666412
20
52570607947098
20
38612259818321
20
40364570500789
20
51351997074859
20
66679329140972
20
33125123694360
20
40734606987102
20
84083153753659
20
39298417523106
20
56756026053760
20
6217044623078...

output:

(|(|(|)))(|((|)|(((|(|(|)))|(|(|))(|(|)))(|)|)(|(|))(|)))(|)
((|)|)((((|)|(|))|((|((|)(|)|))(((|)|)(|)(((|(|))|)|)|)|))|)
(((((|)|)((((|)|)|)|((((|(|)(|(|)))|)|(|))|))(|)|(|(|)))|)|)
(((|((|)|(|))((((|(|)((|(|))(|)((|(|))|)|))|)|)|(|))(|))|)|)
((|)((|)(((|(|(|((|)|))))|)|)|(|((|)(|)|((|)|))))|(|(|))...

result:

ok 1000 lines

Test #27:

score: 100
Accepted
time: 6ms
memory: 3512kb

input:

encode
1000
21
(((|((|(|)(|)(|(|)(|))(|))|))(|(|))|)(|(|))|(((|)|)|(|((|)|))))
21
((|)(|)(|)|(|((|(|)(|((|)|))(|)(|))(|(|)(|)(((|)|(|))(|)|))|)))
21
((|(|(|))(|)((|)|(|)))(|)|(((|)|)|(|(|(|)(|)(((|)(|)|)|)))))(|)
21
(|((|)(|(|))((|)|)(|)(|)((((|)|)|(|)(|))|)|))((|(|((|)|)))(|)|)
21
(|)((|)(|)|(|((((...

output:

623668019670108
593743480470078
199572667750466
302840346541811
239978713429941
628362932723997
664813847616987
542555260656719
307519592222477
226580907578472
157099392267932
175043334559955
163402177376578
252426787029187
657099087643394
503554783671201
152798390417078
401860488383328
566817622213...

input:

decode
1000
21
623668019670108
21
593743480470078
21
199572667750466
21
302840346541811
21
239978713429941
21
628362932723997
21
664813847616987
21
542555260656719
21
307519592222477
21
226580907578472
21
157099392267932
21
175043334559955
21
163402177376578
21
252426787029187
21
657099087643394
21
...

output:

(((|((|(|)(|)(|(|)(|))(|))|))(|(|))|)(|(|))|(((|)|)|(|((|)|))))
((|)(|)(|)|(|((|(|)(|((|)|))(|)(|))(|(|)(|)(((|)|(|))(|)|))|)))
((|(|(|))(|)((|)|(|)))(|)|(((|)|)|(|(|(|)(|)(((|)(|)|)|)))))(|)
(|((|)(|(|))((|)|)(|)(|)((((|)|)|(|)(|))|)|))((|(|((|)|)))(|)|)
(|)((|)(|)|(|(((((|)|(|))|)|)|((|)|(|))(|)((...

result:

ok 1000 lines

Test #28:

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

input:

encode
1000
22
(|((|)|(|(|(((|)(|)(|)|)((|)(((|)|)|)|)(|)|)))(|(|)))(|(((|)|)|)))
22
((|(|(|)))|(|)(|)((|)|))(((|)|)(|((((|)|)|)|))|(|))((((|)(|)|)|)|)
22
((|(|((|(|))|)))(|(|(|)((|((|((((|)|)|(|))|(|)(|)))|)(|))|)))(|)|)
22
((|)(|((|(|(|(|(|)(|(|)))))(|)(|))(((|)|)|(|))(|((|)|)(|))|))(|)|)
22
(((|)...

output:

3106090217344571
1823788350227260
4209159386063081
4219806027992414
3850970087448024
1617091348990606
1290650151289386
3335241835077139
1749478059356229
1894808220420138
1722933734129639
1079633958619275
4286069044730278
1415637078945369
4290978905221043
1613954372993545
1764587763640735
92195084093...

input:

decode
1000
22
3106090217344571
22
1823788350227260
22
4209159386063081
22
4219806027992414
22
3850970087448024
22
1617091348990606
22
1290650151289386
22
3335241835077139
22
1749478059356229
22
1894808220420138
22
1722933734129639
22
1079633958619275
22
4286069044730278
22
1415637078945369
22
42909...

output:

(|((|)|(|(|(((|)(|)(|)|)((|)(((|)|)|)|)(|)|)))(|(|)))(|(((|)|)|)))
((|(|(|)))|(|)(|)((|)|))(((|)|)(|((((|)|)|)|))|(|))((((|)(|)|)|)|)
((|(|((|(|))|)))(|(|(|)((|((|((((|)|)|(|))|(|)(|)))|)(|))|)))(|)|)
((|)(|((|(|(|(|(|)(|(|)))))(|)(|))(((|)|)|(|))(|((|)|)(|))|))(|)|)
(((|)(((|(|))|)|)|((|)|))|(((|)(...

result:

ok 1000 lines

Test #29:

score: 100
Accepted
time: 6ms
memory: 3508kb

input:

encode
1000
23
((|)((|)|)(|((|(|(|(|(|))((|)((|)((|)|(|))(|((|(|))(|)|))|)|))))|))|)
23
(|(|)((|)|(|)))(|((|(|(((|((|)|)(|))|)|)))|)((|(|))(|)|(|(|)(|)(|))))
23
(|(|))((((|)|)(|)|(((|(|))|)(|)|))(|((|(|)(|))(|)|(|((|)|)(|))(|)))|)
23
(((|((|)((|(|))(|)|(|))|))((|)|(|(|)(|(|)((|)|(|)))))((|)|(|)(|))|...

output:

28041103035360880
14719868018923444
16380121978398435
29922056054188887
26327545803693098
8610772365163383
29287284402265059
27112855270771754
24484998051836839
11352548403832243
15717263731227046
24052130130954388
28210921870604344
21956023036444830
18885865870605397
20557387494786544
2880457775649...

input:

decode
1000
23
28041103035360880
23
14719868018923444
23
16380121978398435
23
29922056054188887
23
26327545803693098
23
8610772365163383
23
29287284402265059
23
27112855270771754
23
24484998051836839
23
11352548403832243
23
15717263731227046
23
24052130130954388
23
28210921870604344
23
2195602303644...

output:

((|)((|)|)(|((|(|(|(|(|))((|)((|)((|)|(|))(|((|(|))(|)|))|)|))))|))|)
(|(|)((|)|(|)))(|((|(|(((|((|)|)(|))|)|)))|)((|(|))(|)|(|(|)(|)(|))))
(|(|))((((|)|)(|)|(((|(|))|)(|)|))(|((|(|)(|))(|)|(|((|)|)(|))(|)))|)
(((|((|)((|(|))(|)|(|))|))((|)|(|(|)(|(|)((|)|(|)))))((|)|(|)(|))|)|)
((((|)|((|)(|(|))|)(...

result:

ok 1000 lines

Test #30:

score: 100
Accepted
time: 7ms
memory: 3436kb

input:

encode
1000
24
(|((((|)|)|)|)(|)(((|)|((|)(|(|))|))|(|))((|(|)(|))|(|(((|)|)|))((|)|)))
24
(|)(|(|)(|((|(|))|))(|)(|((|)((|)|)((|)|)|(((|)|)|)))(|((|)|(|(|))(|))))
24
(|(|((((|)|)(|)(|)((|(|))(|)|)|(|))|((((|(|(|))(|))|)|)|))(|(|)))(|)(|))
24
(|((|(|))|(((|)(|)|)|((|(|(|)((|(|))(|)(|)|(|))))|)((|)((...

output:

126019556773349896
107330498430062604
118372542609946866
136612889557949978
87695100263696483
164687238078130089
47466408397086641
45463255984134747
170779761059466940
69466150503076716
57677108271274705
156679489933117859
62013757301256768
104399233042274521
164103687551164323
56856051419019500
155...

input:

decode
1000
24
126019556773349896
24
107330498430062604
24
118372542609946866
24
136612889557949978
24
87695100263696483
24
164687238078130089
24
47466408397086641
24
45463255984134747
24
170779761059466940
24
69466150503076716
24
57677108271274705
24
156679489933117859
24
62013757301256768
24
10439...

output:

(|((((|)|)|)|)(|)(((|)|((|)(|(|))|))|(|))((|(|)(|))|(|(((|)|)|))((|)|)))
(|)(|(|)(|((|(|))|))(|)(|((|)((|)|)((|)|)|(((|)|)|)))(|((|)|(|(|))(|))))
(|(|((((|)|)(|)(|)((|(|))(|)|)|(|))|((((|(|(|))(|))|)|)|))(|(|)))(|)(|))
(|((|(|))|(((|)(|)|)|((|(|(|)((|(|))(|)(|)|(|))))|)((|)((|)|)|)(|))(|)))
(((|)(((...

result:

ok 1000 lines

Test #31:

score: 100
Accepted
time: 7ms
memory: 3512kb

input:

encode
1000
25
(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
25
(((((((((((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
25
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|)))))))))))))))))))))))))
25
((|)|((((|(|((|)|(|)(|))))|)|)(((|)(|)((|)|)|(|)...

output:

192657165369301080
1223805148529083307
854025843432301782
448301084008275476
1210784646792990265
1101394096984414585
698312301506582181
660020510398850510
971349764161842935
226721161443880909
839072236912208862
292591620524435958
1060260760024433287
928252813100223239
431729034896602365
63611699792...

input:

decode
1000
25
192657165369301080
25
1223805148529083307
25
854025843432301782
25
448301084008275476
25
1210784646792990265
25
1101394096984414585
25
698312301506582181
25
660020510398850510
25
971349764161842935
25
226721161443880909
25
839072236912208862
25
292591620524435958
25
106026076002443328...

output:

(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)(|)
(((((((((((((((((((((((((|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)|)
(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|)))))))))))))))))))))))))
((|)|((((|(|((|)|(|)(|))))|)|)(((|)(|)((|)|)|(|))(|(|))(|)|)|))(((|)|(|)...

result:

ok 1000 lines

Test #32:

score: 100
Accepted
time: 6ms
memory: 3548kb

input:

encode
1000
25
(|)(((|(|(|(|))))|(|((|)(|)|)(|(|(|(|(|))))))(|))|(|((|)|)(|((|)|)((|)|))))
25
((|)(|(|((((|)|)|)|((|)|)(|))((((|(|))|)|)((|)|)|)(|(|(|)))))|(|(|)(|(|))))
22
(|(|(|(|((((|)|)|)(((|(((|)|)|))|(((|)|)|)(|))(|(|(|(|))))|)|)))))
24
((|(|))|(|(((|)(|)|(|))(((|)(|)|)(((|)|)(|)|((|)(|)|))(|)...

output:

714370506383154871
1013167272494323431
3355306809304553
148439422477019488
160514529847032767
6840503326223599
711469567384799
76767024133052
94811479359441
21433053227400425
23034891165613471
124875479187988199
627351160937142248
1041405978981278057
13594732870873831
39751216074531650
1
23238952135...

input:

decode
1000
25
714370506383154871
25
1013167272494323431
22
3355306809304553
24
148439422477019488
24
160514529847032767
23
6840503326223599
21
711469567384799
20
76767024133052
20
94811479359441
23
21433053227400425
23
23034891165613471
24
124875479187988199
25
627351160937142248
25
104140597898127...

output:

(|)(((|(|(|(|))))|(|((|)(|)|)(|(|(|(|(|))))))(|))|(|((|)|)(|((|)|)((|)|))))
((|)(|(|((((|)|)|)|((|)|)(|))((((|(|))|)|)((|)|)|)(|(|(|)))))|(|(|)(|(|))))
(|(|(|(|((((|)|)|)(((|(((|)|)|))|(((|)|)|)(|))(|(|(|(|))))|)|)))))
((|(|))|(|(((|)(|)|(|))(((|)(|)|)(((|)|)(|)|((|)(|)|))(|)|)|))((|)|(|)))
((|)((((...

result:

ok 1000 lines