QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#837779#9052. Balanced Tree Pathhztmax0#AC ✓238ms4448kbC++141.0kb2024-12-30 13:20:322024-12-30 13:20:33

詳細信息

Test #1:

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

input:

4
()()
1 2
2 3
3 4

output:

4

result:

ok single line: '4'

Test #2:

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

input:

4
[[]]
1 2
2 3
3 4

output:

2

result:

ok single line: '2'

Test #3:

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

input:

6
([]{})
1 2
2 3
3 4
4 5
5 6

output:

4

result:

ok single line: '4'

Test #4:

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

input:

2
()
1 2

output:

1

result:

ok single line: '1'

Test #5:

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

input:

2
)(
1 2

output:

1

result:

ok single line: '1'

Test #6:

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

input:

2
[]
1 2

output:

1

result:

ok single line: '1'

Test #7:

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

input:

2
][
1 2

output:

1

result:

ok single line: '1'

Test #8:

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

input:

2
{}
1 2

output:

1

result:

ok single line: '1'

Test #9:

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

input:

2
}{
1 2

output:

1

result:

ok single line: '1'

Test #10:

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

input:

3
())
1 2
1 3

output:

2

result:

ok single line: '2'

Test #11:

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

input:

3
)((
1 2
1 3

output:

2

result:

ok single line: '2'

Test #12:

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

input:

3
[]]
1 2
1 3

output:

2

result:

ok single line: '2'

Test #13:

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

input:

3
][[
1 2
1 3

output:

2

result:

ok single line: '2'

Test #14:

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

input:

3
{}}
1 2
1 3

output:

2

result:

ok single line: '2'

Test #15:

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

input:

3
}{{
1 2
1 3

output:

2

result:

ok single line: '2'

Test #16:

score: 0
Accepted
time: 176ms
memory: 4448kb

input:

4999
))(())))()(())(()(())())((()(((())())))((()(((()()))(())(())(()(((()((()((()))))()))(()(()))((())()((()(()))())()(()(()()(()()()))()((((()())(()()))(()))))(()((((()))())(())(())()()))(((()())())((((())(())(()()()(()())()(())()))(()(())(((())()()(((())(()()(())(()()))(())((()))(((()))))(((()()((...

output:

2499

result:

ok single line: '2499'

Test #17:

score: 0
Accepted
time: 176ms
memory: 4284kb

input:

4999
[][][]]][[[[]]]]]][][[[][][]]]]]][[[]]]]][[[[[[[][[][[]][]][][[[[]]]][[]][[]][[[[[[[]]]]]][]][[[][]]][[][[][]]][]]][][[[][]][][[][][[]][]]]]]]][[[[]][[][[]]][]]]][[[][]]][]]][[][][]][][[[[[]][[[[][]]][][[][[[]][]][[[]][[][[][[[[[]]]]][[][]]]][[]]][][]][[[]]][[][]]][[[[[[[[[[][[]][[][][[[[]]][]]...

output:

2499

result:

ok single line: '2499'

Test #18:

score: 0
Accepted
time: 174ms
memory: 4196kb

input:

4999
}}{{{}{{{}{{{}{}{}}{{{}{{}{}}{{}}{}}}{}{{}{}{}}}{{{{{}}}{}}{}{}{{}{}{}}{}{}{{{}}{{}{{}}}{}}{{}}{{}{}{{{}}{}{}}}{}{{}}{}}{}{}{{}{}}}{{}{{{{{{{}{{}}{{{}{{}{}}}{{}}}}}}}{{{}}}}{}{}{}}{{}}}{{}}}{{}}{}}}{}}}{}{}{{}}}{}{{}}}}{{{}{}{{}{}{{}{}}}}}}{}}{{{}{}{}}{{}}}}{}}}}{{{{}{{{}{}{{{{{}}{}{}{}}}{{{{}{...

output:

2499

result:

ok single line: '2499'

Test #19:

score: 0
Accepted
time: 236ms
memory: 4244kb

input:

4999
(())(())(()())))((()()))(())((((()(()((())(((()())))((()))()(((()((((()))(()()))(()))))((()))(())))())(((((())()()())((()((()()))()()((())(()()))(())((())((()()()(()(((()(())))()())))(()))))))((())(()((())))(())((((())(((()()((())())(())((((())()())((((((()))(()(()())))))))))(())))(((((()))))))...

output:

6247500

result:

ok single line: '6247500'

Test #20:

score: 0
Accepted
time: 234ms
memory: 4260kb

input:

4999
][][[[][]]][[[][[[][[][][]]]][][[[[[]][[][]][][][]]]][]]][][]]][[[][][]][]][]][[]][[][[[]][]][[][[][[]][][[[[]][[]]][[[[]]]]][][][][[][]]]]][[[[]][]]]][][][[][[[[[]][]]]]]]][[][[][[[[[][[]][]][[][]][]][[]]]][[[][[][[[]][[[][[[][]][[][]]][[]][[][]]][[]]]][[][[[[[][]]]]][][[]]][[[[]][]][]][][[][[...

output:

6247500

result:

ok single line: '6247500'

Test #21:

score: 0
Accepted
time: 236ms
memory: 4184kb

input:

4999
{}}}}}{{{{{}{{{}}{}}}}{}{{}{{{{{}}{{{{{{{}{{}{}{{}{}}{{}{{}{}{}{{{{{{{}}{{{{}}}}}}}}{}}{}}{}}}{{{}{}{}{{}{{{{{}}}{{{{}}}{}}}}}}}{{{{{{}}}{}{{}}{}}{{{}{{}}{}{{{}}}{{}}{}{}{}}}}}}{}{}{{{}{}{{}}}{}}{}{{}}{{}{{}{}{}}}{}{}{}{}}}}{}}}{{}}{{}{}}{}{}}}{}{{{}{}}}{}{}{}}{{{{}{{}}}{}{{{}{{{}}}}}{{}}}}}}{}...

output:

6247500

result:

ok single line: '6247500'

Test #22:

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

input:

4999
]]][])]))())[([[[([)(([(][]](([([[)()]([)[(()))])))[[)([())([(((]((([(]))]][(]]))(]()(([())([[()])]))([[)]))))][[[(]()[)[)[[])[)]])(])))))])((][)][[)][()[[[]]))[()[()(()]([(])[()]()([)]](]])[(]]))))]][[])[]()][][[[[[[(()]([([])]]))])())]()(](]))]]])][[))][)[([]([(()][])])][]())[(]]))[][(])])()[...

output:

1698

result:

ok single line: '1698'

Test #23:

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

input:

4999
}))){{}))}({{{{}})({(({)}{{(}}}{((}}()(}{{{{()})}({{){)}(})){{}(}(((}(){(}{)}){()}{(})((((){((){(({{}))}(({({}(}(){{({}{{({()}})})(}}{{(}()(}}}(({{)(}}){()))((){{}(){}}{(((((}){()(){}{}((()(}{{{()))}{{}{())()}}(((}}){}(}}})){(}()({{(({{())}}))})(){{}{)}(({))}{{){}}}{}{)}{({((((((()){})(}{}(}}})...

output:

1768

result:

ok single line: '1768'

Test #24:

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

input:

4999
[{[]{]{{]{}}]}]{}]}}}[[[]}}]{{[}[{{{{{[{}[[[{{][[}{[[{}][]{]{{[{[{]]}{}}[{}]}}{[]{]}}{{{}]{{}{}][}[}][}}}][}}]]][}}}[}[]{}}}]{}{]{}}[][][]{[]{}]}}]{[[[{}}{]}[{]{{][}[}]]}[[}]]}{}[]]}{}{}[}[]]][{[}[{[][{}}[]{}}}{}[[]{}[[}[{}]{{{{{[}{}]]{}}}}}}[{}{[}]}{[}}{{[]}]][[[}]}}}}]}}{[]}}[}]}[{}[[[{{[[{[{...

output:

1779

result:

ok single line: '1779'

Test #25:

score: 0
Accepted
time: 1ms
memory: 4060kb

input:

4999
}}()(}(]({{(]()]}](][)()]}[[]}{[(}({{)([}){{{]))(]{{()){)]((}(]){(()[[][((][}[}{]})][{}(]({)))[{([}[[[){[)[}[{])[{)]()}]})((({)}]){{{(}}}{[(]}}][}}{}{{][(}}]][[(){]]}[[)}{]}}}(}){)[([[((}))[)){(}{){]([(][(}]}]]{}[[{{{[[)))([]}[)})[)((}()}{]({]]{{}[{[([}]{{[{)){{)))[}]}]}]]))[[)[]]]][{)]]}][}[}[...

output:

993

result:

ok single line: '993'

Test #26:

score: 0
Accepted
time: 94ms
memory: 3880kb

input:

4999
))()()))((())())((())((((()()()((((()()())))((()()(())((()))())))(())()()()(()(((((())()))())))))())()((()()()(()((()((()(())()())))))()()())()))))()(()())((())))))))()(())()(())()(()()(()))))))))()(())))()()((((()(((((()())((()(((()(()(((()((()(((())))((((()()()()()(())(())((()(()())()()()((()...

output:

6194370

result:

ok single line: '6194370'

Test #27:

score: 0
Accepted
time: 94ms
memory: 4060kb

input:

4999
[]][[]][][[][][[][[]][]]]]]][][]][[[[[[]]][[][[[[[[][]][]][][[]]]]]][[][][]]]][[][[]]][[][[[[[[[[[[][[[[]]][[[[][[[[][][[][[[[[]][[[[][[][[[[]]][[[]][[[[[[[[[[][][][]][[[][[[][[[[][[[[[][[][[]][[][[[[[[][]][[[[][[][]][]][][[][][[[[][[[[][][[][][][[[[][][]][]][[[][[]]]][]]]]][[[[][][[[[]][][[[[[...

output:

6194370

result:

ok single line: '6194370'

Test #28:

score: 0
Accepted
time: 93ms
memory: 3816kb

input:

4999
{{{}{}{}}{{{{{}{{{}}}}{}}{}{}}{}}{{}}{{}{{{}{}{}}}{}}{{}{{}{{{}}}{{{}}}{{{}{}}}{{}}{}}{}{{}{{{{}{}}}{}{}{{}}{{{}{}{{}{{}}{{{{}}{}{}}{{{}}}{{{{}}{{{{}}{}}{{{}{}{}}}{}{{}}}}}{}}{}{{}{}}{}{{}{{{}{{{{}{{{}}}{{{{}}{}}}}{{{}{{}{}{{{}}{{{}{}{{}{{{{{}}}}{}{}}}}{{}}}}{}{{{}{}}}{{}{{{}{{}{{}{}{}}}{{}{{}}...

output:

6194370

result:

ok single line: '6194370'

Test #29:

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

input:

4999
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((...

output:

6320

result:

ok single line: '6320'

Test #30:

score: 0
Accepted
time: 129ms
memory: 3824kb

input:

4999
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[][[[[[[[[[[[[[[[...

output:

6320

result:

ok single line: '6320'

Test #31:

score: 0
Accepted
time: 130ms
memory: 3816kb

input:

4999
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...

output:

6320

result:

ok single line: '6320'

Test #32:

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

input:

4999
]][[][][[[)([)](([)))][([)([[(]])[[[)))))[))])]((]]([(()()([()[])][([[)([][)][]]((][[((]][))[()())[)[[([[(])]()()[][])])))[([][)]([]]][])())[]([])(]]()((]][)[())[)])([(((((((][(])])(]][))()(][]())(][)[][[)((])((]])[)]()([[[((]]])[])(][))[[))(([[((])]()()])][))[(][[[]))])])][((((][(()][[]][[(((]...

output:

2973

result:

ok single line: '2973'

Test #33:

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

input:

4999
}{){)}{({((()(}{)}){)(}()(}{}{){){}({({}(){){}}{)(((){{}})}(({{({}})){)))})())}}}}}{)(}(){}{{))})}{}((({{}()({}){}{}{{({{(}))}()}()){)(}{}))}})){({)}})}((}}{{)}(({))(((}}{(}{}}}{()(}){})())}()){(}}{)}(}}})(((}}(}{(}{}{)({()){})}))(}}}(}}})})}}((}){{{)(}{}{{)}){(({}{)(){(}{{}({)({}({{{{(}))({)(}...

output:

3382

result:

ok single line: '3382'

Test #34:

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

input:

4999
{[]][][[{]{[{]}{}][]}{]}{}[]]{]{{[{}}]{}{}[]{{}[]{[][{][[]{{[[[]{}}{][]{}}{]}}]][}}]]{]}{{}}}]]}{[]}}}]][[]}[}{}]{{[]}{][{[[[]]}}]}{}]]}]]}]{{}{]}[[}}]}{{}]]{]}}{[{{[}}{}[[][}}]}[}][][][[]}]}[]]{]{[][[][{}}]{{{]{]{]}{[{}}]}[{}]]][{{[{[}][][{{}}[{{}{{[[]{[][[}{[[]{[][]][[{{}{}{{}{][[[][}[{]]{}[]...

output:

3066

result:

ok single line: '3066'

Test #35:

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

input:

4999
{[{[)}([}[(}[()((][(]}])){(}()})[()[}{{}[(([)[}[[]({}[])}{(){(}}][{[[{[{){[[)){](}[)[()[][(}}(}}((]}))[)(])){]{){((}}]{{)}]}[{([{)[()}]}[[{])([}([{(}))[{(([([[]})[)([)[(((])}])[{{[)))({){{(}{({]{[[(){]{[}{]]{[((})]][{[(}{[))][]}{[]){{(])){}]]}{(}(([}[){[([]][[(]()}[(}][}[)([({}{{])[[]([[])}})]{...

output:

1207

result:

ok single line: '1207'

Test #36:

score: 0
Accepted
time: 118ms
memory: 4056kb

input:

4999
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((...

output:

4998

result:

ok single line: '4998'

Test #37:

score: 0
Accepted
time: 119ms
memory: 3832kb

input:

4999
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...

output:

4998

result:

ok single line: '4998'

Test #38:

score: 0
Accepted
time: 119ms
memory: 4132kb

input:

4999
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...

output:

4998

result:

ok single line: '4998'

Test #39:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

4999
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))...

output:

4998

result:

ok single line: '4998'

Test #40:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

4999
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]...

output:

4998

result:

ok single line: '4998'

Test #41:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

4999
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}...

output:

4998

result:

ok single line: '4998'

Test #42:

score: 0
Accepted
time: 79ms
memory: 3852kb

input:

4999
)])][((())(()()(]]())(]]))[([[)][]()(][[[][[)[[][)(([(]([([]]())](([])([][[])][)()(]])[[[(])()[)]))))))(((])(]([([))](]()](])(][[)[[(()(](](][][[(([](([[[[])(])[((]]([))(([(]][](]()]][]]([(]]])))]))[)([]))])])))])(][[]]([]))]([)[[()](][[])))[][(]((()[[][)(](()([))(]([[)()[])[]]((([](([]]())[[](...

output:

1239

result:

ok single line: '1239'

Test #43:

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

input:

4999
{)}{)(){}}(}}}(){(()}(())(()((}{{((){)}){({(}{)}}}}}}{}})(}({(}}}}({{{(}){{)}{({})(}){}}){))()}}(){(}{{}}}{((()(}()(}}()}}))(({}))})({)(}{{}{{){){))()({)(}{(}}}}{({)()))}()({}()}((}(}})}{){{}{{)(}({}}}({({())()}}){)}}{){(}{(})){{{){}{()}(({{}}}}}({{{}}{})(})}}{))){((}){)}}}){{)({)({)){{)(}{{)}(...

output:

1230

result:

ok single line: '1230'

Test #44:

score: 0
Accepted
time: 28ms
memory: 3912kb

input:

4999
]]]]]}{}][{]}]{}}]}{]}]}[[[{{]][{}[{{{{}{[][]}}{]]][{]]}[[{}}{[}{[{]{{{]{[{]{{][][][]{][{{[]][}{]{[][]}[}[}}[{{{]}{[{[]{[}{]][{[{}{}}{{][{]]]]]][{}}{}}[]{][}]]][}[[]}{}]}{}]]]}]{[}}{]}]][}{]}}{]{[{}}[][{]]}}}{{]][}{{}[{[}][{[]}}}[][{[[]}}}][]}]{[}}}]]}[[{{}{[}}]{{][]}}[}}]{][{{[}}[]{[[[[[]}]}}[...

output:

1272

result:

ok single line: '1272'

Test #45:

score: 0
Accepted
time: 52ms
memory: 4116kb

input:

4999
)}{)}{{}[(}]])(][(}()()}[[{}){(]([}}]{({])[}){{})(]{)[})[{})][)[[}{]{)}{)})){})([([)(}{)()}{]](}{[(}[]({)}[[({{])([[])(]{][]([[}({[({)(]{){([]){{(](}]]({[}{(}[[}]{]{]]}[}[)[}{[)]](([{[}]]{}})))){]]({((]}(]}(()))]([}()[))(){{(]{((}[}]]{}[)[[)[([}]}[[[)))}(})(]{(}))]{{}][[(())(){]]([[][]))])(}]]]...

output:

842

result:

ok single line: '842'

Test #46:

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

input:

4999
()()())()()())()((()(()((()))(()(())((())())))(()))((()(((())()(())))()))(()())(())())))()()())()()()))()))()))())))())((())()()()(()()))))(()())))))))()))))(((())(()))))((((())()))())))(()((()))())))()())(()))(()())(()())))()((((((((()())))))())(())()((()))()())()((((())())))()(())))))()))(())...

output:

6242503

result:

ok single line: '6242503'

Test #47:

score: 0
Accepted
time: 76ms
memory: 4128kb

input:

4999
[[[][[][][[[]]][]]]][][]]]][[[[[][]][[[][][]]]][[][][[[[[][[[[[[]][[[]]]][[[][[][[[][[[][]][]][][][][][][[][[[][[[[[[]]]][][]][[]]]]]][[[[]]]][[]]]][[[]][]]]][[][][[][][[]][[[[[]][][]][[]][]][[[]][]][][]]]]]]]][[][][[[]][[[[]][[]]][[]][][][]]]][[[[[]][]]][[[][[][[[[[]][]]][[]]]]][[[][[][[]][[]]...

output:

6242503

result:

ok single line: '6242503'

Test #48:

score: 0
Accepted
time: 71ms
memory: 3904kb

input:

4999
}{{}}}{}}}{}}{{{{{{}}{}}}{{{}}}{}}{{{}}{}}}}{{{{}{}{}{}}}{{}}{}}{}}{}}}}}{{}{{{}}}}{}}{}{{{{}{{}{{}{{}{}{{}}{}}}}{{}}{}}}{}{}{{{}}{{}{}}}{{{{}}}{{{}}}{}{{}{{}}}}}}{{}}{{{}{{{{{{{}}}{{}}{}}}{{{{}{}}{{}}{{{}}{{{{{{{{}}}}{}{}}}{}}}{}}}}{{}{{}{{{}{{}{{}{}}}{{}}{{}{}}}}{{{}}{{{{{{{}}{{}{{{{{{}{}{}}{...

output:

6242503

result:

ok single line: '6242503'

Test #49:

score: 0
Accepted
time: 70ms
memory: 3920kb

input:

4999
)))(()(((((()))(()))(()((((())))((())()))(()()(()))()()()((()(((()()))(()(())))))())((()()(()))(())((()())()(())())(()(())(())())((((()(()())((((((())))))))())(((((())()())))()()(((((((()))((()))()()()(())()()(()()())())())()()()(())())(())))((())((()))))()(()((()))()))()(()((()()))())))()))(()...

output:

6242503

result:

ok single line: '6242503'

Test #50:

score: 0
Accepted
time: 71ms
memory: 3856kb

input:

4999
[]]][][][[[][[[]][[][[[][[[]]][[[[][]][[][[[]][][][[]][]][[]]][]][][][[][][][[[]]]][]][[]][[][]]]]][]]][]]][[[[[[][][[][[]][[][][]][][]]][][][][][][[][][[][[[[[[[][[][][[][][[[][]]][[][]][[]][[[]]]][[[]][[[[][[][[]][]][[[[][]]]]][]]][]]][]]]]]][]]]][[[[[][]][][[]]]]]][[[[[[[]]][[]]]][[[][][][][...

output:

6242503

result:

ok single line: '6242503'

Test #51:

score: 0
Accepted
time: 70ms
memory: 3784kb

input:

4999
{{}{}}{{{{{{{}{}}{}}{{}{}{{{}{{}}}}}{}}{}{{{{}{}{}}{{}{{}{{}}{}}}}{}}{{}{}{}{{}{}{}{{{{}}{{{{}{{}{}{}{{{{}}}{{{}{}{}{}{}}}{{}{}{{{{{{}}}}{}{}}{}}}{}}{{{{{{}}}}}{}{{}}}{}{{{}}{}}{}{}{}{{{{}{{}}{{}{{{{{}}{{{{{{{}}}{{}}{{}{{}}}}}}}}}}{}{{{}{{}}{}}}{}}}{}{}}{}{}{}}{}{{}}}{{}{{{}}{}}{{}{{{{}}}{}{{}}...

output:

6242503

result:

ok single line: '6242503'

Test #52:

score: 0
Accepted
time: 70ms
memory: 3852kb

input:

4999
(())(()(()(())(()((((())(())))(()(((())()))))(())()())))((()(((((()))(()((()()()))))))(()()()))((((((()()))()()(()(((())(((()))))))())((((()()())))())()(((()()))))((()()((()())((()(()))()()()(())))))((())()()()))()((()()())())()(()())())()(()))))((()(())((()(()(())())())((())((((())(((())))((((...

output:

6247500

result:

ok single line: '6247500'

Test #53:

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

input:

4999
[]]]]][[]]]]]]][][[[]][]][][]][[[][]][[]][][[[]][[[[]]][][[]]][[[]][][[][][]]][][[[[]][]]][[[][[]]]]][]][][]]]]]]]]][[[[]][[][[]][]][][][[[][][][][[]]]][]]][]][[]][[][[[[[[[[][][[[]][[][][[[]][[][[[][[]][[]]][]][][[[[][[[[][][]][[[[[[[]][]]]]][[][[][]]]]][[]][]][[]]][]][[[[[[][[[][[]][[]]][[[]]...

output:

6247500

result:

ok single line: '6247500'

Test #54:

score: 0
Accepted
time: 69ms
memory: 3832kb

input:

4999
}{{{{{{{{{}}{{}{}{}{}{}}}}{}{}}{{{{{}}}}{{}{}}}{{{}{}}}{}}{{}}}}{{}{}}{{{{}{{}}}{{}{}{}}}{{{{{{{{{}{{{}}{}}}{{}}}}{}}}}{{}}}}}{}{{{}}}}{{{}{{}}{}{{}{{}{}}}}{}{}{{{{{{}}{}}}}{{{{}{}}{}}{{{}}{}{{{}}}}{{{}}}{}}}}}}}{{{{}}{{}{}{{}{{}{{}{{{{{}{{{{{{{{{}{{}}{{}{{}}{{}{}}{{{{{{}}}}{{{}}{}{{{{}}{{}{{{{...

output:

6247500

result:

ok single line: '6247500'

Test #55:

score: 0
Accepted
time: 70ms
memory: 3916kb

input:

4999
))())((())()()(((())()())))))()((())))())())(()((())((()(((()((()(())()()((())()())(()()()()((((()(())))(((((((()))((())((()))(((()())(()))))()))((((((()()(()))))())(((())(()))(())()())(()))()(()()(()()))))()()()(((()())(()(((())))()()()()())))((()))))))(()()))(()(((())()(()())(((()())()())))))...

output:

6247500

result:

ok single line: '6247500'

Test #56:

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

input:

4999
][[[[[[][][][[][[]][]]][]][[[[][[[[[[[[]]][][]][]]][[]]][[[]][][[[]][][][[][[][[]]]]]][[][[]]][]]]]][][[]][][[]]][[[][[][[][]][][[[]]][]]]]]][[[[][][]]][]][[[]][[][][[[][[]][]][]]][]][]]]][][[[][[][]]]]]][[[]]]][[]][]][]]][[]][[][]][[]]][][[]][][[][[]][]][]]]][[[[][[[[]]][]]][]]]]]]][[][]][[[][...

output:

6247500

result:

ok single line: '6247500'

Test #57:

score: 0
Accepted
time: 65ms
memory: 3904kb

input:

4999
}}{{{{{}{}}{}}}}}{}}}{{}}{}}{{{}{}{{{{}{{{{}}{{}}{{{}{{}}}{}{{{}{{}}}{}{}}}}{{}{}}}{{}}{}{{}{{{}{}{{}{}}{}}{}}}}}{}}{}{}{{{{}}{}}}}{}}{}{}{}}{}{}}{{}}}}{{}{{}}}}{}}{}{{{{{}{}{{{}{{{}}{}{}}{}}{{}{{}}{{}{{}{}{}}{{}}{}}{{}}}{{{}}}}{}}}{}}{}{{}}{{{{{{}{{{{}{}}{}{{{}}{}}{{}{}}{{}}}}}{{{{{}{}{}{{}}}}...

output:

6247500

result:

ok single line: '6247500'

Test #58:

score: 0
Accepted
time: 14ms
memory: 3928kb

input:

4999
)[([[)[([)[([(][]][](]]][((]](([(]](())]([(][)][)[[(](](()[)[([([([)[)[[)[][[[]]])))]]][[((]]]]][[[(())((]]())(()](]([))]])]))]()[([)]][])][([[))([[)][)(([)(][(]))]])[[)))[])[]]((][)[][[)(])(]][]))))[])]()()))]][(]()([([](]][())[(]))([)))[[)(](])(]))([])]](]))([[(]][][((][])[[]))[((][))]]])[)][...

output:

1209

result:

ok single line: '1209'

Test #59:

score: 0
Accepted
time: 90ms
memory: 3860kb

input:

4999
})({){{)}{{)}}{{{()}(}()){(}{){}{)(}{{()((({)}}){()}}(()}}{(({()((}}(}()))}})())}{()}){)((()}()))}}){}{}(})(}{)))({{{{){}{}()}(){}())(({}{}((}((()({}})}{{{(){}{}{{}}(}{}{{}}}}}}({}}({)}}}{}))((}{))({})}}()))(}}{({((}}{)})(()})))(}()(}{({)({{)))()())}{{})}()){})()}}})}{()})})()}({}})({}()))(})(}...

output:

1175282

result:

ok single line: '1175282'

Test #60:

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

input:

4999
[[]{[}}{}{{]}[[}{}]}}]]]]}{}[{]}}[}][}]{}{][{[]{]]}}{}[}[}{[{]][]{}[{[[]}}][}{]][{]{[[]]}[[}}]{[}{}{}[}{[]{]][}[[}{}}]][{{]}{}[{]]{]]{[[[}[[{]}]}}[{}]{}}][]]]]{[[}[}{]}{{]{}[[{}{[}]}]}{]{{}[}[]][{][[{[{}]{[}[{[][][{]{}}}}}{[{}{{[]{{}]}[{[[[]{{}[{]}{{]{]]}[}}]]{[]{{}{{]]}[}]{}{][{}}[]{[{{]{{[[{}...

output:

1220

result:

ok single line: '1220'

Test #61:

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

input:

4999
([{(([{(}}{(({)]{([())))[){[[({])()](}](](}[]}}{{(]]{[([[)(]}[([({){([}[)}]}])))]]}([[}][{){(]{(][[)][]}](}{)}){{(}}}(}[[[]((}}){(](}([{([]]]][)(](}(([()}{{[{]{[}}[){([())[{{{}[[[}][(){]}}{)(]][{}]}({([]){](]}((}]])[[]]}[{{})]()[]]}{){}})}()(({(}])[]{}])[}]()[}({}){}([]})]]([{({{{][[{({}}{[}{{]...

output:

183371

result:

ok single line: '183371'

Test #62:

score: 0
Accepted
time: 168ms
memory: 4284kb

input:

5000
()())(((()(((()()(()()))(()((((()))((((())))()(())(()(()((()))())(()(())())())(()()()((((()))))()()))())()(()()(()(()(((((()(()(((()(((())((())((((((()(())())))((((())()((()()())())(((()))((()))()((()()()())())()))())))(()())()()())((())()))(())))))(((()(()((((())()()())())(()(()())))))())())((...

output:

2500

result:

ok single line: '2500'

Test #63:

score: 0
Accepted
time: 172ms
memory: 4256kb

input:

5000
[]][][[][[[[[]]][[]]][[][[[]][[]][[[[[][][]]]][[[][]][[[][[[[][[[[[][[]]][][][[]]]][[[[[]][][][[]][]][[[[[[][[[[]][[[[]][[[[][][]]][[[[[[[]][]]]]][[]]][][[[[]]]][]]]][][][[]]][[[]][]][]][][][][]]][[]][][][][]][[]][[][[]]]][[][[]][][]][[[]][[][[]]]][]]]][]][][[[][[[][][[[[][[][][]][]]]]]]]]]][][...

output:

2500

result:

ok single line: '2500'

Test #64:

score: 0
Accepted
time: 175ms
memory: 4416kb

input:

5000
{}{{}}}{}{}{{{{}{}}{{}{}}{}{}{{{{}}{{}}}{{}}}}}}}}{}}{}}}}{}}{{}{}{{{{}}}{{{{}{{{}}{}{}{}}{{{{{{}}{{{{}}{}{{}}{}{{}}}{{}}}{{{}}{{}}}{{{}{}{{{{{}}}}{{}}}}}}}}{{}{{{}}{}{}{{{}{{}{}}{}{}{{}{{}}{}}{{}}{{{{{}}}{}{{}}}{}{{}}}}{{{}}{}}}{}}{{}}}{{}{{{{{}{}{{}{}{{}{}}}{{}{}}}{{}{{}{{{}{{}}{{}}}{{{{{}{}{...

output:

2500

result:

ok single line: '2500'

Test #65:

score: 0
Accepted
time: 236ms
memory: 4196kb

input:

5000
)()))((((()))())()())))((((((())(())()))()))())()())(()(((()((()(())(()(()())(())))(()((())(()))((()())))(()())((()))()()))(((()()((()(())))))))()(((((()()((((())())(())))())))(()(()()()((()((())()())()))()(()())()(((()())((())()((()()(())))())))(()))(()))(()((((()))()(((()((()(((()((()((())(((...

output:

6250000

result:

ok single line: '6250000'

Test #66:

score: 0
Accepted
time: 238ms
memory: 4276kb

input:

5000
[]]][[[]]][]]]][][]]][[[][[[[][[]][[]][[]][]][[][[[][[[[[]][]]]]]][[][][]]][][][[[[[]][][[[]]][]][[[[]][[[][[[][]][[[]]][]][]][]]]][]]]]][[][[][][[[[][[[[]][[[][[][[[[]][[][][[][[][[[][[][[[]]][[[[][[][][[][][][]][[][[]][[[[][[]]][]][]]]]][[[]]][]][][][[]][][[][[][]][[][[][[[][[]]]]][[[[][][][[...

output:

6250000

result:

ok single line: '6250000'

Test #67:

score: 0
Accepted
time: 238ms
memory: 4260kb

input:

5000
}}{}}}{}}}{}}}{{{}{{}}}{{{}}}}}}}}{}}}}}{}{{{{}{{{{{}{{{{{}}}{{}}{}{{}{{{}{{}{{{{{}{{}}{{{{}}}}{}{}}}}{{}{{{{}{{{}}}{}{{{{}{}}{{{{{{{{{}}}}{{}{}{}{{}{{}}{}{}{{{{{}}}}}{{{{}}{{{{{{}}}{{{{}}}}{}}{}{{}}{{{}}{{}{{{}}}{}}{{}}{}{{{{{{}{}{}{{{}{}{}{{{}{}{}}}{}{{}{{{}}{{}{{}}{{}{}{}}{}}}{}}{}}{}{}{{{}{...

output:

6250000

result:

ok single line: '6250000'

Test #68:

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

input:

5000
)]])])(()([()[])[])[)[)[[)[(([[[))[(([((([)()])]])[[[[(([]([][[]))(((]])[[)[)(([)()[[]])(]]]][]]][([([[)][[][[(([[([]([[[))[]([])])[(][)()()(((([(([[)(][]]])([[]]]))]]]([[[[)))(][]](([())])[(]()[)))][(]([)])[])[(](](([])[[]([((][([)[)))]])(])]]]))([](([))(][))(())](])]([))])[)]))([((()][(])((](...

output:

1763

result:

ok single line: '1763'

Test #69:

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

input:

5000
{)())}){}{}{{{{}(){}(})})}})({)}{(}){})(}{}){{{}){){}{)({{)(){{}((}{(){())(){}{{{}((((}({){}))({)}}{(}))}({{{}(({}{{{()((}{{)}}){(}{({}}}}){{}{{({){(){)(()())}}})})({(){)}{)}{}))){{{)}{}{){}}){{(){)}}{(}()(({{){(})}(}}{)}{}{{()({){)}{(}{}){)(}()(())})){}}({{{}{}{{{(}}}(}})({((}}}){){(})}))(}(()...

output:

1718

result:

ok single line: '1718'

Test #70:

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

input:

5000
]}}}{}[]][[][[[}}}[]]{]{{}}}]}[[{[][][[][[{{}[}}[][}[{{{}{}}{[{}[[}{{{][}[{}}{]]}}[[]]]][}}[}}{}[}}}}[}]}]][}][[[}[}{[][{}[}]{[[[{][}[}[}[}][]]{[[[{]]}{}}[{}{[[[{}[[]]}}]]}}{{]{{]}}[][{[}[]}}}[[]]]]}]][]}}}}{]}}{]}]]][}]}}{[]{]]{}{]{{[[}}}}]}][{[[}}{}}[}}][}][}[}{][[{]}]]}[{][{[[{]]{[{]}]{}[[{]...

output:

1829

result:

ok single line: '1829'

Test #71:

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

input:

5000
){{)({)(]))[[)(}}){(][()}](]{))[[[[]({[]{))([))]{[[[}((]{{[](}(([]]}]]]))[){)({}]]]{(]}](){(({({{)({](}}()[({[])[[(]{((]])([})([()([)}(]]{{[){)])){{[[){](}])[(}{{}}{}[{{)[[){}[[()(}][])]{}]{)][[{)}([]}}][[)}{[]]{()]}({]{[})}[(}{{((]}}}}}[(]][{}[((]([)}[]{[}]{(}}}([}{{]}])}([((])][)}{][}(]]}}][[...

output:

1031

result:

ok single line: '1031'

Test #72:

score: 0
Accepted
time: 94ms
memory: 3900kb

input:

5000
()))))(()))((()(()(((()()()))(()()())())((()(()(((()()()())()))()(()))()())((()(())())))()()(((((()()(())(())()())(()())()())))()()(()(())((())())))()))(((()((()())(())())(()(((()(((())(())))()((()))(()()))()(()(())(((())(((())))(()())()()))(()(()(()()())())))(()))()((((())))()())(())())(((((((...

output:

6197100

result:

ok single line: '6197100'

Test #73:

score: 0
Accepted
time: 95ms
memory: 3812kb

input:

5000
]]]]][]]][[]]][][]]]][][[][[[[]]]]]]]][[[[][[][[[][]]]][[[]]][][]][][][]][]][[[[]]]]][[][][][[]]]]][]]][][][[[[[[[[][[[[[]][[]]]][[[][[[[][]]]]][][[[[[][]][[[][][][[[][][][[[][[[][]][[[][]]][[[[[[][][[[][[][][[[]][]][]][[[]]]][[]]][[][][[][[[[]][][][[[[][][[]]][]]]]][[[[[[][]]]]][[[][][[[[[][[[...

output:

6197100

result:

ok single line: '6197100'

Test #74:

score: 0
Accepted
time: 94ms
memory: 3828kb

input:

5000
{}{{}{}{}{{{}{{{}{{{}}{{{}}}{{{{}{{{}{}}{}}}}}{{{}{{{{}{{}}{}}}{{{{{}{{{}}{{}{}}{}{{}{}{}{}}{{{{{}}{{}}{}{}{}{{}}{{{{{}{{{}}{{{{{}}{{{{}}{}{{}{{}{{{{}}{{{}}{}{}{{}}}}{}}{{}}}}{{}{{}{}}}{}{{}}}{{}}}{}{}}{}}}}{}{{}{{{{{{{}}}}}{{}}}}{}}}}{{{{{{{}}}}{}}{{}{}}{}}{}{}}{{{}{}{{{{}}{}}{{}{}{}}{{}}}}{}}...

output:

6197100

result:

ok single line: '6197100'

Test #75:

score: 0
Accepted
time: 133ms
memory: 3764kb

input:

5000
(((((((((((((((((((((((((((((((((((((()((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((...

output:

6320

result:

ok single line: '6320'

Test #76:

score: 0
Accepted
time: 132ms
memory: 4092kb

input:

5000
[[[[[[[[[[[[[[[[[[[[[[[][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...

output:

6320

result:

ok single line: '6320'

Test #77:

score: 0
Accepted
time: 130ms
memory: 3888kb

input:

5000
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...

output:

6320

result:

ok single line: '6320'

Test #78:

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

input:

5000
[)[(]([[)[()[()(](]((())](([])[[)[][(])[([(][)(([[][)())()(([[[]][]]])([]]])(((([][][)[[()((]((])]][])](([([([])((]())))([)][)[()][(][((])][(])](])]]()])([][[[)](([[([[([[[]]]]))]()()[])[(])][)[[[][(])[[[[[)(()([]]](](((][]()[][))(][([[]))[)])])(])]())][((())]]]())]]([())))]]()()[)[)[[][([(((](...

output:

3919

result:

ok single line: '3919'

Test #79:

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

input:

5000
(()({)})))(){()){)}{{){((})(){)))({)){})}}(}}}))}(())(((({}{}{}(}}({}){{})({}(}}()}}{{)()){(()({{}{(}){})){))({}}(}}}}}}}(()()){()(}{}{{){}(){(}{}))))(}({{})({)()}{)()){}}({))((}{{){()})))}}({)(}{{)()})){(})({()({)}}())}})))())}({}){}))}}}{{({)({)({){({()}({)}{{)(()({({(){}}()}{(}({())){){)}({}...

output:

3419

result:

ok single line: '3419'

Test #80:

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

input:

5000
[{[}{{][[{}}{]{[}[]{[[]]}{[{}[]}[[]]}{{]{{}]]]}}}}]{[{{{[}]]]{}[[]]}{[]]}{[]]][]][}][}}]}}]]{[{][{{]{][[{]{[}[]{[]{{{]{{}[[[}][{]][[]}{]][[]{{{]}[[}]}[}{{{]]}{]}}{}]}{{}{{[]]{{][[]{{}}}{{][]}}{]{]}}][{}{]][[}}[{[]]}}{{{]}}{{{}}[}{{{[][}[][[}}{}{{[[{]{]}[{][{{][}]]{]{]{]{{]}[{[[[{}]{[{]{[{{}{{}}...

output:

3334

result:

ok single line: '3334'

Test #81:

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

input:

5000
))[[{]{{]({}(((]]}[}([[}}]}]{))))]][}}[)}})[[(}[({{({])(){([{}{][]))]{{][}[[}){]()){[{[([}}))}[](}}))(})}{{)){{{(}{{{[)]]])[([[{)(([])}[{{{}}({}))]}}))[([]][[][[)])}(}()({}{[]{)(]({((}){}{({)[({}[}[}((}[}}{[{}[][]]([)}[([}}}{[]}(})]{[])]{}}{}{}[(}}[[{[(}]([{{{)({]}[){}((){{{[)(](}(({][}]{]][][)...

output:

1336

result:

ok single line: '1336'

Test #82:

score: 0
Accepted
time: 118ms
memory: 3836kb

input:

5000
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((...

output:

4999

result:

ok single line: '4999'

Test #83:

score: 0
Accepted
time: 119ms
memory: 3860kb

input:

5000
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[...

output:

4999

result:

ok single line: '4999'

Test #84:

score: 0
Accepted
time: 119ms
memory: 3924kb

input:

5000
{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{...

output:

4999

result:

ok single line: '4999'

Test #85:

score: 0
Accepted
time: 1ms
memory: 3832kb

input:

5000
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))...

output:

4999

result:

ok single line: '4999'

Test #86:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

5000
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]...

output:

4999

result:

ok single line: '4999'

Test #87:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

5000
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}...

output:

4999

result:

ok single line: '4999'

Test #88:

score: 0
Accepted
time: 26ms
memory: 3912kb

input:

5000
[)]([][([]](]([)][][)[(]([(]]][(](()])[([](()[))]])]][]]](])[)([[(]([(]][[]][)[)]])[[([[](])])))()))[[)))))([[)[])(][[([(]])][))]))])((](([(](]))[)))[[[[)[]((([)[)(()(([](]]]))]]()[]()(])[)][)()][)[((]([]())][])[[))(]]()]]][[[[())))])])[([)[][([][[(][[([[(](()()[](()[][[)[[[))[[]])[[](([[[])((]...

output:

1246

result:

ok single line: '1246'

Test #89:

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

input:

5000
){{}{({)}))()}(})}){{()({{{}))(})()(}}{}){{)}))){{){)()}}}}(({}})}{}{)(})))({({)))(}{({()))}}{()({{((})}))})}})}){}}}){()((}{){(()(}}(}{}{{{){}{{{())(({()}())()}))}}){()}}(}}}{})))})){({})}(}{}{{})}{(}))}){}{}{(){}(({(}}))({()()({{)((}}{({{({(){{)(()(({{({{(}{}{}()}({)}({(){{})){(){{())({}(){{}...

output:

1207

result:

ok single line: '1207'

Test #90:

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

input:

5000
}}{[{[[][{]{}[{}[]}[}{}]}}}[}}{{]}[}][}{}[[{[]{}]}]}}]{}]}]][[[]{[}}{}}{}}[[{{]]][{[}{[{{}{}}}{]]{[]]][[{{}[]{}{}{{[{]}{{}[]]]{}}[[]}}[}[{{]{}]}[}}[[]}}}{}{]{[{}{[}]{[}]}}}{}]][}{}}{]]]][{][{[{{}}]]{}}]]{]{[}[}[[[]{{}}}]}{}[]}}{}[]{[[{}]}}{][]}}[[[][][{[}[{{]]][]{}{}[}]}]}{{{{}][{{}]}[]]]][[}}{...

output:

1230

result:

ok single line: '1230'

Test #91:

score: 0
Accepted
time: 56ms
memory: 4152kb

input:

5000
}(][(}[)]})]]({))[}]{([{{)}{([}[){[][({][{}}[[][)}[))[)}]}{((]{[})](([[)[])}{[[{]][}{)]}]}]}]}{{]))][{}){}{})])((}))](]}}))()[)](([[[))]}[[{[][][())[(](}[{{)()}))}[][)]]}){({}]]](){([{})}((({}]){]}{[}{(]([{[][)]}[{[]]]()[)]})[[[]{}](][)(]{[}[]{{[}()]](]]{[]}[]]]]([))([{()][}}][{}()({))](}[[{}()...

output:

890

result:

ok single line: '890'

Test #92:

score: 0
Accepted
time: 70ms
memory: 3908kb

input:

5000
)((())))()))()((()(())))))(()))(()()())((()(())))(()))(()))))))()(())))())(((()(())()((((()()()(())())(())((()(((()((((())(())))(()))((((((((()())())(())((((())(((())))((())))(()((((((()((())))((()((((()))((()))()))))()))())()))))))))()()(())))()))(()(((())())(((())()))))((())()()((()(())((()))...

output:

6245002

result:

ok single line: '6245002'

Test #93:

score: 0
Accepted
time: 71ms
memory: 3796kb

input:

5000
]][[[[[][][][[[][[][[]]][]]][[[][][]]]][[][][[[][[[[[[]]][[[][]][[]][[]][][]][][[]][]][[]]][][]][][][[[[]][]]]]]][[]]][[]][[[]]]][[[[[]]][][][[[[[]][[[]][[[[[[][[[[]][][[][]][][[[[[]][]]][][]]]]]][[]]]][][]][][[]][]][[][[[]][[][[]]][[]][][]]]][]]]][[]][]]]]][]][[[[[][]][]][[[][[]]]]]]][][[[][]]...

output:

6245002

result:

ok single line: '6245002'

Test #94:

score: 0
Accepted
time: 70ms
memory: 3836kb

input:

5000
}}}}}}{}}{{{}{{}{{{}{}{{}{{{}{}{}{}}{{{}{{}}}{}}}{{}{{{}}{{}{}}}}{{}{}{{}{{}{}}}{}}}}}{{}}{}{}{}}}}{{}}{}}{}}}{}}}}{{{{{{}{{{}}{{}}}}{{}}}}{{}}{{}}}{{}{{{{{}{}}}}{}}}}}{{}}}}}{{}}}}{}{}}{{{{{}}{}}{}}{{{{}{{{}{}{}{}}{}}}}{}}}{}{}{}{{}}{{}}}{}}{{{{}}}}{{}}{}}}{}{}}}{{{}}{{{{{}{}}}}{}}{}{{}}}}{{{{...

output:

6245002

result:

ok single line: '6245002'

Test #95:

score: 0
Accepted
time: 69ms
memory: 3836kb

input:

5000
)))()((()())()()()))((((())(())())(()))(())(((((((())(())(()))())()(((((()(()(()()))((()()))())))((())))(()(()))))(()())())))))((()))()()()((()(((())()()(((((())))()))))))(()(())(()))((((()()(((()())))(())((()((((()(((())())))))((())()))()()()))(()((()))()()(())((()((()))(())(((((((())()()(((((...

output:

6245002

result:

ok single line: '6245002'

Test #96:

score: 0
Accepted
time: 71ms
memory: 3856kb

input:

5000
[[[[][]]][][]][]]]][][]][[]]]][]]]]]][[]][]][[[]]][[[[][[[]][][]][[][[[]]]][[[][[][[[][[[][][]]]][[[[[]]]]]]][][[[[]][]]]][[[][][[][[]]]][][[][][[]]]][[[][]]][[[][][]]][]]][]][[[[[[[[][][]][[]][]][[[[]][][]][][]][[[[][[][][][]]][]][[][][[][][[[]][][][[]][[][[[[]]]]]][[[[]][[]][[[]][[][][[[][[[]...

output:

6245002

result:

ok single line: '6245002'

Test #97:

score: 0
Accepted
time: 70ms
memory: 3860kb

input:

5000
{{{{{}}}{{}}}}{{}{{{{{}}}}}{{{}}{{}{{}{}{{{}{}}}{{}}{}{}}{}{}}{{}{{{{}{{{{{{{{{}{}}}{{}}{{}{{{}{{}{{{}{}{}}}}}{}}}{{}{}}{}{{}}{{{}}{}}}}}{}}{}{{}{{}{{}}}}}}}}}{{{}}{}{}}{}}}}{{{{}}{{}{}{}{{{{{}{}{{{}}}}}{}{}}}}}}}}{{}}}{}}{{{{}{}{{}{{{}{{}{}{{{{{{}}}{}{}}{{}}{}}{}}{{}}{{{}{{}}}{}{}{{}{{{{{{{}{}...

output:

6245002

result:

ok single line: '6245002'

Test #98:

score: 0
Accepted
time: 70ms
memory: 3908kb

input:

5000
())))(()()())()())))))()))(()))()(()()())))()()()()(()((((())))))))(()(())))))))()(()())))(((()))))))))(())))))(()(())((()))((())(()(((((())()()((()()()())))))(())()))))()())((())(((()()()))(()())))((()()))())))())(()()))(()()))(((((()()))(())()())()()((((()((()()(()()())((((())(())()()())((()(...

output:

6250000

result:

ok single line: '6250000'

Test #99:

score: 0
Accepted
time: 67ms
memory: 3928kb

input:

5000
][]][[[][[][][[[[]]]]][][]][[]][][[[]]]][]]][[[[][]]]]][]][]][[]]]][]][][[[[[]]][][][][]][[[][[]][][][[[[][[][][]]]]]]][[]]][[][[[]]]][]][][][]][]][]][][[][[[[[][[][]][][[[][[][][]][[[][]][]][[[[[][[[[][]]]][[][[[[[][][[[]]][]]][[][[[]][[][[]]]][]]][]]]]][]][[]][][[[]]]]][]]]][]]]][[]][][[][]]]...

output:

6250000

result:

ok single line: '6250000'

Test #100:

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

input:

5000
{}}}}{{}{}{}}}}}}{}}}}}}}}{{}{{}}}}{{}{}{}{}{{}}{}{}{}}}{}{{{{}}}{{{}}}{{}{}{{}{{}{}{{{{{{{{{}}}}{}}}}{{}{}}{{{}{}}{{}}{}}}}{}}{{}}{{{{}{}{}{}{{}{}}{{}}}{{}}{{}{}}}}}}{}}{{}{{}{{{}{{}{{{}}}}}}{{{{{{}}{}{{{}}{{}{{}{{{{}}}}{{{{{{{{{{{}{{{{{{}{}}{{}}}}}{}{{}}{{}}{{}{{}{{{{{{{{{{}}{}{{}{}}}}}{{{{{{...

output:

6250000

result:

ok single line: '6250000'

Test #101:

score: 0
Accepted
time: 69ms
memory: 3928kb

input:

5000
))())((()()()())))))))((()((())))(())((())())()()()()))((((()()))))()((()(((())(((()))())))))()()()()((()))())()()()((((((()(((()))((()()))))(()(())())(()())((()))())))()())))))()(()()(((()()))(((())))((((((())(()()())(())(((((())((())((()((()(()(())))())))(((())()))(())))))())((()((()(((()())(...

output:

6250000

result:

ok single line: '6250000'

Test #102:

score: 0
Accepted
time: 71ms
memory: 3852kb

input:

5000
]]]][[[]]]]]]]]]][][[[[][]][]]][[[[[]][[[[]]]][[[]]]][][[[][[]][][[][][][[[]][][][][[]][[[[[][[[][][[[[[]][[]][][][[[][][]]]]][][][]][[][]][][[[]][][][[]][]]][][][]][[][[[[[]][][[[]][]][][][][][][[[][][][[[][[][[]]][[[][[[[[]][][]]][][]][[[[[[]]][][[][[]][[]]]][[[[][][[[]][[][]]][[[[][[[]][]][]...

output:

6250000

result:

ok single line: '6250000'

Test #103:

score: 0
Accepted
time: 69ms
memory: 3912kb

input:

5000
}{{{}{{}}}{{{{}}}}{}}{{{{{}{{{{}}{}{}}}}{}{{}}{}{{{{{{}}}{}{}}}{{}}}}{}{}{}{}{}{{{}}{{{{{}{{{}}{}{{{{{}}}}}}{}}{}}}}}}}{{{}}}}{}}}}}{{}{{}}}}{}}}{}}{}{}{{{}}}{{{{}{}{}}}{}}{}{}{{}}{}{}}{}{{{}{}}{{}}}}}{}}{}{}}}{}{}{{{{{{{{}{}}}}{{}{{}}{}{}{{{{{{}{}{{}{{{}{{{}}}{{}}}}}}{}{}}{}{}{}}}}{{{}}}{}{}}}...

output:

6250000

result:

ok single line: '6250000'

Test #104:

score: 0
Accepted
time: 88ms
memory: 3784kb

input:

5000
[][)))][))()][(([)())()))[[))]])[]][[[[](][[[([])([]))](]]([([(]())[])[]()[()]](((][)()(()(()[)])[)([(])[((]]([]])]]][)()([)))([([[][[([(]))[])))](])([(]()][]]]])][][)(](((([[)])][)](][)())][[(][(])][]((()[[)(]][[))]](]()](((]))[]()([][]()][()[[((()[)()[[)]))((()[(](](([)([(]([]))][)]]([][]()](...

output:

1181521

result:

ok single line: '1181521'

Test #105:

score: 0
Accepted
time: 43ms
memory: 3868kb

input:

5000
()(})()})({(}){)}{}(}}{(((({}{}{)((({(}}())}){()({})()({(}){)())})({{(())(}}))({(}{{)))){{})({()()(((}}}()()})}{}{}(}}(){)))(({{(()}({}{{)({)})()})}(()}({{})((){{((}{){}})(((}{}{)}()){)()){}({{)}))}}}{{{(})(){}){)))}{}}({)}}({({)({){)))}}}(({{{{)(({{(}})((()}{}{{{{()({}(}){{(}{{))}()}({({}(({((...

output:

402169

result:

ok single line: '402169'

Test #106:

score: 0
Accepted
time: 84ms
memory: 3836kb

input:

5000
{]][}}}}[{[]{{}{{}[}[{[{{]][{[[][]}}[}}}{[}}]]]{{{]}]}[][}][{[}{{{]}}}{[{]{{{}]][}[{[{][[][{]{{[{{}}{[}]]]{[]}{}{[[{{}]{}}[]]}[[[}[}]{[]{{][}{{}]{}}}]]{[}]{[}[}}{[{{[]{}}]}{]{}]]]}}[[}]]{[{{[][[[{]{{[}}{]]]{]}]]{{[[]{]}[[[][[{]}{[[][][][[}{]][[{]]}{]]{[}[[}]}}][}]{]}{[[[{[{{{[[}[{}}[]]]}}}[[}{[...

output:

1162482

result:

ok single line: '1162482'

Test #107:

score: 0
Accepted
time: 64ms
memory: 3908kb

input:

5000
((})]{)(})]{)((){[{)}([]{(][][})]{){}(]{[[}[)}}]]})}[[[)[]{]][]])])])}][[]})))](}][({}}({}]))]}}}]){][]([{}[)(])](})][}[})([]]){]({]{(()]])}{{]{}(}]]}({(]}[}}][({{([(}([()[][{{()([(]}[))({][{[[(]}{)]](}]]{]({{(}{((){[)))({[{()}}[]}]][){(}}][{)[{]{{{{{[[]}{]}[)([){{]}[{[})](({}[)((([][[[]]({{(}}...

output:

823

result:

ok single line: '823'