#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;

#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
#define mn -
#define pls +
#define mod %
#define E =
#define EE ==
#define le <=
#define ge <=
int mx=9999999;
/**  '' "\n" - ^ **/

class Template{
    public:
    void yes()
    {
        cout<<"Yes\n";
    }

    void no()
    {
        cout<<"No\n";
    }
    void YES()
    {
        cout<<"YES\n";
    }

    void NO()
    {
        cout<<"NO\n";
    }

    void Case(int i,int n)
    {
        cout<<"Case:"<<i<<" "<<n<<endl;
    }
    /**  '' "\n" x ^ **/
    /** printf("\n") */
};

Template root;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    sf(t);
    in(i,t)
    {
        int n,k;
        cin>>n>>k;
        int a[n];
        in(i,n)
        {
            cin>>a[i];
        }
        deque<int> q;
        q.push_back(0);
        queue<int> pk;
        for(int i=1;i<k mn 1;i++)
        {
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
            }
        }
        int l=1;
        int mx=0;
        if(pk.size()>mx)
        {
            mx=pk.size();
            l=1;
        }
        for(int i= k mn 1,kk=2;i< n mn 1;i++,kk++)
        {
            while(!pk.empty()&&pk.front()<kk)
                pk.pop();
            q.pop_front();
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
                //cout<<pk.size()<<endl;
                //cout<<i;ps();pf(pk.size());
            }
            if(pk.size()>mx)
            {
               mx=pk.size();
               l=kk;
            }
        }
        cout<<mx+1;ps();pf(l);
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;

#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
#define mn -
#define pls +
#define mod %
#define E =
#define EE ==
#define le <=
#define ge <=
int mx=9999999;
/**  '' "\n" - ^ **/

class Template{
    public:
    void yes()
    {
        cout<<"Yes\n";
    }

    void no()
    {
        cout<<"No\n";
    }
    void YES()
    {
        cout<<"YES\n";
    }

    void NO()
    {
        cout<<"NO\n";
    }

    void Case(int i,int n)
    {
        cout<<"Case:"<<i<<" "<<n<<endl;
    }
    /**  '' "\n" x ^ **/
    /** printf("\n") */
};
void solve(int n)
{
    int a[n];
    in(i,n)
    {
        cin>>a[i];
    }
}
Template root;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    sf(t);
    in(i,t)
    {
        int n,k;
        cin>>n>>k;
        int a[n];
        in(i,n)
        {
            cin>>a[i];
        }
        deque<int> q;
        q.push_back(0);
        queue<int> pk;
        for(int i=1;i<k mn 1;i++)
        {
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
            }
        }
        int l=0;
        int mx=0;
        if(pk.size()>mx)
        {
            mx=pk.size();
            l=q.front();
        }
        for(int i= k mn 1;i< n mn 1;i++)
        {
            if(!pk.empty()&&q.front()==pk.front())
                pk.pop();
            q.pop_front();
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
                //cout<<pk.size()<<endl;
                //cout<<i;ps();pf(pk.size());
            }
            if(pk.size()>mx)
            {
               mx=pk.size();
               l=q.front();
            }
        }
        cout<<mx+1;ps();pf(l+1);
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;

#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
#define mn -
#define pls +
#define mod %
#define E =
#define EE ==
#define le <=
#define ge <=
int mx=9999999;
/**  '' "\n" - ^ **/

class Template{
    public:
    void yes()
    {
        cout<<"Yes\n";
    }

    void no()
    {
        cout<<"No\n";
    }
    void YES()
    {
        cout<<"YES\n";
    }

    void NO()
    {
        cout<<"NO\n";
    }

    void Case(int i,int n)
    {
        cout<<"Case:"<<i<<" "<<n<<endl;
    }
    /**  '' "\n" x ^ **/
    /** printf("\n") */
};

Template root;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    sf(t);
    in(i,t)
    {
        int n,k;
        cin>>n>>k;
        int a[n];
        in(i,n)
        {
            cin>>a[i];
        }
        deque<int> q;
        q.push_back(0);
        queue<int> pk;
        for(int i=1;i<k mn 1;i++)
        {
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
            }
        }
        int l=1;
        int mx=0;
        if(pk.size()>mx)
        {
            mx=pk.size();
            l=1;
        }
        for(int i= k mn 1,kk=2;i< n mn 1;i++,kk++)
        {
            if(!pk.empty()&&q.front()==pk.front())
                pk.pop();
            q.pop_front();
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
                //cout<<pk.size()<<endl;
                //cout<<i;ps();pf(pk.size());
            }
            if(pk.size()>mx)
            {
               mx=pk.size();
               l=kk;
            }
        }
        cout<<mx+1;ps();pf(l);
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;

#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
#define mn -
#define pls +
#define mod %
#define E =
#define EE ==
#define le <=
#define ge <=
int mx=9999999;
/**  '' "\n" - ^ **/

class Template{
    public:
    void yes()
    {
        cout<<"Yes\n";
    }

    void no()
    {
        cout<<"No\n";
    }
    void YES()
    {
        cout<<"YES\n";
    }

    void NO()
    {
        cout<<"NO\n";
    }

    void Case(int i,int n)
    {
        cout<<"Case:"<<i<<" "<<n<<endl;
    }
    /**  '' "\n" x ^ **/
    /** printf("\n") */
};

Template root;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    sf(t);
    in(i,t)
    {
        int n,k;
        cin>>n>>k;
        int a[n];
        in(i,n)
        {
            cin>>a[i];
        }
        deque<int> q;
        q.push_back(0);
        queue<int> pk;
        for(int i=1;i<k mn 1;i++)
        {
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
            }
        }
        int l=0;
        int mx=0;
        if(pk.size()>mx)
        {
            mx=pk.size();
            l=1;
        }
        for(int i= k mn 1,kk=2;i< n mn 1;i++,kk++)
        {
            if(!pk.empty()&&q.front()==pk.front())
                pk.pop();
            q.pop_front();
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
                //cout<<pk.size()<<endl;
                //cout<<i;ps();pf(pk.size());
            }
            if(pk.size()>mx)
            {
               mx=pk.size();
               l=kk;
            }
        }
        cout<<mx+1;ps();pf(l);
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;

#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
#define mn -
#define pls +
#define mod %
#define E =
#define EE ==
#define le <=
#define ge <=
int mx=9999999;
/**  '' "\n" - ^ **/

class Template{
    public:
    void yes()
    {
        cout<<"Yes\n";
    }

    void no()
    {
        cout<<"No\n";
    }
    void YES()
    {
        cout<<"YES\n";
    }

    void NO()
    {
        cout<<"NO\n";
    }

    void Case(int i,int n)
    {
        cout<<"Case:"<<i<<" "<<n<<endl;
    }
    /**  '' "\n" x ^ **/
    /** printf("\n") */
};

Template root;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    sf(t);
    in(i,t)
    {
        int n,k;
        cin>>n>>k;
        int a[n];
        in(i,n)
        {
            cin>>a[i];
        }
        deque<int> q;
        q.push_back(0);
        queue<int> pk;
        for(int i=1;i<k mn 1;i++)
        {
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
            }
        }
        int l=0;
        int mx=0;
        if(pk.size()>mx)
        {
            mx=pk.size();
            l=q.front();
        }
        for(int i= k mn 1;i< n mn 1;i++)
        {
            if(!pk.empty()&&q.front()==pk.front())
                pk.pop();
            q.pop_front();
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
                //cout<<pk.size()<<endl;
                //cout<<i;ps();pf(pk.size());
            }
            if(pk.size()>mx)
            {
               mx=pk.size();
               l=q.front();
            }
        }
        cout<<mx+1;ps();pf(l+1);
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;

#define pf(n) cout << n << endl
#define ps() cout <<" ";
#define sf(n) cin >> n
#define in(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define vp vector<pair<int, int>>
#define graph vector< vector<int> >
#define vs vector<string>
#define mn -
#define pls +
#define mod %
#define E =
#define EE ==
#define le <=
#define ge <=
int mx=9999999;
/**  '' "\n" - ^ **/

class Template{
    public:
    void yes()
    {
        cout<<"Yes\n";
    }

    void no()
    {
        cout<<"No\n";
    }
    void YES()
    {
        cout<<"YES\n";
    }

    void NO()
    {
        cout<<"NO\n";
    }

    void Case(int i,int n)
    {
        cout<<"Case:"<<i<<" "<<n<<endl;
    }
    /**  '' "\n" x ^ **/
    /** printf("\n") */
};

