=begin 59A - Word
str = gets.chomp
lower = 0
upper = 0
str.each_char { |w| /[[:lower:]]/.match(w) ? lower+= 1 : upper+= 1 }
puts upper > lower ? str.upcase : str.downcase
=end
str = gets.chomp
n = gets.to_i
out = nil
while n > 0
	tmp = gets.chomp
  if /\A#{str}[[:lower:]]*/.match(tmp)
    if out.nil? || tmp < out
      out = tmp
    end
  end
  n-=1
end
puts out.nil? ? str : out


s=gets.strip
n=gets.to_i # n can bo omitted in calculations
ok=false
m=""
n.times{|i| w=gets.strip; m,ok=((m<w || !ok)?m:w),true if w.start_with? m}
puts (ok ? m : s)


s=gets.strip
n=gets.to_i
m=""
n.times{|i| w=gets.strip; m=(m<w && !m.empty?)?m:w if w.start_with? s}
puts (m.empty?)?s:m


s = gets.chomp!
n = gets.to_i

mas = Array.new()
for i in 0..n-1
  mas[i] = gets.chomp!
end

mas.sort!
for i in 0..n-1
  if (mas[i].index(s) == 0)
    puts mas[i]
    exit
  end
end

puts s


str = gets.chomp
num = gets.chomp.to_i

lines = []
num.times {|i|
  lines << gets.chomp
}

regexp = Regexp.new("^" + str)
strs = lines.select {|line| regexp =~ line}
if strs.length == 0
  puts str
else
  puts strs.sort[0]
end


s = gets.strip
a = []

gets.to_i.times {
    n = gets.strip
    a.push n if n.start_with? s
}

puts a.empty? ? s : a.sort.first


str = STDIN.gets.chomp
n   = STDIN.gets.to_i
lines = []
n.times { lines << STDIN.gets.chomp }
lines.sort!

lines.each do |line|
  if line.rindex(str) == 0
    puts line
    exit
  end
end
puts str


str = gets.strip; gets; auto = []
while g = gets; auto.push g.strip; end
s = auto.sort.grep(/^#{str}+/).first
print s ? s : str


s = raw_input()
n = input()
t = []
for _ in xrange(n):
  u = raw_input()
  if u.startswith(s):
    t.append(u)
sz = len(t)
print s if sz == 0 else t[(n-1)%sz]


s = raw_input()
n = input()
t = []
for _ in xrange(n):
  u = raw_input()
  if u.startswith(s):
    t.append(u)
sz = len(t)
if sz == 0:
  print s
else:
  t = sorted(t)
  print t[0]


s=str(raw_input())
n=int(raw_input())
l=[]
for i in range(n):
	l.append(str(raw_input()))
l.sort()
if l[0].startswith(s)==False:
	print s
else:
	print l[0]


s=str(raw_input())
n=int(raw_input())
l=[]
for i in range(n):
	l.append(str(raw_input()))
l.sort()
b=False
for x in l:
	if x.startswith(s):
		res=x
		b=True
		break
if b:
	print res
else:
	print s


#!/usr/bin/python

class a :

    def __init__ (self) :

        self.b = raw_input ()
        self.c = input ()
        self.d = [ raw_input () for x in xrange (self.c) ]
        self.e = []
        self.f = []

    def g (self) :

        if 1 <= len (self.b) <= 100 :
            for x in self.d :
                if 1 <= len (x) <= 100 :
                    if self.b == x [: len (self.b) ] :
                        self.e.append (x)
                else :
                    quit ()
            if len (self.e) == 0 :
                print self.b
                quit ()
            elif len (self.e) == 1 :
                print self.e [0]
                quit ()
            for i , x in enumerate (self.e) :
                if i != 0 :
                    if self.f [0] > x :
                        self.f.pop (0)
                        self.f.append (x)
                else :
                    self.f.append (x)
            print self.f [0]

if __name__ == '__main__' :
    a () . g ()


#!/usr/bin/python

class a :

    def __init__ (self) :

        self.b = raw_input ()
        self.c = input ()
        self.d = [ raw_input () for x in xrange (self.c) ]
        self.e = []
        self.f = []

    def g (self) :

        if 1 <= len (self.b) <= 100 :
            for x in self.d :
                if 1 <= len (x) <= 100 :
                    if self.b == x [: len (self.b) ] :
                        self.e.append (x)
                else :
                    quit ()
            if len (self.e) == 0 :
                print self.b
                quit ()
            elif len (self.e) == 1 :
                print self.e [0]
                quit ()
            for i , x in enumerate (self.e) :
                if i != 0 :
                    if f [0] > x :
                        f.pop (0)
                        f.append (x)
                else :
                    f.append (x)
            print f [0]

if __name__ == '__main__' :
    a () . g ()


s = raw_input()

N = int(raw_input())

addresses = []

for i in xrange(N):
	addresses.append(raw_input())

addresses.sort()

contained = s

for address in addresses:
	if s == address[:len(s)]:
		contained = address
		break

print contained


# -*- coding: utf-8 -*-
from __future__ import division

def readint_line():
    res = map(int, raw_input().split(' '))
    if len(res) == 1:
        return res[0]
    else:
        return res

def readstr_line():
    res = raw_input().split(' ')
    if len(res) == 1:
        return res[0]
    else:
        return res

s = readstr_line()
n = readint_line()

sites = []

for i in range(n):
    sites.append(readstr_line())

sites.sort()

out = None
i = 0

while out is None and i < len(sites):
    if sites[i].startswith(s):
        out = sites[i]
    else:
        i += 1

if out is None:
    print s
else:
    print out


s = raw_input()
n = int(raw_input())
vis = []
for i in xrange(n):
	t = raw_input()
	if s in t:
		#~ print "7",s,t
		vis.append(t)
vis.sort()
if len(vis) == 0 or len(s) > len(vis[0]):
	print s
elif s == vis[0][0:len(s)]:
	print vis[0]
else:
	print s


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "1 1" << endl;
      continue;
    }
    int ans1 = cnt;
    int ans2 = left;
    while(right <= k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "0 1" << endl;
      continue;
    }
    int ans1 = cnt;
    int ans2 = left;
    while(right <= k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "0 1" << endl;
      cont;
    }
    int ans1;
    if(cnt == 0) {
      ans1 = 0;
    }
    else ans1 = cnt + 1;
    int ans2 = left;
    while(right <= k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt + 1 > ans1) {
        ans1 = cnt + 1;
        ans2 = left;
      }
    }
    cout << ans1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 99974848454999;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "1 1" << endl;
      continue;
    }
    int ans1 = cnt;
    int ans2 = left;
    while(right < k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "1 1" << endl;
      continue;
    }
    int ans1 = cnt;
    int ans2 = left;
    while(right < k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 1987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "1 1" << endl;
      continue;
    }
    int ans1 = cnt;
    int ans2 = left;
    while(right < k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define MAX 10000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 2147483646;

int T;
int chk;

bool isRange(int x) {
  if (x <= 0 || x > chk) return false;
  else return true;
}
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int n, k;
    cin >> n >> k;

    vector<int> arr;

    set<int> pos;

    arr.pb(INF);

    for(int j = 0 ; j < n ; j++) {
      int num;
      cin >> num;
      arr.pb(num);
    }
    arr.pb(INF);

    for(int j = 1 ; j < arr.size() - 1 ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 2;
    int right = k - 1;
    int ans_peek = 0;;
    int ans_idx = 1;
    int cur_peek = 0;

    for(int j = 2 ; j <= k - 1 ; j++) {
      if(pos.find(j) != pos.end()) {
        cur_peek++;
      }
    }
 //   cout << "cur_peek : " << cur_peek << endl;
    ans_peek = cur_peek;
    while(right <= arr.size() - 1) {
 //     cout << "left : " << left << ' ' << "right : " << right << endl;
      if(pos.find(left) != pos.end()) cur_peek--;
      left++;

      right++;
      if(pos.find(right) != pos.end()) cur_peek++;

      if(cur_peek > ans_peek) {
    //    cout << "?" << endl;
        ans_peek = cur_peek;
        ans_idx = left - 1;
      }
    }
    cout << ans_peek + 1 << ' ' << ans_idx << endl;
  }
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    int dp[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    int ans1 = cnt + 1;
    int ans2 = 1;
    while(right < k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;

      if(cnt + 1 > ans1) {
        ans1 = cnt + 1;
        ans2 = left;
      }
    }
    cout << ans1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 1;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "1 1" << endl;
      continue;
    }
    int ans1 = max(cnt, 1);
    int ans2 = left;
    while(right <= k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define MAX 10000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 2147483646;

int T;
int chk;

bool isRange(int x) {
  if (x <= 0 || x > chk) return false;
  else return true;
}
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int n, k;
    cin >> n >> k;

    vector<int> arr;

    set<int> pos;

    arr.pb(INF);

    for(int j = 0 ; j < n ; j++) {
      int num;
      cin >> num;
      arr.pb(num);
    }

    for(int j = 1 ; j < arr.size() - 1 ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = k - 1;
    int ans_peek = 0;;
    int ans_idx = 1;
    int cur_peek = 0;

    for(int j = 2 ; j <= k - 1 ; j++) {
      if(pos.find(j) != pos.end()) {
        cur_peek++;
      }
    }
 //   cout << "cur_peek : " << cur_peek << endl;
    ans_peek = cur_peek;
    while(right <= arr.size() - 1) {
 //     cout << "left : " << left << ' ' << "right : " << right << endl;
      if(pos.find(left) != pos.end()) cur_peek--;
      left++;
      right++;
      if(pos.find(right) != pos.end()) cur_peek++;

      if(cur_peek > ans_peek) {
    //    cout << "?" << endl;
        ans_peek = cur_peek;
        ans_idx = left;
      }
    }
    cout << ans_peek + 1 << ' ' << ans_idx << endl;
  }
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "0 1" << endl;
      continue;
    }
    int ans1 = cnt;
    int ans2 = left;
    while(right < k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt > ans1) {
        ans1 = cnt;
        ans2 = left;
      }
    }
    cout << ans1 + 1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "1 1" << endl;
      cont;
    }
    int ans1 = cnt + 1;
    int ans2 = left;
    while(right <= k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt + 1 > ans1) {
        ans1 = cnt + 1;
        ans2 = left;
      }
    }
    cout << ans1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) x.begin(), x.end()
