#include using namespace std; long long int fact(int count){ long long int res = 1; for(int i = 2; i <=count; i++){ res *= i; res %= 1000000007; } return res; } int answerQuery(string s, int l, int r) { // Return the answer for this query modulo 1000000007. int a[26]={0},count_even = 0,count_odd = 0; int b[20]={0}; for(int i = l; i <= r; i++){ int index = s[i-1]-'a'; a[index]++; } int k = 0; for(int j =0; j <26; j++ ){ if( a[j] / 2 >=1 ){ count_even += a[j]/2; if(a[j]/2 > 1){ b[k] = a[j]/2; k++; } } else{ count_odd += a[j]%2; } } cout <<"count even "<> s; int q; cin >> q; for(int a0 = 0; a0 < q; a0++){ int l; int r; cin >> l >> r; int result = answerQuery(s,l, r); cout << result << endl; } return 0; }