#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int q;
  cin >> q;
  while (q--) {
    int n, p(0), d(0), s2(0), l(1), t(0), k;
    cin >> n >> k;
    int arr[n + 1];
    arr[0] = 0;
    for (int i = 1; i < n + 1; i++) cin >> arr[i];
    for (int i = 2; i <= k - 1; i++) {
      if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1]) {
        p++;
      }
    }
    d = p;
    for (int i = 2; i <= n + 1 - k; i++) {
      if (arr[i] > arr[i - 1] && arr[i] > arr[i + 1]) {
        p--;
        if (p < 0) {
          p = 0;
        }
      }
      if (arr[i + k - 2] > arr[i + k - 3] && arr[i + k - 2] > arr[i + k - 1]) {
        p++;
      }
      if (d < p) {
        d = p;
        l = i;
      }
    }
    cout << d + 1 << " " << l << endl;
  }
}