#define MAX 10000000
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 987654321;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int k, n;
    cin >> k >> n;
    int arr[k + 2] = {};
    arr[0] = INF;
    arr[k + 1] = INF;
    for(int j = 1 ; j <= k ; j++) {
      cin >> arr[j];
    }
    set<int>pos;

    for(int j = 1 ; j <= k ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.insert(j);
      }
    }

    int left = 1;
    int right = n - 1;
    int ans = 0;
    int cnt = 0;
    for(int j = left ; j <= right ; j++) {
      if(pos.find(j) != pos.end()) {
        cnt++;
      }
    }
    if(pos.size() == 0) {
      cout << "0 1" << endl;
      cont;
    }
    int ans1 = cnt + 1;
    int ans2 = 1;
    while(right <= k) {
      right++;
      if(pos.find(right) != pos.end()) cnt++;
      if(pos.find(left) != pos.end()) cnt--;
      left++;
      if(cnt + 1 > ans1) {
        ans1 = cnt + 1;
        ans2 = left;
      }
    }
    cout << ans1 << ' ' << ans2;
    cout << endl;
  }
  return 0;
}


#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define MAX 10000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF = 2147483646;

int T;
int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);

  cin >> T;

  for(int i = 0 ; i < T ; i++) {
    int n, k;
    cin >> n >> k;

    vector<int> arr;

    vector<int> pos;

    arr.pb(INF);

    for(int j = 0 ; j < n ; j++) {
      int num;
      cin >> num;
      arr.pb(num);
    }

    for(int j = 1 ; j < arr.size() - 1 ; j++) {
      if(arr[j] > arr[j - 1] && arr[j] > arr[j + 1]) {
        pos.pb(j);
      }
    }
    int ans_peek = 0;
    int ans_idx = 0;

    int lo = 1;
    int hi = k;

    while(hi <= arr.size() - 1) {
      int left_find = upper_bound(pos.begin(), pos.end(), lo) - pos.begin();
      int right_find = upper_bound(pos.begin(), pos.end(), hi) - pos.begin();
      int left_idx;
      int right_idx;
      int left_pos, right_pos;
      int cur_peek;
      if(pos[left_find - 1] == lo) {
        left_pos = pos[left_find - 1];
        left_idx = left_find - 1;
      }
      else {
        left_pos = pos[left_find];
        left_idx = left_find;
      }

      if(pos[right_find - 1] == hi) {
        right_pos = pos[right_find - 1];
        right_idx = right_find - 1;
      }
      else {
        right_pos = pos[right_find];
        right_idx = right_find;
      }
      cur_peek = right_idx - left_idx;

      if(cur_peek > ans_peek) {
        ans_peek = cur_peek;
        ans_idx = lo;
      }
      lo++;
      hi++;
    }

    cout << ans_peek + 1 << ' ' << ans_idx << endl;
  }
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;