Template root;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t;
    sf(t);
    in(i,t)
    {
        int n,k;
        cin>>n>>k;
        int a[n];
        in(i,n)
        {
            cin>>a[i];
        }
        deque<int> q;
        q.push_back(0);
        queue<int> pk;
        for(int i=1;i<k mn 1;i++)
        {
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
            }
        }
        int l=0;
        int mx=0;
        if(pk.size()>mx)
        {
            mx=pk.size();
            l=q.front();
        }
        for(int i= k mn 1;i< n mn 1;i++)
        {
            while(!pk.empty()&&pk.front()<=q.front())
                pk.pop();
            q.pop_front();
            q.push_back(i);
            if(a[i]>a[i mn 1] && a[i]>a[i+1])
            {
                pk.push(i);
                //cout<<pk.size()<<endl;
                //cout<<i;ps();pf(pk.size());
            }
            if(pk.size()>mx)
            {
               mx=pk.size();
               l=q.front();
            }
        }
        cout<<mx+1;ps();pf(l+1);
    }
}


#include<iostream>
#include<vector>

using namespace std;

int n , k;

void solve(){
    cin >> n >> k;
    vector<int> a(n);
    vector<int> peaks(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 1; i < n-1; i++){
        if (a[i] > a[i-1] && a[i] > a[i+1])
            peaks[i] = peaks[i-1] + 1;
        else
            peaks[i] = peaks[i-1];
    }
    // Last element
    peaks[n-1] = peaks[n-2];
    int anspeaks = 0, ansl = 1;
    for (int i = 0; i < n-k+1; i++){
        if (peaks[i+k-2] - peaks[i] > anspeaks){
            anspeaks = peaks[i+k-2] - peaks[i];
            ansl = i + 1;
        }
    }
    cout << anspeaks + 1 << ' ' << ansl << endl;
}

int main(){
    int t;
    cin >> t;
    while (t--){
        solve();
    }
}


#include<iostream>
#include<vector>

using namespace std;

int a[200001];
int b[200001];
int t, n, k;

bool issapeak(int x){
    if (x == 1 || x == n)
        return false;
    else if (a[x] > a[x-1] && a[x] > a[x-1])
        return true;
}

int main(){
    cin >> t;
    while (t--){
        cin >> n >> k;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        int ans = 0, anst, ansl;
        for (int i = 1; i <= n; i++){
            b[i] = b[i-1] + issapeak(i);
            int peaks = b[i]-b[i-k]-issapeak(i)-issapeak(i-k+1);
            if (i >= k && peaks > ans){
                anst = peaks;
                ansl = i - k;
            }
        }
        cout << anst + 1 << ' ' << ansl + 1 << "\n";
    }
    return 0;
}


#include<iostream>
#include<vector>

using namespace std;

int main(){
    int t;
    cin >> t;
    while (t--){
        int n, k;
        cin >> n >> k;
        vector<int> a(n+1);
        vector<int> peaks;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        for (int i = 2; i <= n - 1; i++){
            if (a[i] > a[i-1] && a[i] > a[i+1])
                peaks.push_back(i);
        }
        int mxpeaks = 0;
        int anst = 1;
        int ansl = 1;
        for (int i = peaks.size()-1; i >= 0; i--){
            int r = peaks[i] + 1 ;
            int l = (r - k + 1 > 0 ? r - k + 1 :1);
            int numpeaks = 0;
            for (int j = i; j >= 0; j--){
                if (peaks[j] > l)
                    numpeaks++;
            }
            if (numpeaks >= mxpeaks){
                anst = numpeaks + 1;
                ansl = l;
                mxpeaks = numpeaks;
            }
        }
        cout << anst << ' ' << ansl << endl;
    }

    return 0;
}


#include<iostream>
#include<vector>

using namespace std;

int main(){
    int t;
    cin >> t;
    while (t--){
        int n, k;
        cin >> n >> k;
        vector<int> a(n+1);
        vector<int> peaks;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        for (int i = 2; i <= n - 1; i++){
            if (a[i] > a[i-1] && a[i] > a[i+1])
                peaks.push_back(i);
        }
        int mxpeaks = 0;
        int anst = 1;
        int ansl = 1;
        for (int i = peaks.size()-1; i >= 0; i--){
            int r = peaks[i] + 1 ;
            int l = (r - k + 1 > 0 ? r - k + 1 :1);
            int numpeaks = 0;
            for (int j = i; j >= 0; j--){
                if (peaks[j] > l)
                    numpeaks++;
            }
            if (numpeaks >= mxpeaks){
                anst += numpeaks;
                ansl = l;
                mxpeaks = numpeaks;
            }
        }
        cout << anst << ' ' << ansl << endl;
    }

    return 0;
}


#include<iostream>
#include<vector>

using namespace std;

int main(){
    int t;
    cin >> t;
    while (t--){
        int n, k;
        cin >> n >> k;
        vector<int> a(n+1);
        vector<int> peaks;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        for (int i = 2; i <= n - 1; i++){
            if (a[i] > a[i-1] && a[i] > a[i+1])
                peaks.push_back(i);
        }
        int mxpeaks = 0;
        int anst = 1;
        int ansl = 1;
        for (int i = peaks.size()-1; i >= 0; i--){
            int r = peaks[i] + 1 ;
            int l = peaks[i] - k + 2;
            if (l < 1)
                l = 1;
            int numpeaks = 0;
            for (int j = i; j >= 0; j--){
                if (peaks[j] > l)
                    numpeaks++;
            }
            if (numpeaks >= mxpeaks){
                anst = numpeaks + 1;
                ansl = l;
                mxpeaks = numpeaks;
            }
        }
        cout << anst << ' ' << ansl << endl;
    }

    return 0;
}


#include<iostream>
#include<vector>

using namespace std;

int n , k;

void solve(){
    cin >> n >> k;
    vector<int> a(n);
    vector<int> peaks(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 1; i < n-1; i++){
        if (a[i] > a[i-1] && a[i] > a[i+1])
            peaks[i] = peaks[i-1] + 1;
        else
            peaks[i] = peaks[i-1];
    }
    // Last element
    peaks[n-1] = peaks[n-2];
    int anspeaks = 0, ansl = 0;
    for (int i = 0; i < n-k+1; i++){
        if (peaks[i+k-2] - peaks[i] > anspeaks){
            anspeaks = peaks[i+k-2] - peaks[i];
            ansl = i + 1;
        }
    }
    cout << anspeaks + 1 << ' ' << ansl << endl;
}

int main(){
    int t;
    cin >> t;
    while (t--){
        solve();
    }
}


#include<iostream>
#include<vector>

using namespace std;

int main(){
    int t;
    cin >> t;
    while (t--){
        int n, k;
        cin >> n >> k;
        vector<int> a(200001);
        vector<int> peaks;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        for (int i = 2; i <= n - 1; i++){
            if (a[i] > a[i-1] && a[i] > a[i+1])
                peaks.push_back(i);
        }
        int mxpeaks = 0;
        int anst = 1;
        int ansl = 1;
        for (int i = peaks.size()-1; i >= 0; i--){
            int r = peaks[i] + 1 ;
            int l = peaks[i] - k + 2;
            if (l < 1)
                l = 1;
            int numpeaks = 0;
            for (int j = i; j >= 0; j--){
                if (peaks[j] > l)
                    numpeaks++;
            }
            if (numpeaks >= mxpeaks){
                anst = numpeaks + 1;
                ansl = l;
                mxpeaks = numpeaks;
            }
        }
        cout << anst << ' ' << ansl << endl;
    }

    return 0;
}


#include<iostream>
#include<vector>

using namespace std;

