#include <bits/stdc++.h>   using namespace std;   char a[1005];   char b[1005];   int t[1005];   int sum[1005];   int main() {     memset(t, 0, sizeof(t));     int p, n, m;     cin >> n >> m >> p;     cin >> a >> b;     for (int i = 0; i < n; i++) {       for (int j = 0; j < m; j++) {         if (a[i + j] != b[j])           break;         else if (j == m - 1)           t[i] = 1;       }     }     sum[0] = t[0];     for (int i = 1; i < n; i++) sum[i] = sum[i - 1] + t[i];     while (p--) {       int l, r;       scanf( %d%d , &l, &r);       l--, r--;       if (n < m || r - l + 1 < m)         cout << 0 << endl;       else         cout << sum[r - m + 1] - sum[l - 1] << endl;     }     return 0;   }   