ll peak(ll arr[],ll o){
	if(arr[o]>arr[o-1] && arr[o]>arr[o+1])
		return 1 ;
	else
		return 0;
}
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<=b;i++){
		if(i==a||i==b)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0,bemp=0 ;

		temp = numpeak(pek,0,k-1) ;
		// cerr<<temp<<"\n";
		bemp =temp ;
		if(k!=n){
		rep(i,n){

			l++ ;
			if( peak(pek,l)==1)
				temp -= 1 ;
			if (peak(pek,l+k-2)==1)
				temp++;
			if(bemp<temp)
				p = l ;
			bemp=bemp>temp?bemp:temp ;

			if(k + l  == n)
				break ;

		}
	}

		cout<<bemp+1<<" "<<p+1<<"\n" ;

	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<b;i++){
		if(i==0||i==n-1)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0 ;
		rep(i,n){
			if(temp<numpeak(pek,l,l+k-1)){
				temp = numpeak(pek,l,l+k-1);
				p =l ;
			}
			if(l+k-1==n-1)
				break;
			l++ ;
		}
		if(temp!=0)
		cout<<temp+1<<" "<<p+1<<"\n" ;
		else
		cout<<1<<" "<<0<<"\n" ;

	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<=b;i++){
		if(i==a||i==b)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0 ;
		rep(i,n){
			if(temp<numpeak(pek,l,l+k-1)){
				temp = numpeak(pek,l,l+k-1);
				p =l ;
			}
			if(l+k-1==n-1)
				break;
			l++ ;
		}
		if(temp!=0)
		cout<<temp+1<<" "<<p+1<<"\n" ;
		else
		cout<<1<<" "<<1<<"\n" ;

	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<b;i++){
		if(i==0||i==n-1)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0 ;
		rep(i,n){
			if(temp<numpeak(pek,l,l+k-1)){
				temp = numpeak(pek,l,l+k-1);
				p =l ;
			}
			if(l+k-1==n-1)
				break;
			l++ ;
		}
		if(temp!=0)
		cout<<temp+1<<" "<<p+1<<"\n" ;
		else
		cout<<1<<" "<<1<<"\n" ;

	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<b;i++){
		if(i==0||i==n-1)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0 ;
		rep(i,n){
			if(temp<numpeak(pek,l,l+k-1)){
				temp = numpeak(pek,l,l+k-1);
				p =l ;
			}
			if(l+k-1==n-1)
				break;
			l++ ;
		}
		cout<<temp+1<<" "<<p+1<<"\n" ;
	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<b;i++){
		if(i==0||i==n-1)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0 ;
		rep(i,n){
			if(temp<numpeak(pek,l,l+k-1)){
				temp = numpeak(pek,l,l+k-1);
				p =l ;
			}
			if(l+k-1==n-1)
				break;
			l++ ;
		}
		if(p!=0)
		cout<<temp+1<<" "<<p+1<<"\n" ;
		if(p==0)
		cout<<0<<" "<<0<<"\n" ;

	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<b;i++){
		if(i==0||i==n-1)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0 ;
		rep(i,n){
			if(temp<numpeak(pek,l,l+k-1)){
				temp = numpeak(pek,l,l+k-1);
				p =l ;
			}
			if(l+k-1==n-1)
				break;
			l++ ;
		}
		if(temp!=0)
		cout<<temp+1<<" "<<p+1<<"\n" ;
		else
		cout<<0<<" "<<0<<"\n" ;

	}
    //your code here
    return 0;
}


#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define rep(i,a) for(i = 0 ; i < a ; i++)
#define whln(t) while(t--)
#define whlp(t) while(t++)
#define ff first
#define ss second
ll n ;

