#include <bits/stdc++.h>
using namespace std;
long long int a[500005], b[500005];
int main() {
  long long int p, x, y, z, i, j, k, n, m, t;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    for (i = 0; i <= n + 1; i++) {
      b[i] = 0;
    }
    for (i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (i = 2; i < n; i++) {
      if ((a[i] > a[i - 1]) && (a[i] > a[i + 1])) b[i]++;
    }
    for (i = 2; i <= n; i++) {
      b[i] += b[i - 1];
    }
    m = 0;
    y = 1;
    for (i = 1; i <= n - k + 1; i++) {
      x = b[i + k - 2] - b[i];
      if (x > m) {
        m = x;
        y = i;
      }
    }
    m++;
    cout << m << " " << y << endl;
  }
}
