/* brute force O(sum l) reference to learn the query length distribution */
static const unsigned char WIN[3][3] = {{0,0,1},{1,0,0},{0,1,0}}; /* WIN[a][b]: a beats b */
void solve(int n, int q, char *s1, char *s2, int *q_x, int *q_y, int *q_len, unsigned *ans) {
(void)n;
for (int t = 0; t < q; t++) {
int x = q_x[t], y = q_y[t], l = q_len[t];
unsigned c = 0;
for (int i = 0; i < l; i++) c += WIN[(unsigned char)s1[x+i]][(unsigned char)s2[y+i]];
ans[t] = c;
}
}