ll peak(ll arr[],ll o){
	if(arr[o]>arr[o-1] && arr[o]>arr[o+1])
		return 1 ;
	else
		return 0;
}
ll numpeak (ll arr[],ll a,ll b){
	ll cnt = 0 ;
	for(ll i = a ; i<=b;i++){
		if(i==a||i==b)
			continue;
		if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
			cnt++ ;
	}
	return cnt ;
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif
	ll t ;
	cin>>t;
	whln(t){
		ll k;
		cin>>n>>k;
		ll i,pek[n];
		rep(i,n)
			cin>>pek[i];
		ll l=0,temp=0,p=0,bemp=0 ;

		temp = numpeak(pek,0,k-1) ;
		// cerr<<temp<<"\n";
		bemp =temp ;
		rep(i,n){
			l++ ;
			if( peak(pek,l)==1)
				temp -= 1 ;
			if (peak(pek,l+k-2)==1)
				temp++;
			if(bemp<temp)
				p = l ;
			bemp=bemp>temp?bemp:temp ;

			if(k + l  == n)
				break ;

		}

		cout<<bemp+1<<" "<<p+1<<"\n" ;

	}
    //your code here
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        input(n,k);
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() && peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        int n,k;
        cin>>n>>k;
        vi arr(n,0);
        loop(i,0,n)
        {
            cin>>arr[i];
        }
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        if(size!=0)
        peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() && peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        input(n,k);
        vi peeks;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peeks.pb(i);
        }
        int max_peek=0;
        queue<int> peek_count;
        peek_count.push(peeks[0]);
        int size=peeks.size();
        debug(size);
        int total=1;
        int right_index=0;
        loop(i,1,size)
        {
            if(peeks[i]-peek_count.front()<k-2)
            {
                total++;
                peek_count.push(peeks[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peeks[i-1];
                }
                while(!peek_count.empty() && peeks[i]-peek_count.front()>k-2)
                {
                    peek_count.pop();
                    total--;
                }
                peek_count.push(peeks[i]);
                total++;
            }
            debug2(total,i);

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peeks[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        int n,k;
        cin>>n>>k;
        vi arr(n,0);
        loop(i,0,n)
        {
            cin>>arr[i];
        }
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() && peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        input(n,k);
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() || peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        input(n,k);
        vi peeks;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peeks.pb(i);
        }
        int max_peek=0;
        queue<int> peek_count;
        peek_count.push(peeks[0]);
        int size=peeks.size();
        debug(size);
        int total=1;
        int right_index=0;
        loop(i,1,size)
        {
            if(peeks[i]-peek_count.front()<k-2)
            {
                total++;
                peek_count.push(peeks[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peeks[i-1];
                }
                while(!peek_count.empty() && peeks[i]-peek_count.front()>=k-2)
                {
                    peek_count.pop();
                    total--;
                }
                peek_count.push(peeks[i]);
                total++;
            }
            debug2(total,i);

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peeks[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        int n,k;
        cin>>n>>k;
        vi arr(n,0);
        loop(i,0,n)
        {
            cin>>arr[i];
        }
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        if(size > 0)
            peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() && peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek and size>0)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
// typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        int n,k;
        cin>>n>>k;
        vi arr(n,0);
        loop(i,0,n)
        {
            cin>>arr[i];
        }
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() && peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#ifdef Local_debug

#define debug(x) cout<<"x= "<<x<<"  "
#define debug1(a) cout << a << endl
#define debug2(a, b) cout << a << " " << b << endl
#define debug3(a, b, c) cout << a << " " << b << " " << c << endl
#define debug4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

#else
#define debug(x)
#define debug1(x)
#define debug2(x,y)
#define debug3(x,y,z)
#define debug4(x,y,z,a)
#endif

#define ll long long
#define pb push_back
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) rbegin(x), rend(x) //useful in sorting
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define gcd __gcd
#define deci(n) fixed << setprecision(n)
#define test() int t;cin >> t;while (t--)
#define loop(i,a,n) for(int i=a;i<n;i++)

typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef priority_queue<int, vector<int>, greater<int>> minpq;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umi;
typedef map<int,int> mi;
#define input(n,k) int n,k;cin>>n;cin>>k;vi arr(n,0);loop(i,0,n){cin>>arr[i];}

const int MOD = 1e9 + 7;

//********************THE END OF TEMPLATES*******************//
int main()
{
    fast();
    test()
    {
        input(n,k);
        vi peek_index_array;
        loop(i,1,n-1)
        {
            if(arr[i]>arr[i-1] && arr[i]>arr[i+1])
                peek_index_array.pb(i);
        }
        int max_peek=0;
        int size=peek_index_array.size();
        int total=1;
        int right_index=0;
        queue<int> peek_queue;
        peek_queue.push(peek_index_array[0]);
        loop(i,1,size)
        {
            if(peek_index_array[i]-peek_queue.front()<=k-3)
            {
                total++;
                peek_queue.push(peek_index_array[i]);
            }
            else
            {
                if(total>max_peek)
                {
                    max_peek=total;
                    right_index=peek_index_array[i-1];
                }
                while(!peek_queue.empty() || peek_index_array[i]-peek_queue.front()>k-3)
                {
                    peek_queue.pop();
                    total--;
                }
                peek_queue.push(peek_index_array[i]);
                total++;
            }
            debug2(total,i);

        }
        // cout<<"total,max"<<total<<max_peek<<endl;
        if(total>max_peek)
        {
            max_peek=total;
            right_index=peek_index_array[size-1];
        }
        int left_index=right_index-k+3<=0? 1: right_index -k +3;
        cout<<max_peek+1<<" "<<left_index<<endl;

    }

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
 		ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		ll peak[n]={0};
 		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;

 		}
 		ll pref[n]={0};
 		pref[0]=0;
 		for (int i = 1; i < n; ++i)
 		{
 			pref[i]+=peak[i-1];
 			pref[i]+=pref[i-1];
 		}
 		// for (int i = 0; i < n; ++i)
 		// {
 		// 	cout<<pref[i]<<" ";
 		// }
 		// cout<<endl;
 		ll max=0,ind=0;
 		std::map<ll, int> map1;
 		for (int i = 0; i < (n-k+1); ++i)
 		{
 			if((pref[i+k-1]-pref[i])>max){
 				ind=(i);
 				max=(pref[i+k-1]-pref[i]);
 				map1[max]=ind;
 			}
 		}
 		 ll min=INT_MAX;
 		for (auto i = map1.begin(); i != map1.end(); ++i)
 		{
 			if(i->first==max && i->second<min)
 				min=i->second;
 		}
 		cout<<max+1<<" "<<min+1<<endl;
    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
    	ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		   	ll peak[n]={0};
		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;
 			//cout<<peak[i]<<" ";
 		}
 		//cout<<endl;
 		ll pref[n]={0};
 		if(peak[0]==1)
 			pref[0]=1;
 		//cout<<pref[0]<<" ";
 		for (int i = 1; i < n; ++i)
 		{
 			pref[i]=pref[i-1];
 			if(peak[i]==1)
 				pref[i]++;
 			//cout<<pref[i]<<" ";
 		}
 		//cout<<endl;
 		ll start=0;
 		ll cnt=0,max=0,ind=1;
 		std::vector<ll> v;
 		for (int i = k-1; i < n; ++i)
 		{
 			//cout<<pref[i]<<" "<<pref[start]<<" "<<arr[i]<<" "<<arr[start]<<endl;
 			cnt=(pref[i]-pref[start]-peak[i]-peak[start]);
 			if(cnt>max){
 				ind=i-(k-1)+1;
 			//	v.push_back(ind);
 				max=cnt;
 			}
 			//cout<<cnt<<endl;
 			start++;
 		}

 		cout<<max+1<<" "<<ind<<endl;
    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
 		ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		ll peak[n]={0};
 		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;

 		}
 		ll pref[n]={0};
 		pref[0]=0;
 		for (int i = 1; i < n; ++i)
 		{
 			pref[i]+=peak[i-1];
 			pref[i]+=pref[i-1];
 		}
 		int f=0;
 		for (int i = 0; i < n; ++i)
 		{
 			if(pref[i]!=0){
 				f=1;
 				break;
 			}
 			//cout<<pref[i]<<" ";
 		}
 		if(f==0)
 		{
 			cout<<0<<" "<<0<<endl;
 			continue;
 		}
 		//cout<<endl;
 		ll max=0,ind=0;
 		std::map<ll, int> map1;
 		for (int i = 0; i < (n-k+1); ++i)
 		{
 			if((pref[i+k-1]-pref[i])>max){
 				ind=(i);
 				max=(pref[i+k-1]-pref[i]);
 				map1[max]=ind;
 			}
 		}
 		 ll min=INT_MAX;
 		for (auto i = map1.begin(); i != map1.end(); ++i)
 		{
 			if(i->first==max && i->second<min)
 				min=i->second;
 		}
 		cout<<max+1<<" "<<min+1<<endl;
    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
 		ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		ll peak[n]={0};
 		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;

 		}
 		ll pref[n]={0};
 		pref[0]=0;
 		std::map<ll, ll> map1;
 		ll cnt=0;
 			for (int j = 1; j < (k-1); ++j)
 			{
 				//cout<<peak[j]<<" ";
 				if(peak[j]==1)
 					cnt++;
 			}
 		map1[0]=cnt;
 		ll l=(0),r=(k-1);
 		for (int i = 0; i < (n-k); ++i)
 		{
 			if(peak[r]==1){
	 			map1[l+1]=(cnt+1);
	 			cnt++;
 			}
 			else
 				map1[l+1]=cnt;
 			if(peak[l]==1){
 				map1[l+1]=(cnt-1);
 				cnt--;
 			}
 			else
 				map1[l+1]=cnt;

	 			r++;l++;

 		}
 		ll max=0;
 		for (auto i = map1.begin(); i != map1.end(); ++i)
 		{
 			//cout<<i->first<<" "<<i->second<<endl;
 			if(i->second>max)
 				max=i->second;
 		}
 		ll ind=INT_MAX;
 		for (auto i = map1.begin(); i != map1.end(); ++i)
 		{
 			if(i->second==max){
 				ind=i->first;
 				break;
 			}
 		}
 		cout<<max+1<<" "<<ind+1<<endl;

    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
 		ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		ll peak[n]={0};
 		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;

 		}
 		ll pref[n]={0};
 		pref[0]=0;
 		for (int i = 1; i < n; ++i)
 		{
 			pref[i]+=peak[i-1];
 			pref[i]+=pref[i-1];
 		}
 		int f=0;
 		for (int i = 0; i < n; ++i)
 		{
 			if(pref[i]!=0){
 				f=1;
 				break;
 			}
 			//cout<<pref[i]<<" ";
 		}
 		if(f==0)
 		{
 			cout<<0<<" "<<0<<endl;
 			continue;
 		}
 		//cout<<endl;
 		ll max=0,ind=0;
 		std::vector<pair<ll,ll>> v;
 		for (int i = 0; i < (n-k+1); ++i)
 		{
 			if((pref[i+k-1]-pref[i])>max){
 				ind=(i);
 				max=(pref[i+k-1]-pref[i]);
 				v.push_back(make_pair(ind,max));
 			}
 		}
 		ll min=INT_MAX;
 		for (int i = 0; i < v.size(); ++i)
 		{
 			if(v[i].second==max && v[i].first<min)
 				min=v[i].first;
 		}
 		cout<<max+1<<" "<<min+1<<endl;
    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
 		ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		ll peak[n]={0};
 		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;

 		}
 		ll pref[n]={0};
 		pref[0]=0;
 		std::map<ll, ll> map1;
 		for (int i = 0; i < (n-k+1); ++i)
 		{
 			ll cnt=0;
 			for (int j = (i+1); j < (i+k-1); ++j)
 			{
 				if(peak[j]==1)
 					cnt++;
 			}
 			map1[i+1]=(cnt);
 		}
 		ll max=0;
 		for (auto i = map1.begin(); i != map1.end(); ++i)
 		{
 			//cout<<i->first<<" "<<i->second<<endl;
 			if(i->second>max)
 				max=i->second;
 		}
 		ll ind=INT_MAX;
 		for (auto i = map1.begin(); i != map1.end(); ++i)
 		{
 			if(i->second==max){
 				ind=i->first;
 				break;
 			}
 		}
 		cout<<max+1<<" "<<ind<<endl;

    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
 		ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		ll peak[n]={0};
 		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;

 		}
 		ll pref[n]={0};
 		pref[0]=0;
 		for (int i = 1; i < n; ++i)
 		{
 			pref[i]+=peak[i-1];
 			pref[i]+=pref[i-1];
 		}
 		// for (int i = 0; i < n; ++i)
 		// {
 		// 	cout<<pref[i]<<" ";
 		// }
 		// cout<<endl;
 		ll max=0,ind=0;
 		for (int i = 0; i < (n-k+1); ++i)
 		{
 			if((pref[i+k-1]-pref[i])>max){
 				ind=(i);
 				max=(pref[i+k-1]-pref[i]);
 			}
 		}
 		cout<<max+1<<" "<<ind+1<<endl;
    }
}


