int main(){ setup(); int offset = 'A'; int letters = 'Z' - 'A'; auto t = read1(); while(0 < t--){ auto h = read1(); auto w = read1(); auto note = read1(); int n = note.size(); graph G(2+letters+h*w); edge_adder adder(G); auto source = boost::vertex(0, G); auto target = boost::vertex(1, G); // Edge for every letter (letter -> target [num]) for(int i=0; i snippet [1]) for(int i=0; i letter [1]) for(int i=0; i(); for(int j=0; j letter [1]) for(int i=0; i(); for(int j=0; j