int main(){
    int t;
    cin >> t;
    while (t--){
        int n, k;
        cin >> n >> k;
        int a[n+1];
        vector<int> peaks;
        for (int i = 1; i <= n; i++)
            cin >> a[i];
        for (int i = 2; i <= n - 1; i++){
            if (a[i] > a[i-1] && a[i] > a[i+1])
                peaks.push_back(i);
        }
        int mxpeaks = 0;
        int anst, ansl;
        for (int i = peaks.size()-1; i >= 0; i--){
            int r = peaks[i] + 1 ;
            int l = (r - k + 1 > 0 ? r - k + 1 :1);
            int numpeaks = 0;
            for (int j = i; j >= 0; j--){
                if (peaks[j] > l)
                    numpeaks++;
            }
            if (numpeaks >= mxpeaks){
                anst = numpeaks + 1;
                ansl = l;
                mxpeaks = numpeaks;
            }
        }
        cout << anst << ' ' << ansl << endl;
    }

    return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		int maxv=-1;
		int maxi=0;
		int b[n+1];
		b[1]=0;
		for(int i=2;i<n;++i)
			b[i]=b[i-1]+bool(a[i]>a[i-1]&&a[i]>a[i+1]);
		b[n]=b[n-1];
		for(int i=1;i+k-2<=n;++i)
			if(b[i+k-2]-b[i]>maxv){
				maxv=b[i+k-2]-b[i];
				maxi=i;
			}
		cout<<maxv+1<<' '<<maxi<<endl;
	}
	return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		int maxv=0;
		int maxi=0;
		int j=1;
		int sum=0;
		for(int i=2;i<j+k-1;++i)
			if(a[i]>a[i-1]&&a[i]>a[i+1])
				++sum;
		while(true){
			if(sum>maxv){
				maxv=sum;
				maxi=j;
			}
			++j;
			if(j+k-1>n)
				break;
			if(a[j]>a[j-1]&&a[j]>a[j+1])
				--sum;
			if(a[j+k-2]>a[j+k-3]&&a[j+k-2]>a[j+k-1])
				++sum;
		}
		cout<<maxv+1<<' '<<maxi<<endl;
	}
	return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		int maxv=0;
		int maxi=0;
		int b[n+1];
		b[1]=0;
		for(int i=2;i<n;++i)
			b[i]=b[i-1]+bool(a[i]>a[i-1]&&a[i]>a[i+1]);
		for(int i=1;i<=n-k+1;++i)
			if(b[i+k-2]-b[i]>maxv){
				maxv=b[i+k-2]-b[i];
				maxi=i;
			}
		cout<<maxv+1<<' '<<maxi<<endl;
	}
	return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		vector<int>p;
		for(int i=2;i<n;++i)
			if(a[i]>a[i-1]&&a[i]>a[i+1])
				p.push_back(i);
		int maxv=0;
		int maxi=0;
		int i=0;
		for(int j=0;j<p.size();++j){
			while(i<j&&p[j]-p[i]+3>k)
				++i;
			if(j-i+2>maxv){
				maxv=j-i+2;
				maxi=p[i]-1;
			}
		}
		cout<<maxv<<' '<<maxi<<endl;
	}
	return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		int maxv=0;
		int maxi=0;
		int b[n+1];
		b[1]=0;
		for(int i=2;i<n;++i)
			b[i]=b[i-1]+bool(a[i]>a[i-1]&&a[i]>a[i+1]);
		b[n]=b[n-1];
		for(int i=1;i<=n-k+1;++i)
			if(b[i+k-2]-b[i]>maxv){
				maxv=b[i+k-2]-b[i];
				maxi=i;
			}
		cout<<maxv+1<<' '<<maxi<<endl;
	}
	return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		int maxv=0;
		int maxi=0;
		int b[n+1];
		b[1]=0;
		for(int i=2;i<n;++i)
			b[i]=b[i-1]+bool(a[i]>a[i-1]&&a[i]>a[i+1]);
		b[n]=b[n-1];
		for(int i=1;i+k-2<=n;++i)
			if(b[i+k-2]-b[i]>maxv){
				maxv=b[i+k-2]-b[i];
				maxi=i;
			}
		cout<<maxv+1<<' '<<maxi<<endl;
	}
	return 0;
}


/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool
 * Author: OI-Master
 * Time: 2020-04-23 23:01:01
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	cin>>t;
	while(t--){
		int n,k;
		cin>>n>>k;
		int a[n+1];
		for(int i=1;i<=n;++i)
			cin>>a[i];
		vector<int>p;
		for(int i=2;i<n;++i)
			if(a[i]>a[i-1]&&a[i]>a[i+1])
				p.push_back(i);
		int maxv=0;
		int maxi=0;
		int i=0;
		for(int j=0;j<p.size();++j){
			while(i<j&&p[j]-p[i]+3>k)
				++i;
			if(j-i+2>maxv){
				maxv=j-i+2;
				maxi=max(1LL,min(p[i]-1,p[j]-k+2));
			}
		}
		cout<<maxv<<' '<<maxi<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2] ) ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans    ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans && (dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1])  ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n+1];
          ll dp[n+1];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;
          dp[1]=0;
          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans && dp[i+k-2]==dp[i-1+k] ){
                    ans=mini;
                    minindex=i;
               }

          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans && (dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1])  ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans &&  (dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1])  ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] )||dp[i]!=dp[i+1])  ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] )||dp[i]!=dp[i+1])   ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1] && i+1<n){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2] ) ){
                    ans=mini;
                    minindex=i;
               }

          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans && (dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1])  ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans && (dp[i+k-1]==dp[i+k-2]  && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1]&& dp[i]<dp[i+k-1])  ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans && (dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1])  ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans && (dp[i+k-1]==dp[i+k-2] && (dp[i]==dp[i+1] && dp[i]<dp[i+k-1])||dp[i]!=dp[i+1])  ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2] ) ){
                    ans=mini;
                    minindex=i;
               }
               else if(mini==ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2])   ){
                    minindex=min(i,minindex);
               }
          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n];
          ll dp[n];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;

          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-1]-dp[i];
               if(mini>ans &&  dp[i]<dp[i+k-1] &&(dp[i+k-1]==dp[i+k-2] ) ){
                    ans=mini;
                    minindex=i;
               }

          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define ll long long int
/*
typedef pair<int, int> pairs;
bool mycomp(pair<ll,ll>a,pair<ll,ll>b){
     return a.second>b.second;
}
ll func(ll n){
     if (n==1){
          return 1;
     }

     return n+func(n/2);

}
set<int>* segment;
unordered_set<char>st;
void build(string s,ll start,ll end,index){
     if(start==end){
          segment[index].insert(s[start]);
     }

     ll mid=(start+end)/2;

     build(s,start,mid,2*index);
     build(s,mid++1,end,2*index+1);

     segment[i].insert(segment[2 * index].begin(),
                      segment[2 * index].end());

    segment[i].insert(segment[2 * index + 1].begin(),
                      segment[2 * index + 1].end());

}*/
bool check(ll n){
     for(ll i=2;i*i<=n;i++){
          if(n%i==0){
               return false;
          }

     }
     return true;
}
int factorial(int n)
{
    // single line to find factorial
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}
int main(){
     ll t,i;
     cin>>t;
     while(t--){
          ll n,k;
          cin>>n>>k;
          ll arr[n+1];
          ll dp[n+1];
          for(i=0;i<n;i++){
               cin>>arr[i];
          }
          dp[0]=0;
          dp[1]=0;
          for(i=1;i<n;i++){
               if(arr[i]>arr[i-1] && arr[i]>arr[i+1]){
                    dp[i]=dp[i-1]+1;
               }
               else{
                    dp[i]=dp[i-1];
               }

          }
          ll mini=0;
          ll ans=0;
          ll minindex=0;
          for(i=0;i<n-k+1;i++){
               mini=dp[i+k-2]-dp[i];
               if(mini>ans ){
                    ans=mini;
                    minindex=i;
               }

          }
          cout<<ans+1<<" "<<minindex+1<<endl;
     }

}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];
bool vis[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(vis, 0, sizeof(vis));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                vis[i] = true;
        }
        int ans = 0, l = 1;
        for (int i=1;i<=n-k+1;i++)
        {
            int cnt = 0;
            for (int j=i+1;j<=i+k-2;j++)
            {
                if (vis[j])
                    cnt++;
            }
            if (cnt > ans)
                ans = cnt, l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(sum, 0, sizeof(sum));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        sum[1] = 0;
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                sum[i] = sum[i-1] + 1;
            else
                sum[i] = sum[i-1];
        }
        sum[n] = sum[n-1];
        for (int i=1;i<=n;i++)
            printf("%d ", sum[i]);
        puts("");
        int ans = 0, l = 1;
        for (int i=1;i<=n-k+1;i++)
        {
            if (sum[i+k-2] - sum[i-1] > ans)
                ans = sum[i+k-2] - sum[i-1], l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(sum, 0, sizeof(sum));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        sum[1] = 0;
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                sum[i] = sum[i-1] + 1;
            else
                sum[i] = sum[i-1];
        }
        sum[n] = sum[n-1];
