Digit Patterns

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=279&page=show_problem&problem=3846 [PDF](https://uva.onlinejudge.org/external/124/p12415.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12415/482fc185c983ec4c19afe3ce0b8ea7f8356525ca.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12415/752db3557e5708352566a7baedfe67e47136f82c.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12415/fc7f1d8a64a7434b587a9f7ce474f1a794d8d335.png)

输入输出样例

输入样例 #1

Hint
This problem is hard. You need to know some theory behind regular expressions, not just how to
use them. Please make sure your program can pass the test cases in the gift package in the contest
website.
6 1(2+3)*4
012345
2 00*(10+100)*
00100

输出样例 #1

5
1 2 4 5