#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  long long t;
  cin >> t;
  while (t--) {
    long long n, i, m, k = 0, t = 0, j = 1;
    vector<long long> v, p = {0};
    cin >> n >> m;
    for ((i) = 0; (i) < (n); (i)++) {
      cin >> k;
      v.push_back(k);
    }
    k = 0;
    for ((i) = 1; (i) < (n - 1); (i)++) {
      if (v[i] > v[i - 1] && v[i] > v[i + 1]) k++;
      p.push_back(k);
    }
    p.push_back(k);
    for ((i) = 0; (i) < (n - m + 1); (i)++) {
      if (min(p[i + m - 1], p[i + m - 2]) - p[i] > t) {
        t = min(p[i + m - 1], p[i + m - 2]) - p[i];
        j = i + 1;
      }
    }
    cout << t + 1 << " " << j << endl;
  }
  return 0;
}