//        for (int i=1;i<=n;i++)
//            printf("%d ", sum[i]);
//        puts("");
        int ans = 0, l = 1;
        for (int i=1;i<=n-k+1;i++)
        {
            if (sum[i+k-2] - sum[i-1] > ans)
                ans = sum[i+k-2] - sum[i-1], l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(sum, 0, sizeof(sum));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        sum[1] = 0;
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                sum[i] = sum[i-1] + 1;
            else
                sum[i] = sum[i-1];
        }
        sum[n] = sum[n-1];
//        for (int i=1;i<=n;i++)
//            printf("%d ", sum[i]);
//        puts("");
        int ans = 0, l = 1;
        for (int i=1;i<=n-k+1;i++)
        {
            if (sum[i+k-2] - sum[i] > ans)
                ans = sum[i+k-2] - sum[i], l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(sum, 0, sizeof(sum));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        sum[1] = 0;
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                sum[i] = sum[i-1] + 1;
            else
                sum[i] = sum[i-1];
        }
        sum[n] = sum[n-1];
//        for (int i=1;i<=n;i++)
//            printf("%d ", sum[i]);
//        puts("");
        int ans = 0, l = 0;
        for (int i=1;i<=n-k+1;i++)
        {
            if (sum[i+k-2] - sum[i] > ans)
                ans = sum[i+k-2] - sum[i], l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(sum, 0, sizeof(sum));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        sum[1] = 0;
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                sum[i] = sum[i-1] + 1;
            else
                sum[i] = sum[i-1];
        }
        sum[n] = sum[n-1];
