#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long double PI = acos(-1);
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;
const int mod1 = 998244353;
const long long INF = 2e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<int> v;
    int a[200005];
    int z = 0, maxx = -MOD, l = 0;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    v.push_back(0);
    for (int i = 1; i < n - 1; i++) {
      if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
        ++cnt;
      }
      v.push_back(cnt);
    }
    v.push_back(cnt);
    for (int i = 0; i < n - k + 1; i++) {
      z = abs(v[i] - v[i + k - 2]);
      if (z > maxx) {
        maxx = z;
        l = i;
      }
    }
    ++maxx;
    ++l;
    cout << maxx << " " << l << "\n";
  }
  return 0;
}