#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007

using namespace std;

int main()
{
    io
    ll t;
    cin>>t;
   	while(t--)
    {
    	ll n,k;
 		cin>>n>>k;
 		ll arr[n];
 		for (int i = 0; i < n; ++i)
 		   	{
 		   		cin>>arr[i];
 		   	}
 		   	ll peak[n]={0};
		for (int i = 1; i < n-1; ++i)
 		{
 			if(arr[i]>arr[i+1] && arr[i]>arr[i-1])
 				peak[i]=1;
 			//cout<<peak[i]<<" ";
 		}
 		//cout<<endl;
 		ll pref[n]={0};
 		if(peak[0]==1)
 			pref[0]=1;
 		//cout<<pref[0]<<" ";
 		for (int i = 1; i < n; ++i)
 		{
 			pref[i]=pref[i-1];
 			if(peak[i]==1)
 				pref[i]++;
 			//cout<<pref[i]<<" ";
 		}
 		//cout<<endl;
 		ll start=0;
 		ll cnt=0,max=0,ind=0;
 		std::vector<ll> v;
 		for (int i = k-1; i < n; ++i)
 		{
 			//cout<<pref[i]<<" "<<pref[start]<<" "<<arr[i]<<" "<<arr[start]<<endl;
 			cnt=(pref[i]-pref[start]-peak[i]-peak[start]);
 			if(cnt>max){
 				ind=i-(k-1)+1;
 			//	v.push_back(ind);
 				max=cnt;
 			}
 			//cout<<cnt<<endl;
 			start++;
 		}
 		cout<<max+1<<" "<<ind<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	while (t--) {
		int n, k, left = 0, mx = 0;
		cin >> n >> k;
		vector<int> a(n + 1), pref(n + 1), peaks(n + 1);
		for (int i = 1; i <= n; ++i)
			cin >> a[i];

		for (int i = 2; i < n; ++i)
			if (a[i] > a[i - 1] && a[i] > a[i + 1])
				pref[i] = peaks[i] = 1;

		for (int i = 1; i <= n; ++i)
			pref[i] += pref[i - 1];

		for (int i = k; i <= n; ++i) {
			int r = i, l = i - k + 1;
			if (peaks[r])
				--r;
			/*if (peaks[l])
				++l;*/
			if (pref[r] - pref[l] > mx)
				mx = pref[r] - pref[l], left = l;
		}
		cout << ++mx << " " << left << '\n';
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	while (t--) {
		int n, k, left = 1, mx = 0;
		cin >> n >> k;
		vector<int> a(n + 1), pref(n + 1), peaks(n + 1);
		for (int i = 1; i <= n; ++i)
			cin >> a[i];

		for (int i = 2; i < n; ++i)
			if (a[i] > a[i - 1] && a[i] > a[i + 1])
				pref[i] = peaks[i] = 1;

		for (int i = 1; i <= n; ++i)
			pref[i] += pref[i - 1];

		for (int i = k; i <= n; ++i) {
			int r = i, l = i - k + 1;
			if (peaks[r])
				--r;
			if (pref[r] - pref[l] > mx)
				mx = pref[r] - pref[l], left = l;
		}
		cout << ++mx << " " << left << '\n';
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	while (t--) {
		int n, k, left = 0, mx = 0;
		cin >> n >> k;
		vector<int> a(n + 1), pref(n + 1), peaks(n + 1);
		for (int i = 1; i <= n; ++i)
			cin >> a[i];

		for (int i = 2; i < n; ++i)
			if (a[i] > a[i - 1] && a[i] > a[i + 1])
				pref[i] = peaks[i] = 1;

		for (int i = 1; i <= n; ++i)
			pref[i] += pref[i - 1];

		for (int i = k; i <= n; ++i) {
			int r = i, l = i - k + 1;
			if (peaks[r])
				--r;
			if (peaks[l])
				++l;
			if (pref[r] - pref[l] > mx)
				mx = pref[r] - pref[l], left = l;
		}
		cout << ++mx << " " << left << '\n';
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

bool comp(pair<int, int>& a, pair<int, int>& b) {
	if (a.first == b.first)
		return a.second < b.second;
	return a.first > b.first;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while (tt--) {
		int n, k;
		int x = 0, cnt = 0, mx = -1e9;
		cin >> n >> k;
		vector<int> a(n);
		vector<int> res(n);
		vector<pair<int, int>> res2;
		for (int i = 0; i < n; ++i)
			cin >> a[i];
		for (int i = 1; i < n - 1; ++i) {
			if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
				res[i] = 1;
			}
		}
		for (int i = 0, j = 0; i < n; ++i) {
			if (res[i])
				++cnt;
			while (i + 1 - j > k)
				if (res[j++])
					--cnt;
			if (res[j])--cnt;
			if(res[i])--cnt;
			res2.emplace_back(cnt, j);
		}
			sort(res2.begin(), res2.end(), comp);

			cout << res2[0].first + 1 << " " << res2[1].second + 1 << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

bool comp(pair<int, int>& a, pair<int, int>& b) {
	if (a.first == b.first)
		return a.second < b.second;
	return a.first > b.first;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while (tt--) {
		int n, k;
		int x = 0, cnt = 0, mx = -1e9;
		cin >> n >> k;
		vector<int> a(n);
		vector<int> res(n);
		vector<pair<int, int>> res2;
		for (int i = 0; i < n; ++i)
			cin >> a[i];
		for (int i = 1; i < n - 1; ++i) {
			if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
				res[i] = 1;
			}
		}
		for (int i = 0, j = 0; i < n; ++i) {
			if (res[i])
				++cnt;
			int r = i;
			if(res[i])
			    ++r;
			while (r - j > k)
				if (res[j++])
					--cnt;
			if (res[j])--cnt;
			res2.emplace_back(cnt, j);
		}
			sort(res2.begin(), res2.end(), comp);

			cout << res2[0].first + 1 << " " << res2[1].second + 1 << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

bool comp(pair<int, int>& a, pair<int, int>& b) {
	if (a.first == b.first)
		return a.second < b.second;
	return a.first > b.first;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while (tt--) {
		int n, k;
		int x = 0, cnt = 0, mx = -1e9;
		cin >> n >> k;
		vector<int> a(n);
		vector<int> res(n);
		vector<pair<int, int>> res2;
		for (int i = 0; i < n; ++i)
			cin >> a[i];
		for (int i = 1; i < n - 1; ++i) {
			if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
				res[i] = 1;
			}
		}
		for (int i = 0, j = 0; i < n; ++i) {
			if (res[i])
				++cnt;
			while (i + 1 - j >= k)
				if (res[j++])
					--cnt;
			if (res[j])--cnt;
			res2.emplace_back(cnt, j);
		}
			sort(res2.begin(), res2.end(), comp);

			cout << res2[0].first + 1 << " " << res2[1].second + 1 << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

bool comp(pair<int, int>& a, pair<int, int>& b) {
	if (a.first == b.first)
		return a.second < b.second;
	return a.first > b.first;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while (tt--) {
		int n, k;
		int x = 0, cnt = 0, mx = -1e9;
		cin >> n >> k;
		vector<int> a(n);
		vector<int> res(n);
		vector<pair<int, int>> res2;
		for (int i = 0; i < n; ++i)
			cin >> a[i];
		for (int i = 1; i < n - 1; ++i) {
			if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
				res[i] = 1;
			}
		}
		for (int i = 0, j = 0; i < n; ++i) {
			if (res[i])
				++cnt;
			while (i + 1 - j => k)
				if (res[j++])
					--cnt;
			if (res[j])--cnt;
			res2.emplace_back(cnt, j);
		}
			sort(res2.begin(), res2.end(), comp);

			cout << res2[0].first + 1 << " " << res2[1].second + 1 << endl;
	}

}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	cin >> t;
	while (t--) {
		int n, k, left = 0, mx = 0;
		cin >> n >> k;
		vector<int> a(n + 1), pref(n + 1), peaks(n + 1);
		for (int i = 1; i <= n; ++i)
			cin >> a[i];

		for (int i = 2; i < n; ++i)
			if (a[i] > a[i - 1] && a[i] > a[i + 1])
				pref[i] = peaks[i] = 1;

		for (int i = 1; i <= n; ++i)
			pref[i] += pref[i - 1];

		for (int i = k; i <= n; ++i) {
			int r = i, l = i - k;
			if (peaks[r])
				--r;
			if (peaks[l])
				++l;
			if (pref[r] - pref[l] > mx)
				mx = pref[r] - pref[l], left = l;
		}
		cout << ++mx << " " << ++left << '\n';
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef  long long   ll;

bool comp(pair<int, int>& a, pair<int, int>& b) {
	if (a.first == b.first)
		return a.second < b.second;
	return a.first > b.first;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while (tt--) {
		int n, k;
		int x = 0, cnt = 0, mx = -1e9;
		cin >> n >> k;
		vector<int> a(n);
		vector<int> res(n);
		vector<pair<int, int>> res2;
		for (int i = 0; i < n; ++i)
			cin >> a[i];
		for (int i = 1; i < n - 1; ++i) {
			if (a[i] > a[i - 1] && a[i] > a[i + 1]) {
				res[i] = 1;
			}
		}
		for (int i = 0, j = 0; i < n; ++i) {
			if (res[i])
				++cnt;
			while (i + 1 - j > k)
				if (res[j++])
					--cnt;
			if (res[j])--cnt;
			res2.emplace_back(cnt, j);
		}
			sort(res2.begin(), res2.end(), comp);

			cout << res2[0].first + 1 << " " << res2[1].second + 1 << endl;
	}

}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=10000;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				flag=0;
				for(int j=i;j<=i+k-1;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxn = 200000 + 15;
bool b[maxn];
int n, k, a[maxn];
int s[maxn] = {};
int main()
{
	int T;
	scanf("%d", &T);
	while(T --)
	{
		memset(a, 0, sizeof(a));
		memset(s, 0, sizeof(s));
		memset(b, false, sizeof(b));

		scanf("%d %d", &n, &k);
		for(int i = 1; i <= n; ++ i) scanf("%d", &a[i]);
		for(int i = 2; i <= n - 1; ++ i)
		{
			s[i] = s[i - 1];
			if(a[i] > a[i - 1] && a[i] > a[i + 1])
			{
				++ s[i];
				b[i] = true;
			}
		}
		int L = 1, val = -1;
		for(int i = 1; i <= n; ++ i)
		{
			if(i + k > n + 1) break;
			if(val < s[i + k - 2] - s[i])
			{
				L = i;
				val = s[i + k - 2] - s[i];
			}
		}
		printf("%d %d\n", val + 1, L);
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录峰的位置
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=10000;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				flag=0;
				for(int j=i+1;j<=i+k-2;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
bool vis[300000];
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		int n,k;
		int a[300000];
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])
			{
				vis[i]=true;
			}
		}
		int flag=0,maxn=0,index=10000;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				for(int j=i;j<=i+k-1;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn&&i<index)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxn = 200000 + 15;
bool b[maxn];
int n, k, a[maxn];
int main()
{
	int T;
	scanf("%d", &T);
	while(T --)
	{
		memset(a, 0, sizeof(a));
		memset(s, 0, sizeof(s));
		scanf("%d %d", &n, &k);
		for(int i = 1; i <= n; ++ i)
		scanf("%d", &a[i]);
		for(int i = 2; i <= n - 1; ++ i)
		{
			s[i] = s[i - 1];
			if(a[i] > a[i - 1] && a[i] > a[i + 1])
			{
				++ s[i];
			}
		}
		int L = 1, val = -1;
		for(int i = 1; i <= n-k+1; ++ i)
		{
			if(val < s[i + k - 2] - s[i])
			{
				L = i;
				val = s[i + k - 2] - s[i];
			}
		}
		printf("%d %d\n", val + 1, L);
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
int a[300000],fsum[300000];//long long 超时
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
	//	cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
	    int maxn=-1,index=1;//longlong 超时
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%d %d\n",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxn = 200000 + 15;
int n, k, a[maxn];
int s[maxn];
int main()
{
	int T;
	scanf("%d", &T);
	while(T --)
	{
		memset(a, 0, sizeof(a));
		memset(s, 0, sizeof(s));
		scanf("%d %d", &n, &k);
		for(int i = 1; i <= n; ++ i)
		scanf("%d", &a[i]);
		for(int i = 2; i <= n - 1; ++ i)
		{
			s[i] = s[i - 1];
			if(a[i] > a[i - 1] && a[i] > a[i + 1])
			{
				++ s[i];
			}
		}
		int L = 1, val = -1;
		for(int i = 1; i <= n-k+1; ++ i)
		{
			if(val < s[i + k - 2] - s[i])
			{
				L = i;
				val = s[i + k - 2] - s[i];
			}
		}
		printf("%d %d\n", val + 1, L);
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
ll a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
	//	cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%lld",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
	    ll maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%lld %lld\n",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
ll a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
		ll maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%lld %lld",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
bool vis[300000];
int index;
int main()
{
	int NUM,flag1;
	cin>>NUM;
	flag1=NUM;
	while(NUM--)
	{
		int n,k;
		int a[300000];
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])
			{
				vis[i]=true;
			}
		}
		int flag=0,maxn=0,index=flag1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				for(int j=i;j<=i+k-1;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn&&i<index)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
ll a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
	//	cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
		ll maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%lld %lld",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=10000;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				flag=0;
				for(int j=i;j<=i+k-1;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn&&i<index)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
ll a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
	//	cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
		ll maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%lld %lld\n",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=100000;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				flag=0;
				for(int j=i;j<=i+k-1;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn&&i<index)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录峰的位置
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=10000;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				flag=0;
				for(int j=i+1;j<=i+k-2;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录峰的位置
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			flag=0;
			for(int j=i+1;j<=i+k-2;j++)
			{
				if(vis[j]==true)
				{
					flag++;
				}
			}
			if(flag>maxn)
			{
				maxn=flag;
				index=i;
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
int a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
	//	cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
	    int maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%d %d\n",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxn = 200000 + 15;
bool b[maxn];
int n, k, a[maxn];
int s[maxn] = {};
int main()
{
	int T;
	scanf("%d", &T);
	while(T --)
	{
		memset(a, 0, sizeof(a));
		memset(b, false, sizeof(b));
		scanf("%d %d", &n, &k);
		for(int i = 1; i <= n; ++ i)
		scanf("%d", &a[i]);
		for(int i = 2; i <= n - 1; ++ i)
		{
			if(a[i] > a[i - 1] && a[i] > a[i + 1])
			{
				b[i] = true;
			}
		}
		int L = 1, val = -1,flag;//L为起点，val为：可分为的部分
		for(int i = 1; i <= n-k+1; ++ i)
		{
			flag=0;
			for(int j=i;j<=i+k-2;j++)
			{
				if(b[j]==true)
				{
					flag++;
				}
			}
			if(val < flag)
			{
				L = i;
				val = flag;
			}
		}
		printf("%d %d\n", val + 1, L);
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
bool vis[300000];
ll a[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(vis,false,sizeof(vis));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)
		{
			if(a[i]>a[i-1]&&a[i+1]<a[i])
			{
				vis[i]=true;
			}
		}
		ll flag=0,maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(vis[i]==true||vis[i+k-1]==true)
			{
				continue;
			}
			else
			{
				flag=0;
				for(int j=i;j<=i+k-1;j++)
				{
					if(vis[j]==true)
					{
						flag++;
					}
				}
				if(flag>maxn)
				{
					maxn=flag;
					index=i;
				}
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
int a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		scanf("%d%d",&n,&k);
	//	cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
	    int maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		printf("%lld %lld\n",maxn+1,index);
	//	cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include "iostream"
#include "cstring"
using namespace std;
typedef long long ll;
ll a[300000],fsum[300000];
int n,k;
int main()
{
	int NUM;
	cin>>NUM;
	while(NUM--)
	{
		memset(a,0,sizeof(a));
		memset(fsum,0,sizeof(fsum));
		cin>>n>>k;
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		for(int i=2;i<n;i++)//不在端点找峰因为就算端点值最大也不满足峰的条件
		{
			fsum[i]=fsum[i-1];//求前缀和   不然用bool数组记录峰的位置再遍历会超时
			if(a[i]>a[i-1]&&a[i+1]<a[i])//记录区间峰的数量
			{
				fsum[i]++;
			}
		}
		ll maxn=-1,index=1;
		for(int i=1;i<=n-k+1;i++)
		{
			if(fsum[i+k-2]-fsum[i]>maxn)
			{
				maxn=fsum[i+k-2]-fsum[i];
				index=i;
			}
		}
		cout<<maxn+1<<" "<<index<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

void solve(){
    int t; cin >> t;
    while(t--){
        int n,k; cin >> n >> k;
        vector<int> nums(n);
        for(int i = 0; i < n; i++) cin >> nums[i];

        vector<int> peaks(n + 1, 0);
        for(int i = 2; i < n; i++){
            if(nums[i - 1] > nums[i - 2] && nums[i - 1] > nums[i]){
                peaks[i]++;
            }
            peaks[i + 1] = peaks[i];
        }

        // for(int i = 0; i < peaks.size(); i++){
        //     cout << peaks[i] << " ";
        // }
        // cout << endl;
        int max_count = 0;
        int start = 0;
        for(int i = 1; i <= n - k + 1; i++){
            int cur_count = peaks[i + k - 2] - peaks[i];
            if(cur_count > max_count){
                max_count = cur_count;
                start = i;
            }
        }

        cout << max_count + 1 << " " << start << endl;
    }

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

void solve(){
    int t; cin >> t;
    while(t--){
        int n,k; cin >> n >> k;
        vector<int> nums(n);
        for(int i = 0; i < n; i++) cin >> nums[i];

        vector<int> peaks;
        for(int i = 2; i < n; i++){
            if(nums[i - 1] > nums[i - 2] && nums[i - 1] > nums[i]){
                peaks.push_back(i);
            }
        }

        int max_count = 0;
        int left_res = 0;
        // for(int i = 0; i < peaks.size(); i++){
        //     int right = peaks[i] - 1 + k;

        //     auto endp = lower_bound(peaks.begin(), peaks.end(), right); endp--;
        //     int end_idx = endp - peaks.begin();

        //     // cout << i << " - " << end_idx << " " << peaks[i] << " - " << (*endp) << endl;
        //     if(end_idx >= i && end_idx - i + 1 > max_count){
        //         max_count = end_idx - i + 1;
        //         left_res = max(1, (*endp) + 1 - (k - 1));
        //     }
        // }

        for(int i = 1; i <= n; i++){
            int left = i;
            int right = min(n, left + k - 1);

            int cur_count = 0;
            for(int j = 0; j < peaks.size(); j++){
                if(peaks[j] > left && peaks[j] < right)
                    cur_count++;
            }

            if(cur_count > max_count){
                max_count = cur_count;
                left_res = i;
            }
        }

        cout << max_count + 1 << " " << left_res<< endl;
    }

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

void solve(){
    int t; cin >> t;
    while(t--){
        int n,k; cin >> n >> k;
        vector<int> nums(n);
        for(int i = 0; i < n; i++) cin >> nums[i];

        vector<int> peaks;
        for(int i = 2; i < n; i++){
            if(nums[i - 1] > nums[i - 2] && nums[i - 1] > nums[i]){
                peaks.push_back(i);
            }
        }

        int max_count = 0;
        int left_res = 1;
        // for(int i = 0; i < peaks.size(); i++){
        //     int right = peaks[i] - 1 + k;

        //     auto endp = lower_bound(peaks.begin(), peaks.end(), right); endp--;
        //     int end_idx = endp - peaks.begin();

        //     // cout << i << " - " << end_idx << " " << peaks[i] << " - " << (*endp) << endl;
        //     if(end_idx >= i && end_idx - i + 1 > max_count){
        //         max_count = end_idx - i + 1;
        //         left_res = max(1, (*endp) + 1 - (k - 1));
        //     }
        // }

        for(int i = 1; i <= n; i++){
            int left = i;
            int right = left + k - 1;

            int cur_count = 0;
            for(int j = 0; j < peaks.size(); j++){
                if(peaks[j] > left && peaks[j] < right)
                    cur_count++;
            }

            if(cur_count > max_count){
                max_count = cur_count;
                left_res = i;
            }
        }

        cout << (max_count == 0 ? 0 : (max_count + 1)) << " " << left_res<< endl;
    }

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

void solve(){
    int t; cin >> t;
    while(t--){
        int n,k; cin >> n >> k;
        vector<int> nums(n);
        for(int i = 0; i < n; i++) cin >> nums[i];

        vector<int> peaks;
        for(int i = 2; i < n; i++){
            if(nums[i - 1] > nums[i - 2] && nums[i - 1] > nums[i]){
                peaks.push_back(i);
            }
        }

        int max_count = 0;
        int left_res = 0;
        // for(int i = 0; i < peaks.size(); i++){
        //     int right = peaks[i] - 1 + k;

        //     auto endp = lower_bound(peaks.begin(), peaks.end(), right); endp--;
        //     int end_idx = endp - peaks.begin();

        //     // cout << i << " - " << end_idx << " " << peaks[i] << " - " << (*endp) << endl;
        //     if(end_idx >= i && end_idx - i + 1 > max_count){
        //         max_count = end_idx - i + 1;
        //         left_res = max(1, (*endp) + 1 - (k - 1));
        //     }
        // }

        for(int i = 1; i <= n; i++){
            int left = i;
            int right = min(n, left + k - 1);

            int cur_count = 0;
            for(int j = 0; j < peaks.size(); j++){
                if(peaks[j] > left && peaks[j] < right)
                    cur_count++;
            }

            if(cur_count > max_count){
                max_count = cur_count;
                left_res = i;
            }
        }

        cout << (max_count == 0 ? 0 : (max_count + 1)) << " " << left_res<< endl;
    }

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

void solve(){
    int t; cin >> t;
    while(t--){
        int n,k; cin >> n >> k;
        vector<int> nums(n);
        for(int i = 0; i < n; i++) cin >> nums[i];

        vector<int> peaks;
        for(int i = 2; i < n; i++){
            if(nums[i - 1] > nums[i - 2] && nums[i - 1] > nums[i]){
                peaks.push_back(i);
            }
        }

        int max_count = 0;
        int left_res = 1;
        // for(int i = 0; i < peaks.size(); i++){
        //     int right = peaks[i] - 1 + k;

        //     auto endp = lower_bound(peaks.begin(), peaks.end(), right); endp--;
        //     int end_idx = endp - peaks.begin();

        //     // cout << i << " - " << end_idx << " " << peaks[i] << " - " << (*endp) << endl;
        //     if(end_idx >= i && end_idx - i + 1 > max_count){
        //         max_count = end_idx - i + 1;
        //         left_res = max(1, (*endp) + 1 - (k - 1));
        //     }
        // }

        for(int i = 1; i <= n; i++){
            int left = i;
            int right = min(n, left + k - 1);

            int cur_count = 0;
            for(int j = 0; j < peaks.size(); j++){
                if(peaks[j] > left && peaks[j] < right)
                    cur_count++;
            }

            if(cur_count > max_count){
                max_count = cur_count;
                left_res = i;
            }
        }

        cout << (max_count == 0 ? 0 : (max_count + 1)) << " " << left_res<< endl;
    }

}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    solve();

    return 0;
}