#include <iostream>
using namespace std;

int main() {
    int T;
    cin >> T;

    for(int i=0; i<T; i++) 
    {
        int N, A, B;
        cin >> N >> A >> B;

        int wearCount = 0;
        bool jacket = false; 

        for (int i = 0; i < N; i++) 
        {
            int temp;
            cin >> temp;

            if (temp < A) 
            {
                if (!jacket)
                {
                    wearCount = wearCount + 1;
                    jacket = true;
                }
            }
            else if (temp > B) 
            {
                jacket = false;
            }
        
        }

        cout << wearCount << endl;
    }

    return 0;
}
