#include #include #include using namespace std; int n; char as[12],bs[12]; int vs[12]; int solve(int pos, int step) { if (pos==n) return step; int d=vs[pos]; if (d==0) return solve(pos+1,step); int res=INT_MAX; for (int tail=pos;tail