#include using namespace std; int f[200]; void initialize(int f[]) { for(int i=97;i<123;i++) f[i]=0; // This function is called once before all queries. } int answer(int l, int r,string s) { initialize(f); for(int i=l;i> s; int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ int l; int r; cin >> l >> r; int result = answer(l, r,s); cout << result << endl; } return 0; }