//        for (int i=1;i<=n;i++)
//            printf("%d ", sum[i]);
//        puts("");
        int ans = 0, l = 0;
        for (int i=1;i<=n-k+1;i++)
        {
            if (sum[i+k-2] - sum[i-1] > ans)
                ans = sum[i+k-2] - sum[i-1], l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <vector>
#include <string>
using namespace std;
const int N = 2e5+5;
int n, T, k, a[N], sum[N];
bool vis[N];

int main()
{
    scanf("%d", &T);
    while (T--)
    {
        memset(vis, 0, sizeof(vis));
        scanf("%d %d", &n, &k);
        for (int i=1;i<=n;i++)
            scanf("%d", &a[i]);
        for (int i=2;i<=n-1;i++)
        {
            if (a[i] > a[i-1] && a[i] > a[i+1])
                vis[i] = true;
        }
        int ans = 0, l = 0;
        for (int i=1;i<=n-k+1;i++)
        {
            int cnt = 0;
            for (int j=i+1;j<=i+k-2;j++)
            {
                if (vis[j])
                    cnt++;
            }
            if (cnt > ans)
                ans = cnt, l = i;
        }
        printf("%d %d\n", ans+1, l);
    }
    return 0;
}


#include<iostream>
using namespace std;
int m,mt[222220]={},sd[222220]={},n,k,l,s,smax;
int main(){
	cin>>m;
	for(int rbq=1;rbq<=m;rbq++){
		smax=1;
		s=1;
		l=1;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			cin>>mt[i];
		}
		for(int i=2;i<=n-1;i++){
			if(mt[i]>mt[i-1]&&mt[i]>mt[i+1]){
				sd[i]=1;
			}else {
				sd[i]=0;
			}
		}
		for(int i=2;i<=k-1;i++){
			smax+=sd[i];
			s+=sd[i];
		}
		for(int i=2;i<=n-k+1;i++){
			if(sd[i])s--;
			if(sd[i+k-2])s++;
			if(s>smax){
				smax=s;
				l=i;
			}
		}
		cout<<smax<<' '<<l<<endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int m,mt[22222]={},sd[22222]={},n,k,l,s,smax;
int main(){
	cin>>m;
	for(int rbq=1;rbq<=m;rbq++){
		smax=1;
		s=1;
		l=1;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			cin>>mt[i];
		}
		for(int i=2;i<=n-1;i++){
			if(mt[i]>mt[i-1]&&mt[i]>mt[i+1]){
				sd[i]=1;
			}else {
				sd[i]=0;
			}
		}
		for(int i=2;i<=k-1;i++){
			smax+=sd[i];
			s+=sd[i];
		}
		for(int i=2;i<=n-k+1;i++){
			if(sd[i])s--;
			if(sd[i+k-2])s++;
			if(s>smax){
				smax=s;
				l=i;
			}
		}
		cout<<smax<<' '<<l<<endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int m,n,k,s,p,mxs=0;
void mr(int r){
	if(s>mxs){
		mxs=s;
		p=r;
	}
}
int main(){
	cin>>m;
	for(int rbq=1;rbq<=m;rbq++){
		cin>>n>>k;
		mxs=0;
		s=1;
		p=1;
		int qj[10086]={};
		for(int i=1;i<=n;i++){
			cin>>qj[i];
		}
		for(int i=2;i<=k-1;i++){
			if(qj[i]>=qj[i-1]&&qj[i]>=qj[i+1]){
				s++;
			}
		}
		mr(1);
		for(int i=2;i<=n-k+1;i++){
			if(qj[i]>=qj[i-1]&&qj[i]>=qj[i+1]){
				s--;
			}
			int e=i+k-2;
			if(qj[e]>=qj[e-1]&&qj[e]>=qj[e+1]){
				s++;
			}
			mr(i);
		}
		cout<<mxs<<' '<<p<<endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int main(){

	int m,mt[22222]={},sd[22222]={},n,k,l,s,smax;
	cin>>m;
	for(int rbq=1;rbq<=m;rbq++){
		smax=1;
		s=1;
		l=1;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			cin>>mt[i];
		}
		for(int i=2;i<=n-1;i++){
			if(mt[i]>mt[i-1]&&mt[i]>mt[i+1]){
				sd[i]=1;
			}else {
				sd[i]=0;
			}
		}
		for(int i=2;i<=k-1;i++){
			smax+=sd[i];
			s+=sd[i];
		}
		for(int i=2;i<=n-k+1;i++){
			if(sd[i])s--;
			if(sd[i+k-2])s++;
			if(s>smax){
				smax++;
				l=i;
			}
		}
		cout<<smax<<' '<<l<<endl;
	}
	return 0;
}


#include<iostream>
using namespace std;
int m,mt[22222]={},sd[22222]={},n,k,l,s,smax;
int main(){
	cin>>m;
	for(int rbq=1;rbq<=m;rbq++){
		smax=1;
		s=1;
		l=1;
		cin>>n>>k;
		for(int i=1;i<=n;i++){
			cin>>mt[i];
		}
		for(int i=2;i<=n-1;i++){
			if(mt[i]>mt[i-1]&&mt[i]>mt[i+1]){
				sd[i]=1;
			}else {
				sd[i]=0;
			}
		}
		for(int i=2;i<=k-1;i++){
			smax+=sd[i];
			s+=sd[i];
		}
		for(int i=2;i<=n-k+1;i++){
			if(sd[i])s--;
			if(sd[i+k-2])s++;
			if(s>smax){
				smax++;
				l=i;
			}
		}
		cout<<smax<<' '<<l<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,k;

		cin>>n>>k;
		ll arr[n+1];
		for(ll i=1;i<=n;i++)
		{
			cin>>arr[i];
		}

		ll count=0;
		ll arr1[n+1];
		arr[1]=0;
		for(ll i=2;i<n;i++)
		{
			arr1[i]=count;
			if(arr[i]>arr[i-1]&&arr[i]>arr[i+1])
			{
				count++;
			}
		}
		arr1[n]=count;
		ll j=1;
		int ma=0;
		int left=0;

		for(ll i=k;i<=n;i++)
		{   ll a=arr1[i]-arr1[j+1];
			if(a>ma)
			{
				ma=arr1[i];
				left=j;

			}
			j++;
		}
		cout<<ma+1<<" "<<left<<endl;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,k;

		cin>>n>>k;
		ll arr[n];
		for(ll i=1;i<=n;i++)
		{
			cin>>arr[i];
		}
		ll l=arr[0];
		ll r=arr[n-1];
		ll left=0;
		ll ma=INT_MIN;
		for(ll i=2;i<=n-k+2;i++)
		{

			ll temp=0;
			ll j=i;
			ll w=0;
			while(w<k-2)
			{

					if(arr[j]>arr[j-1]&&arr[j]>arr[j+1])
					{
						temp++;

					}

				j++;
				w++;
			}
			if(temp>ma)
			{
				ma=temp;
				left=i-1;
			}
		}

		cout<<ma+1<<" "<<left<<endl;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,k;

		cin>>n>>k;
		ll arr[n];
		for(ll i=1;i<=n;i++)
		{
			cin>>arr[i];
		}
		ll l=arr[0];
		ll r=arr[n-1];
		ll left=0;
		ll ma=INT_MIN;
		for(ll i=2;i<=n-1;i++)
		{

			ll temp=0;
			ll j=i;
			ll w=0;
			while(w<k-2)
			{

					if(arr[j]>arr[j-1]&&arr[j]>arr[j+1])
					{
						temp++;

					}

				j++;
				w++;
			}
			if(temp>ma)
			{
				ma=temp;
				left=i-1;
			}
		}

		cout<<ma+1<<" "<<left<<endl;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,k;

		cin>>n>>k;
		ll arr[n+1];
		for(ll i=1;i<=n;i++)
		{
			cin>>arr[i];
		}

		ll count=0;
		ll arr1[n];
		arr[1]=0;
		for(ll i=2;i<n;i++)
		{
			arr1[i]=count;
			if(arr[i]>arr[i-1]&&arr[i]>arr[i+1])
			{
				count++;
			}
		}
		arr1[n]=count;
		ll j=1;
		int ma=0;
		int left=0;

		for(ll i=k;i<=n;i++)
		{   ll a=arr1[i]-arr1[j+1];
			if(a>ma)
			{
				ma=arr1[i];
				left=j;

			}
			j++;
		}
		cout<<ma+1<<" "<<left<<endl;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n,k;

		cin>>n>>k;
		ll arr[n+1];
		for(ll i=1;i<=n;i++)
		{
			cin>>arr[i];
		}

		ll count=0;
		ll arr1[n+1];
		arr1[0]=0;
		arr1[1]=0;
		for(ll i=2;i<n;i++)
		{
			arr1[i]=count;
			if(arr[i]>arr[i-1]&&arr[i]>arr[i+1])
			{
				count++;
			}
		}
		arr1[n]=count;
		ll j=1;
		int ma=0;
		int left=1;

		for(ll i=k;i<=n;i++)
		{   ll a=arr1[i]-arr1[j+1];
			if(a>ma)
			{
				ma=arr1[i];
				left=j;

			}
			j++;
		}
		cout<<ma+1<<" "<<left<<endl;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main()
{
 int t;
 cin>>t;
  while(t--){
    ll n, k;
    cin>>n>>k;
    ll arr[n+1];
    for(int i=1; i<=n; i++)
        cin>>arr[i];

    ll prefix[n+1];
    prefix[0] = 0;
    prefix[1] = 0;
    int cnt = 0;
    for(int i=2; i<n; i++){
        prefix[i] = cnt;
        if(arr[i]>arr[i-1] and arr[i]>arr[i+1])
            cnt++;
    }
    prefix[n] = cnt;
    // for(int i=0; i<=n; i++)
    //     cout<<prefix[i]<<" ";
    // cout<<endl;

    ll j = 1;
    ll st = 1, maxi = 0;
    for(ll i=k; i<=n; i++){
        ll currP = prefix[i] - prefix[j+1];
        if(currP > maxi){
            maxi = currP;
            st = j;
        }
        j++;
    }
    cout<<maxi+1<<" "<<st<<endl;
  }
 return 0;
}


#include <bits/stdc++.h>

using namespace std;

bool pick(int i, vector<int>& v, int l, int r) {
    if (i == l || i == r) {
        return false;
    }
    return v[i - 1] < v[i] && v[i] > v[i + 1];
}

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n, 0);
    for (int i = 0; i < n; ++i) {
        cin >> i;
    }
    int ans = -1, l = -1, r = -1, now = 0;
    for (int i = 1; i + 1 < k; ++i) {
        if (pick(i, v, 0, k - 1)) {
            ++now;
        }
    }
    ans = now + 1, l = 0, r = k - 1;
    for (int i = k; i < n; ++i) {
        if (pick(i - k + 1, v, i - k, i - 1)) {
            --now;
        }
        if (pick(i - 1, v, i - k + 1, i)) {
            ++now;
        }
        if (now + 1 > ans) {
            ans = now + 1;
            l = i - k + 1;
            r = i;
        }
    }
    cout << ans << " " << l + 1 << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define mem(a, b) memset(a, b, sizeof(a))
#define inf       1e9
#define eps       1e-9
#define mod       1000000007
#define NN        200010

#ifdef  redback
#define bug printf("line=%d\n",__LINE__);
#define debug(args...) {cout<<":: "; dbg,args; cout<<endl;}
struct  debugger {template<typename T>debugger& operator , (const T& v) {cout << v << " "; return *this;}} dbg;
#else
#define bug
#define debug(args...)
#endif

ll a[NN], freq[NN];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t = 1, tc;
    cin >> tc;
    ll n, m;
    while (tc--) {
        ll i, j, k;
        cin >> n >> k;
        mem(freq, 0);

        for (i = 0; i < n; i++) {
            cin >> a[i];
        }

        freq[0] = 0;
        for (i = 1; i < n - 1; i++) {
            freq[i] = freq[i - 1];

            if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                freq[i]++;
            }
        }

        freq[n - 1] = freq[n - 2];

        ll ret  = -1;
        ll left = -1;
        for (i = k - 1; i < n; i++) {
            j = freq[i] - freq[i - k + 1];
            debug(j, i, i - k + 1, freq[i], freq[i - k + 1])
            if (freq[i] > freq[i - 1]) j--;
            if (j > ret) {
                ret  = j;
                left = i - k + 2;
            }
        }
        cout << ret+1 << " " << left << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    // stuff to make input/output faster
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n, 0);
        vector<bool> isPeak(n, 0);
        int a1 = 0, a2 = 0;
        for (int i = 0; i < n; ++i) {
            cin >> a[i];
        }
        for (int i = 1; i < n - 1; ++i) {
            if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                isPeak[i] = true;
            }
        }
        vector<int> prefix(n, 0);
        for (int i = 1; i < n; ++i) {
            prefix[i] = prefix[i - 1] + ((isPeak[i]) ? 1 : 0);
        }
        int v = 0;
        for (int i = 0; i < n - k; ++i) {
            v = prefix[i + k - 1] - prefix[i];
            if (v + 1 > a1) {
                a1 = v + 1;
                a2 = i + 1;
            }
        }
        cout << a1 << ' ' << a2 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    // stuff to make input/output faster
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n + 1, 0);
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        vector<bool> isPeak(n + 1, 0);
        for (int i = 2; i < n; ++i) {
            isPeak[i] = (a[i] > a[i - 1] && a[i] > a[i + 1]);
        }

        int a1 = -1, a2 = -1;
        vector<int> prefix(n + 1, 0);
        for (int i = 2; i <= n; ++i) {
            prefix[i] = prefix[i - 1] + isPeak[i - 1];
        }

        for (int i = 1; i <= n - k + 1; ++i) {
            int v = prefix[i + k - 1] - prefix[i];
            if (v + 1> a1) {
                a1 = v + 1;
                a2 = i;
            }
        }
        cout << a1 << ' ' << a2 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll a[NN], freq[NN];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t = 1, tc;
    cin >> tc;
    ll n, m;
    while (tc--) {
        ll i, j, k;
        cin >> n >> k;
        mem(freq, 0);

        for (i = 0; i < n; i++) {
            cin >> a[i];
        }

        freq[0] = 0;
        for (i = 1; i < n - 1; i++) {
            freq[i] = freq[i - 1];

            if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
                freq[i]++;
            }
        }

        freq[n - 1] = freq[n - 2];

        ll ret  = -1;
        ll left = -1;
        for (i = k - 1; i < n; i++) {
            j = freq[i] - freq[i - k + 1];
            debug(j, i, i - k + 1, freq[i], freq[i - k + 1])
            if (freq[i] > freq[i - 1]) j--;
            if (j > ret) {
                ret  = j;
                left = i - k + 2;
            }
        }
        cout << ret+1 << " " << left << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

bool pick(int i, vector<int>& v, int l, int r) {
    if (i == l || i == r) return 0;
    return v[i - 1] < v[i] && v[i] > v[i + 1];
}

void solve() {
    int n, k;
    cin >> n >> k;
    vector<int> v(n, 0);
    for (int i = 0; i < n; ++i) {
        cin >> i;
    }
    int ans = -1, l = -1, r = -1, now = 0;
    for (int i = 1; i + 1 < k; ++i) {
        if (pick(i, v, 0, k - 1)) {
            ++now;
        }
    }
    ans = now + 1, l = 0, r = k - 1;
    for (int i = k; i < n; ++i) {
        if (pick(i - k + 1, v, i - k, i - 1)) {
            --now;
        }
        if (pick(i - 1, v, i - k + 1, i)) {
            ++now;
        }
        if (now + 1 > ans) {
            ans = now + 1;
            l = i - k + 1;
            r = i;
        }
    }
    cout << ans << " " << l + 1 << endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i+1]=1;
            }
        }
        int ans=0,l=0;
        for(int i=1;i<=n;i++)
        {

            if(i<=k) sum[i]=sum[i-1]+dp[i];
            else sum[i-1]-=dp[i-k+1],sum[i]=sum[i-1]+dp[i];
            if(i>=k)
            {
                if(ans<sum[i]) ans=sum[i],l=i-k+1;
            }
        }
        //cout<<endl;
        cout<<ans+1<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i]=1;
            }
        }
        int ans=0,l=0,cnt=0;
        for(int i=1;i<=n;i++)
        {
            if(i<=k)
            {
                if(dp[i]==1 && i!=k) cnt++,l=1,ans++;
            }
            else
            {
                if(dp[i-1]==1) cnt++;
                if(dp[i-k+1]==1) cnt--;
                if(ans<cnt) ans=cnt,l=i-k+1;
            }
        }
        if(ans!=0) ans+=1;
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i]=1;
            }
        }
        int ans=0,l=1,cnt=0;
        for(int i=1;i<=n;i++)
        {
            if(i<=k)
            {
                if(dp[i]==1 && i!=k) cnt++,l=1,ans++;
            }
            else
            {
                if(dp[i-1]==1) cnt++;
                if(dp[i-k+1]==1) cnt--;
                if(ans<cnt) ans=cnt,l=i-k+1;
            }
        }
        if(ans==0) ans=1;
        else ans+=1;
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i+1]=1;
            }
        }
        int ans=0,l=0;
        for(int i=1;i<=n;i++)
        {

            if(i<=k) sum[i]=sum[i-1]+dp[i];
            else sum[i-1]-=dp[i-k+1],sum[i]=sum[i-1]+dp[i];
            if(i>=k)
            {
                if(ans<sum[i]) ans=sum[i],l=i-k+1;
            }
        }
        if(ans!=0) ans+=1;
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i]=1;
            }
        }
        int ans=0,l=0,cnt=0;
        for(int i=1;i<=n;i++)
        {
            if(i<=k)
            {
                if(dp[i]==1 && i!=k) cnt++,l=1,ans++;
            }
            else
            {
                if(dp[i-1]==1) cnt++;
                if(dp[i-k]==1) cnt--;
                if(ans<cnt) ans=cnt,l=i-k+1;
            }
        }
        if(ans!=0) ans+=1;
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i]=1;
            }
        }
        int ans=1,l=1,cnt=0;
        for(int i=1;i<=n;i++)
        {
            if(i<=k)
            {
                if(dp[i]==1 && i!=k) cnt++,l=1,ans++;
            }
            else
            {
                if(dp[i-1]==1) cnt++;
                if(dp[i-k+1]==1) cnt--;
                if(ans<cnt) ans=cnt,l=i-k+1;
            }
        }
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i]=1;
            }
        }
        int ans=0,l=1,cnt=0;
        for(int i=1;i<=n;i++)
        {
            if(i<=k)
            {
                if(dp[i]==1 && i!=k) cnt++,l=1,ans++;
            }
            else
            {
                if(dp[i-1]==1) cnt++;
                if(dp[i-k+1]==1) cnt--;
                if(ans<cnt) ans=cnt,l=i-k+1;
            }
        }
        if(ans!=0) ans+=1;
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=2e5+10;

