#include <bits/stdc++.h>
using namespace std;
string s;
int n, q, a, b;
int main(){
    cin >> n >> q >> s;
    while(q--){
        cin >> a >> b;
        676767
        int m = b-a+1;
        cout << m*2-1 << endl;
    }
    return 0;
}