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