int arr[maxn];
int dp[maxn];
int sum[maxn];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int T;cin>>T;
    while(T--)
    {
        int n,k;cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>arr[i],sum[i]=0,dp[i]=0;
        for(int i=2;i<=n-1;i++)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
            {
                dp[i]=1;
            }
        }
        int ans=0,l=1,cnt=0;
        for(int i=1;i<=n;i++)
        {
            if(i<=k)
            {
                if(dp[i]==1 && i!=k) cnt++,l=1,ans++;
            }
            else
            {
                if(dp[i-1]==1) cnt++;
                if(dp[i-k+1]==1) cnt--;
                if(ans<cnt) ans=cnt,l=i-k+1;
            }
        }
        if(ans=0) ans+=1;
        cout<<ans<<" "<<l<<endl;
    }
    return 0;
 }


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1=1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-2;
      int num = isPeak[right] - isPeak[i];
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout <<( !ans2 ? 0 : ans2+1) << " " << ans1 << endl;
  }
}


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1=1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-1;
      int num = isPeak[right] - isPeak[i];
      if(right+1 < n && vet[right] > vet[right-1] && vet[right] > vet[right+1]) num--;
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout <<( !ans2 ? 0 : ans2+1) << " " << ans1 << endl;
  }
}


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-1;
      int num = isPeak[right] - isPeak[i];
      if(i && vet[i] > vet[i-1] && vet[i] > vet[i+1]) num--;
      if(vet[right] > vet[right-1] && vet[right] > vet[right+1]) num--;
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout <<( ans2+1) << " " << ans1 << endl;
  }
}


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1=1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-2;
      int num = isPeak[right] - isPeak[i];
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout << ans2+1 << " " << ans1 << endl;
  }
}


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1=1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-2;
      int num = isPeak[right] - isPeak[i] + 1;
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout << ans2 << " " << ans1 << endl;
  }
}


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-1;
      int num = isPeak[right] - isPeak[i];
      if(vet[right] > vet[right-1] && vet[right] > vet[right+1]) num--;
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout <<( !ans2 ? 0 : ans2+1) << " " << ans1 << endl;
  }
}


#include <bits/stdc++.h>
#define lp(init,var) for(int i=init;i<var;i++)
#define pri(a) printf("%d\n",a)
#define prld(a) printf("%ld\n",a)
#define si(a) scanf("%d",&a)
#define sii(a,b) scanf("%d %d",&a,&b)
#define sl(a) scanf("%lld",&a)
#define sll(a, b) scanf("%lld %lld",&a,&b)

#define mp make_pair
#define buff ios::sync_with_stdio(false);cin.tie(NULL)
#define endl '\n'
#define pb push_back
#define f first
#define s second
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fl
#define int long long

const int MAX = 2e5;

using namespace std;

signed main() {
  buff;int t; cin >> t;
  while(t--) {
    int n; cin >> n;
    int k; cin >> k;
    int isPeak[MAX+10];
    vector<int> vet(n,0); lp(0,n){cin >> vet[i]; isPeak[i] = 0;}
    for(int i=1;i<n-1;i++) {
      if(vet[i] > vet[i-1] && vet[i] > vet[i+1]) isPeak[i] ++;
    }
    lp(1,n){isPeak[i] += isPeak[i-1];}
    int ans1, ans2 = -1;
    lp(0,n-k+1) {
      int right = i+k-1;
      int num = isPeak[right] - isPeak[i];
      if(vet[right] > vet[right-1] && vet[right] > vet[right+1]) num--;
      if(num > ans2) {
        ans2 = num;
        ans1 = i+1;
      }
    }
    cout <<( ans2+1) << " " << ans1 << endl;
  }
}


#include<iostream>
//#define scanf scanf_s
using namespace std;
struct Mountain
{
	int pre;
	int next;
	int pos;
}b[200001];
int m[200001];
int main() {
	int t, k,n,i,j,l,max,left,right,flag,limit,move,len,begin;
	cin >> t;
	while (t--)
	{
		j =move= 0;
		cin >>n>> k;
		for (i = 1; i <= n; i++) scanf("%d", &m[i]);
		for (i = 2; i <= n - 1; i++)
		{
			if (m[i] > m[i - 1] && m[i] > m[i + 1]) b[j++].pos=i;
		}
		if (j == 0) {
			cout << 1 << ' ' << 1 << endl;
			continue;
		}
		for (i = 0; i < j; i++)
		{
			if (i != 0) b[i].pre = b[i].pos - b[i-1].pos;
			if (i != j - 1) b[i].next = b[i + 1].pos - b[i].pos;
		}
		left = 0, right = j - 1;
		while (1)
		{
			len = b[right].pos - b[left].pos + 1 + 2;
			if (len <= k) break;
			else
			{
				if (b[left].next > b[right].pre) left++;
				else right--;
			}
		}
		begin = b[left].pos - (k - len) - 1;
		if (begin < 1) begin = 1;
		cout << right - left + 1 + 1 << ' ' << begin<< endl;
	}
}


#include<iostream>
//#define scanf scanf_s
const int MAX = 2e5 + 1;
using namespace std;
int m[MAX],b[MAX];
int main() {
	int t, i,n,k,max,maxl;
	cin >> t;
	while (t--)
	{
		cin >> n >> k;
		for (i = 1; i <=n; i++) scanf("%d", &m[i]);
		for (i = 2; i <= n - 1; i++)
		{
			if (m[i] > m[i - 1] && m[i] > m[i + 1]) b[i] = b[i - 1] + 1;
			else b[i] = b[i - 1];
		}
		max = -1; maxl = 1;
		for (i = 1; i <= n - k + 1; i++)
		{
			if (b[i + k - 2] - b[i] > max) max = b[i + k - 2] - b[i],maxl=i;
		}
		cout << max + 1 << ' ' << maxl << endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,n,k,a[200009],b[200009],ans,l;
int main(){
    cin>>q;
    while(q--){
        cin>>n>>k;
        for(int i=1;i<=n;i++) { cin>>a[i]; b[i]=0;}
        for(int i=2;i<n;i++) if(a[i]>a[i-1] && a[i]>a[i+1]) b[i]=1;
        for(int i=1;i<=n;i++) b[i]+=b[i-1];
        l=0; ans=0;
        for(int i=1;i<=n-k+1;i++)
            if(b[i+k-2]-b[i] > ans) {ans=b[i+k-2]-b[i]; l=i;}
        if(ans) ans++;
        cout<<ans<<" "<<l<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,n,k,a[200009],b[200009],ans,l;
int main(){
    cin>>q;
    while(q--){
        cin>>n>>k;
        memset(b,0,sizeof b);
        for(int i=1;i<=n;i++) cin>>a[i];
        for(int i=2;i<n;i++) if(a[i]>a[i-1] && a[i]>a[i+1]) b[i]=1;
        for(int i=1;i<=n+10;i++) b[i]+=b[i-1];
        l=1; ans=0;
        for(int i=1;i<=n;i++) if(b[i+k-2]-b[i] > ans) {ans=b[i+k-2]-b[i]; l=i;}
        cout<<ans+1<<" "<<l<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,n,k,a[200009],b[200009],ans,l;
int main(){
    cin>>q;
    while(q--){
        cin>>n>>k;
        memset(b,0,sizeof b);
        for(int i=1;i<=n;i++) cin>>a[i];
        for(int i=2;i<n;i++) if(a[i]>a[i-1] && a[i]>a[i+1]) b[i]=1;
        for(int i=1;i<=n+10;i++) b[i]+=b[i-1];
        l=1; ans=0;
        for(int i=1;i<=n;i++)
            if(b[i+k-2]-b[i] > ans) {ans=b[i+k-2]-b[i]; l=i;}
        if(ans) ans++;
        cout<<ans<<" "<<l<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,n,k,a[200009],b[200009],ans,l;
int main(){
    cin>>q;
    while(q--){
        cin>>n>>k;
        for(int i=1;i<=n;i++) { cin>>a[i]; b[i]=0;}
        for(int i=2;i<n;i++) if(a[i]>a[i-1] && a[i]>a[i+1]) b[i]=1;
        for(int i=1;i<=n;i++) b[i]+=b[i-1];
        l=0; ans=0;
        for(int i=1;i<=n-k+1;i++)
            if(b[i+k-1]-b[i] > ans) {ans=b[i+k-2]-b[i-1]; l=i;}
        if(ans) ans++;
        cout<<ans<<" "<<l<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll q,n,k,a[200009],b[200009],ans,l;
int main(){
    cin>>q;
    while(q--){
        cin>>n>>k;
        memset(b,0,sizeof b);
        for(int i=1;i<=n;i++) cin>>a[i];
        for(int i=2;i<n;i++) if(a[i]>a[i-1] && a[i]>a[i+1]) b[i]=1;
        for(int i=1;i<=n;i++) b[i]+=b[i-1];
        l=0; ans=0;
        for(int i=1;i<=n;i++)
            if(b[i+k-2]-b[i] > ans) {ans=b[i+k-2]-b[i]; l=i;}
        if(ans) ans++;
        cout<<ans<<" "<<l<<endl;
    }
}


#include<iostream>
#include<queue>
#include<queue>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const long long INF=0x3f3f3f3f3f3f3f3f;
const int N=2e5+10;
int a[N],b[N],sum[N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
        memset(sum,0,sizeof(sum));
        memset(b,0,sizeof(b));
        int n,k;
        cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>a[i];
        for(int i=2;i<n;i++)
        {
            if(a[i]>a[i-1]&&a[i]>a[i+1])
            {
                b[i]=1;
            }
        }
        //for(int i=1;i<=n;i++) cout<<b[i]<<" ";
        //cout<<endl;
        for(int i=1;i<=n;i++) sum[i]=sum[i-1]+b[i];
        //for(int i=1;i<=n;i++) cout<<sum[i]<<" ";
        int ans=-1,l;
        for(int i=k;i<=n;i++)
        {
            if(ans<sum[i-1]-sum[i-k+1])
            {
                ans=sum[i-1]-sum[i-k+1];
                l=i-k+1;
            }
        }
        cout<<ans+1<<" "<<l<<endl;
    }
    return 0;
}


#include<iostream>
#include<queue>
#include<queue>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const long long INF=0x3f3f3f3f3f3f3f3f;
const int N=2e5+10;
int a[N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
        int n,k;
        cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>a[i];
        int left=1,right=1,ans=-1,tot=0,l;
        while(right>=left&&right<=n)
        {
            tot=0;
            while(right<left+k-1) right++;
            if(right>n) break;
            for(int i=left+1;i<=right-1;i++)
            {
                if(a[i]>a[i-1]&&a[i]>a[i+1])
                    tot++;
            }
            if(ans<tot)
            {
                l=left;
                ans=tot;
            }
            left++;
        }
        cout<<ans+1<<" "<<l<<endl;
    }
    return 0;
}


#include<iostream>
#include<queue>
#include<queue>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const long long INF=0x3f3f3f3f3f3f3f3f;
const int N=2e5+10;
int a[N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
        int n,k;
        cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>a[i];
        int left=1,right=1,ans=-1,tot=0,l;
        while(right>=left&&right<=n)
        {
            tot=0;
            right=left+k-1;
            if(right>n) break;
            for(int i=left+1;i<=right-1;i++)
            {
                if(a[i]>a[i-1]&&a[i]>a[i+1])
                    tot++;
            }
            if(ans<tot)
            {
                l=left;
                ans=tot;
            }
            left++;
        }
        cout<<ans+1<<" "<<l<<endl;
    }
    return 0;
}


#include<iostream>
#include<queue>
#include<queue>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const long long INF=0x3f3f3f3f3f3f3f3f;
const int N=2e5+10;
int a[N];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t;
    cin>>t;
    while(t--)
    {
        int n,k;
        cin>>n>>k;
        for(int i=1;i<=n;i++) cin>>a[i];
        int left=1,right=1,ans=-1,tot=0,l;
        while(right>=left&&right<=n)
        {
            tot=0;
            right=left+k-1;
            if(right>n) break;
            for(int i=left+1;i<=right-1;)
            {
                if(a[i]>a[i-1]&&a[i]>a[i+1])
                {
                    tot++;
                    i+=2;
                }
                else i++;
            }
            if(ans<tot)
            {
                l=left;
                ans=tot;
            }
            left++;
        }
        cout<<ans+1<<" "<<l<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   s.insert({0,0});
   ss.insert(0);
   vector<int>a(n+1),ans(n+1,0);
   for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    int y=5;
    while(s.size()>1){y--;
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      //ss.erase(jt);
      int ck=0;
      int pp;
      s.erase(it);
      jt++;
     // for(auto pt=ss.begin();pt!=ss.end();pt++)cout<<*pt<<"   ";
     // cout<<endl;
     // cout<<*jt;cout<<endl;
      //auto qt=jt;
      vector<int>temp;
      while(jt!=ss.end() && ck<k){ck++;
        pp=*jt;
        //cout<<pp<<"     ";//cout<<endl;
        temp.push_back(pp);
        auto dt=s.lower_bound({a[pp],-1});
        if(dt!=s.end())
        s.erase(dt);
        ans[pp]=x;
        jt++;
      }

      ck=0;
       if(ct!=ss.begin()){
       	jt=ct;
      	jt--;

       while(jt!=ss.begin() && ck<k){ck++;
      	 pp=*jt;
       // cout<<pp<<"     ";//cout<<endl;
        temp.push_back(pp);
       auto dt=s.lower_bound({a[pp],-1});
       s.erase(dt);
        ans[pp]=x;
        jt--;
       }

      }
         jt=ss.lower_bound(pos);
      if(jt!=ss.end())
      ss.erase(jt);
       for(int i=0;i<temp.size();i++){
       	auto tpj=ss.lower_bound(temp[i]);
       	ss.erase(tpj);
       }

     i++;
    }
    for(int i=1;i<=n;i++)cout<<ans[i];
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   s.insert({0,0});
   ss.insert(0);
   vector<int>a(n+1),ans(n+1,0);
   for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    while(s.size()>1){
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      jt++;
      int ck=0;
      int pp;
      s.erase(it);
      while(jt!=ss.end() && ck<k){ck++;
        pp=*jt;
        ans[pp]=x;
        auto dt=s.lower_bound({a[pp],-1});
        s.earse(dt);
        ss.erase(jt);
      }
      ct--;ck=0;

      while(ct!=ss.begin() && ck<k){
        ck++;
        pp=*jt;
        ans[pp]=x;
        auto et=s.lower_bound({a[pp],-1});
        s.erase(et);
        ss.erase(ct);ct--;
      }
       s.erase(it);
      jt=ss.lower_bound(pos);
      ss.erase(jt);
      i++;
    }
    for(int i=1;i<=n;i++)cout<<ans[i]<<" ";
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   s.insert({0,0});
   ss.insert(0);
   vector<int>a(n+1),ans(n+1,0);
   for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    int y=5;
    while(s.size()>1){y--;
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      //ss.erase(jt);
      int ck=0;
      int pp;
      s.erase(it);
      jt++;
     // for(auto pt=ss.begin();pt!=ss.end();pt++)cout<<*pt<<"   ";
     // cout<<endl;
     // cout<<*jt;cout<<endl;
      //auto qt=jt;
      vector<int>temp;
      while(jt!=ss.end() && ck<k){ck++;
        pp=*jt;
        //cout<<pp<<"     ";//cout<<endl;
        temp.push_back(pp);
        auto dt=s.lower_bound({a[pp],-1});
        if(dt!=s.end())
        s.erase(dt);
        ans[pp]=x;
        jt++;
      }

      ck=0;
       if(ct!=ss.begin()){
       	jt=ct;
      	jt--;
      //	cout<<*jt<<"    ";
    //  auto jtt=ss.begin();
      //cout<<*jtt<<" "<<"nnljlkj"<<"  ";
       while(jt!=ss.begin() && ck<k){ck++;
      	 pp=*jt;
       // cout<<pp<<"     ";//cout<<endl;
        temp.push_back(pp);
       auto dt=s.lower_bound({a[pp],-1});
       s.erase(dt);
        ans[pp]=x;
        jt--;
       }

      }
         jt=ss.lower_bound(pos);
      if(jt!=ss.end())
      ss.erase(jt);
       for(int i=0;i<temp.size();i++){
       	auto tpj=ss.lower_bound(temp[i]);
       	ss.erase(tpj);
       }
 // for(auto pt=ss.begin();pt!=ss.end();pt++)cout<<*pt<<"   ";cout<<endl;
 //   for(auto pt=s.begin();pt!=s.end();pt++)cout<<(*pt).first<<"   ";
     i++;//cout<<endl<<endl;
    }
    for(int i=1;i<=n;i++)cout<<ans[i]<<" ";
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   vector<int>a(n),ans(n,0);
   for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    while(ss.size()!=0){
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      jt++;
      int ck=0;
      int pp;
      while(jt!=ss.end() && ck<k){ck++;
          pp=*jt;
          ans[pp]=x;
          auto dt=s.lower_bound({a[pp],-1});
          s.erase(dt);
          ss.erase(jt);
      }
      ct--;ck=0;

      while(ct!=s.begin() && ck<k){
        ck++;
        pp=*jt;
        ans[pp]=x;
        auto et=s.lower_bound({a[pp],-1});
        s.erase({et});
        ss.erase(ct);ct--;
      }
       s.erase(it);
      jt=ss.lower_bound(pos);
      ss.ersae(jt);
    }
    for(int i=0;i<n;i++)cout<<ans[i]<<" ";
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   vector<int>a(n),ans(n,0);
   for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    while(ss.size()!=0){
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      jt++;
      int ck=0;
      int pp;
      while(jt!=ss.end() && ck<k){ck++;
          pp=*jt;
          ans[pp]=x;
          auto dt=s.lower_bound({a[pp],-1});
          s.erase(dt);
          ss.erase(jt);
      }
      ct--;ck=0;

      while(ct!=ss.begin() && ck<k){
        ck++;
        pp=*jt;
        ans[pp]=x;
        auto et=s.lower_bound({a[pp],-1});
        s.erase({et});
        ss.erase(ct);ct--;
      }
       s.erase(it);
      jt=ss.lower_bound(pos);
      ss.erase(jt);
    }
    for(int i=0;i<n;i++)cout<<ans[i]<<" ";
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   vector<int>a(n),ans(n,0);
   for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    while(ss.size()!=0){
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      jt++;
      int ck=0;
      int pp;
      while(jt<ss.end() && ck<k){ck++;
          pp=*jt;
          ans[pp]=x;
          auto dt=s.lower_bound({a[pp],-1});
          s.erase(dt);
          ss.erase(jt);
      }
      ct--;ck=0;

      while(ct>=s.begin() && ck<k){
        ck++;
        pp=*jt;
        ans[pp]=x;
        auto et=s.lower_bound({a[pp],-1});
        s.erase({et});
        ss.erase(ct);ct--;
      }
       s.erase(it);
      jt=ss.lower_bound(pos);
      ss.ersae(jt);
    }
    for(int i=0;i<n;i++)cout<<ans[i]<<" ";
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   vector<int>a(n),ans(n,0);
   for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    while(ss.size()!=0){
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      jt++;
      int ck=0;
      int pp;
      while(jt!=ss.end() && ck<k){ck++;
          pp=*jt;
          ans[pp]=x;
          auto dt=s.lower_bound({a[pp],-1});
          s.erase(dt);
          ss.erase(jt);
      }
      ct--;ck=0;

      while(ct!=ss.begin() && ck<k){
        ck++;
        pp=*jt;
        ans[pp]=x;
        auto et=s.lower_bound({a[pp],-1});
        s.erase({et});
        ss.erase(ct);ct--;
      }
       s.erase(it);
      jt=ss.lower_bound(pos);
      ss.ersae(jt);
    }
    for(int i=0;i<n;i++)cout<<ans[i]<<" ";
}


#include<bits/stdc++.h>
#define int long long int
using namespace std;
main(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n,k;cin>>n>>k;
   set<pair<int,int>>s;
   set<int>ss;
   s.insert({0,0});
   ss.insert(0);
   vector<int>a(n+1),ans(n+1,0);
   for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=n;i++){
      s.insert({a[i],i});
      ss.insert(i);
    }
    int i=0;
    int y=5;
    while(s.size()>1){y--;
      int x=1;
      if(i%2==1)x=2;
      auto it=s.end();
      it--;
      int pos=(*it).second;
      ans[pos]=x;
      auto jt=ss.lower_bound(pos);
      auto ct=jt;
      //ss.erase(jt);
      int ck=0;
      int pp;
      s.erase(it);
      jt++;
      vector<int>temp;
      while(jt!=ss.end() && ck<k){ck++;
        pp=*jt;
        temp.push_back(pp);
        auto dt=s.lower_bound({a[pp],-1});
        if(dt!=s.end())
        s.erase(dt);
        ans[pp]=x;
        jt++;
      }
     ck=0;
       if(ct!=ss.begin()){
       	jt=ct;
      	jt--;

       while(jt!=ss.begin() && ck<k){ck++;
      	 pp=*jt;
        temp.push_back(pp);
       auto dt=s.lower_bound({a[pp],-1});
       s.erase(dt);
        ans[pp]=x;
        jt--;
       }

      }
         jt=ss.lower_bound(pos);
      if(jt!=ss.end())
      ss.erase(jt);
       for(int i=0;i<temp.size();i++){
       	auto tpj=ss.lower_bound(temp[i]);
       	ss.erase(tpj);
       }

     i++;
    }
    for(int i=1;i<=n;i++)cout<<ans[i];
}