On February 14 Denis decided to give Valentine to Nastya and did not come up with anything better than to draw a huge red heart on the door of the length $k$ ($k \ge 3$). Nastya was very confused by this present, so she decided to break the door, throwing it on the mountains.

Mountains are described by a sequence of heights $a_1, a_2, \dots, a_n$ in order from left to right ($k \le n$). It is guaranteed that neighboring heights are not equal to each other (that is, $a_i \ne a_{i+1}$ for all $i$ from $1$ to $n-1$).

Peaks of mountains on the segment $[l,r]$ (from $l$ to $r$) are called indexes $i$ such that $l < i < r$, $a_{i - 1} < a_i$ and $a_i > a_{i + 1}$. It is worth noting that the boundary indexes $l$ and $r$ for the segment are not peaks. For example, if $n=8$ and $a=[3,1,4,1,5,9,2,6]$, then the segment $[1,8]$ has only two peaks (with indexes $3$ and $6$), and there are no peaks on the segment $[3, 6]$.

To break the door, Nastya throws it to a segment $[l,l+k-1]$ of consecutive mountains of length $k$ ($1 \le l \le n-k+1$). When the door touches the peaks of the mountains, it breaks into two parts, after that these parts will continue to fall in different halves and also break into pieces when touching the peaks of the mountains, and so on. Formally, the number of parts that the door will break into will be equal to $p+1$, where $p$ is the number of peaks on the segment $[l,l+k-1]$.

Nastya wants to break it into as many pieces as possible. Help her choose such a segment of mountains $[l, l+k-1]$ that the number of peaks on it is maximum. If there are several optimal segments, Nastya wants to find one for which the value $l$ is minimal.

Formally, you need to choose a segment of mountains $[l, l+k-1]$ that has the maximum number of peaks. Among all such segments, you need to find the segment that has the minimum possible value $l$.


-----Input-----

The first line contains an integer $t$ ($1 \leq t \leq 10^4$)  — the number of test cases. Then the descriptions of the test cases follow.

The first line of each test case contains two integers $n$ and $k$ ($3 \leq k \leq n \leq 2 \cdot 10^5$)  — the number of mountains and the length of the door.

The second line of the input data set contains $n$ integers $a_1, a_2, \dots, a_n$ ($0 \leq a_i \leq 10 ^ 9$, $a_i \neq a_{i + 1}$)  — the heights of mountains.

It is guaranteed that the sum of $n$ over all the test cases will not exceed $2 \cdot 10^5$.


-----Output-----

For each test case, output two integers $t$ and $l$  — the maximum number of parts that the door can split into, and the left border of the segment of length $k$ that the door should be reset to.


-----Example-----
Input
5
8 6
1 2 4 1 2 4 1 2
5 3
3 2 3 2 1
10 4
4 3 4 3 2 3 2 1 0 1
15 7
3 7 4 8 2 3 4 5 21 2 3 4 2 1 3
7 5
1 2 3 4 5 6 1

Output
3 2
2 2
2 1
3 1
2 3



-----Note-----

In the first example, you need to select a segment of mountains from $2$ to $7$. In this segment, the indexes $3$ and $6$ are peaks, so the answer is $3$ (only $2$ peaks, so the door will break into $3$ parts). It is not difficult to notice that the mountain segments $[1, 6]$ and $[3, 8]$ are not suitable since they only have a $1$ peak (for the first segment, the $6$ index is not a peak, and for the second segment, the $3$ index is not a peak).

In the second example, you need to select a segment of mountains from $2$ to $4$. In this segment, the index $3$ is a peak, so the answer is $2$ (only $1$ peak, so the door will break into $2$ parts).

In the third example, you need to select a segment of mountains from $1$ to $4$. In this segment, the index $3$ is a peak, so the answer is $2$ (only $1$ peak, so the door will break into $2$ parts). You can see that on the segments $[2, 5]$, $[4, 7]$ and $[5, 8]$ the number of peaks is also $1$, but these segments have a left border greater than the segment $[1, 4]$, so they are not the correct answer.

Source: codeforces | Difficulty: EASY
Tags: Implementation

Greedy algorithms


Solutions:
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	np = [0] * n
	vis = [0] * n
	sm = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			np[i] += 1
			vis[i] = 1
		sm += np[i]
		np[i] = sm
	np[n - 1] = sm
	(t, l) = (0, 0)
	for i in range(n - k + 1):
		p = np[i + k - 1] - np[max(i - 1, 0)]
		if vis[i + k - 1]:
			p -= 1
		if vis[i]:
			p -= 1
		if p > t:
			l = i
			t = p
	print(t + 1, l + 1)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	t = 0
	size = 2
	res_t = 0
	res_l = 0
	for r in range(2, n):
		size += 1
		l = max(0, r - k + 1)
		if a[r - 2] < a[r - 1] and a[r - 1] > a[r]:
			t += 1
		if size > k:
			if a[l - 1] < a[l] and a[l] > a[l + 1]:
				t -= 1
			size -= 1
		if t > res_t:
			res_t = t
			res_l = l
	print(res_t + 1, res_l + 1)


t = int(input())
for i in range(t):
	(n, k) = [int(i) for i in input().split()]
	mt = [int(i) for i in input().split()]
	peak = [0 for i in range(n)]
	maxP = 0
	pos = 0
	for i in range(1, k - 1):
		if mt[i - 1] < mt[i] and mt[i] > mt[i + 1]:
			maxP += 1
			peak[i] = 1
	i = k - 1
	nowP = maxP
	while i < n - 1:
		if peak[i - (k - 2)] == 1:
			nowP -= 1
		if mt[i - 1] < mt[i] and mt[i] > mt[i + 1]:
			nowP += 1
			peak[i] = 1
		if nowP > maxP:
			maxP = nowP
			pos = i - (k - 2)
		i += 1
	print(maxP + 1, pos + 1)


R = lambda : map(int, input().split())
(t,) = R()
for _ in [0] * t:
	(n, k) = R()
	a = (*R(),)
	b = [0]
	for (x, y, z) in zip(a, a[1:], a[2:]):
		b += (b[-1] + (x < y > z),)
	a = [y - x + 1 for (x, y) in zip(b, b[k - 2:])]
	m = max(a)
	print(m, a.index(m) + 1)


from sys import stdin
for _ in range(int(stdin.readline().rstrip())):
	(n, k) = map(int, stdin.readline().rstrip().split(' '))
	l = list(map(int, stdin.readline().rstrip().split(' ')))
	r = 0
	mi = 1
	peeks = [0] * n
	c = 0
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			c += 1
		peeks[i] = c
	for i in range(n - k + 1):
		c = peeks[i + k - 2] - peeks[i] + 1
		if c > r:
			r = c
			mi = i + 1
	print(r, mi)


t = int(input())
for h in range(t):
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	k -= 2
	j = n - 1
	i = j - k
	s = 1
	for l in range(i, j):
		if x[l] > x[l - 1] and x[l] > x[l + 1]:
			s += 1
	m = s
	ind = i - 1
	j -= 1
	i -= 1
	while i > 0:
		if x[i] > x[i - 1] and x[i] > x[i + 1]:
			s += 1
		if x[j] > x[j - 1] and x[j] > x[j + 1]:
			s -= 1
		if s >= m:
			ind = i - 1
			m = s
		i -= 1
		j -= 1
	print(m, ind + 1)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = I()
	rr = []
	for _ in range(t):
		(n, k) = LI()
		a = LI()
		b = [0] * n
		for i in range(1, n - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				b[i] = 1
		c = 0
		for i in range(1, k - 1):
			c += b[i]
		r = c
		t = 1
		for i in range(n - k):
			c -= b[i + 1]
			c += b[i + k - 1]
			if r < c:
				r = c
				t = i + 2
		rr.append(JA([r + 1, t], ' '))
	return JA(rr, '\n')
print(main())


import sys
input = sys.stdin.buffer.readline

def solve(n, k, arr):
	d = [0] * (n + 1)
	for i in range(2, n):
		if arr[i - 2] < arr[i - 1] > arr[i]:
			d[i - 1] = 1
	c = list(d)
	for i in range(n):
		c[i] += c[i - 1]
	maxv = -float('inf')
	l = 0
	for i in range(n - k + 1):
		temp = c[i + k - 1] - c[i - 1] - d[i] - d[i + k - 1]
		if temp > maxv:
			maxv = temp
			l = i
	return (maxv, l)
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = solve(n, k, arr)
	print(ans[0] + 1, ans[1] + 1)


T = int(input())
for case in range(T):
	(N, K) = map(int, input().split())
	montains = list(map(int, input().split()))
	peaks = [False] * N
	for i in range(2, N):
		if montains[i - 2] < montains[i - 1] > montains[i]:
			peaks[i - 1] = True
	maxl = 0
	parts = 1
	for m in range(1, K - 1):
		if peaks[m]:
			parts += 1
	maxp = parts
	for l in range(1, N - K + 1):
		if peaks[l]:
			parts -= 1
		if peaks[l + K - 2]:
			parts += 1
		if parts > maxp:
			maxp = parts
			maxl = l
	print(maxp, maxl + 1)


from collections import defaultdict as dd

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	(n, k) = rl()
	A = rl()
	peaks = []
	for i in range(1, n - 1):
		if A[i] > max(A[i - 1], A[i + 1]):
			peaks.append(1)
		else:
			peaks.append(0)
	best = sum(peaks[:k - 2])
	curr = best
	best_l = 0
	for i in range(1, n - (k - 1)):
		curr -= peaks[i - 1]
		curr += peaks[i + k - 3]
		if curr > best:
			best = curr
			best_l = i
	return (best + 1, best_l + 1)
t = ri()
for i in range(t):
	print(*solve())


import math

def main():
	for q in range(int(input())):
		(N, K) = map(int, input().split())
		l = list(map(int, input().split()))
		gm = 0
		gst = 0
		count = 0
		for i in range(1, K - 1):
			if l[i] > l[i - 1] and l[i] > l[i + 1]:
				count += 1
		if count > gm:
			gm = count
		for i in range(1, N - K + 1):
			if l[i + K - 2] > l[i + K - 3] and l[i + K - 2] > l[i + K - 1]:
				count += 1
			if l[i] > l[i - 1] and l[i] > l[i + 1]:
				count -= 1
			if gm < count:
				gm = count
				gst = i
		print(gm + 1, gst + 1)
main()


import sys
input = sys.stdin.buffer.readline

def print(val):
	sys.stdout.write(str(val) + '\n')

def yo():
	for i in range(int(input().strip())):
		(n, k) = map(int, input().split())
		mountains = list(map(int, input().split()))
		current_start = 1
		max_parts = 1
		for i in range(1, k - 1):
			if mountains[i] > mountains[i - 1] and mountains[i] > mountains[i + 1]:
				max_parts += 1
			curr_parts = max_parts
		for i in range(1, n - k + 1):
			change = 0
			if mountains[i] > mountains[i - 1] and mountains[i] > mountains[i + 1]:
				change -= 1
			if mountains[i + k - 2] > mountains[i + k - 3] and mountains[i + k - 2] > mountains[i + k - 1]:
				change += 1
			curr_parts += change
			if curr_parts > max_parts:
				max_parts = curr_parts
				current_start = i + 1
		print(str(max_parts) + ' ' + str(current_start))
yo()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	r = []
	c = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			r.append(1)
			c = c + 1
		else:
			r.append(0)
	(m, l) = (0, 0)
	for i in range(n - k + 1):
		if c > m:
			m = c
			l = i
		if r[i] == 1:
			c = c - 1
		if i + k != n:
			if a[i + k - 1] > a[i + k - 2] and a[i + k - 1] > a[i + k]:
				c = c + 1
				r.append(1)
			else:
				r.append(0)
	print(m + 1, l + 1)


from __future__ import print_function
from collections import Counter, OrderedDict
from itertools import permutations as perm
from fractions import Fraction
from collections import deque
from sys import stdin
from bisect import *
from heapq import *
import math
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gfl = lambda : [float(var) for var in gl()]
gcl = lambda : list(g())
gbs = lambda : [int(var) for var in g()]
mod = int(1000000000.0) + 7
inf = float('inf')
(t,) = gil()
for _ in range(t):
	(n, k) = gil()
	a = gil()
	pk = 0
	for i in range(1, k - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			pk += 1
	(maxPeakIdx, maxPeak) = (0, pk)
	for i in range(k, n):
		if a[i - 2] < a[i - 1] > a[i]:
			pk += 1
		j = i - k + 1
		if a[j - 1] < a[j] > a[j + 1]:
			pk -= 1
		if pk > maxPeak:
			maxPeakIdx = j
			maxPeak = pk
	print(maxPeak + 1, maxPeakIdx + 1)


t = int(input())
while t:
	t = t - 1
	(n, k) = [int(s) for s in input().split()]
	a = [int(s) for s in input().split()]
	d = {}
	d[0] = 0
	for i in range(1, n - 1):
		current_height = a[i]
		if a[i - 1] < current_height and a[i + 1] < current_height:
			d[i] = d[i - 1] + 1
		else:
			d[i] = d[i - 1]
	d[n - 1] = d[n - 2]
	temp_d = d.copy()
	for i in range(1, n):
		if temp_d[i] > d[i - 1]:
			temp_d[i] = temp_d[i] - 1
	d = temp_d
	n_range = n - k + 1
	max_peak = 0
	optimal_l = 0
	for i in range(n_range):
		l = i
		r = i + k - 1
		n_peaks = d[r] - d[l + 1]
		if n_peaks > max_peak:
			max_peak = n_peaks
			optimal_l = l
	print(max_peak + 1, optimal_l + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	A = [0] + list(map(int, input().split()))
	B = [0] * len(A)
	for j in range(2, n):
		if A[j - 1] < A[j] > A[j + 1]:
			B[j] = 1
	now = 0
	R = [0] * len(A)
	for q in range(1, k + 1):
		if B[q] == 1 and q != 1 and (q != k):
			now += 1
	maxx = now
	maxxi = 1
	for j in range(2, n - k + 2):
		if B[j] == 1:
			now -= 1
		if B[j + k - 2] == 1:
			now += 1
		if now > maxx:
			maxx = now
			maxxi = j
	print(maxx + 1, maxxi)


from itertools import accumulate
for ii in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peaks[i] = 1
	p_sum = list(accumulate(peaks))
	p = 0
	ind = 0
	i = 0
	while i + k - 1 < n:
		temp = p_sum[i + k - 2] - p_sum[i]
		if temp > p:
			p = temp
			ind = i
		i += 1
	print(p + 1, ind + 1)


t = int(input())
for T in range(t):
	(n, k) = map(int, input().split())
	a = [int(r) for r in input().split()]
	piki = 0
	for i in range(1, k - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			piki += 1
	l = 0
	ans = piki
	for j in range(k, n):
		if a[j - 2] < a[j - 1] > a[j]:
			piki += 1
		if a[j - k] < a[j - k + 1] > a[j - k + 2]:
			piki -= 1
		if piki > ans:
			ans = piki
			l = j - k + 1
	print(ans + 1, l + 1)


from sys import stdin, stdout

def main():
	rows = stdin.read().split('\n')
	T = int(rows[0])
	for t in range(1, T + 1):
		(n, k) = map(int, rows[2 * t - 1].split(' '))
		p = list(map(int, rows[2 * t].split(' ')))
		s = 1
		for i in range(1, k - 1):
			if p[i] > p[i - 1] and p[i] > p[i + 1]:
				s += 1
		besti = 0
		bests = s
		for i in range(1, n - k + 1):
			if p[i] > p[i - 1] and p[i] > p[i + 1]:
				s -= 1
			j = i + k - 2
			if p[j] > p[j - 1] and p[j] > p[j + 1]:
				s += 1
			if bests < s:
				besti = i
				bests = s
		stdout.write('{} {}\n'.format(bests, besti + 1))
main()


m = int(input())
for _ in range(m):
	(n, k) = map(int, input().split())
	m = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(n):
		if i >= 1 and i + 1 < n and (m[i - 1] < m[i]) and (m[i] > m[i + 1]):
			peaks[i] = 1
	psum = [0]
	for i in range(n):
		if i >= 1:
			psum.append(peaks[i] + psum[i - 1])
	(ans, ansi) = (-1, -1)
	for i in range(n):
		if i + k - 1 < n:
			cur = psum[i + k - 1] - psum[i]
			if peaks[i] == 1:
				cur -= 1
			if peaks[i + k - 1] == 1:
				cur -= 1
			if cur > ans:
				ans = cur
				ansi = i
	print(ans + 1, ansi + 1)


R1 = lambda : list(map(int, input().split()))
R2 = lambda : int(input())
t = R2()
for _ in range(t):
	(n, k) = R1()
	A = R1()
	res = [0] * n
	for i in range(1, n - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			res[i] += 1
	s = sum(res[1:k - 1])
	(m, l) = (s, 0)
	for i in range(1, n - k + 1):
		s -= res[i]
		s += res[i + k - 2]
		if s > m:
			m = s
			l = i
	print(m + 1, l + 1)


t = int(input())
for ii in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = 1
	cur = 0
	ind = k - 1
	for i in range(k):
		if i != 0 and i != k - 1:
			cur += p[i]
	ans = cur
	ans_ind = k - 1
	while ind < n:
		if p[ind - k + 2]:
			cur -= 1
		if p[ind]:
			cur += 1
		if cur > ans:
			ans = cur
			ans_ind = ind + 1
		ind += 1
	print(ans + 1, ans_ind - k + 2)


f = lambda : list(map(int, input().split()))
p = lambda i: h[i - 1] < h[i] > h[i + 1] if i > 0 else 0
for t in range(int(input())):
	(n, k) = f()
	h = f()
	s = S = R = 1
	for r in range(1, n - 1):
		s += p(r) - p(r - k + 2)
		if s > S:
			(S, R) = (s, r)
	print(S, max(1, R - k + 3))


import bisect

def solve():
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	mount = []
	for (i, v) in enumerate(lis[1:len(lis) - 1], 1):
		if v > lis[i - 1] and v > lis[i + 1]:
			mount.append(i + 1)
	max_mount = 0
	index = 1
	for i in range(1, len(lis) + 1):
		mt = bisect.bisect_left(mount, i + k - 1)
		ind = bisect.bisect_right(mount, i)
		if mt - ind > max_mount:
			max_mount = mt - ind
			index = i
	print(max_mount + 1, index)
t = int(input())
for i in range(t):
	solve()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	cnt = 0
	for j in range(k):
		if 0 < j < k - 1 and a[j - 1] < a[j] > a[j + 1]:
			cnt += 1
	ans = cnt
	l = 0
	for j in range(n - k):
		if a[j + 2] < a[j + 1] > a[j]:
			cnt -= 1
		if a[j + k - 2] < a[j + k - 1] > a[j + k]:
			cnt += 1
		if cnt > ans:
			ans = cnt
			l = j + 1
	print(ans + 1, l + 1)


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	(n, k) = mapi()
	a = list(mapi())
	cnt = 0
	for i in range(n - k + 1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			cnt += 1
	res = cnt
	l = n - k
	i = n - k
	while i > 0:
		if a[i - 1] < a[i] > a[i + 1]:
			cnt += 1
		if a[i + k - 3] < a[i + k - 2] > a[i + k - 1]:
			cnt -= 1
		if cnt >= res:
			res = cnt
			l = i - 1
		i -= 1
	print(res + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	ansmin = 0
	s = sum(peaks[1:k - 1])
	ans = s
	for i in range(1, n - k + 1):
		s -= peaks[i]
		s += peaks[k + i - 2]
		if s > ans:
			ans = s
			ansmin = i
	print(ans + 1, ansmin + 1)


def solve():
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	l = len(a)
	b = [0 for i in range(l)]
	for i in range(1, l - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			b[i] = 1
	mx = 0
	mxi = 0
	pref = 0
	k -= 2
	for i in range(1, l - 1):
		if i > k:
			pref -= b[i - k]
			pref += b[i]
			if pref > mx:
				mx = pref
				mxi = i - k
		else:
			pref += b[i]
			if pref > mx:
				mx = pref
				mxi = 0
	print(mx + 1, mxi + 1)
t = int(input())
for i in range(t):
	solve()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = temp = ind = 0
	for i in range(k):
		if i != 0 and i != k - 1:
			if a[i + 1] < a[i] > a[i - 1]:
				ans += 1
	(p1, p2) = (1, k)
	temp = ans
	while p2 < n:
		if a[p1 + 1] < a[p1] > a[p1 - 1]:
			temp -= 1
		if a[p2] < a[p2 - 1] > a[p2 - 2]:
			temp += 1
		if temp > ans:
			ind = p1
			ans = temp
		p1 += 1
		p2 += 1
	print(str(ans + 1), str(ind + 1))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	S = [0 for _ in range(n)]
	for i in range(1, n - 1):
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			S[i] = 1
	for i in range(n - 1):
		S[i + 1] += S[i]
	X = [0 for _ in range(n - k + 1)]
	for i in range(k - 1, n):
		X[i - k + 1] = S[i - 1] - S[i - k + 1]
	M = max(X)
	t = 0
	for i in range(n - k + 1):
		if X[i] == M:
			t = i + 1
			break
	print(M + 1, t)


def checker(i, v, l, r):
	if i == l or i == r:
		return False
	return v[i - 1] < v[i] and v[i] > v[i + 1]

def solver(n, k, lst):
	(ans, l, r, now) = (-1, -1, -1, 0)
	i = 1
	while i + 1 < k:
		if checker(i, lst, 0, k - 1):
			now += 1
		i += 1
	(ans, l, r) = (now + 1, 0, k - 1)
	for i in range(k, n):
		if checker(i - k + 1, lst, i - k, i - 1):
			now -= 1
		if checker(i - 1, lst, i - k + 1, i):
			now += 1
		if now + 1 > ans:
			(ans, l, r) = (now + 1, i - k + 1, i)
	return (ans, l + 1)
for _ in range(int(input())):
	(N, K) = [int(j) for j in input().split()]
	a = [int(j) for j in input().split()]
	print(*solver(N, K, a))


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def case():
	(n, k) = li()
	a = li()
	ans = [0 for i in range(n)]
	i = 1
	while i < n - 1:
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			ans[i] = 1
			i += 2
		else:
			ans[i] = 0
			i += 1
	s = sum(ans[:k])
	pink = 1
	s -= ans[k - 1]
	m = s
	s += ans[k - 1]
	for i in range(1, n - k + 1):
		s -= ans[i]
		if s > m:
			m = s
			pink = i + 1
		s += ans[i + k - 1]
	print(m + 1, pink)
for _ in range(int(input())):
	case()


T = int(input())
for _ in range(0, T):
	(n, k) = map(int, input().split())
	s = [int(x) for x in input().split()]
	c = 0
	for i in range(1, k - 1):
		if s[i] > s[i - 1] and s[i] > s[i + 1]:
			c += 1
	mx = c
	ptr = 1
	kk = 1
	for i in range(k - 1, n - 1):
		if s[ptr] > s[ptr - 1] and s[ptr] > s[ptr + 1]:
			c -= 1
		if s[i] > s[i - 1] and s[i] > s[i + 1]:
			c += 1
		ptr += 1
		if c > mx:
			mx = max(mx, c)
			kk = ptr
	print(mx + 1, kk)


from sys import stdin
for _ in range(int(stdin.readline())):
	(n, k) = map(int, stdin.readline().split())
	arr = list(map(int, stdin.readline().strip().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peaks[i] = 1
	k -= 2
	S = sum(peaks[:k])
	ans = [S, 0]
	for i in range(n - k):
		S = S - peaks[i] + peaks[i + k]
		if S > ans[0]:
			ans = [S, i]
	print(ans[0] + 1, ans[1] + 1)


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
	for i in range(1, n):
		b[i] += b[i - 1]
	peak = 0
	ans = 1
	for i in range(0, n - k + 1):
		pk = b[i + k - 2] - b[i]
		if pk > peak:
			peak = pk
			ans = i + 1
	print(peak + 1, ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0] * n
	mx = -1
	l = -1
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peak[i] = peak[i - 1] + 1
		else:
			peak[i] = peak[i - 1]
	for i in range(k - 1, n):
		if mx < peak[i - 1] - peak[i - k + 1]:
			mx = peak[i - 1] - peak[i - k + 1]
			l = i - k + 2
	print(mx + 1, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = [0] + list(map(int, input().split()))
	ind = 1
	peakcnt = 0
	for i in range(2, k):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peakcnt += 1
	temp = peakcnt
	removed = 0
	added = 0
	for i in range(k + 1, n + 1):
		if arr[i - (k - 1) - 1] < arr[i - (k - 1)] > arr[i - (k - 1) + 1]:
			removed += 1
		if arr[i - 2] < arr[i - 1] > arr[i]:
			added += 1
		if added + peakcnt - removed > peakcnt:
			peakcnt = added - removed + peakcnt
			added = 0
			removed = 0
			ind = i - (k - 1)
	print(peakcnt + 1, ind)


import bisect
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(s) for s in input().split()]
	x = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			x[i] = 1
	b = [0] * n
	for i in range(1, n):
		b[i] = x[i] + b[i - 1]
	d = {}
	m = 0
	for i in range(n - k + 1):
		z = b[i + k - 1] - b[i] + 1 - x[i] - x[i + k - 1]
		if z not in d:
			d[z] = i
		if m < z:
			m = z
	print(m, d[m] + 1)


t = int(input())
for i in range(t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	lst = input().split()
	lst = list(map(int, lst))
	b = [0 for i in range(n)]
	pos = 1
	maxn = 0
	cnt = 0
	for i in range(n):
		if i >= 2 and lst[i - 1] > lst[i - 2] and (lst[i - 1] > lst[i]):
			cnt += 1
		b[i] = cnt
	for i in range(n - k + 1):
		if maxn < b[i + k - 1] - b[i + 1]:
			pos = i + 1
		maxn = max(maxn, b[i + k - 1] - b[i + 1])
	print(maxn + 1, pos)


def compute(ar, d):
	c = 0
	i = 1
	s = set()
	while i < len(ar):
		if i != len(ar) - 1 and ar[i] > ar[i - 1] and (ar[i] > ar[i + 1]):
			s.add(i)
			if i - k + 1 > 0:
				if i - k + 1 in s:
					c -= 1
			d[i] = c
			c += 1
		else:
			if i - k + 1 > 0:
				if i - k + 1 in s:
					c -= 1
			d[i] = c
		i += 1
for i in range(int(input())):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	d = {0: 0}
	compute(ar, d)
	l = 0
	ans = 0
	for i in range(n - k + 1):
		if d[i + k - 1] > ans:
			l = i
			ans = d[i + k - 1]
	print(ans + 1, l + 1)


t = int(input())
for q in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().strip().split()))
	m = 0
	x = []
	for i in range(1, k - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			m += 1
	x.append(m)
	start = 1
	r = k
	while r <= len(a) - 1:
		try:
			if a[start] > a[start - 1] and a[start] > a[start + 1]:
				m = m - 1
			if a[r - 1] > a[r] and a[r - 1] > a[r - 2]:
				m = m + 1
			x.append(m)
			start += 1
			r += 1
		except BaseException:
			break
	m = 0
	index = 0
	for i in range(0, len(x)):
		if x[i] > m:
			m = x[i]
			index = i
	print(m + 1, index + 1)


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	peaks = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks[i] = 1
	sp = [0 for i in range(n)]
	j = 0
	while j < k - 1:
		sp[0] += peaks[j]
		j += 1
	for i in range(1, n - k + 1):
		sp[i] = sp[i - 1] + peaks[j] - peaks[j + 2 - k]
		j += 1
	m = max(sp)
	for i in range(len(sp)):
		if sp[i] == m:
			print(m + 1, i + 1)
			break


from sys import stdin, stdout
input = stdin.buffer.readline
t = int(input())
while t > 0:
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	p = []
	for i in range(n - k + 1):
		p.append(0)
	c = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			c += 1
		p[0] = c
	for i in range(1, n - k + 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			c -= 1
		j = i + k - 2
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			c += 1
		p[i] = c
	ind = 0
	m = p[0]
	for i in range(len(p)):
		if m < p[i]:
			m = p[i]
			ind = i
	print(m + 1, ind + 1)
	t -= 1


iterations = int(input())
for i in range(iterations):
	(n, k) = list(map(int, input().split()))
	nums = list(map(int, input().split()))
	peaks = []
	pieces = []
	count = 1
	for j in range(1, k - 1):
		if nums[j - 1] < nums[j] and nums[j + 1] < nums[j]:
			peaks.append(j)
			count += 1
	pieces.append(count)
	for j in range(0, n - k):
		if peaks != [] and peaks[0] == j + 1:
			peaks.pop(0)
			count -= 1
		if nums[j + k - 2] < nums[j + k - 1] and nums[j + k] < nums[j + k - 1]:
			peaks.append(j + k - 1)
			count += 1
		pieces.append(count)
	t = max(pieces)
	l = pieces.index(t) + 1
	print(t, l)


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def lsi():
	x = list(stdin.readline())
	x.pop()
	return x

def si():
	return stdin.readline()
res = ['Yes', 'No']
t_c = ii()
while t_c:
	t_c -= 1
	(n, k) = mi()
	a = li()
	peak = [0] * n
	x = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			x += 1
		peak[i] = x
	peak[-1] = peak[-2]
	(mx, ind) = (0, 1)
	for i in range(k - 1, n):
		if peak[i - 1] - peak[i - k + 1] > mx:
			mx = peak[i - 1] - peak[i - k + 1]
			ind = i - k + 2
	print(mx + 1, ind)


def isPeak(a, b, c):
	return True if b > a and b > c else False
t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().rstrip().split(' ')))
	arr = list(map(int, input().rstrip().split(' ')))
	isLpeak = False
	maxPeaks = 0
	minL = 0
	if isPeak(arr[0], arr[1], arr[2]):
		isLpeak = True
	for l in range(k - 2):
		if isPeak(arr[l], arr[l + 1], arr[l + 2]):
			maxPeaks += 1
	curPeaks = maxPeaks
	for l in range(1, n - k + 1):
		if isLpeak:
			curPeaks -= 1
			isLpeak = False
		elif isPeak(arr[l], arr[l + 1], arr[l + 2]):
			isLpeak = True
		if isPeak(arr[l + k - 3], arr[l + k - 2], arr[l + k - 1]):
			curPeaks += 1
		if curPeaks > maxPeaks:
			maxPeaks = curPeaks
			minL = l
	print(f'{maxPeaks + 1} {minL + 1}')


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	count = [0]
	count += [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			count[i] = 1
		count[i] += count[i - 1]
	count[-1] = count[-3]
	count[-2] = count[-3]
	index = 0
	ma = 0
	for i in range(n - k + 1):
		ans = count[i + k - 1] - count[i]
		if count[i] != count[i - 1] and i > 0:
			ans = ans - 1
		if count[i + k - 1] != count[i + k - 2]:
			ans = ans - 1
		if ans > ma:
			ma = ans
			index = i
	print(ma + 1, index + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			p[i] = 1
	count = sum(p[1:k - 1])
	count2 = count
	idx = 0
	for i in range(1, n - k + 1):
		count2 = count2 + p[i + k - 2] - p[i]
		if count2 > count:
			idx = i
			count = count2
	print(count + 1, idx + 1)


import os

def f(nums, k):
	n = len(nums)
	peaks = [False] * n
	max_peak_count = -1
	max_peak_idx = None
	current_peaks = 0
	for (idx, a) in enumerate(nums):
		if idx == 0:
			continue
		is_peak = idx < n - 1 and nums[idx - 1] < a and (nums[idx + 1] < a)
		peaks[idx] = is_peak
		current_peaks += is_peak
		if idx < k - 2:
			continue
		if max_peak_count < current_peaks:
			max_peak_idx = idx - k + 2
			max_peak_count = current_peaks
		current_peaks -= peaks[idx - k + 3]
	return (max_peak_count + 1, max_peak_idx + 1)

def pp(input):
	n_test = int(input())
	for i in range(n_test):
		(n, k) = map(int, input().split())
		nums = list(map(int, input().split(' ')))
		print(' '.join(map(str, f(nums, k))))
if 'paalto' in os.getcwd():
	from string_source import string_source
	s1 = string_source('5\n8 6\n1 2 4 1 2 4 1 2\n5 3\n3 2 3 2 1\n10 4\n4 3 4 3 2 3 2 1 0 1\n15 7\n3 7 4 8 2 3 4 5 21 2 3 4 2 1 3\n7 5\n1 2 3 4 5 6 1\n')
	pp(s1)
else:
	pp(input)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	p = []
	i = 0
	m = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			m += 1
		l = 1
	u = m
	for i in range(1, n - k + 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			u -= 1
		j = i + k - 2
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			u += 1
		if u > m:
			m = u
			l = i + 1
	print(m + 1, l)


import sys
input = sys.stdin.readline
from math import log2, log, ceil

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return res

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	while x != link[x]:
		x = link[x]
	return x

def union(x, y, size, link):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	(n, k) = int_array()
	a = int_array()
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	for i in range(1, n):
		peaks[i] += peaks[i - 1]
	ans = 0
	ind = 0
	k -= 1
	for i in range(n - k):
		peaky = peaks[i + k - 1] - peaks[i]
		if peaky > ans:
			ans = peaky
			ind = i
	print(*(ans + 1, ind + 1))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	al = 0
	pl = [0 for t in range(n)]
	for t in range(1, n - 1):
		if l[t] > l[t - 1] and l[t] > l[t + 1]:
			pl[t] = 1
	pk = sum(pl[:k - 1])
	pll = [0]
	for i in range(n):
		pll.append(pll[-1] + pl[i])
	pll.pop(0)
	i = 0
	j = k - 1
	for j in range(k - 1, n):
		pkk = pll[j - 1] - pll[i]
		if pkk > pk:
			al = i
			pk = pkk
		i += 1
	print(pk + 1, al + 1)


import os, sys, atexit
from io import BytesIO, StringIO
input = BytesIO(os.read(0, os.fstat(0).st_size)).readline
_OUTPUT_BUFFER = StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
t = int(input())
while t:
	t += -1
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = [0] * (n + 1)
	pk = [0] * n
	for i in range(n - 2):
		if l[i] < l[i + 1] and l[i + 1] > l[i + 2]:
			pk[i + 1] = 1
			peak[i + 2] = 1
	for i in range(1, n):
		peak[i] += peak[i - 1]
	ans = [0] * n
	for i in range(n - k + 1):
		ans[i] = peak[i + k - 1] - peak[i]
		if pk[i]:
			ans[i] += -1
	f = 0
	ind = 0
	for i in range(n):
		if ans[i] > f:
			f = ans[i]
			ind = i
	print(f + 1, ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			l1[i] += 1
	cnt = l1[1:k - 1].count(1)
	ans = cnt
	a = 0
	for i in range(n - k):
		if l1[i + k - 1] == 1:
			cnt += 1
		if l1[i + 1] == 1:
			cnt -= 1
		if cnt > ans:
			ans = cnt
			a = i + 1
	print(ans + 1, a + 1)


import sys
input = sys.stdin.buffer.readline
t = int(input())
ans = []
for _ in range(t):
	(X, K) = map(int, input().split())
	(*a,) = map(int, input().split())
	b = [i < j > k for (i, j, k) in zip(a, a[1:], a[2:])]
	mx = score = sum(b[:K - 2])
	idx = 1
	cur = 1
	for (l, r) in zip(b, b[K - 2:]):
		cur += 1
		score += -l + r
		if mx < score:
			mx = score
			idx = cur
	ans.append('{} {}'.format(mx + 1, idx))
print('\n'.join(ans))


t = int(input())
for w in range(t):
	(n, k) = (int(i) for i in input().split())
	l = [int(i) for i in input().split()]
	c = 0
	m = 0
	c1 = 1
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			c += 1
	m = c
	for i in range(1, n - k + 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			m -= 1
		if l[i + k - 2] > l[i + k - 3] and l[i + k - 2] > l[i + k - 1]:
			m += 1
		if m > c:
			c = m
			c1 = i + 1
	print(c + 1, c1)


from collections import defaultdict
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	cnt = 0
	peaks = []
	for i in range(n):
		if i == 0 or i == n - 1:
			peaks.append(cnt)
			continue
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			cnt += 1
			peaks.append(cnt)
		else:
			peaks.append(cnt)
	l = 0
	maxpeaks = -1
	for i in range(k - 1, n):
		cntpeak = peaks[i - 1] - peaks[i - (k - 1)]
		if maxpeaks < cntpeak:
			l = i - (k - 1)
			maxpeaks = cntpeak
	print(maxpeaks + 1, l + 1, sep=' ')


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	prifix_arr = []
	prifix_arr.append(0)
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			prifix_arr.append(1)
		else:
			prifix_arr.append(0)
	prifix_arr.append(0)
	m = len(prifix_arr)
	for i in range(1, m):
		prifix_arr[i] += prifix_arr[i - 1]
	i = 0
	j = k - 1
	max_peak = 0
	l = 0
	while j < m:
		peak = prifix_arr[j - 1] - prifix_arr[i]
		if peak > max_peak:
			max_peak = peak
			l = i
		i += 1
		j += 1
	print(max_peak + 1)
	print(l + 1)


import math
t = int(input())

def solve(n, k, nums):
	pref_peaks = [0] * n
	for i in range(1, n - 1):
		if nums[i - 1] < nums[i] > nums[i + 1]:
			pref_peaks[i] = 1 + pref_peaks[i - 1]
		else:
			pref_peaks[i] = pref_peaks[i - 1]
	pref_peaks[n - 1] = pref_peaks[n - 2]
	mx = -1
	mx_i = -1
	for l in range(n - k + 1):
		r = l + k - 1
		if 0 > r or r >= n:
			continue
		res = pref_peaks[r - 1] - pref_peaks[l] + 1
		if res > mx:
			mx = res
			mx_i = l + 1
	return (mx, mx_i)
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	nums = list(map(int, input().split()))
	res = solve(n, k, nums)
	print(res[0], res[1])


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks[i] = 1
	k -= 2
	i = 1
	j = 1
	sumi = 0
	maxi = -1
	ans = 0
	while i < n - 1 and j < n - 1:
		sumi += peaks[j]
		j += 1
		if j - i == k:
			if sumi > maxi:
				maxi = sumi
				ans = i
			sumi -= peaks[i]
			i += 1
	print(maxi + 1, ans)


from sys import stdin, stdout
from collections import Counter

def ai():
	return list(map(int, stdin.readline().split()))

def ei():
	return map(int, stdin.readline().split())

def ip():
	return int(stdin.readline().strip())

def op(ans):
	return stdout.write(str(ans) + '\n')
from math import ceil
for i in range(ip()):
	(n, k) = ei()
	li = ai()
	li = [0] + li
	peak = [0] * n
	for i in range(2, n):
		if li[i] > li[i - 1] and li[i] > li[i + 1]:
			peak[i] = 1
	for i in range(1, n):
		peak[i] += peak[i - 1]
	ans = 0
	index = 1
	for i in range(1, n - k + 1 + 1):
		x = peak[i + k - 2] - peak[i]
		if x > ans:
			ans = x
			index = i
	print(ans + 1, index)


t = int(input())
for i in range(t):
	nk = input().split()
	n = int(nk[0])
	k = int(nk[1])
	mountains = list(map(int, input().split()))
	uphill = True
	if mountains[1] < mountains[0]:
		uphill = False
	peak = mountains[1]
	nxtpeak = mountains[2]
	i = 2
	arr = [0 for i in range(n)]
	while i < n:
		if uphill:
			if nxtpeak < peak:
				arr[i - 1] = 1
				uphill = False
		elif nxtpeak > peak:
			uphill = True
		peak = nxtpeak
		if i < n - 1:
			nxtpeak = mountains[i + 1]
		i += 1
	maxcount = 0
	pos = 0
	count = 0
	for i in range(1, k - 1):
		if arr[i] == 1:
			count += 1
	maxcount = count
	pos = 0
	pointer = 1
	for i in range(k - 1, n - 1):
		count += arr[i]
		count -= arr[pointer]
		if count > maxcount:
			maxcount = count
			pos = pointer
		pointer += 1
	print(maxcount + 1, pos + 1)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	ar = [0] * n
	for i in range(n - 2):
		if arr[i + 1] > arr[i] and arr[i + 1] > arr[i + 2]:
			ar[i + 1] = 1
	if k < 3:
		print('1 0')
	else:
		s = sum(ar[1:k - 1])
		mx = s
		ind = 1
		for j in range(1, n - k + 1):
			s += ar[k - 2 + j] - ar[j]
			if s > mx:
				mx = s
				ind = j + 1
		print(mx + 1, ind)


def isPeak(arr, i):
	return arr[i - 1] < arr[i] and arr[i] > arr[i + 1]

def solve():
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	arr.insert(0, -1)
	c = 0
	for i in range(2, k):
		c += isPeak(arr, i)
	ans = c
	left = 1
	for i in range(k, n):
		c += isPeak(arr, i) - isPeak(arr, i - k + 2)
		if c > ans:
			ans = c
			left = i - k + 2
	print(ans + 1, left)
try:
	for _ in range(int(input())):
		solve()
except:
	pass


from collections import deque
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	dp = [0] * n
	for i in range(1, n):
		if i + 1 < n and l[i] > l[i - 1] and (l[i] > l[i + 1]):
			dp[i] = dp[i - 1] + 1
		else:
			dp[i] = dp[i - 1]
	(ans, maxx) = (-1, -1)
	idx = -1
	for i in range(0, n):
		if i + k - 1 < n and (i == 0 or dp[i] == dp[i - 1]):
			if i == 0 and dp[i] == 0:
				ans = dp[i + k - 1] if dp[i + k - 1] == dp[i + k - 2] else dp[i + k - 2]
			elif i == 0:
				continue
			else:
				a = dp[i + k - 1] if dp[i + k - 1] == dp[i + k - 2] else dp[i + k - 2]
				ans = a - dp[i - 1]
		if ans > maxx:
			maxx = ans
			idx = i
	if maxx == 0:
		print(1, 1)
	else:
		print(maxx + 1, idx + 1)


from sys import stdin
t = int(stdin.readline())
for i in range(t):
	(n, k) = map(int, stdin.readline().split())
	arr = list(map(int, stdin.readline().split()))
	count = 0
	peaks = []
	for j in range(1, k - 1):
		if arr[j] > arr[j - 1] and arr[j] > arr[j + 1]:
			peaks.append(j)
			count += 1
	p = count
	j = 1
	loop = 0
	ans_so_far = p
	l_so_far = 0
	while j <= n - k:
		l = j
		r = j + k - 2
		p1 = p
		if loop < count and peaks[loop] == l:
			p1 -= 1
			loop += 1
		if arr[r] > arr[r - 1] and arr[r] > arr[r + 1]:
			p1 += 1
			peaks.append(r)
			count += 1
		p = p1
		if p > ans_so_far:
			ans_so_far = p
			l_so_far = j
		j += 1
	print(str(ans_so_far + 1) + ' ' + str(l_so_far + 1))


import sys

def answer(n, k, a):
	peaks = [False] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = True
	count = peaks[1:k - 1].count(True)
	best_count = count
	addr = 0
	for i in range(1, n - k + 1, 1):
		if peaks[i] == True:
			count -= 1
		if peaks[i + (k - 2)] == True:
			count += 1
		if count > best_count:
			addr = i
			best_count = count
	return [best_count + 1, addr + 1]

def main():
	t = int(input())
	while t:
		(n, k) = [int(i) for i in sys.stdin.readline().split()]
		a = [int(i) for i in sys.stdin.readline().split()]
		print(' '.join(map(str, answer(n, k, a))))
		t -= 1
	return
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	is_peak = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			is_peak[i] = 1
	acc = [0]
	for i in range(n):
		acc.append(acc[-1] + is_peak[i])
	M = 0
	for i in range(n - k + 1):
		if acc[i + k - 1] - acc[i + 1] > M:
			M = acc[i + k - 1] - acc[i + 1]
			ans = i
	print(M + 1, ans + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [0]
	a[1:] = list(map(int, input().strip().split(' ')))
	peaki = [0] * (n + 2)
	peak = 0
	for i in range(2, n):
		if a[i] > a[i - 1] and a[i] >= a[i + 1]:
			peak += 1
		peaki[i] = peak
	l = 0
	mp = 0
	for i in range(1, n - k + 2):
		pb = peaki[i + k - 2] - peaki[i] + 1
		if pb > mp:
			mp = pb
			l = i
	print(mp, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peak = [arr[i] > arr[i - 1] and arr[i] > arr[i + 1] for i in range(1, n - 1)]
	peak.append(False)
	peak.insert(0, False)
	l = 0
	max_ = 0
	for i in range(1, k - 1):
		if peak[i]:
			max_ += 1
	cur = max_
	for i in range(1, n - k + 1):
		cur += peak[i + k - 2] - peak[i]
		if cur > max_:
			l = i
			max_ = cur
	print(max_ + 1, l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	dp = [0] * n
	dp[0] = 1
	dp[n - 1] = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			dp[i] = 1
	cnt = 0
	for i in range(1, k - 1):
		if dp[i]:
			cnt += 1
	ans = cnt
	l = 0
	for i in range(k, n):
		if dp[i - k + 1] == 1:
			cnt -= 1
		if dp[i - 1]:
			cnt += 1
		if cnt > ans:
			ans = cnt
			l = i - k + 1
	print(ans + 1, l + 1)


from sys import stdin, stdout
import math
import heapq
t = 1

def aint():
	return int(input().strip())

def lint():
	return list(map(int, input().split()))

def fint():
	return list(map(int, stdin.readline().split()))

def main():
	(n, k) = lint()
	l = [-1] + lint() + [-1]
	pre = [0]
	for i in range(1, n + 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			pre.append(pre[-1] + 1)
		else:
			pre.append(pre[-1])
	ans = 1
	mx = 0
	for i in range(1, n - k + 2):
		sm = pre[i + k - 2] - pre[i]
		if sm > mx:
			mx = sm
			ans = i
	print(mx + 1, ans)
t = int(input())
for i in range(t):
	main()


from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
from collections import defaultdict as dd, deque

def data():
	return sys.stdin.readline().strip()

def mdata():
	return map(int, data().split())
out = sys.stdout.write
for t in range(int(data())):
	(n, k) = mdata()
	A = list(mdata())
	d = [0] * n
	m = 0
	for i in range(1, k - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			m += 1
			d[i] = 1
	i = k - 1
	s = m
	ind = 1
	while i < n - 1:
		if d[i - k + 2] == 1:
			s -= 1
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			s += 1
			d[i] = 1
		if s > m:
			m = s
			ind = i + 3 - k
		i += 1
	print(m + 1, ind)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	peak = [0] * n
	for i in range(1, n - 1):
		if ar[i] > ar[i + 1] and ar[i] > ar[i - 1]:
			peak[i] = 1
	maxpos = 0
	start = 0
	end = start + k - 1
	sumi = sum(peak[start + 1:end])
	maxi = sumi
	while end < n:
		sumi = sumi - peak[start + 1] + peak[end]
		start += 1
		end += 1
		if maxi < sumi:
			maxi = sumi
			maxpos = start
	print(maxi + 1, maxpos + 1)
	t -= 1


def inp():
	x = int(input())
	return x

def linp():
	x = [int(i) for i in input().split()]
	return x
T = inp()
ans = []
for t in range(T):
	(n, k) = linp()
	a = linp()
	peaks = [0] * n
	p = 0
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peaks[i] = 1
			p += 1
	if k == n:
		ans.append((p + 1, 1))
	else:
		pref = [0] * n
		s = 0
		for i in range(n):
			s += peaks[i]
			pref[i] = s
		(l, r) = (0, k - 1)
		mx = (0, 0)
		while r < n:
			s = pref[r - 1] - pref[l]
			if s > mx[0]:
				mx = (s, l)
			l += 1
			r += 1
		ans.append((mx[0] + 1, mx[1] + 1))
for a in ans:
	print(*a)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	scale = [0] * (n + 1)
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			scale[i] = 1
	c = 0
	for i in range(1, k - 1):
		if scale[i] == 1:
			c += 1
	num = c
	peaks = c
	l = 1
	for i in range(1, n - k + 1):
		if scale[i + k - 2] == 1:
			peaks += 1
		if scale[i] == 1:
			peaks -= 1
		if peaks > num:
			num = peaks
			l = i + 1
	print(num + 1, l)


def solve(n, k, a):
	b = [0] * n
	pic_idx = -1
	for i in range(2, n):
		if (a[-i - 1] < a[-i]) & (a[-i] > a[-i + 1]):
			b[n - i] = 1
	sum_i = sum(b[-k + 1:-1])
	sum_max = sum_i
	l = n - k
	left_idx = n - k
	for i in range(1, n - k + 1):
		sum_i = sum_i + b[-k - i + 1] - b[-i - 1]
		if sum_i >= sum_max:
			sum_max = sum_i
			l = n - k - i
	l = l + 1
	p = sum_max
	print(p + 1, l)
t = int(input())
for i in range(t):
	s = input().split(' ')
	(n, k) = (int(s[0]), int(s[1]))
	a = list(map(lambda x: int(x), input().split(' ')))
	solve(n, k, a)


z = int(input())
for i in range(z):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	peaks = []
	start = end = -1
	res = 0
	res_end = 0
	j = -1
	count = 0
	for i in range(n - 2, 0, -1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.append(i)
			if end == -1:
				end = i + 1
				count = 1
				j = 0
			elif end - (i - 1) >= k:
				if count >= res:
					res = count
					res_end = end
				count += 1
				while peaks[j] + 1 - (i - 1) >= k:
					j += 1
					count -= 1
				end = peaks[j] + 1
			elif end - (i - 1) < k:
				count += 1
	if count >= res:
		res = count
		res_end = end
	res_end = res_end - k + 2
	if res_end < 1:
		res_end = 1
	print(res + 1, res_end)


import sys
import math

def main():
	input = sys.stdin.readline
	t = int(input())
	while t > 0:
		t -= 1
		(n, k) = (int(i) for i in input().split())
		a = [int(i) for i in input().split()]
		peaks = [0 for i in range(n)]
		for i in range(1, n - 1):
			if a[i - 1] < a[i] and a[i] > a[i + 1]:
				peaks[i] = 1
		s = 0
		for i in range(1, k - 1):
			s += peaks[i]
		maxs = s
		start = 0
		for i in range(k, n):
			s += peaks[i - 1]
			s -= peaks[i - k + 1]
			if maxs < s:
				maxs = s
				start = i - k + 1
		print(maxs + 1, start + 1)
main()


import sys
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n, k) = I()
	l = I()
	a = b = 0
	p = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			p[i] = p[i - 1] + 1
		else:
			p[i] = p[i - 1]
	p[n - 1] = p[n - 2]
	for i in range(n - k + 1):
		m = p[i + k - 1] - p[i] - int(p[i + k - 2] < p[i + k - 1]) - int(i != 0 and p[i - 1] < p[i])
		if m > a:
			a = m
			b = i
	print(a + 1, b + 1)


t = int(input())
for i in range(t):
	(n, k) = [int(s) for s in input().split()]
	a = [int(s) for s in input().split()]
	c = 0
	for j in range(1, k - 1):
		if a[j - 1] < a[j] > a[j + 1]:
			c += 1
	t = c
	l = 0
	for j in range(1, n - k + 1):
		if a[j - 1] < a[j] > a[j + 1]:
			c -= 1
		if a[j + k - 3] < a[j + k - 2] > a[j + k - 1]:
			c += 1
		if c > t:
			t = c
			l = j
	print(t + 1, l + 1)


t = int(input())
while t:
	line = input().split()
	(n, k) = (int(line[0]), int(line[1]))
	a = input().split()
	a = [int(x) for x in a]
	cnt = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			cnt += 1
	m = cnt
	l = 0
	for i in range(k, n):
		if a[i - k + 1] > a[i - k] and a[i - k + 1] > a[i - k + 2]:
			cnt -= 1
		if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
			cnt += 1
		if cnt > m:
			m = cnt
			l = i - k + 1
	print(m + 1, l + 1)
	t -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	numPeak = [0 for i in range(n)]
	for i in range(1, n - 1):
		j = i - 1
		numPeak[i] = numPeak[i - 1]
		if a[i] > a[j] and a[i] > a[i + 1]:
			numPeak[i] += 1
	m = 0
	ans = 0
	ansp = 1
	for i in range(k - 1, n):
		l = i - k + 1
		d = numPeak[i - 1] - numPeak[l]
		if d > m:
			ans = l
			ansp = d + 1
			m = d
	print(ansp, ans + 1)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	ans = 0
	g = 1
	if k == n:
		for i in range(1, n - 1):
			if a[i - 1] < a[i] > a[i + 1]:
				ans += 1
		print(ans + 1, 1)
	else:
		now = 0
		for i in range(1, k - 1):
			if a[i - 1] < a[i] > a[i + 1]:
				ans += 1
		now = ans
		for i in range(k, n):
			if a[i - 2] < a[i - 1] > a[i] and (a[i - k] >= a[i - k + 1] or a[i - k + 2] >= a[i - k + 1]):
				now += 1
			elif (a[i - 2] >= a[i - 1] or a[i - 1] <= a[i]) and a[i - k] < a[i - k + 1] > a[i - k + 2]:
				now -= 1
			if now > ans:
				ans = now
				g = i - k + 2
		print(ans + 1, g)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	m = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			m[i] = 1
		m[i] += m[i - 1]
	m[-1] += m[-2]
	x = y = 0
	for i in range(n - k + 1):
		if m[i + k - 2] - m[i] > x:
			x = m[i + k - 2] - m[i]
			y = i
	print(x + 1, y + 1)
	t -= 1


import bisect
t = int(input())
for test in range(t):
	(n, k) = [int(x) for x in input().split()]
	peaks = [int(x) for x in input().split()]
	p = []
	for i in range(1, n - 1):
		if peaks[i] > peaks[i - 1] and peaks[i] > peaks[i + 1]:
			p.append(i)
	maxx = 0
	start = 0
	for i in range(n - k + 1):
		left = bisect.bisect_left(p, i)
		right = bisect.bisect_left(p, i + k - 1)
		delta = right - left
		if left < len(p):
			if p[left] == i:
				delta -= 1
		if delta > maxx:
			start = i
		maxx = max(maxx, delta)
	print(maxx + 1, start + 1)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	a = []
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			a.append(1)
		else:
			a.append(0)
	i = 0
	j = 0
	count = 0
	while j < k - 2 and j < len(a):
		if a[j] == 1:
			count += 1
		j += 1
	i = 1
	ans = count
	left = 0
	while j < len(a):
		if a[j] == 1:
			count += 1
		if a[i - 1] == 1:
			count -= 1
		if ans < count:
			ans = count
			left = i
		j += 1
		i += 1
	print(ans + 1, left + 1)
	t -= 1


for ix in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	lmax = n + 1 - k
	pks = [0]
	p1k = 0
	for i in range(1, n - 1):
		if a[i - 1] <= a[i] >= a[i + 1]:
			p1k += 1
		pks.append(p1k)
	pks.append(p1k)
	peaks = 0
	ls = 1
	for l in range(0, lmax):
		x = pks[l + k - 2] - pks[l]
		if x > peaks:
			ls = l + 1
			peaks = x
	print(peaks + 1, ls)


import sys
import math
input = sys.stdin.buffer.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	maxPeaks = sum(peaks[:k - 1])
	currPeaks = maxPeaks
	l = 1
	for i in range(1, n - k + 1):
		if currPeaks - peaks[i] + peaks[i + k - 2] > maxPeaks:
			maxPeaks = currPeaks - peaks[i] + peaks[i + k - 2]
			l = i + 1
		currPeaks = currPeaks - peaks[i] + peaks[i + k - 2]
	print(maxPeaks + 1, l)


MOD = 10 ** 9 + 7

def main():
	for _ in inputt():
		(n, k) = inputi()
		A = inputl()
		B = [0]
		t = 0
		for i in range(1, n - 1):
			if A[i - 1] < A[i] > A[i + 1]:
				t += 1
			B.append(t)
		B.append(t)
		m = (0, -1)
		for i in range(1, n - k + 2):
			m = max(m, (B[i + k - 3] - B[i - 1], -i))
		print(m[0] + 1, -m[1])
from math import *
from heapq import *
from itertools import *
from functools import reduce, lru_cache, partial
from collections import Counter, defaultdict
import re, copy, operator, cmath
import sys, io, os, builtins
sys.setrecursionlimit(1000)
BUFSIZE = 8192

class FastIO(io.IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = io.BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(io.IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	sys.stdout.write(kwargs.pop('split', ' ').join(map(str, args)))
	sys.stdout.write(kwargs.pop('end', '\n'))
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip()
inputt = lambda t=0: range(t) if t else range(int(input()))
inputs = lambda : input().split()
inputi = lambda : map(int, inputs())
inputl = lambda t=0, k=inputi: map(list, (k() for _ in range(t))) if t else list(k())

def len(a):
	if isinstance(a, range):
		return -((a.start - a.stop) // a.step)
	return builtins.len(a)

def bisect_left(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if key(a[mid]) < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def bisect_right(a, x, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	while lo < hi:
		mid = (lo + hi) // 2
		if x < key(a[mid]):
			hi = mid
		else:
			lo = mid + 1
	return lo

def insort_left(a, x, key=None, lo=0, hi=None):
	lo = bisect_left(a, x, key, lo, hi)
	a.insert(lo, x)

def insort_right(a, x, key=None, lo=0, hi=None):
	lo = bisect_right(a, x, key, lo, hi)
	a.insert(lo, x)
do_nothing = lambda x: x
bisect = bisect_right
insort = insort_right

def index(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	if key == None:
		key = do_nothing
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi and key(a[i]) == x:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_lt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_le(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo < i <= hi:
		return a[i - 1]
	if default != None:
		return default
	raise ValueError

def find_gt(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_right(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

def find_ge(a, x, default=None, key=None, lo=0, hi=None):
	if lo < 0:
		lo = 0
	if hi == None:
		hi = len(a)
	i = bisect_left(a, x, key, lo, hi)
	if lo <= i < hi:
		return a[i]
	if default != None:
		return default
	raise ValueError

class Tree:

	def __init__(n):
		self._n = n
		self._conn = [[] for _ in range(n)]
		self._list = [0] * n

	def connect(a, b):
		pass

class Sieve:

	def __init__(self):
		self._n = 6
		self._list = [2, 3, 5, 7, 11, 13]

	def extend(self, n):
		pass
sieve = Sieve()

def isprime(n):
	pass

def prime(n):
	pass

def factorint(n):
	factordict = defaultdict(int)
	for i in sieve:
		if n <= i * i:
			break
		while not n % i:
			factordict[i] += 1
			n //= i
	if n != 1:
		factordict[n] += 1
	return factordict
main()


t = int(input().strip())
for _ in range(t):
	(n, k) = [int(x) for x in input().strip().split()]
	arr = [int(x) for x in input().strip().split()]
	max_peaks = 0
	min_l = 0
	for i in range(1, k - 1):
		if arr[i] > arr[i + 1] and arr[i] > arr[i - 1]:
			max_peaks += 1
	last_peak = max_peaks
	for i in range(1, n - k + 1):
		new_peak = last_peak
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			new_peak -= 1
		if arr[i + k - 2] > arr[i + k - 1] and arr[i + k - 2] > arr[i + k - 3]:
			new_peak += 1
		if new_peak > max_peaks:
			max_peaks = new_peak
			min_l = i
		last_peak = new_peak
	print(max_peaks + 1, min_l + 1)


from sys import stdin, stdout
import bisect
for _ in range(int(input())):
	(n, k) = map(int, stdin.readline().split())
	a = list(map(int, stdin.readline().split()))
	dp = [0] * n
	ans = s = ms = 0
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			dp[i] = 1
	for i in range(n - k + 1):
		if i == 0:
			for j in range(1, k - 1):
				s += dp[j]
		else:
			s = s - dp[i] + dp[i + k - 2]
		if s > ms:
			ms = s
			ans = i
	print(ms + 1, ans + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().rstrip().split())
	arr = list(map(int, input().rstrip().split()))
	peaks = {}
	for pos in range(1, n - 1):
		if arr[pos] > arr[pos - 1] and arr[pos] > arr[pos + 1]:
			peaks[pos] = 1
	lmax = n - k + 1
	minL = 0
	maxPeaks = 0
	dpPeaks = [0] * n
	for pos in range(1, n):
		if pos in peaks:
			dpPeaks[pos] = dpPeaks[pos - 1] + 1
		else:
			dpPeaks[pos] += dpPeaks[pos - 1]
	for l in range(lmax):
		r = l + k - 1
		if r - l <= 1:
			continue
		noOfPeaks = dpPeaks[r - 1] - dpPeaks[l]
		if noOfPeaks > maxPeaks:
			maxPeaks = noOfPeaks
			minL = l
	print(maxPeaks + 1, minL + 1)


import math
import atexit
import io
import sys
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def array_to_string(a):
	s = ''
	for i in a:
		s += str(i)
	return s

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
t = int(input())
while t > 0:
	t = t - 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0 for i in range(n)]
	cum_peak_sum = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak[i] = 1
		cum_peak_sum.append(peak[i] + cum_peak_sum[i - 1])
	m = 0
	pos = 0
	for i in range(0, n - k + 1):
		p1 = cum_peak_sum[i]
		p2 = cum_peak_sum[i + k - 2]
		no_of_peaks = p2 - p1
		if no_of_peaks > m:
			m = no_of_peaks
			pos = i
	print(m + 1, pos + 1)


kl = int(input())
for l in range(kl):
	(n, k) = map(int, input().split())
	(t1, t2) = (1000000009, 1000000006)
	kv = 0
	sp = []
	for i in input().split():
		i = int(i)
		if t1 < t2 and t2 > i:
			kv += 1
		sp += [kv]
		(t1, t2) = (t2, i)
	sp += [kv]
	(kv, inn) = (0, 1)
	for i in range(1, n - k + 2):
		if sp[k + i - 2] - sp[i] > kv:
			kv = sp[k + i - 2] - sp[i]
			inn = i
	rz = [kv + 1, inn]
	print(*rz)


from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect
import math

def test_case():
	inf = list(map(int, input().split()))
	(n, k) = inf
	a = list(map(int, input().split()))
	peaks = []
	curr = 0
	ans = 0
	l = 1
	for i in range(2, n):
		if i >= k:
			if a[i - k] < a[i - k + 1] > a[i - k + 2]:
				curr -= 1
		if a[i - 2] < a[i - 1] > a[i]:
			curr += 1
		if ans < curr and i >= k - 1:
			ans = curr
			l = i - k + 2
	print(ans + 1, l)
for _ in range(int(input())):
	ret = test_case()
	if ret:
		print(ret)


from collections import Counter
import itertools
from functools import lru_cache
import sys
import math

def helper():
	pass

def solve():
	(n, k) = map(int, input().split(' '))
	arr = list(map(int, input().split(' ')))
	ans = 0
	aindex = 0
	peakSet = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] >= arr[i - 1] and arr[i] >= arr[i + 1]:
			peakSet[i] = 1
	peakSum = [0 for i in range(n)]
	peakSum[0] = peakSet[0]
	for i in range(1, n):
		peakSum[i] = peakSet[i] + peakSum[i - 1]
	for i in range(n - k + 1):
		total = peakSum[i + k - 1] - (peakSum[i - 1] if i > 0 else 0)
		total -= peakSet[i + k - 1] + peakSet[i]
		if total > ans:
			ans = total
			aindex = i
	print(ans + 1, aindex + 1)
t = int(input())
for _ in range(t):
	solve()


from collections import deque

def tc():
	(n, k) = map(int, input().split())
	mtns = [int(x) for x in input().split()]
	peaks = [False] * n
	for i in range(1, n - 1):
		if mtns[i] > mtns[i - 1] and mtns[i] > mtns[i + 1]:
			peaks[i] = True
	np = sum(peaks[1:k - 1])
	best = np
	l = 1
	for i in range(k, n):
		np += peaks[i - 1] - peaks[i - k + 1]
		if np > best:
			best = np
			l = i - k + 2
	return (best + 1, l)
T = int(input())
for _ in range(T):
	(t, l) = tc()
	print(t, l)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	values = list(map(int, input().split()))
	peaks = 0
	ma_peaks = 0
	f = 0
	for j in range(1, k - 1):
		if values[j - 1] < values[j] > values[j + 1]:
			peaks += 1
	ma_peaks = peaks
	left = 0
	right = k - 1
	while right < n - 1:
		if values[left] < values[left + 1] > values[left + 2]:
			peaks -= 1
		if values[right - 1] < values[right] > values[right + 1]:
			peaks += 1
		left += 1
		right += 1
		if ma_peaks < peaks:
			ma_peaks = peaks
			f = left
	print(ma_peaks + 1, f + 1)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	peak = [0] + [1 if a[i - 1] < a[i] and a[i] > a[i + 1] else 0 for i in range(1, n - 1)] + [0]
	b = [None] * (n - k + 1)
	b[0] = sum(peak[1:k - 1])
	for i in range(1, n - k + 1):
		b[i] = b[i - 1] - peak[i] + peak[i + k - 2]
	p = max(b)
	print(p + 1, b.index(p) + 1)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
import sys
from itertools import accumulate

def solve(n, k, A):
	Peak = [0] * n
	for i in range(n - 2):
		if A[i] < A[i + 1] and A[i + 1] > A[i + 2]:
			Peak[i + 1] += 1
	PeakAcc = list(accumulate(Peak))
	cnt = -1
	idx = -1
	for i in range(n - k + 1):
		tmp = PeakAcc[i + k - 2] - PeakAcc[i]
		if tmp > cnt:
			cnt = tmp
			idx = i
	return (cnt + 1, idx + 1)

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, input().split())
		A = list(map(int, input().split()))
		Ans = solve(n, k, A)
		print(*Ans)
main()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	(ans, tmp, ind) = (0, 0, 0)
	for i in range(2, n):
		if a[i - 2] < a[i - 1] > a[i]:
			tmp += 1
			p[i - 1] = 1
		if i >= k:
			tmp -= p[i - k + 1]
		if ans < tmp:
			ans = tmp
			ind = max(0, i - k + 1)
	print(ans + 1, ind + 1)


def main():
	t = int(input())
	for _ in range(t):
		line = input().split()
		(n, k) = (int(line[0]), int(line[1]))
		nums = list(map(int, input().split()))
		sums = [0 for _ in range(n)]
		peak = [0 for _ in range(n)]
		for i in range(n):
			if i == 0 or i == n - 1:
				continue
			if nums[i - 1] < nums[i] and nums[i] > nums[i + 1]:
				peak[i] = 1
		for i in range(n):
			if i == 0:
				sums[i] = peak[i]
				continue
			sums[i] = sums[i - 1] + peak[i]
		(max_, l) = (-1, -1)
		for i in range(k - 1, n):
			if i == k - 1:
				cur = sums[i]
			else:
				cur = sums[i] - sums[i - k]
			if peak[i - k + 1] == 1:
				cur -= 1
			if peak[i] == 1:
				cur -= 1
			if cur > max_:
				max_ = cur
				l = i - k + 1
		print(str(max_ + 1) + ' ' + str(l + 1))
main()


import sys
input = sys.stdin.readline
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	peak2 = [0] * len(a)
	peak = [0] * len(a)
	suma = 0
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak[i] += 1
			peak2[i] = suma + 1
			suma += 1
		else:
			peak2[i] = peak2[i - 1]
	peak2[-1] = peak2[-2]
	maxpiece = peak2[k - 2] - peak2[0]
	l = 1
	for j in range(1, n - k + 1):
		pq = peak2[k - 2 + j] - peak2[j]
		if pq > maxpiece:
			maxpiece = pq
			l = j + 1
	print(maxpiece + 1, l)


testCases = int(input())
while testCases:
	(lenSequence, k) = list(map(int, input().split()))
	sequence = list(map(int, input().split()))
	peaks = [0] * lenSequence
	start = 0
	indexLeft = 0
	k -= 1
	currentIndex = 1
	currentLen = 1
	totalPeaks = 0
	maxPeaks = 0
	maxLeftStart = 0
	leftStart = 0
	while currentIndex < lenSequence - 1:
		if currentLen == k:
			if totalPeaks - peaks[leftStart] > maxPeaks:
				maxPeaks = totalPeaks - peaks[leftStart]
				maxLeftStart = leftStart
			totalPeaks -= peaks[leftStart]
			currentLen -= 1
			leftStart += 1
		if sequence[currentIndex] > sequence[currentIndex - 1] and sequence[currentIndex] > sequence[currentIndex + 1]:
			totalPeaks += 1
			peaks[currentIndex] = 1
		currentLen += 1
		currentIndex += 1
	if totalPeaks - peaks[leftStart] > maxPeaks:
		maxPeaks = totalPeaks - peaks[leftStart]
		maxLeftStart = leftStart
	print(maxPeaks + 1, maxLeftStart + 1)
	testCases -= 1


for j in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	x = 0
	xm = -1
	(m1, m2) = (1, k - 1)
	for i in range(1, k - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			x += 1
	if xm < x:
		(m1, m2) = (i - k + 3, i + 2)
		xm = x
	for i in range(k - 1, n - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			x += 1
		if A[i - k + 1] < A[i - k + 2] > A[i - k + 3]:
			x -= 1
		if xm < x:
			(m1, m2) = (i - k + 3, i + 2)
			xm = x
	print(xm + 1, m1)


from sys import stdin

def inp():
	return stdin.readline().strip()
t = int(inp())
for _ in range(t):
	(n, k) = [int(x) for x in inp().split()]
	ar = [int(x) for x in inp().split()]
	p = [0] * n
	for i in range(n - 1):
		if i > 0:
			if ar[i - 1] < ar[i] > ar[i + 1]:
				p[i] = 1
	best = 0
	peaks = 0
	counter = 0
	index = 0
	c = 0
	flag = False
	for i in range(n):
		if counter >= k + c:
			if max(best, peaks) > best:
				best = max(best, peaks)
				index = counter - k
			if p[counter - k] == 1 or p[counter - k + 1] == 1:
				peaks -= 1
				p[counter - k] = 0
				p[counter - k + 1] = 0
			if flag:
				peaks += 1
				flag = False
			c += 1
		if p[counter] == 1:
			if counter + 1 < k:
				peaks += 1
			else:
				flag = True
		counter += 1
	if max(best, peaks) > best:
		best = max(best, peaks)
		index = counter - k
	print(best + 1, end=' ')
	print(index + 1)


from sys import stdin
input = stdin.readline

def main():
	test = int(input())
	for t in range(test):
		l = [int(i) for i in input().split(' ')]
		n = l[0]
		k = l[1]
		l = [int(i) for i in input().split(' ')]
		peaks = [0 for i in range(n)]
		for i in range(1, n - 1):
			if l[i - 1] < l[i] > l[i + 1]:
				peaks[i] = 1
		temp = 0
		for i in range(k - 1):
			if peaks[i] == 1:
				temp += 1
		ans = temp
		ind = 0
		for i in range(k, n):
			if peaks[i - 1] == 1:
				temp += 1
			if peaks[i - k + 1] == 1:
				temp -= 1
			if ans < temp:
				ans = temp
				ind = i - k + 1
		print(ans + 1, ind + 1)
main()


import sys
input = sys.stdin.readline
Q = int(input())
Query = []
for _ in range(Q):
	(N, K) = map(int, input().split())
	A = list(map(int, input().split()))
	Query.append((N, K, A))
for (N, K, A) in Query:
	P = []
	for (i, a) in enumerate(A):
		if i == 0 or i == N - 1:
			continue
		if A[i - 1] < a and a > A[i + 1]:
			P.append(i)
	ans = 0
	score = 0
	p_ind = 0
	for (i, p) in enumerate(P):
		while p_ind < len(P) and P[p_ind] < p - 1 + K - 1:
			p_ind += 1
		if score < p_ind - i:
			score = p_ind - i
			ans = max(P[p_ind - 1] - K + 2, 0)
	print(score + 1, ans + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	(overall, i) = (0, 1)
	k -= 1
	while i < k:
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			overall += 1
			i += 1
		i += 1
	k += 1
	maxl = 1
	window = overall
	for i in range(k, n):
		if a[i - 1] > a[i] and a[i - 1] > a[i - 2]:
			window += 1
		if a[i - k + 1] > a[i - k] and a[i - k + 1] > a[i - k + 2]:
			window -= 1
		if window > overall:
			overall = window
			maxl = i - k + 2
	print(overall + 1, maxl)


import math
t = int(input())
for i in range(t):
	(n, k) = map(int, input().strip().split(' '))
	lst = list(map(int, input().strip().split(' ')))
	l = [0]
	m = 0
	for j in range(1, n - 1):
		if lst[j] > lst[j - 1] and lst[j] > lst[j + 1]:
			m += 1
		l.append(m)
	l.append(m)
	t1 = 1
	l1 = 0
	for j in range(n - k + 1):
		s = l[j + k - 2] - l[j]
		if s > l1:
			l1 = s
			t1 = j + 1
	print(l1 + 1, t1, end=' ')
	print()


t = int(input())
for i in range(0, t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	m = 0
	x = []
	for j in range(1, k - 1):
		if l[j] > l[j + 1] and l[j] > l[j - 1]:
			m += 1
	x.append(m)
	start = 1
	r = k
	while r <= len(l) - 1:
		try:
			if l[start] > l[start - 1] and l[start] > l[start + 1]:
				m = m - 1
			if l[r - 1] > l[r] and l[r - 1] > l[r - 2]:
				m = m + 1
			x.append(m)
			start += 1
			r += 1
		except IndentationError:
			break
	m = 0
	index = 0
	for j in range(0, len(x)):
		if x[j] > m:
			m = x[j]
			index = j
	print(m + 1, index + 1)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().rstrip().split()))
	a = list(map(int, input().rstrip().split()))
	p = []
	d = {}
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p.append(i)
			d[i] = True
	cnt = [0] * (n - k + 1)
	ans = 0
	for j in range(0, k - 1):
		if j in d:
			ans += 1
	tmp = ans
	mx = ans
	pos = 0
	for i in range(1, n - k + 2):
		if i in d:
			tmp -= 1
		if i + k - 2 in d:
			tmp += 1
		if mx < tmp:
			mx = tmp
			pos = i
	print(str(mx + 1) + ' ' + str(pos + 1))


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	pek = [0] * n
	for i in range(1, n - 1, 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			pek[i] = 1
		pek[i] += pek[i - 1]
	mx = lft = j = 0
	while j + k - 1 < n:
		if pek[j + k - 2] - pek[j] > mx:
			mx = pek[j + k - 2] - pek[j]
			lft = j
		j += 1
	print(mx + 1, lft + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	l = 0
	r = k - 1
	peaks = 0
	index = 0
	maxp = 0
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks += 1
	maxp = peaks
	while r < n - 1:
		if arr[r] > arr[r - 1] and arr[r] > arr[r + 1]:
			peaks += 1
		r += 1
		l += 1
		if arr[l] > arr[l - 1] and arr[l] > arr[l + 1]:
			peaks -= 1
		if peaks > maxp:
			maxp = peaks
			index = l
	print(maxp + 1, index + 1)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	c = 0
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			c += 1
		b[i] = c
		m = im = 0
	for j in range(n - k + 1):
		if b[j + k - 2] - b[j] > m:
			im = j
			m = b[j + k - 2] - b[j]
	print(m + 1, im + 1)


from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def readTree(n):
	adj = [set() for _ in range(n)]
	for _ in range(n - 1):
		(u, v) = map(int, input().split())
		adj[u - 1].add(v - 1)
		adj[v - 1].add(u - 1)
	return adj

def treeOrderByDepth(n, adj, root=0):
	parent = [-2] + [-1] * (n - 1)
	ordered = []
	q = deque()
	q.append(root)
	depth = [0] * n
	while q:
		c = q.popleft()
		ordered.append(c)
		for a in adj[c]:
			if parent[a] == -1:
				parent[a] = c
				depth[a] = depth[c] + 1
				q.append(a)
	return (ordered, parent, depth)
for _ in range(ii()):
	(n, k) = mi()
	l = li()
	out = [0] * n
	p = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			p[i] = 1
			out[i] = out[i - 1] + 1
		else:
			out[i] = out[i - 1]
	out[-1] = out[-2]
	m = 0
	pos = 1
	for i in range(n - k + 1):
		peak = 0
		if p[i + k - 1] == 1:
			peak = 1
		if out[i + k - 1] - peak - out[i] > m:
			m = out[i + k - 1] - peak - out[i]
			pos = i + 1
	print(m + 1, pos)


test_cases = int(input())
data = []
infoSet = []
while test_cases > 0:
	infoSet.append(list(map(int, input().split())))
	data.append(list(map(int, input().split())))
	test_cases -= 1
for i in range(0, len(data)):
	mountains = infoSet[i][0]
	doorLength = infoSet[i][1]
	peak = [0 for j in range(0, mountains)]
	for j in range(1, mountains - 1):
		if data[i][j] > data[i][j - 1] and data[i][j] > data[i][j + 1]:
			peak[j] = 1
	maxBreak = 0
	start = 1
	breaks = 1
	for l in range(1, doorLength - 1):
		breaks += peak[l]
	maxBreak = breaks
	for k in range(1, mountains - doorLength + 1):
		breaks = breaks + peak[k + doorLength - 2] - peak[k]
		if breaks > maxBreak:
			maxBreak = breaks
			start = k + 1
	print(maxBreak, start)


rn = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rns = lambda : map(int, input().split())
rs = lambda : input()
yn = lambda x: print('Yes') if x else print('No')
for _ in range(rn()):
	(n, k) = rns()
	l = rl()
	curr = 1
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			curr += 1
	ans = curr
	le = 1
	for i in range(1, n - k + 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			curr -= 1
		if i + k - 2 < n - 1 and l[i + k - 2] > l[i + k - 3] and (l[i + k - 2] > l[i + k - 1]):
			curr += 1
		if curr > ans:
			ans = curr
			le = i + 1
	print(ans, le)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = [0]
	for j in range(1, n - 1):
		if a[j - 1] < a[j] > a[j + 1]:
			l.append(1)
		else:
			l.append(0)
	l.append(0)
	s = sum(l[1:k - 1])
	mx = (s, 0)
	for j in range(n - k + 1):
		s += l[j + k - 1]
		s -= l[j + 1]
		if s > mx[0]:
			mx = (s, j + 1)
	print(mx[0] + 1, mx[1] + 1)


def solve(n, k, hts):
	prefix = [0] * n
	for i in range(1, n - 1):
		if hts[i - 1] < hts[i] and hts[i] > hts[i + 1]:
			prefix[i] = 1
	for i in range(1, n):
		prefix[i] = prefix[i] + prefix[i - 1]
	(pieces, ans) = (0, 0)
	for i in range(n):
		left = i
		right = left + k - 1
		if right >= n:
			break
		p = prefix[right - 1] - prefix[left]
		if p > pieces:
			pieces = p
			ans = left
	return (pieces + 1, ans + 1)
tc = int(input())
for _ in range(tc):
	(n, k) = map(int, input().split())
	hts = list(map(int, input().split()))
	(t, l) = solve(n, k, hts)
	print(f'{t} {l}')


def valentine(n, k, A):
	d = {}
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			d[i] = 1
	l = 0
	r = l + k - 1
	count = 0
	for i in range(1, r):
		if i in d:
			count += 1
	max_c = count
	min_l = l
	l += 1
	r = l + k - 1
	while r < n:
		if l in d:
			count -= 1
		if r - 1 in d:
			count += 1
		if count > max_c:
			min_l = l
			max_c = count
		l += 1
		r = l + k - 1
	print(*[max_c + 1, min_l + 1])
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	valentine(n, k, arr)


ANS = ''

def cat(a):
	global ANS
	if a:
		ANS += 'YES'
	else:
		ANS += 'NO'
	ANS += '\n'
n = 0
k = 0
arr = []
brr = []
pref = []

def s(l, r):
	return pref[r + 1] - pref[l] - brr[l] - brr[r]
for kek in range(int(input())):
	(n, k) = [int(s) for s in input().split()]
	arr = [int(s) for s in input().split()]
	brr = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i + 1] < arr[i]:
			brr[i] = 1
	pref = [0] * (n + 1)
	for i in range(n):
		pref[i + 1] = pref[i] + brr[i]
	(ans, rec) = (-1, -1)
	for i in range(n - k + 1):
		if s(i, i + k - 1) > rec:
			rec = s(i, i + k - 1)
			ans = i
	print(rec + 1, ans + 1)
print(ANS)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 2
	q = 1
	ans = 0
	count = 0
	s = 1
	for i in range(2, n):
		if l == k:
			l -= 1
			if a[q] > a[q - 1] and a[q] > a[q + 1]:
				count -= 1
			q += 1
		if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
			count += 1
			if count > ans:
				s = q
				ans = count
		l += 1
	print(ans + 1, s)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = [0]
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			l1.append(1)
		else:
			l1.append(0)
	l1.append(0)
	sum_pre = [l1[0]]
	for i in range(1, n):
		sum_pre.append(l1[i] + sum_pre[i - 1])
	summ = -1
	save = 0
	for i in range(n - k + 1):
		if summ < sum_pre[i + k - 2] - sum_pre[i]:
			summ = sum_pre[i + k - 2] - sum_pre[i]
			save1 = i
	print(summ + 1, save1 + 1)


import collections
t = int(input())
for test in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = 0
	firstpeak = collections.deque([])
	for i in range(1, k - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peaks += 1
			firstpeak.append(i - 1)
	r = k - 1
	l = 0
	maxpeices = peaks + 1
	smallestl = l + 1
	while r < n - 1:
		l += 1
		if a[r - 1] < a[r] and a[r] > a[r + 1]:
			peaks += 1
			firstpeak.append(r - 1)
		if len(firstpeak) != 0 and l > firstpeak[0]:
			peaks -= 1
			firstpeak.popleft()
		if peaks + 1 > maxpeices:
			maxpeices = peaks + 1
			smallestl = l + 1
		r += 1
	print(maxpeices, smallestl)


from sys import stdin, exit
input = stdin.readline

def i():
	return input()

def ii():
	return int(input())

def iis():
	return map(int, input().split())

def liis():
	return list(map(int, input().split()))

def print_array(a):
	print(' '.join(map(str, a)))
t = ii()
for _ in range(t):
	(n, k) = iis()
	A = liis()
	is_peak = [0 for i in range(n)]
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			is_peak[i] = 1
	cur = sum(is_peak[:k - 1]) + 1
	soma = [[cur, -1]]
	for i in range(k, n):
		cur += is_peak[i - 1]
		cur -= is_peak[i - k + 1]
		soma.append([cur, -(i - k + 2)])
	soma = sorted(soma)[::-1]
	print(soma[0][0], -soma[0][1])


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			peaks[i] = 1
	count = 0
	for i in range(1, k - 1):
		if peaks[i] == 1:
			count += 1
	ans = [count, 1]
	for i in range(2, n - k + 2):
		if peaks[i - 1] == 1:
			count -= 1
		if peaks[i + k - 3] == 1:
			count += 1
		if count > ans[0]:
			ans[0] = count
			ans[1] = i
	print(ans[0] + 1, ans[1])


import collections

def solve(n, k, arr):
	window = collections.deque([])
	currentPeaks = 0
	ans = (0, 0)
	for i in range(n):
		if i >= k:
			(num, j) = window.popleft()
			if arr[j] < arr[j + 1] > arr[j + 2]:
				currentPeaks -= 1
		window.append((arr[i], i))
		if len(window) >= 3:
			if window[-3][0] < window[-2][0] > window[-1][0]:
				currentPeaks += 1
				if currentPeaks > ans[0]:
					left = window[0][1] + 1
					ans = (currentPeaks, left)
	return ' '.join(map(str, (ans[0] + 1, 1 if ans[1] == 0 else ans[1])))
t = int(input().strip())
for _ in range(t):
	[n, k] = list(map(int, input().strip().split()))
	arr = list(map(int, input().strip().split()))
	print(solve(n, k, arr))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks[i] = 1
	acum = [0]
	for i in range(1, n):
		acum.append(acum[-1] + peaks[i])
	maxs = 0
	pos = -1
	for i in range(n - k, -1, -1):
		tmp = acum[i + k - 1] - acum[i]
		if peaks[i + k - 1] == 1:
			tmp -= 1
		if tmp >= maxs:
			maxs = tmp
			pos = i
	print(maxs + 1, pos + 1)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	p = 0
	peak = [0] * n
	maxx = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peak[i] = 1
	prefix = [peak[0]]
	for i in range(1, n):
		prefix.append(prefix[i - 1] + peak[i])
	index = None
	for i in range(n - k + 1):
		l = i
		r = i + k - 1
		summ = prefix[r - 1] - prefix[l]
		if summ > maxx:
			maxx = summ
			index = l
	if not index:
		print(maxx + 1, 1)
	else:
		print(maxx + 1, index + 1)
	t -= 1


t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	l = [int(x) for x in input().split()]
	c = 0
	d = {}
	d[0] = 0
	for i in range(1, n - 1):
		d[i] = d[i - 1]
		if max(l[i - 1], l[i], l[i + 1]) == l[i]:
			d[i] += 1
	d[n - 1] = d[n - 2]
	mx = -1
	s = 0
	for i in range(n - k + 1):
		res = d[i + k - 2] - d[i]
		if res > mx:
			mx = res
			s = i
	print(mx + 1, s + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = list((0 for i in range(n)))
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peak[i] = 1
	(t, l) = (0, 1)
	cnt = 1
	for i in range(1, k - 1):
		if peak[i]:
			cnt += 1
	t = cnt
	i = k
	while i < n:
		if peak[i - 1]:
			cnt += 1
		if peak[i - k + 1]:
			cnt -= 1
		if cnt > t:
			t = cnt
			l = i - k + 2
		i += 1
	print(t, l)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0 for _ in range(n)]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			b[i] = 1
	p = sum(b[1:k - 1])
	mp = p
	ml = 0
	for l in range(1, n - k + 1):
		p -= b[l]
		p += b[l + k - 2]
		if p > mp:
			mp = p
			ml = l
	print(mp + 1, ml + 1)


for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	bhalu = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			bhalu[i] = 1
	coo = bhalu[:k - 1].count(1)
	dak = []
	dak.append([coo, -1])
	for j in range(1, n - k + 1):
		if bhalu[j] == 1:
			coo = coo - 1
		if bhalu[j + k - 2] == 1:
			coo = coo + 1
		dak.append([coo, -1 * (j + 1)])
	e = max(dak)
	print(e[0] + 1, e[1] * -1)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	pref = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			pref[i] += 1
	for i in range(1, n):
		pref[i] += pref[i - 1]
	mx = 0
	idx = 0
	for i in range(n - k + 1):
		ans = pref[i + k - 2] - pref[i] + 1
		if ans > mx:
			mx = ans
			idx = i + 1
	print(mx, idx)


try:
	t = int(input())
	for i1 in range(t):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		p = [False] * n
		for i in range(1, n - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				p[i] = True
		total = p.count(True)
		num = p[1:k - 1].count(True)
		temp = num
		l = 0
		for i in range(1, n - k + 1):
			temp += p[i + k - 2] - p[i]
			if temp > num:
				num = temp
				l = i
				if num == total:
					break
		print(num + 1, l + 1)
except:
	pass


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = peaks[i - 1] + 1
		else:
			peaks[i] = peaks[i - 1]
	peaks[-1] = peaks[-2] + 1
	m = l_ans = 0
	for l in range(n - k + 1):
		temp = peaks[l + k - 2] - peaks[l]
		if temp > m:
			m = temp
			l_ans = l
	print(m + 1, l_ans + 1)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	cnt = 0
	s.insert(0, float('inf'))
	s.append(float('inf'))
	st = [0] * (n + 2)
	for i in range(1, n):
		if s[i] > s[i - 1] and s[i] > s[i + 1]:
			cnt += 1
		st[i] = cnt
	(res_max, res_index) = (0, 1)
	for i in range(1, n - k + 2):
		c = st[i + k - 2] - st[i]
		if c > res_max:
			res_max = c
			res_index = i
	print(res_max + 1, res_index)
	t -= 1


from math import *
from collections import *
from functools import *
from bisect import *
from itertools import *
from heapq import *
from statistics import *
inf = float('inf')
ninf = -float('inf')
ip = input
alphal = 'abcdefghijklmnopqrstuvwxyz'
alphau = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def ipl():
	return list(map(int, ip().split()))

def ipn():
	return int(ip())

def ipf():
	return float(ip())

def solve():
	(n, k) = ipl()
	a = ipl()
	i = j = 1
	cp = p = 0
	r = 1
	while j < n - 1:
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			cp += 1
		if j - i + 1 == k - 2:
			if p < cp:
				p = cp
				r = i
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				cp -= 1
			i += 1
		j += 1
	print(p + 1, r)
for _ in range(ipn()):
	solve()


def check(arr, n, k):
	brr = [0]
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			brr.append(1)
		else:
			brr.append(0)
	brr.append(0)
	p = 0
	val = sum(brr[1:k - 1])
	m = val
	j = 1
	temp = brr[j]
	if k < n:
		for i in range(k - 1, n - 1):
			val = val + brr[i] - temp
			if val > m:
				m = val
				p = i - k + 2
			j += 1
			temp = brr[j]
	return [m + 1, p + 1]
t = int(input())
while t:
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	result = check(arr, n, k)
	print(result[0], result[1])
	t -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	isp = [False] * n
	for i in range(1, n):
		if a[i] > a[i - 1]:
			isp[i - 1] = False
			isp[i] = True
	isp[-1] = False
	np = [isp[1:k - 1].count(True)]
	ac = np[0]
	for i in range(k - 1, n - 1):
		ac += isp[i]
		ac -= isp[i - k + 2]
		np.append(ac)
	(mx, mi) = (np[0], 1)
	for (i, e) in enumerate(np, 1):
		if e > mx:
			mx = e
			mi = i
	print(mx + 1, mi)


import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest

def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST():
	return list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def sortListWithIndex(listOfTuples, idx):
	return sorted(listOfTuples, key=lambda x: x[idx])

def sortDictWithVal(passedDic):
	temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
	toret = {}
	for tup in temp:
		toret[tup[0]] = tup[1]
	return toret

def sortDictWithKey(passedDic):
	return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
t = INT()
while t != 0:
	(n, k) = MAP()
	a = LIST()
	ans = []
	pTillNow = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			pTillNow += 1
	ans.append(pTillNow)
	idx1 = 1
	idx2 = k - 1
	for j in range(1, n - k + 1):
		if a[idx1] > a[idx1 + 1] and a[idx1] > a[idx1 - 1]:
			pTillNow -= 1
		if a[idx2] > a[idx2 + 1] and a[idx2] > a[idx2 - 1]:
			pTillNow += 1
		idx1 += 1
		idx2 += 1
		ans.append(pTillNow)
	maxpieces = max(ans)
	l = ans.index(maxpieces)
	print(maxpieces + 1, l + 1)
	t -= 1


a = []
b = [0]
t = int(input())
while t:
	j = 0
	p = 0
	sum = 0
	(n, k) = map(int, input().split())
	a = b + list(map(int, input().split()))
	m = k
	for i in range(2, m):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			p += 1
		i = i + 1
	l = 2
	max = p
	q = 1
	for i in range(m, n):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			p = p + 1
		if a[l] > a[l + 1] and a[l] > a[l - 1] and p:
			p -= 1
		if p > max:
			max = p
			q = l
		i += 1
		l += 1
	print(max + 1, q)
	t -= 1


def R():
	return map(int, input().split())

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
for _ in range(I()):
	(n, k) = R()
	a = L()
	p = [0] * n
	for i in range(1, n - 1):
		ad = 0
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			ad = 1
		p[i] = p[i - 1] + ad
	p[n - 1] = p[n - 2]
	mm = -1
	for i in range(n - k + 1):
		if p[i + k - 2] - p[i] > mm:
			mm = p[i + k - 2] - p[i]
			imin = i
	print(mm + 1, imin + 1)


t = int(input())
for x in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	perks = {0: 0}
	for y in range(1, len(a) - 1):
		if a[y - 1] < a[y] and a[y] > a[y + 1]:
			perks[y] = perks[y - 1] + 1
		else:
			perks[y] = perks[y - 1]
	max_perks = -1
	l = 0
	while l + k - 1 < n:
		if perks[l + k - 2] - perks[l] > max_perks:
			max_perks = perks[l + k - 2] - perks[l]
			index = l
		l += 1
	print(max_perks + 1, index + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i + 1] < a[i]:
			p += 1
	mx = p
	ml = 0
	for i in range(k, n):
		if a[i - k + 1] > a[i - k] and a[i - k + 1] > a[i - k + 2]:
			p -= 1
		if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
			p += 1
		if p > mx:
			mx = p
			ml = i - k + 1
	print(mx + 1, ml + 1)


get_int = lambda : int(input())
get_mul_int = lambda : map(int, input().rstrip().split())
get_list = lambda : list(map(int, input().rstrip().split()))
TEST_CASES = True

def main():
	(n, k) = get_mul_int()
	a = get_list()
	(tukde, l) = (0, 0)
	new = [0]
	for j in range(1, n - 1):
		if a[j - 1] < a[j] > a[j + 1]:
			new.append(1 + new[-1])
		else:
			new.append(0 + new[-1])
	new.append(0 + new[-1])
	for i in range(n - k + 1):
		m = new[i + k - 2] - new[i]
		if m > tukde:
			(tukde, l) = (m, i)
	print(tukde + 1, l + 1) if tukde > 0 else print(1, 1)
if not TEST_CASES:
	main()
else:
	[main() for _ in range(int(input()))]


def manip(arr, n, k):
	hills = [0 for i in range(0, n)]
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			hills[i] = 1
	pref = []
	sumSoFar = 0
	for i in range(n):
		sumSoFar += hills[i]
		pref.append(sumSoFar)
	ma = index = 0
	for l in range(0, n - k + 1):
		curr = pref[l + k - 2] - pref[l]
		if curr > ma:
			ma = curr
			index = l
	return (ma + 1, index + 1)
tc = int(input())
for _ in range(tc):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	(m, lf) = manip(arr, n, k)
	print(m, lf)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = []
	dd = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			dd += 1
	peak.append(dd)
	i = k
	while i < n:
		cc = 0
		if i - k > -1 and a[i - k + 1] > a[i - k] and (a[i - k + 1] > a[i - k + 2]):
			cc += 1
		if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
			peak.append(peak[-1] + 1 - cc)
		else:
			peak.append(peak[-1] - cc)
		i += 1
	i = 0
	ans = 0
	l = 0
	while i < len(peak):
		if ans < peak[i]:
			ans = peak[i]
			l = i
		i += 1
	print(ans + 1, l + 1)


import os
import sys
from io import BytesIO, IOBase

def solution(arr, n, k):
	pre = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			pre[i] = 1
	for i in range(1, n):
		pre[i] += pre[i - 1]
	start = k - 2
	(l, res) = (0, -1)
	for i in range(start, n):
		prev = res
		res = max(res, pre[i] - pre[i - k + 2])
		if res > prev:
			l = i - k + 2
	write(res + 1, l + 1)

def main():
	for _ in range(r_int()):
		(n, k) = r_array()
		arr = r_array()
		solution(arr, n, k)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args[:-1]:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(str(args[-1]))
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())
main()


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	isPick = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			isPick[i] = 1
	dp = [0] * (n - k + 1)
	dp[0] = sum(isPick[0:k]) - isPick[0] - isPick[k - 1]
	add = isPick[k - 1]
	for i in range(1, n - k + 1):
		dp[i] = dp[i - 1] - isPick[i] + add
		add = isPick[i + k - 1]
	max = dp[0]
	ind = 0
	for i in range(1, len(dp)):
		if dp[i] > max:
			ind = i
			max = dp[i]
	print(max + 1, ind + 1)


import sys
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def a():
	ans = ''
	for _ in range(int(inp())):
		(n, a, b, c, d) = read()
		mi = (a - b) * n
		ma = (a + b) * n
		ans += 'YNEOS'[not (c - d <= mi <= c + d or c - d <= ma <= c + d or mi <= c - d <= ma or (mi <= c + d <= ma))::2] + '\n'
	print(ans)

def b():
	ans = ''
	for _ in range(int(inp())):
		(n, k) = read()
		arr = read()
		l = 0
		mp_arr = deque()
		for i in range(1, k - 1):
			if arr[i - 1] < arr[i] > arr[i + 1]:
				mp_arr.append(i)
		mp = len(mp_arr)
		j = 1
		for i in range(k - 1, n - 1):
			if arr[i - 1] < arr[i] > arr[i + 1]:
				mp_arr.append(i)
			if mp_arr and j == mp_arr[0]:
				mp_arr.popleft()
			j += 1
			if mp < len(mp_arr):
				l = i - k + 2
				mp = len(mp_arr)
		ans += str(mp + 1) + ' ' + str(l + 1) + '\n'
	print(ans)
b()


def read():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, k, a)

def solve(n, k, a):
	peak = [False] * n
	for i in range(1, n - 1):
		peak[i] = a[i - 1] < a[i] > a[i + 1]
	pre = [0] * n
	c = 0
	for i in range(1, n):
		c += 1 if peak[i] else 0
		pre[i] = c
	mx = 0
	mx_l = 0
	for l in range(n - k + 2):
		l2 = l + k - 2
		if pre[l2] - pre[l] > mx:
			mx = pre[l2] - pre[l]
			mx_l = l
	return (mx + 1, mx_l + 1)
for t in range(int(input())):
	result = solve(*read())
	print(*result)


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [Scanner.string() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [Scanner.int() for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def divisor(n):
		res = []
		i = 1
		for i in range(1, int(n ** 0.5) + 1):
			if n % i == 0:
				res.append(i)
				if i != n // i:
					res.append(n // i)
		return res

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

def pop_count(x):
	x = x - (x >> 1 & 6148914691236517205)
	x = (x & 3689348814741910323) + (x >> 2 & 3689348814741910323)
	x = x + (x >> 4) & 1085102592571150095
	x = x + (x >> 8)
	x = x + (x >> 16)
	x = x + (x >> 32)
	return x & 127
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def solve():
	(N, K) = Scanner.map_int()
	A = Scanner.map_int()
	cnt = 0
	ans = 0
	for i in range(1, K - 1):
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			cnt += 1
	ans = cnt
	l = 0
	for i in range(1, N - K + 1):
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			cnt -= 1
		if A[i + K - 3] < A[i + K - 2] and A[i + K - 2] > A[i + K - 1]:
			cnt += 1
		if ans < cnt:
			ans = cnt
			l = i
	print(ans + 1, l + 1, sep=' ')

def main():
	T = Scanner.int()
	for _ in range(T):
		solve()
main()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	pref = [0] * n
	ans = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			pref[i] += 1
	for i in range(1, n):
		pref[i] = pref[i] + pref[i - 1]
	for i in range(n - k + 1):
		ans[i] = pref[i + (k - 2)] - pref[i]
	max_ = max(ans)
	index = ans.index(max_)
	print(max_ + 1, index + 1)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak[i] = peak[i - 1] + 1
		else:
			peak[i] = peak[i - 1]
	peak[n - 1] = peak[n - 2]
	l = 0
	r = l + k - 1
	ans_l = 0
	ans_h = 0
	while r <= n - 1:
		num_peaks = peak[r - 1] - peak[l]
		if num_peaks > ans_h:
			ans_h = num_peaks
			ans_l = l
		l += 1
		r += 1
	print(ans_h + 1, ans_l + 1)
	t -= 1


def solution(k, ar):
	n = len(ar)
	store = [0 for i in range(n)]
	peaks = {}
	for i in range(1, n - 1):
		if ar[i] > ar[i - 1] and ar[i] > ar[i + 1]:
			store[i] = store[i - 1] + 1
			peaks[i] = True
		else:
			store[i] = store[i - 1]
	store[n - 1] = store[n - 2]
	max_part = 0
	index = 0
	for i in range(n - k + 1):
		local = store[i + k - 1] - store[i]
		if i + k - 1 in peaks:
			local -= 1
		if max_part < local + 1:
			max_part = local + 1
			index = i
	print(max_part, index + 1)
test_case = int(input())
test_input = []
for i in range(test_case):
	(n, k) = [int(x) for x in input().split()]
	ar = [int(x) for x in input().split()]
	test_input.append([k, ar])
for test in test_input:
	k = test[0]
	ar = test[1]
	solution(k, ar)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	j = 0
	t = 0
	l = 1
	m = 0
	for i in range(1, n - 1):
		if i + 1 < k:
			if a[i - 1] < a[i] > a[i + 1]:
				t += 1
			j = 1
			m = t
		else:
			if a[i - 1] < a[i] > a[i + 1]:
				t += 1
			if a[j - 1] < a[j] > a[j + 1]:
				t -= 1
			j += 1
			if t > m:
				m = t
				l = j
	print(m + 1, l)


def RA():
	return list(map(int, input().split()))

def solve():
	(n, k) = RA()
	arr = RA()
	isPeak = [False] * len(arr)
	for i in range(1, len(arr) - 1):
		if arr[i - 1] < arr[i] and arr[i + 1] < arr[i]:
			isPeak[i] = True
	peakCount = 0
	for i in range(1, k - 1):
		if isPeak[i]:
			peakCount += 1
	best = peakCount
	bestStart = 0
	for i in range(k, n):
		if isPeak[i - 1]:
			peakCount += 1
		if isPeak[i - k + 1]:
			peakCount -= 1
		if peakCount > best:
			best = peakCount
			bestStart = i - k + 1
	print(best + 1, bestStart + 1)
t = int(input())
for i in range(t):
	solve()


from sys import *
import collections
import math
t = int(stdin.readline())
for _ in range(t):
	(n, k) = list(map(int, stdin.readline().split(' ')))
	a = list(map(int, stdin.readline().split(' ')))
	peaks = {}
	for i in range(1, k - 1, 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i - 1] = True
	ans = 1
	mx = len(peaks)
	pks = mx
	for i in range(k, n, 1):
		if a[i - 1] > a[i] and a[i - 1] > a[i - 2]:
			peaks[i - 2] = True
			pks = pks + 1
		if i - k in peaks:
			del peaks[i - k]
			pks = pks - 1
		if pks > mx:
			mx = pks
			ans = i - k + 2
	print(str(mx + 1) + ' ' + str(ans))


for t in range(int(input())):
	(n, k) = map(int, input().split())
	m = [int(i) for i in input().split()]
	m2 = [False] + [m[i - 1] < m[i] > m[i + 1] for i in range(1, n - 1)] + [False]
	m3 = [sum(m2[1:k - 1])]
	for i in range(1, n - k + 1):
		m3.append(m3[-1] - m2[i] + m2[i + k - 2])
	a = max(m3)
	b = m3.index(a)
	print(a + 1, b + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	nl = [0]
	s = []
	ind = []
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			nl.append(1)
		else:
			nl.append(0)
	nl.append(0)
	for i in range(1, n):
		nl[i] += nl[i - 1]
	for i in range(1, len(nl)):
		if i + k - 1 <= len(nl):
			st = i
			en = i + k - 3
			s.append(nl[en] - nl[st - 1])
			ind.append(i)
	print(max(s) + 1, ind[s.index(max(s))])


def isPeak(ind, arr):
	if ind == 0 or ind >= len(arr) - 1:
		return False
	elif arr[ind] > arr[ind - 1] and arr[ind] > arr[ind + 1]:
		return True
	else:
		return False
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	al = list(map(int, input().split()))
	peaks = []
	pc = 0
	ma = -100000
	ind = -1
	for i in range(k - 1):
		if isPeak(i, al):
			pc += 1
			peaks.append(pc)
			if pc > ma:
				ma = pc
				ind = 0
	sti = k
	while sti != n:
		if isPeak(sti - k + 1, al):
			pc -= 1
		if isPeak(sti - 1, al):
			pc += 1
			if pc > ma:
				ma = pc
				ind = sti - k + 1
		sti += 1
	if ma < 0:
		print(1, 1)
	else:
		print(ma + 1, ind + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	mountain = [int(g) for g in input().split()]
	end_pointer = [0 for _ in range(n)]
	start_pointer = [0 for _ in range(n)]
	peak_count = 0
	for i in range(1, len(mountain) - 1):
		if mountain[i - 1] < mountain[i] and mountain[i] > mountain[i + 1]:
			peak_count += 1
			end_pointer[i + 1] += peak_count
			start_pointer[i] -= peak_count
		else:
			end_pointer[i + 1] = peak_count
			start_pointer[i] = -peak_count
	start = 0
	end = 0
	max_peaks = -float('inf')
	for i in range(0, n - (k - 1)):
		if end_pointer[i + (k - 1)] + start_pointer[i] > max_peaks:
			start = i
			end = i + (k - 1)
			max_peaks = end_pointer[end] + start_pointer[i]
	print(max_peaks + 1, start + 1)


def nastyaAndDoor(n, k, array):
	array[0] = [array[0], 0]
	for x in range(1, n - 1):
		if array[x] > array[x - 1][0] and array[x] > array[x + 1]:
			array[x] = [array[x], 1]
		else:
			array[x] = [array[x], 0]
	array[-1] = [array[-1], 0]
	max_peeks = 0
	max_l = 0
	for x in range(1, k - 1):
		if array[x][1] == 1:
			max_peeks += 1
	max_l = 0
	peek = max_peeks
	for x in range(1, n - k + 1):
		if array[x][1] == 1:
			peek -= 1
		if array[x + k - 2][1] == 1:
			peek += 1
		if peek > max_peeks:
			max_peeks = peek
			max_l = x
	return (max_peeks + 1, max_l + 1)
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	ans = nastyaAndDoor(n, k, l)
	print(ans[0], ans[1])


def solution():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			p[i] = 1
	cnt = p[1:k - 1].count(1)
	ans = cnt
	l = 0
	for i in range(n - k):
		if p[i + k - 1] == 1:
			cnt += 1
		if p[i + 1] == 1:
			cnt -= 1
		if cnt > ans:
			ans = cnt
			l = i + 1
	print(ans + 1, l + 1)
for _ in range(int(input())):
	solution()


import sys
import math
import collections

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
for t in range(int(input())):
	(n, k) = get_ints()
	arr = get_list()
	peak = []
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peak.append(i)
	count = 0
	pos = 0
	ans = []
	r = 0
	for i in range(len(peak)):
		p = peak[i]
		ans.append(p)
		if ans[-1] - ans[0] < k - 2:
			if len(ans) > count:
				count = len(ans)
				pos = ans[0]
				r = ans[-1]
		else:
			ans.pop(0)
	selected = r - pos + 3
	pos_left = k - selected
	start = max(1, pos - pos_left)
	print(count + 1, start)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if ar[i] > ar[i - 1] and ar[i] > ar[i + 1]:
			peaks[i] = 1
	(i, j) = (1, 1)
	ct = 0
	while j < k - 1:
		ct += peaks[j]
		j += 1
	j -= 1
	l = 1
	mx = ct
	while j < n - 1:
		if peaks[i] == 1:
			ct -= 1
		if peaks[j + 1] == 1:
			ct += 1
		if ct > mx:
			l = i + 1
			mx = ct
		i += 1
		j += 1
	print(mx + 1, l)


import sys
t = int(input())
inp = [line.strip().split() for line in reversed(sys.stdin.readlines())]
ans = []
while t:
	(n, k) = map(int, inp.pop())
	a = [int(i) for i in inp.pop()]
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	pr = [0]
	for i in range(1, n + 1):
		pr.append(pr[-1] + peaks[i - 1])
	sf = [pr[-1]]
	for i in range(0, n - 1):
		sf.append(sf[-1] - peaks[i + 1])
	mx_p = 0
	L = -1
	for i in range(0, n - k + 1):
		tmp = sf[i] - sf[i + k - 2]
		if mx_p < tmp:
			mx_p = tmp
			L = i + 1
	if L == -1:
		L = 1
	ans.append(str(mx_p + 1) + ' ' + str(L))
	t -= 1
print(*ans, sep='\n')


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().strip().split()))
	l = list(map(int, input().strip().split()))
	count = [0 for j in range(n)]
	for j in range(1, n - 1):
		if l[j] > l[j - 1] and l[j + 1] < l[j]:
			count[j] = count[j - 1] + 1
		else:
			count[j] = count[j - 1]
	sol = [0 for j in range(n - k + 1)]
	for j in range(n - k + 1):
		sol[j] = count[j + k - 2] - count[j]
	big = sol[0]
	c = 0
	for j in range(n - k + 1):
		if sol[j] > big:
			big = sol[j]
			c = j
	print(big + 1, c + 1)


import math, sys
import heapq
from collections import Counter, defaultdict

def li():
	return list(map(int, sys.stdin.readline().split()))

def ls():
	return list(map(int, list(input())))

def la():
	return list(input())

def ii():
	return int(input())

def dic(x):
	return defaultdict(lambda : x)

def isPrime(n):
	i = 2
	if n == 1:
		return False
	while i <= int(math.sqrt(n)):
		if n % i == 0:
			return False
		i = i + 1
	return True

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def binarySearch(arr, x):
	(l, r) = (0, len(arr) - 1)
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return True
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return False
t = ii()
for _ in range(t):
	(n, k) = li()
	a = li()
	peaks = {}
	peaks[1] = 0
	l = [0]
	for i in range(2, len(a)):
		if a[i - 2] < a[i - 1] and a[i - 1] > a[i]:
			peaks[i] = peaks[i - 1] + 1
			l.append(1)
		else:
			peaks[i] = peaks[i - 1]
			l.append(0)
	peaks[i + 1] = peaks[i]
	l.append(0)
	a = []
	for i in range(1, n - k + 2):
		a.append(peaks[i + k - 1] - peaks[i])
		if l[i + k - 2] == 1:
			a[i - 1] -= 1
		if l[i - 1] == 1:
			a[i - 1] -= 1
	maxx = max(a)
	i = a.index(maxx) + 1
	print(maxx + 1, i)


t = int(input())
s = set()
for i in range(t):
	(n, k) = input().split()
	(n, k) = (int(n), int(k))
	res = []
	inp = [int(x) for x in input().split()]
	peak = [0 for i in range(n)]
	for i in range(1, n - 1):
		if inp[i - 1] < inp[i] > inp[i + 1]:
			peak[i] = 1
	temp = 0
	for j in range(1, k - 1):
		temp = temp + peak[j]
	res.append((temp + 1, 1))
	for j in range(k, n):
		temp = temp + peak[j - 1] - peak[j - k + 1]
		res.append((temp + 1, j - k + 2))
	res.sort(reverse=True)
	res1 = int(res[0][0])
	res2 = int(res[0][1])
	for i in res:
		if i[0] < res1:
			break
		res2 = min(res2, i[1])
	print(res1, res2)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	m = list(map(int, input().split()))
	mp = [0 for i in range(n)]
	l = 0
	mpeak = 0
	for i in range(1, n - 1):
		if m[i] > m[i - 1] and m[i] > m[i + 1]:
			mp[i] = 1
	i = 1
	j = i + k - 2
	l = i
	np = mp[i:k + i - 2].count(1)
	mpeak = np
	while j < n:
		np += mp[j]
		np -= mp[i]
		i += 1
		j += 1
		if np > mpeak:
			mpeak = np
			l = i
	print(mpeak + 1, l)


a = int(input())
for i in range(0, a):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	ones = []
	for i in range(0, len(arr)):
		if i == 0:
			ones.append(0)
		elif i == len(arr) - 1:
			ones.append(0)
		elif arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			ones.append(1)
		else:
			ones.append(0)
	ls = []
	l = 0
	fir = 0
	for i in range(1, k - 1):
		if ones[i] == 1:
			fir = fir + 1
	ls.append(fir)
	p1 = 1
	p2 = 1 + k - 1
	while p2 < len(ones):
		if ones[p1] == 1 and ones[p2 - 1] == 1:
			ls.append(ls[len(ls) - 1])
		elif ones[p1] == 1 and ones[p2 - 1] == 0:
			ls.append(ls[len(ls) - 1] - 1)
		elif ones[p1] == 0 and ones[p2 - 1] == 1:
			ls.append(ls[len(ls) - 1] + 1)
		else:
			ls.append(ls[len(ls) - 1])
		p1 = p1 + 1
		p2 = p2 + 1
	print(max(ls) + 1, ls.index(max(ls)) + 1)


a = int(input())
for y in range(a):
	a = [int(x) for x in input().split()]
	mountains = [int(x) for x in input().split()]
	peaks = list()
	length = a[1] - 2
	answer = 0
	current = 0
	start = 0
	for x in range(1, len(mountains) - 1):
		if len(peaks) > 0 and peaks[0] == x - length:
			peaks.pop(0)
			current -= 1
		if mountains[x] > mountains[x - 1] and mountains[x] > mountains[x + 1]:
			current += 1
			if current > answer:
				answer = current
				start = x - length
				if start < 0:
					start = 0
			peaks.append(x)
	print(answer + 1, start + 1)


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = [0] * n
	r = [0] * n
	l[0] = r[-1] = -1
	for i in range(1, n - 1):
		if a[i - 1] < a[i]:
			l[i] = 1
		if a[i] > a[i + 1]:
			r[i] = 1
	count = 0
	for i in range(1, k - 1):
		if l[i] == 1 and r[i] == 1:
			count += 1
	ans = [0] * (n - k + 1)
	ans[0] = count
	for i in range(1, n - k + 1):
		start = i
		end = i + k - 1
		if l[end - 1] == 1 and r[end - 1] == 1:
			count += 1
		if l[start] == 1 and r[start] == 1:
			count -= 1
		ans[i] = count
	print(max(ans) + 1, ans.index(max(ans)) + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	peak_diary = {}
	sec_peak = {0: 0}
	count = 0
	for i in range(1, n - 1):
		if lis[i] > lis[i - 1] and lis[i] > lis[i + 1]:
			count += 1
			peak_diary[i] = 0
		sec_peak[i] = count
	sec_peak[n - 1] = count
	curr_peak = -112
	for i in range(k - 1, n):
		left = i - k + 1
		abhi_count = sec_peak[i] - sec_peak[left]
		if left in peak_diary:
			abhi_count -= 1
		if i in peak_diary:
			abhi_count -= 1
		if abhi_count > curr_peak:
			curr_peak = abhi_count
			lower = left
			right = i
	print(curr_peak + 1, lower + 1)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
from io import BytesIO
for t in range(int(input())):
	(n, k) = map(int, input().split())
	array = input().split()
	for i in range(n):
		array[i] = int(array[i])
	arraPic = [0] * n
	SumaPic = [0] * n
	for i in range(1, n - 1):
		if array[i] > array[i - 1] and array[i] > array[i + 1]:
			arraPic[i] = 1
	for i in range(1, n - 1):
		SumaPic[i] = SumaPic[i - 1] + arraPic[i]
	maxAnswer = 0
	left = 0
	isAnswer = False
	for i in range(0, n - k + 1):
		localAnswer = SumaPic[i + k - 2] - SumaPic[i]
		if localAnswer > maxAnswer:
			maxAnswer = localAnswer
			left = i
	print(maxAnswer + 1, left + 1)


for xyz in range(0, int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	pp = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i + 1] and l[i - 1] < l[i]:
			pp[i] = 1
	si = sum(pp[0:k]) - pp[0] - pp[k - 1]
	m = si
	p = 0
	su = [si]
	for i in range(1, n - k + 1):
		si -= pp[i]
		si += pp[i + k - 2]
		if si > m:
			m = si
			p = i
		su.append(si)
	print(m + 1, p + 1)


def isPeak(a, i):
	if i <= 0 or i >= len(a) - 1:
		return False
	else:
		return a[i - 1] < a[i] and a[i] > a[i + 1]
nt = int(input().strip())
for t in range(1, nt + 1):
	(n, k) = map(int, input().strip().split(' '))
	v = list(map(int, input().strip().split(' ')))
	best = 0
	bestPos = 0
	act = 0
	for i in range(-k, len(v) - k + 1):
		if isPeak(v, i - 1):
			act -= 1
		if isPeak(v, i + k - 1):
			act += 1
		val = act - isPeak(v, i) - isPeak(v, i + k - 1)
		if val > best:
			best = val
			bestPos = i
	if bestPos < 0:
		bestPos = 0
	print(str(best + 1) + ' ' + str(bestPos + 1))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	dp = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			dp[i] = 1
	ans = 0
	sm = 0
	for i in range(k - 1):
		sm += dp[i]
	fsm = sm
	for i in range(k - 1, n - 1):
		sm += dp[i] - dp[i - k + 2]
		if sm > fsm:
			ans = i - k + 2
			fsm = sm
	print(fsm + 1, ans + 1)


import sys
from collections import deque
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	(n, k) = map(int, input().split())
	c = list(map(int, input().split()))
	ans = [1, 1]
	for i in range(k - 2):
		if c[i] < c[i + 1] > c[i + 2]:
			ans[0] += 1
	ansn = ans[:]
	for i in range(n - k):
		ansn[1] = i + 2
		if c[i] < c[i + 1] > c[i + 2]:
			ansn[0] -= 1
		if c[i + k - 2] < c[i + k - 1] > c[i + k]:
			ansn[0] += 1
		if ans[0] < ansn[0]:
			ans = ansn[:]
	print(*ans)


t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().strip().split(' '))
	a = [0]
	a[1:] = list((int(i) for i in input().strip().split(' ')))
	prefix = [0] * (n + 2)
	z = 0
	for i in range(2, n):
		if a[i] > a[i - 1] and a[i] >= a[i + 1]:
			z += 1
		prefix[i] = z
	m = 0
	x = 0
	for i in range(1, n - k + 2):
		nop = prefix[i + k - 1 - 1] - prefix[i] + 1
		if nop > m:
			m = nop
			x = i
	print(m, x)


import sys, math

def solve(val, i, a, l, r):
	if i != l and i != r:
		if val > a[i + 1] and val > a[i - 1]:
			return 1
	return 0

def solve1(val, i, a):
	if i != 0 and i != len(a) - 1:
		if val > a[i + 1] and val > a[i - 1]:
			return 1
	return 0
t = int(sys.stdin.readline())
for _ in range(t):
	(n, k) = map(int, sys.stdin.readline().split())
	arr = list(map(int, sys.stdin.readline().split()))
	ans = []
	cur = 0
	l = 0
	r = k - 1
	for i in range(1, k):
		if solve(arr[i], i, arr, l, r):
			cur += 1
	ans.append(cur)
	for i in range(k, n):
		l += 1
		r += 1
		cur = ans[-1]
		if solve1(arr[l], l, arr):
			cur -= 1
		if solve1(arr[r - 1], r - 1, arr):
			cur += 1
		ans.append(cur)
	print(max(ans) + 1, ans.index(max(ans)) + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = [int(j) for j in input().split()]
	count = 0
	for i in range(k):
		if i != 0 and i != k - 1 and (arr[i - 1] < arr[i] > arr[i + 1]):
			count += 1
	ma = count
	ans = [0, k - 1]
	for i in range(k, n):
		if arr[i - 2] < arr[i - 1] > arr[i]:
			count += 1
		if arr[i - k] < arr[i - k + 1] > arr[i - k + 2]:
			count -= 1
		if count > ma:
			ma = count
			ans = [i - (k - 1), i]
	print(ma + 1, ans[0] + 1)


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	k -= 2
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			b[i] = 1
	ans = -1
	cnt = sum(b[1:k + 1])
	maxcnt = -1
	for i in range(k + 1, n):
		if cnt > maxcnt:
			ans = i - k
			maxcnt = cnt
		cnt += b[i]
		cnt -= b[i - k]
	print(maxcnt + 1, ans)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = [0] * n
	l2 = []
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			l1[i] = l1[i - 1] + 1
			l2.append(i)
		else:
			l1[i] = l1[i - 1]
	l1[n - 1] = l1[n - 2]
	x = 0
	m = 0
	ans = 0
	y = 1
	while y < n:
		if l1[y] > l1[x]:
			if y - x + 2 <= k:
				if l1[y] - l1[x] > m:
					m = l1[y] - l1[x]
					ans = x
			else:
				x += 1
				y -= 1
		y += 1
	print(m + 1, ans + 1)


def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(int(input())):
	[n, k] = rl()
	a = rl()
	p = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p.append(1)
		else:
			p.append(0)
	cts = []
	ct = 0
	for i in range(1, k - 1):
		if p[i] == 1:
			ct += 1
	cts.append(ct)
	for i in range(k - 1, n - 1):
		ct -= p[i - k + 2]
		ct += p[i]
		cts.append(ct)
	mv = max(cts)
	mi = cts.index(mv)
	print(mv + 1, mi + 1)


from sys import stdin, stdout
import heapq as hq
from collections import defaultdict
t = int(input())
for tc in range(t):
	(n, k) = map(int, stdin.readline().split())
	ar = list(map(int, stdin.readline().split()))
	peak = [ar[x - 1] < ar[x] > ar[x + 1] for x in range(1, n - 1)]
	peak = [False] + peak + [False]
	l = 0
	r = l + k - 1
	peakcount = 0
	for x in range(r):
		if peak[x]:
			peakcount += 1
	maxpeaks = peakcount
	maxpos = 0
	while r < n - 1:
		peakchange = 0
		if peak[l + 1]:
			peakchange -= 1
		if peak[r]:
			peakchange += 1
		peakcount += peakchange
		if maxpeaks < peakcount:
			maxpeaks = peakcount
			maxpos = l + 1
		l += 1
		r += 1
	stdout.write(str(maxpeaks + 1) + ' ')
	stdout.write(str(maxpos + 1) + '\n')


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	accum = n * [0]
	for i in range(1, n - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			accum[i] += 1
		accum[i] += accum[i - 1]
	accum[-1] += accum[-2]
	l = 0
	ans = 0
	for i in range(k - 1, n):
		if accum[i - 1] - accum[i - k + 1] > ans:
			ans = accum[i - 1] - accum[i - k + 1]
			l = i - k + 1
	print(ans + 1, l + 1)


import sys
t = int(input())
for i in range(t):
	(n, k) = list(map(int, sys.stdin.readline().strip().split()))
	a = list(map(int, sys.stdin.readline().strip().split()))
	x = [0] * n
	for j in range(1, n - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			x[j] = 1
	k = k - 2
	op = 0
	curr = 0
	curr = sum(x[:k])
	op = curr
	op1 = 1
	for j in range(k, n):
		curr = curr + x[j] - x[j - k]
		if curr > op:
			op1 = j - k + 1
			op = curr
	op = max(op, curr)
	print(op + 1, op1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			l1[i] = 1
	cnt = sum(l1[1:k - 1])
	cnt2 = cnt
	left = 0
	for i in range(1, n - k + 1):
		cnt2 = cnt2 + l1[i + k - 2] - l1[i]
		if cnt2 > cnt:
			left = i
			cnt = cnt2
	print(cnt + 1, left + 1)


for tt in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = [0 for i in range(n)]
	cnt = 0
	m = 0
	index = 0
	for i in range(2, n):
		if l[i - 1] > l[i] and l[i - 1] > l[i - 2]:
			peak[i - 1] = 1
			cnt += 1
		if i >= k:
			cnt -= peak[i - k + 1]
		if cnt > m:
			m = cnt
			index = max(0, i - k + 1)
	print(m + 1, index + 1)


t = int(input())
for i in range(t):
	l = str.split(input(), ' ')
	n = int(l[0])
	k = int(l[1])
	l = str.split(input(), ' ')
	for i in range(len(l)):
		l[i] = int(l[i])
	ll = []
	ll.append(0)
	for i in range(1, n - 1, 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			ll.append(1)
		else:
			ll.append(0)
	ll.append(0)
	ans = 0
	maxx = 0
	for i in range(k - 1):
		if ll[i] == 1:
			maxx = maxx + 1
	temp = maxx
	for i in range(1, n - k + 1, 1):
		if ll[i] == 1:
			temp = temp - 1
		if ll[i + k - 2] == 1:
			temp = temp + 1
		if temp > maxx:
			ans = i
			maxx = temp
	print(maxx + 1, end=' ')
	print(ans + 1)


import sys, math
t = int(sys.stdin.readline())
for T in range(t):
	(n, k) = map(int, sys.stdin.readline().split())
	arr = list(map(int, sys.stdin.readline().split()))
	pk = [False] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			pk[i] = True
	m = 0
	prev = 0
	l = 1
	for i in range(0, k - 1):
		if pk[i] == True:
			m += 1
			prev += 1
	for i in range(k + 1, n + 1):
		z = prev
		if pk[i - k] == True:
			z -= 1
		if pk[i - 2] == True:
			z += 1
		if z > m:
			m = z
			l = i - k + 1
		prev = z
	print(m + 1, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	h = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if h[i] > h[i - 1] and h[i] > h[i + 1]:
			peaks[i] = 1
	pref = [0] * n
	for i in range(1, n):
		pref[i] = pref[i - 1]
		if peaks[i] == 1:
			pref[i] += 1
	m = 0
	p = 0
	for i in range(k, n + 1):
		x = pref[i - 2] - pref[i - k]
		if x > m:
			m = x
			p = i - k
	print(m + 1, end=' ')
	print(p + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = []
	flag = 0
	for (f, s) in zip(a[:-1], a[1:]):
		if s > f:
			peaks.append(0)
			flag = 1
		if f > s:
			if flag == 1:
				peaks.append(1)
			else:
				peaks.append(0)
			flag = 0
	peaks.append(0)
	best_l = n - k
	max_p = sum(peaks[best_l + 1:])
	cur_p = max_p
	for i in range(1, n - k + 1):
		if peaks[n - k - i + 1] == 1:
			cur_p += 1
		if peaks[n - i - 1] == 1:
			cur_p = cur_p - 1
		if cur_p >= max_p:
			max_p = cur_p
			best_l = n - k - i
	print(max_p + 1, best_l + 1)


I = input
t = int(I())
for _ in range(t):
	(n, k) = map(int, I().split())
	a = list(map(int, I().split()))
	b = []
	for i in range(1, len(a) - 1):
		b.append(1 if a[i] > a[i - 1] and a[i] > a[i + 1] else 0)
	pref = [0]
	for i in b:
		pref.append(pref[-1] + i)
	res = [(l, pref[l + k - 2] - pref[l]) for l in range(n - k + 1)]
	r = max(res, key=lambda x: x[1])
	print(r[1] + 1, r[0] + 1)


t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	indexes = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			indexes[i] = 1
	Indexsum = [0] * n
	for i in reversed(range(n - 1)):
		Indexsum[i] = Indexsum[i + 1] + indexes[i]
	maxk = 0
	ind = 1
	for i in range(n - k + 2):
		if Indexsum[i] - Indexsum[i + k - 2] > maxk:
			maxk = Indexsum[i] - Indexsum[i + k - 2]
			ind = i
			if ind == 0:
				ind = 1
	print(maxk + 1, ind)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = [0] * n
	ans = 0
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			ans += 1
		p[i] = ans
	p[n - 1] = ans
	mx = -1
	st = 0
	peak = 0
	for i in range(0, n - k + 1):
		xx = p[i + k - 1] - p[i]
		if p[i + k - 1] != p[i + k - 2]:
			xx -= 1
		if xx > peak:
			mx = i
			peak = xx
	if peak > 0:
		print(peak + 1, mx + 1)
	else:
		print(1, 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = [0, 0]
	for i in range(2, n):
		if arr[i - 1] > arr[i - 2] and arr[i - 1] > arr[i]:
			peaks.append(peaks[-1] + 1)
		else:
			peaks.append(peaks[-1])
	(i, j) = (0, k - 1)
	(maxx, ind) = (-1, -1)
	while j < n:
		if peaks[j] - peaks[i + 1] > maxx:
			maxx = peaks[j] - peaks[i + 1]
			ind = i
		i += 1
		j += 1
	print(maxx + 1, ind + 1)


from sys import stdin, stdout

def find(A, N, K):
	arr = [0] * N
	for i in range(1, N - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			arr[i] = 1
	(i, j) = (0, 2)
	c = 0
	while j < K:
		if arr[j - 1]:
			c += 1
		j += 1
	m = [c, i]
	while j < N:
		if arr[i + 1]:
			c -= 1
		if arr[j - 1]:
			c += 1
		i += 1
		j += 1
		m = max(m, [c, i], key=lambda x: (x[0], -x[1]))
	m[1] += 1
	m[0] += 1
	return ' '.join(map(str, m))

def main():
	for _ in range(int(stdin.readline())):
		(N, K) = list(map(int, stdin.readline().split()))
		arr = list(map(int, stdin.readline().split()))
		print(find(arr, N, K))
main()


t = int(input())
while t:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak[i] = 1
	ls = []
	temp = 0
	for i in range(n):
		if i >= k - 1:
			ls.append(temp)
			temp -= peak[i - (k - 2)]
		temp += peak[i]
	maxi = 0
	j = 0
	for i in range(len(ls)):
		if ls[i] > maxi:
			maxi = ls[i]
			j = i
	print(maxi + 1, j + 1)
	t -= 1


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	my_list = list(map(int, input().split()))
	l = 0
	peaks = 0
	max_peaks = 0
	for i in range(1, l + k - 1):
		if my_list[i] > my_list[i - 1] and my_list[i] > my_list[i + 1]:
			peaks += 1
		if peaks > max_peaks:
			max_peaks = peaks
	for i in range(1, n - k + 1):
		if my_list[i] > my_list[i - 1] and my_list[i] > my_list[i + 1]:
			peaks -= 1
		var = i + k - 2
		if my_list[var] > my_list[var - 1] and my_list[var] > my_list[var + 1]:
			peaks += 1
		if peaks > max_peaks:
			max_peaks = peaks
			l = i
	print(max_peaks + 1, l + 1)


t = int(input())

def is_peak(j):
	return a[j - 1] < a[j] > a[j + 1]
for i in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	idx = 0
	curr = 0
	for j in range(1, k - 1):
		curr += is_peak(j)
	maximum = curr
	for j in range(1, n - k + 1):
		current = curr - is_peak(j)
		current += is_peak(j + k - 2)
		if current > maximum:
			maximum = current
			idx = j
		curr = current
	print(maximum + 1, idx + 1)


from _collections import deque
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	ar = list(map(int, input().split()))
	picks = 0
	lol = deque([])
	for i in range(1, k - 1):
		if ar[i - 1] < ar[i] > ar[i + 1]:
			picks += 1
			lol.append(i)
	max_picks = picks
	ans = 0
	for i in range(k - 1, n - 1):
		if len(lol) > 0 and lol[0] == i - k + 2:
			lol.popleft()
			picks -= 1
		if ar[i - 1] < ar[i] > ar[i + 1]:
			picks += 1
			lol.append(i)
		if picks > max_picks:
			max_picks = picks
			ans = i - k + 2
	print(max_picks + 1, ans + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	idxs = []
	peaks = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peaks[i] = 1
			idxs.append(i)
	pieces = sum(peaks[:k - 1])
	idx = 0
	max_pieces = 0
	for i in range(n - k + 1):
		pieces -= peaks[i]
		if pieces > max_pieces:
			max_pieces = pieces
			idx = i
		pieces += peaks[i + k - 1]
	print(max_pieces + 1, idx + 1)


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	List = [int(x) for x in input().split()]
	Prefix = [0]
	for i in range(1, N - 1):
		if List[i] > List[i - 1] and List[i] > List[i + 1]:
			Prefix.append(Prefix[-1] + 1)
		else:
			Prefix.append(Prefix[-1])
	Prefix.append(Prefix[-1])
	Left = 0
	Break = 0
	for i in range(K - 1, N):
		if Prefix[i] == Prefix[i - 1]:
			if Break < Prefix[i] - Prefix[i - K + 1]:
				Break = Prefix[i] - Prefix[i - K + 1]
				Left = i - K + 1
		elif Break < Prefix[i] - Prefix[i - K + 1] - 1:
			Break = Prefix[i] - Prefix[i - K + 1] - 1
			Left = i - K + 1
	print(Break + 1, Left + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	p = sum(peaks[:k - 1])
	mp = p
	ind = 0
	i = 1
	while i < 1 + n - k:
		if peaks[i + 1] == 0 and peaks[i] == 1:
			p -= 1
		if peaks[i + k - 2] == 1 and peaks[i + k - 3] == 0:
			p += 1
			if p > mp:
				mp = p
				ind = i
		i += 1
	print(str(mp + 1) + ' ' + str(ind + 1))


for t in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = [0] * (n + 5)
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			peak[i] += 1 + peak[i - 1]
		else:
			peak[i] = peak[i - 1]
	peak[n - 1] = peak[n - 2]
	peak.insert(0, 0)
	x = n - k + 1
	mx = -float('inf')
	for l in range(1, x + 1):
		(lw, h) = (l, l + k - 1)
		tmp = peak[h - 1] - peak[lw]
		mx = max(mx, tmp)
	ans = float('inf')
	for l in range(1, x + 1):
		(lw, h) = (l, l + k - 1)
		tmp = peak[h - 1] - peak[lw]
		if tmp == mx:
			ans = min(ans, l)
	print(mx + 1, ans)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	mount = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if mount[i] > mount[i + 1] and mount[i] > mount[i - 1]:
			peaks[i] = 1
	bmax = sum(peaks[1:k - 1])
	b = bmax
	lowest = 0
	for i in range(1, n - k + 1):
		b -= peaks[i] - peaks[k - 2 + i]
		if b > bmax:
			lowest = i
			bmax = b
	print(bmax + 1, lowest + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [0] + list(map(int, input().split()))
	l = [0 for i in range(n + 1)]
	for i in range(2, n):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			l[max(i - k + 2, 0)] += 1
			l[i] -= 1
	for i in range(1, n + 1):
		l[i] += l[i - 1]
	(count, ini) = (0, 1)
	for i in range(1, n + 1):
		if l[i] > count:
			count = l[i]
			ini = i
	print(count + 1, ini)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * (n + 1)
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			p[i + 1] = 1
		p[i + 1] += p[i]
	t = 0
	l = 0
	for i in range(n - k + 1):
		if t < p[i + k - 1] - p[i + 1]:
			l = i
			t = p[i + k - 1] - p[i + 1]
	print(t + 1, l + 1)


import sys
input = sys.stdin.readline
(t,) = map(int, input().split())
for _ in range(t):
	(N, K) = map(int, input().split())
	X = list(map(int, input().split()))
	pn = 0
	r = (0, 0)
	for i in range(2, N):
		if X[i] < X[i - 1] and X[i - 1] > X[i - 2]:
			pn += 1
		if i == K - 1:
			r = (pn, i - K + 2)
		if i < K:
			continue
		if X[i - K] < X[i - K + 1] and X[i - K + 1] > X[i - K + 2]:
			pn -= 1
		if pn > r[0]:
			r = (pn, i - K + 2)
	print(r[0] + 1, r[1])


t = int(input())
for _ in range(t):
	(n, k) = list(input().split(' '))
	(n, k) = (int(n), int(k))
	a = list(map(int, list(input().split(' '))))
	p = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = 1
	su = []
	tmp = 0
	for i in range(len(p)):
		su.append(tmp)
		tmp += p[i]
	(ansp, ansl) = (0, 1)
	for i in range(len(su) - k + 1):
		if p[i] == 1:
			tmpp = su[i + k - 1] - su[i] - 1
		else:
			tmpp = su[i + k - 1] - su[i]
		if tmpp > ansp:
			ansp = tmpp
			ansl = i + 1
	print(ansp + 1, ansl)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	mountains = list(map(int, input().split()))
	i = 0
	peaks = set()
	for i in range(1, len(mountains) - 1):
		if mountains[i + 1] < mountains[i] > mountains[i - 1]:
			peaks.add(i)
	yos = {}
	hehe = 0
	for i in range(len(mountains)):
		yos[i] = hehe
		if i in peaks:
			hehe += 1
	ans = [0, 0]
	for i in range(len(mountains) - 1, n - (n - k) - 2, -1):
		yos[i] = yos[i] - yos[i - k + 1]
		if i - k + 1 in peaks:
			yos[i] -= 1
		if yos[i] >= ans[-1]:
			ans = [i, yos[i]]
	print(ans[1] + 1, ans[0] - k + 2)
	t -= 1


I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n, k) = I()
	l = I()
	te = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			te[i] = 1
	tee = te.copy()
	for i in range(1, n):
		te[i] += te[i - 1]
	ans1 = 0
	ans2 = 0
	for i in range(n - k + 1):
		temp = te[i + k - 1] - te[i] - tee[i] - tee[i + k - 1]
		if temp > ans1:
			ans1 = temp
			ans2 = i
	print(ans1 + 1, ans2 + 1)


numcases = int(input())

def sliding_door(peaks, k, n):
	acc = sum(peaks[:k])
	ans = 0
	p1 = 0
	for i in range(n - k):
		j = i + k
		acc = acc - peaks[i] + peaks[j]
		if acc > ans or i == 0:
			ans = acc
			p1 = i + 1
	print(ans + 1, p1)
	return
for z in range(numcases):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p1 = 0
	p2 = 0
	maxpeaks = 0
	peaks = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			peaks[i] += 1
	sliding_door(peaks, k - 2, n)


t = int(input())
for i in range(t):
	l = 1
	ans = 0
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for j in range(1, n - 1):
		if a[j - 1] < a[j] > a[j + 1]:
			b[j] = 1
	temp = b[1:1 + k - 3].count(1)
	ans = temp
	for j in range(1, n - k + 2):
		temp += b[j - 1 + k - 2]
		temp -= b[j - 1]
		if ans < temp:
			ans = temp
			l = j
	print(ans + 1, l)


t = int(input(''))
for _ in range(t):
	[n, k] = list(map(int, input().split()))
	a = list(map(int, input().split()))
	dp = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			dp[i] = 1
	for i in range(1, n):
		dp[i] += dp[i - 1]
	mx = -1
	ind = 0
	for i in range(n + 1 - k):
		asi = dp[i + k - 1]
		if i:
			asi -= dp[i - 1]
			if dp[i] > dp[i - 1]:
				asi -= 1
		if dp[i + k - 1] > dp[i + k - 2]:
			asi -= 1
		if asi > mx:
			mx = asi
			ind = i + 1
	print(mx + 1, ind)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0]
	c = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			c += 1
		b.append(c)
	b.append(c)
	(ans, l) = (0, 0)
	for i in range(n - k + 1):
		r = i + k - 1
		v = b[r] - b[i]
		if r != n - 1 and a[r] > a[r - 1] and (a[r] > a[r + 1]):
			v -= 1
		if v > ans:
			ans = v
			l = i
	print(ans + 1, l + 1)


def is_peak(i):
	return a[i - 1] < a[i] > a[i + 1]
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = 0
	for i in range(1, k - 1):
		if is_peak(i):
			peaks += 1
	best = peaks
	low = 1
	bestIndex = 0
	for i in range(k - 1, n - 1):
		if is_peak(i):
			peaks += 1
		if is_peak(low):
			if peaks:
				peaks -= 1
		if peaks > best:
			best = peaks
			bestIndex = low
		low += 1
	print(best + 1, bestIndex + 1)


import io, os
import sys
from atexit import register
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
sys.stdout = io.BytesIO()
register(lambda : os.write(1, sys.stdout.getvalue()))
tokens = []
tokens_next = 0

def next_str():
	global tokens, tokens_next
	while tokens_next >= len(tokens):
		tokens = input().split()
		tokens_next = 0
	tokens_next += 1
	return tokens[tokens_next - 1]

def nextInt():
	return int(next_str())

def print(s):
	sys.stdout.write((str(s) + '\n').encode())

def getPeaks(a):
	res = set()
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			res.add(i)
	return res
t = nextInt()
for _ in range(t):
	n = nextInt()
	k = nextInt()
	a = [nextInt() for i in range(n)]
	peaks = getPeaks(a[:k])
	res = (len(peaks), 0)
	for i in range(1, n):
		end = i + k - 1
		if end >= n:
			break
		if i in peaks:
			peaks.remove(i)
		if a[end - 1] > a[end] and a[end - 1] > a[end - 2]:
			peaks.add(end - 1)
		cur = (len(peaks), i)
		if cur[0] > res[0]:
			res = cur
	print(str(res[0] + 1) + ' ' + str(res[1] + 1))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	out = [0] * n
	p = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			p[i] = 1
			out[i] = out[i - 1] + 1
		else:
			out[i] = out[i - 1]
	out[-1] = out[-2]
	m = 0
	pos = 1
	for i in range(n - k + 1):
		peak = 0
		if p[i + k - 1] == 1:
			peak = 1
		if out[i + k - 1] - peak - out[i] > m:
			m = out[i + k - 1] - peak - out[i]
			pos = i + 1
	print(m + 1, pos)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = [False] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i + 1] < a[i]:
			d[i] = True
	c = 0
	for i in range(k):
		if d[i]:
			c += 1
	if d[k - 1]:
		c -= 1
	ans = c
	l = 1
	r = k
	for i in range(k, n):
		if d[i - k + 1]:
			c -= 1
		if d[i - 1]:
			c += 1
		if ans < c:
			ans = c
			l = i - k + 2
			r = i + 1
	print(ans + 1, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	pek = [0] * n
	for i in range(1, n - 1):
		if lis[i] > lis[i - 1] and lis[i] > lis[i + 1]:
			pek[i] = 1
		pek[i] += pek[i - 1]
	ans = 0
	ind = 0
	for i in range(n - k + 2):
		tmp = pek[i + k - 2] - pek[i]
		if tmp > ans:
			ans = tmp
			ind = i
	print(ans + 1, ind + 1)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split(' ')))
	a = list(map(int, input().split(' ')))
	c = 0
	for i in range(1, k - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			c += 1
	ans = c
	l = 0
	for i in range(1, n - k + 1):
		if a[i - 1] < a[i] > a[i + 1]:
			c -= 1
		if a[i + (k - 1)] < a[i + (k - 2)] > a[i + (k - 3)]:
			c += 1
		if c > ans:
			ans = c
			l = i
	print(ans + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	arr = [0] * n
	i = 1
	while i < n - 1:
		if l[i] > l[i + 1] and l[i] > l[i - 1]:
			arr[i] = 1
			i = i + 2
		else:
			i = i + 1
	x = arr[:k - 1]
	maxi = x.count(1)
	counter = maxi
	i = 0
	j = k - 1
	ind = 0
	next = arr[j]
	while j < n:
		i = i + 1
		j = j + 1
		counter = counter - arr[i] + next
		if counter > maxi:
			ind = i
			maxi = counter
		if j < n:
			next = arr[j]
	print(maxi + 1, ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	peak = [0]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peak.append(1)
		else:
			peak.append(0)
	peak.append(0)
	t = sum(peak[:k - 1])
	l = 1
	count = t
	for i in range(2, n - k + 2):
		if peak[i - 1] == 1:
			count -= 1
		if peak[i + k - 3] == 1:
			count += 1
		if count > t:
			t = count
			l = i
	print(t + 1, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	h = []
	for i in range(n):
		if i == 0 or a[i - 1] > a[i] or i == n - 1 or (a[i + 1] > a[i]):
			h.append(0)
		else:
			h.append(1)
	m = 0
	s = 0
	for i in range(n - k + 1):
		if i == 0:
			a = sum(h[i + 1:i + k - 1])
		elif i == n - k:
			a = sum(h[i + 1:i + k - 1])
		else:
			a -= h[i]
			a += h[i + k - 2]
		if a > m:
			m = a
			s = i
	print(m + 1, s + 1)


import sys
import heapq
import math
import bisect

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, input().split())

def rlinput():
	return list(map(int, input().split()))

def srlinput():
	return sorted(list(map(int, input().split())))

def main():
	(n, k) = rinput()
	q = rlinput()
	p = [0] * n
	w = [0] * (n + 1)
	for i in range(1, n - 1):
		p[i] = 1 * (q[i] > max(q[i - 1], q[i + 1]))
	for i in range(0, n):
		w[i + 1] = w[i] + p[i]
	(res, ans) = (0, 0)
	for i in range(1, n + 2 - k):
		m = w[i + k - 1] - w[i - 1] - p[i - 1] - p[i + k - 2]
		if m > res or ans == 0:
			(ans, res) = (i, m)
	print(res + 1, ans)
for i in range(iinput()):
	main()


import os
import sys
from math import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return map(int, input().split())

def array():
	return [int(i) for i in input().split()]

def calc(a, l, h):
	c = 0
	for i in range(l + 1, h):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			c += 1
	return c

def peak(i):
	if a[i] > a[i - 1] and a[i] > a[i + 1]:
		return True
	return False
for _ in range(int(input())):
	(l, k) = map(int, input().split())
	a = array()
	ans = calc(a, 0, 0 + k - 1)
	ansl = 1
	i = 1
	c = ans
	while i <= l - k:
		if peak(i):
			c -= 1
		if peak(i + k - 2):
			c += 1
		if c > ans:
			ans = c
			ansl = i + 1
		i += 1
	print(ans + 1, ansl)


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	for t in range(I()):
		(n, k) = In()
		arr = L()
		lis = [0 for i in range(n)]
		for i in range(1, n - 1):
			if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
				lis[i] = 1
		for i in range(1, n):
			lis[i] += lis[i - 1]
		l = 0
		mx = 0
		for i in range(n - k + 1):
			if lis[i + k - 2] - lis[i] > mx:
				mx = lis[i + k - 2] - lis[i]
				l = i
		print(mx + 1, l + 1)
main()


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	maxct = 0
	l = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			maxct += 1
	ct = maxct
	for li in range(1, n - k + 1):
		if a[li] > a[li - 1] and a[li] > a[li + 1]:
			ct -= 1
		if a[li + k - 2] > a[li + k - 3] and a[li + k - 2] > a[li + k - 1]:
			ct += 1
		if ct > maxct:
			maxct = ct
			l = li
	print(maxct + 1, l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	dp = [0 for _ in range(n)]
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			dp[i] = 1
	max_peaks = 0
	end = n - 1
	start = n - k
	for i in range(start + 1, end):
		if dp[i] == 1:
			max_peaks += 1
	new_length = max_peaks
	low = start
	while start > 0:
		last = dp[end - 1]
		begin = dp[start]
		start -= 1
		end -= 1
		new_length -= last
		new_length += begin
		if max_peaks <= new_length:
			max_peaks = new_length
			low = start
	print(max_peaks + 1, low + 1, sep=' ')


test = int(input())
for i in range(test):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = []
	s.append(0)
	for i in range(1, len(l) - 1):
		s.append(s[i - 1])
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			s[i] += 1
	x = len(s)
	(ind, ans, c) = (0, 0, 0)
	for i in range(len(l) - k + 1):
		c = s[i + k - 2] - s[i]
		if ans < c:
			ind = i
			ans = c
	print(ans + 1, end=' ')
	print(ind + 1)


def solve():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	dp = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			dp[i] += 1
	s = sum(dp[1:k - 1])
	mx = (s, 0)
	for i in range(n - k + 1):
		s += dp[i + k - 1]
		s -= dp[i + 1]
		if s > mx[0]:
			mx = (s, i + 1)
	print(mx[0] + 1, mx[1] + 1)
t = int(input())
for _ in range(t):
	solve()


from math import *
from copy import *
from heapq import *
from string import *
from random import *
from bisect import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
from collections import defaultdict

def solve(l, k):
	n = len(l)
	prePeaks = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			prePeaks[i] = prePeaks[i - 1] + 1
		else:
			prePeaks[i] = prePeaks[i - 1]
	prePeaks[-1] = prePeaks[-2]
	maxx = 0
	leftAns = 1
	prePeaks = prePeaks
	for i in range(k - 1, n):
		(left, right) = (i - k + 1, i)
		peaks = prePeaks[right - 1] - prePeaks[left]
		if peaks > maxx:
			maxx = peaks
			leftAns = left + 1
	print(maxx + 1, max(1, leftAns))
T = int(input())
for _ in range(T):
	(N, K) = list(map(int, stdin.readline().rstrip().split()))
	l = list(map(int, stdin.readline().rstrip().split()))
	solve(l, K)


t = int(input())
for w in range(t):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	ans1 = 0
	ans2 = 1
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			ans1 += 1
	ans3 = ans1
	for i in range(k, n):
		if a[i - 1] > a[i] and a[i - 1] > a[i - 2]:
			ans3 += 1
		if a[i - k + 1] > a[i - k] and a[i - k + 1] > a[i - k + 2]:
			ans3 -= 1
		if ans3 > ans1:
			ans2 = i - k + 2
			ans1 = ans3
	print(ans1 + 1, ans2)


t = int(input())
for xx in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0 for i in range(n)]
	for i in range(1, n - 1):
		peak[i] += peak[i - 1]
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak[i] += 1
	l = 0
	mxp = 0
	for i in range(n - k + 2):
		if mxp < peak[i + k - 2] - peak[i]:
			mxp = peak[i + k - 2] - peak[i]
			l = i
	print(mxp + 1, l + 1)


def natsya(n, l, a):
	newa = [0]
	s = 0
	for i in range(1, n - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			s += 1
			newa.append(s)
		else:
			newa.append(s)
	newa.append(s)
	current_peaks = None
	current_index = None
	for j in range(0, n - l + 1):
		if current_index != None and current_peaks != None and (newa[j + l - 2] - newa[j] > current_peaks):
			current_peaks = newa[j + l - 2] - newa[j]
			current_index = j
		elif current_peaks == None and current_index == None:
			if newa[j + l - 2] - newa[j] != 0:
				current_peaks = newa[j + l - 2] - newa[j]
				current_index = j
	if current_index == None:
		print(1, 1)
		return
	print(current_peaks + 1, current_index + 1)
	return
t = int(input())
a = []
for i in range(t):
	(b, c) = list(map(int, input().split(' ')))
	d = list(map(int, input().split(' ')))
	a.append([b, c, d])
for x in a:
	natsya(*x)


def read_int():
	return int(input())

def read_ints():
	return map(int, input().split(' '))
t = read_int()
for case_num in range(t):
	(n, k) = read_ints()
	a = list(read_ints())
	s = [0]
	for i in range(n):
		is_peak = False
		if 1 <= i < n - 1:
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				is_peak = True
		s.append(s[-1] + (1 if is_peak else 0))
	mp = 0
	ans = 0
	for l in range(n - k + 1):
		peaks = s[l + k - 1] - s[l + 1]
		if peaks > mp:
			mp = peaks
			ans = l
	print(mp + 1, ans + 1)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = []
	peak = [0] * n
	x = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			x += 1
		peak[i] = x
	for i in range(k - 1, n):
		ans.append([peak[i - 1] - peak[i - k + 1] + 1, -1 * (i - k + 1)])
	ans.sort(reverse=True)
	if len(ans) == 0:
		print(1, 1)
		continue
	print(ans[0][0], abs(ans[0][1]) + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	dp = [0 for i in range(n + 1)]
	c = 0
	z = float('-inf')
	for j in range(1, k - 1):
		if l[j] >= l[j - 1] and l[j] >= l[j + 1]:
			c = c + 1
	if z < c:
		r = 1
	z = max(z, c)
	for j in range(k - 1, n - 1):
		if l[j - 1] <= l[j] and l[j] >= l[j + 1]:
			c = c + 1
		if l[j - k + 2] >= l[j - k + 1] and l[j - k + 3] <= l[j - k + 2]:
			c = c - 1
		if z < c:
			r = j - k + 3
		z = max(z, c)
	print(z + 1, r)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	res = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			res[i] = 1
	c = 0
	for i in range(1, k - 1):
		if res[i] == 1:
			c += 1
	ans = c
	l = 0
	for i in range(k, n):
		if res[i - k + 1] == 1:
			c -= 1
		if res[i - 1] == 1:
			c += 1
		if c > ans:
			ans = c
			l = i - k + 1
	print(ans + 1, l + 1)


def solve():
	(n, k) = [int(x) for x in input().split()]
	li = [int(x) for x in input().split()]
	(min_index, max_peak) = (1, 0)
	for i in range(1, k - 1):
		if li[i] > li[i - 1] and li[i] > li[i + 1]:
			max_peak += 1
	last_window_peak = max_peak
	for i in range(k, n):
		curr_start = i - k + 1
		if li[curr_start] > li[curr_start - 1] and li[curr_start] > li[curr_start + 1]:
			last_window_peak -= 1
		if li[i - 1] > li[i - 2] and li[i - 1] > li[i]:
			last_window_peak += 1
		if last_window_peak > max_peak:
			max_peak = last_window_peak
			min_index = curr_start + 1
	print(max_peak + 1, min_index)
t = int(input())
for i in range(t):
	solve()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		peaks[i] += peaks[i - 1]
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peaks[i] += 1
	ind = 0
	maxi = 0
	for i in range(n - k + 1):
		if maxi < peaks[i + k - 2] - peaks[i]:
			maxi = peaks[i + k - 2] - peaks[i]
			ind = i
	print(maxi + 1, ind + 1)


for i in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	peaks = 0
	ind = []
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks += 1
			ind.append(i)
	max_peaks = peaks
	l = 0
	for i in range(k - 1, n - 1):
		if len(ind) != 0 and ind[0] == i - k + 2:
			ind.pop(0)
			peaks -= 1
			peaks = max(0, peaks)
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks += 1
			ind.append(i)
			if max_peaks < peaks:
				max_peaks = peaks
				l = i - k + 2
	print(max_peaks + 1, l + 1)


from math import gcd, sqrt
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	cnt = 0
	mxcnt = -1
	ind = -1
	pr = [False] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			cnt = cnt + 1
			pr[i] = True
		p[i + 1] = cnt
	for i in range(k - 1, n):
		if pr[i - k + 1]:
			if p[i] - p[i - k + 1] - 1 > mxcnt:
				mxcnt = p[i] - p[i - k + 1] - 1
				ind = i - k + 2
		elif p[i] - p[i - k + 1] > mxcnt:
			mxcnt = p[i] - p[i - k + 1]
			ind = i - k + 2
	print(mxcnt + 1, ind)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	parr = [0] * n
	ind = 0
	maxx = 0
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			parr[i] = parr[i - 1] + 1
		else:
			parr[i] = parr[i - 1]
	for i in range(0, n - k + 1):
		peak = parr[i + k - 2] - parr[i]
		if peak > maxx:
			ind = i
			maxx = peak
	print('{} {}'.format(maxx + 1, ind + 1))


from sys import stdin
r = stdin.readline

def solve(n, k, A):
	(peaks, i, j) = (0, 0, 1)
	while j < k - 1:
		if A[j - 1] < A[j] > A[j + 1]:
			peaks += 1
		j += 1
	ans = (peaks, 0)
	while j < n - 1:
		if A[j - 1] < A[j] > A[j + 1]:
			peaks += 1
		if A[i] < A[i + 1] > A[i + 2]:
			peaks -= 1
		(i, j) = (i + 1, j + 1)
		if peaks > ans[0]:
			ans = (peaks, i)
	ans = (ans[0] + 1, ans[1] + 1)
	return ans

def main():
	global r
	cases = int(r())
	for case in range(cases):
		(n, k) = map(int, r().strip().split())
		A = list(map(int, r().strip().split()))
		print(*solve(n, k, A))
main()


for _ in range(int(input().strip())):
	(n, k) = map(int, input().strip().split())
	M = list(map(int, input().strip().split()))
	(maxL, prevMax) = (-1, -1)
	peakSum = [0] * n
	for i in range(1, n - 1):
		if M[i - 1] < M[i] and M[i + 1] < M[i]:
			peakSum[i] = peakSum[i - 1] + 1
		else:
			peakSum[i] = peakSum[i - 1]
	peakSum[-1] = peakSum[-2]
	for j in range(0, n - k + 1):
		t = peakSum[j + k - 2] - peakSum[j] + 1
		if prevMax < t:
			maxL = j + 1
			prevMax = t
	print(str(prevMax), str(maxL))


def findPeaks(arr):
	peaks = []
	for i in range(1, len(arr) - 1):
		el = arr[i]
		if arr[i - 1] < el and el > arr[i + 1]:
			peaks.append(i + 1)
	return peaks

def getLen(arr, a, b):
	return arr[b] + 1 - (arr[a] - 1) + 1

def getLeft(arr, leftIndex, _max, k):
	_len = getLen(arr, leftIndex, leftIndex + _max - 1)
	rest = k - _len
	left = arr[leftIndex] - 1
	if rest > 0:
		left -= rest
		if left < 1:
			left = 1
	return left

def answer(arr, k):
	peaks = findPeaks(arr)
	if len(peaks) == 0:
		return '1 1'
	leftIndex = 0
	_max = 1
	count = 0
	startPoint = 0
	for i in range(len(peaks)):
		for j in range(startPoint, len(peaks)):
			_len = getLen(peaks, i, j)
			if k >= _len:
				count += 1
				startPoint = j
			if k < _len:
				startPoint = j
				break
		if _max < count:
			_max = count
			leftIndex = i
		count = max(0, count - 1)
	left = getLeft(peaks, leftIndex, _max, k)
	return str(_max + 1) + ' ' + str(left)
testCount = int(input())
for _ in range(testCount):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	print(answer(arr, k))


t = int(input())
for i in range(t):
	line = input()
	line = line.split()
	n = int(line[0])
	k = int(line[1])
	line = input()
	line = line.split()
	peaks = [0]
	for j in range(1, n - 1):
		if int(line[j]) > int(line[j - 1]) and int(line[j]) > int(line[j + 1]):
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	max_peaks = (0, 0)
	s_peaks = sum(peaks[1:k - 1])
	for j in range(n - k + 1):
		if j != 0:
			s_peaks = s_peaks - peaks[j] + peaks[j + k - 2]
		if max_peaks[0] < s_peaks + 1:
			max_peaks = (s_peaks + 1, j + 1)
	print(str(max_peaks[0]) + ' ' + str(max_peaks[1]))


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(INT()):
	(N, K) = MAP()
	A = LIST()
	peak = [0] * N
	for i in range(1, N - 1):
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			peak[i] = 1
	K -= 2
	acc = [0] + list(accumulate(peak))
	idx = 1
	mx = 1
	for l in range(1, N - K):
		r = l + K
		if acc[r] - acc[l] + 1 > mx:
			mx = acc[r] - acc[l] + 1
			idx = l
	print(mx, idx)


import sys
input = sys.stdin.readline
t_ = int(input())
while t_:
	t_ -= 1
	(n, k) = map(int, input().split())
	lis = list(map(int, input().split()))
	peaks = [0] * n
	c = [0] * n
	v = 0
	for i in range(1, n - 1):
		if lis[i - 1] < lis[i] and lis[i] > lis[i + 1]:
			v += 1
			peaks[i] = 1
		c[i] = v
	ans = 0
	index = -1
	for i in range(1, n - 1 - k + 2 + 1):
		h = i + k - 2 - 1
		if c[h] - c[i] + peaks[i] > ans:
			ans = c[h] - c[i] + peaks[i]
			index = i
	if index == -1:
		print(1, 1)
	else:
		print(ans + 1, index)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	data = [int(x) for x in input().split()]
	product = [0] * n
	ans = []
	for q in range(1, n):
		try:
			if data[q] > data[q - 1]:
				if data[q] > data[q + 1]:
					product[q] = product[q - 1] + 1
				else:
					product[q] = product[q - 1]
			else:
				product[q] = product[q - 1]
		except:
			product[q] = product[q - 1]
	for q in range(n - k + 1):
		ans.append(product[q + k - 2] - product[q])
	temp = max(ans)
	pos = ans.index(temp)
	print(temp + 1, pos + 1)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
		b[i] += b[i - 1]
	b[n - 1] = b[n - 2]
	res = (0, 0)
	for i in range(0, n - k + 1):
		res = max(res, (b[i + k - 2] - b[i], -i))
	print(res[0] + 1, -res[1] + 1)


from sys import stdin, exit, setrecursionlimit
from collections import deque
from heapq import *
from math import gcd
from math import ceil, log2
setrecursionlimit(10000000)
from collections import deque
input = stdin.readline
lmi = lambda : list(map(int, input().split()))
mi = lambda : map(int, input().split())
si = lambda : input().strip('\n')
ssi = lambda : input().strip('\n').split()
for _ in range(int(input())):
	(n, k) = mi()
	a = lmi()
	b = [0] * (n + 1)
	for i in range(1, n - 1):
		b[i + 1] = a[i - 1] < a[i] > a[i + 1]
	for i in range(1, n + 1):
		b[i] += b[i - 1]
	mx = -1
	idx = -1
	for i in range(0, n + 1 - k):
		if b[i + k - 1] - b[i + 1] > mx:
			mx = b[i + k - 1] - b[i + 1]
			idx = i
	print(mx + 1, idx + 1)


T = int(input())
for _ in range(T):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	li = input().split()
	peak = [0] * n
	for i in range(1, n - 1):
		if int(li[i]) > int(li[i - 1]) and int(li[i]) > int(li[i + 1]):
			peak[i] += 1
		peak[i] += peak[i - 1]
	maximum = -1
	flag = 0
	for i in range(n + 2 - k):
		count = peak[i + k - 2] - peak[i]
		if count > maximum:
			maximum = count
			flag = i
	print(maximum + 1, flag + 1)


import sys
input = sys.stdin.readline
t = int(input())
for r in range(t):
	(n, k) = map(int, input().split())
	n += 1
	l = list(map(int, input().split()))
	l = [0] + l
	numpeaks = 0
	ans = -1
	pos = 1
	d = {}
	for i in range(1, 1 + k):
		if i == 1 or i == 1 + k - 1:
			continue
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			d[i] = 0
			numpeaks += 1
	ans = numpeaks
	pos = 1
	for i in range(k + 1, n):
		try:
			if d[i - k + 1] == 0:
				numpeaks -= 1
		except:
			pass
		if l[i - 1] > l[i] and l[i - 1] > l[i - 2]:
			numpeaks += 1
			d[i - 1] = 0
		if numpeaks > ans:
			ans = numpeaks
			pos = i - k + 1
	print(str(ans + 1) + ' ' + str(pos))


import math
from decimal import *
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	no = list(map(int, input().split()))
	pt = 0
	cnt = 0
	while pt < k - 2:
		pt += 1
		if no[pt] > no[pt - 1] and no[pt] > no[pt + 1]:
			cnt += 1
	(tot, pnt) = (int(cnt), int(1))
	for i in range(1, n - pt - 1):
		pt += 1
		if no[i] > no[i - 1] and no[i] > no[i + 1]:
			cnt -= 1
		if no[pt] > no[pt + 1] and no[pt] > no[pt - 1]:
			cnt += 1
		if cnt > tot:
			pnt = int(i) + 1
			tot = int(cnt)
	print(tot + 1, pnt)


t = int(input())
for _ in range(t):
	(nopeak, k) = map(int, input().split())
	lpeaks = list(map(int, input().split()))
	lone = lpeaks[:]
	for i in range(1, nopeak - 1):
		if lone[i - 1] < lone[i] and lone[i + 1] < lone[i]:
			lpeaks[i] = 1
		else:
			lpeaks[i] = 0
	lpeaks[0] = 0
	lpeaks[nopeak - 1] = 0
	l2 = lpeaks[:]
	for i in range(1, nopeak):
		if lpeaks[i] == 1:
			lpeaks[i] = lpeaks[i - 1] + 1
		else:
			lpeaks[i] = lpeaks[i - 1]
	(mxcount, findex) = (0, 1)
	for i in range(0, nopeak - k + 1):
		if i != 0:
			count = lpeaks[i + k - 1] - lpeaks[i - 1]
			count = count - l2[i] - l2[i + k - 1]
		else:
			count = lpeaks[i + k - 1]
			count = count - l2[i] - l2[i + k - 1]
		if count > mxcount:
			mxcount = count
			findex = i + 1
	print(mxcount + 1, findex)


from itertools import accumulate
T = int(input())
for i in range(T):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	out = []
	for j in range(n):
		out.append(0)
	for j in range(1, n - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			out[j] = 1
	out1 = list(accumulate(out))
	max1 = 0
	index = 0
	for l in range(n - k + 1):
		if out1[l + k - 2] - out1[l] > max1:
			max1 = out1[l + k - 2] - out1[l]
			index = l
	print(max1 + 1, index + 1)


from sys import stdin

def help():
	(n, k) = map(int, stdin.readline().split(' '))
	arr = list(map(int, stdin.readline().split(' ')))
	peaks = [0] * n
	maxpeaks = 0
	start = 1
	curpeak = 0
	curr = 0
	currpeakact = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			peaks[i] = 1
		curpeak += peaks[i] - peaks[max(0, i - k)]
		curr = max(0, i - k + 1)
		currpeakact = curpeak
		if peaks[i] == 1:
			currpeakact -= 1
		if peaks[max(0, i - k + 1)] == 1:
			currpeakact -= 1
		if currpeakact > maxpeaks:
			maxpeaks = currpeakact
			start = curr + 1
	curpeak += peaks[n - 1] - peaks[max(0, n - 1 - k)]
	curr = max(0, n - k)
	currpeakact = curpeak
	if peaks[n - 1] == 1:
		currpeakact -= 1
	if peaks[max(0, n - k)] == 1:
		currpeakact -= 1
	if currpeakact > maxpeaks:
		maxpeaks = currpeakact
		start = curr + 1
	print(maxpeaks + 1, start)
for i in range(int(stdin.readline())):
	help()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	cn = 0
	for i in range(1, k - 1):
		cn += int(a[i] > a[i - 1] and a[i] > a[i + 1])
	maxcn = cn
	maxl = 1
	cn -= int(a[1] > a[0] and a[1] > a[2])
	for i in range(k - 1, n - 1):
		cn += int(a[i] > a[i - 1] and a[i] > a[i + 1])
		if cn > maxcn:
			maxcn = cn
			maxl = i - k + 3
		cn -= int(a[i - k + 3] > a[i - k + 2] and a[i - k + 3] > a[i - k + 4])
	print(maxcn + 1, maxl)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	maxi = 0
	maxj = 1
	used = [0] * n
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i + 1] < a[i]:
			used[i] = 1
			maxi += 1
	s = maxi
	for i in range(k - 1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			used[i] = 1
			s += 1
		if used[i - k + 2] == 1:
			s -= 1
		if s > maxi:
			maxi = s
			maxj = i - k + 3
	print(maxi + 1, maxj)


def check(a, n, last):
	if n == 0 or n == last - 1:
		return 0
	if a[n] > a[n - 1] and a[n] > a[n + 1]:
		return 1
	else:
		return 0
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	temp = a[:k]
	cur = 0
	for j in range(1, k - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			cur += 1
	ans = cur
	ind = 0
	l = 1
	r = k
	while r < n:
		if check(a, l, n):
			cur -= 1
		if check(a, r - 1, n):
			cur += 1
		if ans < cur:
			ans = cur
			ind = l
		l += 1
		r += 1
	print(ans + 1, ind + 1)


t = int(input())
import math
delay = []
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = input().split()
	arr = [int(a) for a in arr]
	copy = [0 for _ in arr]
	for i in range(1, len(arr) - 1):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			copy[i] = 1
	maxfound = 0
	ilow = 0
	ihigh = 0
	for i in range(0, n - k + 1):
		if i == 0:
			total = sum(copy[1:k - 1])
			if total > maxfound:
				maxfound = total
				ilow = i
				ihigh = k
		else:
			total -= copy[i]
			total += copy[i + k - 2]
			if total > maxfound:
				maxfound = total
				ilow = i
				ihigh = i + k - 1
	delay.append(f'{maxfound + 1} {ilow + 1}')
for d in delay:
	print(d)


from collections import defaultdict
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	ls = list(map(int, input().strip().split()))
	peak = defaultdict(int)
	i = 1
	max_peaks = 0
	while i < min(k - 1, n - 1):
		if ls[i] > ls[i - 1] and ls[i] > ls[i + 1]:
			max_peaks += 1
		i += 1
	i = 1
	j = k - 1
	while j < n - 1:
		peak[i] = -max_peaks
		if ls[j] > ls[j - 1] and ls[j] > ls[j + 1]:
			max_peaks += 1
		if i > 0 and (ls[i] > ls[i - 1] and ls[i] > ls[i + 1]):
			max_peaks -= 1
		i += 1
		j += 1
	peak[i] = -max_peaks
	peak = dict(sorted(peak.items(), key=lambda x: (x[1], x[0])))
	for (key, val) in peak.items():
		if val == 0:
			print(1, 1)
		else:
			print(-val + 1, key)
		break


import os, io
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
cases = int(input())
for t in range(cases):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = [0] * n
	c = []
	for i in range(1, n - 1):
		if a[i] - a[i - 1] > 0 and a[i] - a[i + 1] > 0:
			b[i] = 1
			c.append(i)
	for i in range(1, n):
		b[i] += b[i - 1]
	mp = 0
	l = 0
	if c:
		end = c[-1] + 1
		l = max(0, end - k + 1)
		mp = b[end] - b[l]
		for i in c[::-1][1:]:
			end = i + 1
			tl = max(0, end - k + 1)
			tmp = b[end] - b[tl]
			if tmp >= mp:
				l = tl
				mp = tmp
	print(mp + 1, l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	aa = list(map(int, input().split()))
	peak = [False] * n
	for i in range(1, n - 1):
		peak[i] = True if aa[i - 1] < aa[i] and aa[i] > aa[i + 1] else False
	ans = 1
	mn = 0
	for i in range(1, k - 1):
		mn += 1 if peak[i] else 0
	now = mn
	for l in range(1, n - k + 1):
		if peak[l]:
			now -= 1
		if peak[l + k - 2]:
			now += 1
		if now > mn:
			mn = now
			ans = l + 1
	print(mn + 1, ans)


def main():
	for t in range(int(input())):
		(n, k) = map(int, input().split())
		a = [int(i) for i in input().split()]
		peaks = [-1 for i in range(n)]
		for i in range(1, n - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				peaks[i] = 1
		p = 0
		index = 0
		for i in range(1, k - 1):
			if peaks[i] == 1:
				p += 1
		count = p
		for i in range(1, n - k + 2):
			if peaks[i] == 1:
				count -= 1
			if peaks[i + k - 2] == 1:
				count += 1
			if count > p:
				p = count
				index = i
		print(p + 1, index + 1)
main()


for T in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	left = False
	maxi = float('-inf')
	max_l = 0
	peaks = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks += 1
		if peaks > maxi:
			maxi = peaks
			maxi_l = 0
	if a[1] > a[0] and a[1] > a[2]:
		left = True
	for i in range(1, n - (k - 1)):
		if left:
			peaks -= 1
		if a[i + k - 1 - 1] > a[i + k - 1] and a[i + k - 1 - 1] > a[i + k - 1 - 1 - 1]:
			peaks += 1
		if peaks > maxi:
			maxi = peaks
			maxi_l = i
		if a[i + 1] > a[i] and a[i + 1] > a[i + 2]:
			left = True
		else:
			left = False
	print(maxi + 1, maxi_l + 1)


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = sys.stdin.readline
for tt in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			peak[i] = 1
	pref = list(peak)
	for i in range(n - 2, n - k - 1, -1):
		pref[i] += pref[i + 1]
	for i in range(n - k - 1, -1, -1):
		pref[i] += pref[i + 1] - peak[i + k]
	m = 0
	st = 1
	for i in range(n):
		temp = pref[i]
		if peak[i] == 1:
			temp -= 1
		if i + k - 1 < n and peak[i + k - 1] == 1:
			temp -= 1
		if temp > m:
			m = temp
			st = i + 1
	print(m + 1, st)


class SegmentTree:

	def __init__(self, data, default=0, func=max):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ind = []
	iset = set()
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			ind += [i]
			iset.add(i)
	p = [0] * n
	for i in range(n):
		if i in iset:
			p[i] = 1
	st = SegmentTree(p, func=lambda a, b: a + b)
	i = k - 1
	mx = st.query(i - (k - 1), i) - p[i] - p[i - (k - 1)]
	ans = 0
	ans2 = 0
	for i in range(k - 1, n):
		mx = max(mx, st.query(i - (k - 1), i) - p[i] - p[i - (k - 1)])
	for i in range(k - 1, n):
		if st.query(i - (k - 1), i) - p[i] - p[i - (k - 1)] == mx:
			ans = i - (k - 1) + 1
			ans2 = st.query(i - (k - 1), i) - p[i] - p[i - (k - 1)] + 1
			break
	print(ans2, ans)


R = lambda : map(int, input().split())
(t,) = R()
for _ in [0] * t:
	(n, k) = R()
	a = (*R(),)
	r = [0]
	for (x, y, z) in zip(a, a[1:], a[2:]):
		r += (r[-1] + (x < y > z),)
	(d, i) = max(((y - x, -i) for (x, y, i) in zip(r, r[k - 2:], range(n))))
	print(d + 1, 1 - i)


t = int(input())
for u in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	picks = [0] * n
	count = [0] * (n - k + 1)
	tmp = 0
	tmpact = [0, 1]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			picks[i] = 1
	for i in range(k - 1):
		if picks[i] == 1:
			tmp += 1
	count[0] = tmp
	for i in range(k, n):
		if picks[i - k + 1] == 1:
			tmp -= 1
		if picks[i - 1] == 1:
			tmp += 1
		count[i - k + 1] = tmp
	for i in range(n - k + 1):
		if count[i] > tmpact[0]:
			tmpact[1] = i + 1
			tmpact[0] = count[i]
	print(tmpact[0] + 1, tmpact[1])


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	l = 1
	pc = sum((1 for i in range(1, k - 1) if a[i - 1] < a[i] and a[i] > a[i + 1]))
	best = pc
	for i in range(k - 1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			pc += 1
		i = i - k + 2
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			pc -= 1
		if pc > best:
			best = pc
			l = i + 1
		assert pc >= 0
	print(best + 1, l)


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	is_peak = [False] * n
	for i in range(1, min(n - 1, k - 1)):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			ans += 1
			is_peak[i] = True
	cur = ans
	ind = 0
	i = 1
	j = k - 1
	while j < n - 1:
		if is_peak[i]:
			cur -= 1
		if a[j - 1] < a[j] and a[j + 1] < a[j]:
			cur += 1
			is_peak[j] = True
		if cur > ans:
			ans = cur
			ind = i
		i += 1
		j += 1
	print(ans + 1, ind + 1)


import os
import sys
import math
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def seive(n):
	primes = [True] * (n + 1)
	ans = []
	for i in range(2, n):
		if not primes[i]:
			continue
		j = 2 * i
		while j <= n:
			primes[j] = False
			j += i
	for p in range(2, n + 1):
		if primes[p]:
			ans += [p]
	return ans

def factors(n):
	factors = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			if n // x == x:
				factors.append(x)
			else:
				factors.append(x)
				factors.append(n // x)
		x += 1
	return factors

def main():
	try:
		for _ in range(inp()):
			(n, k) = invr()
			a = inlt()
			(ans, idx) = (0, 1)
			l = 0
			r = l + k - 1
			i = l + 1
			temp = 0
			while i < r:
				if a[i - 1] < a[i] and a[i] > a[i + 1]:
					temp += 1
				i += 1
			if ans < temp:
				ans = temp
				idx = l + 1
			i = 2
			(l, r) = (1, k)
			temp = ans
			while r < n:
				if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
					temp -= 1
				if a[r - 1] > a[r] and a[r - 1] > a[r - 2]:
					temp += 1
				if temp > ans:
					ans = temp
					idx = i
				i += 1
				r += 1
			print(ans + 1, idx)
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


cases = int(input())
for t in range(cases):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = [0] * n
	c = []
	for i in range(1, n - 1):
		if a[i] - a[i - 1] > 0 and a[i] - a[i + 1] > 0:
			b[i] = 1
			c.append(i)
	for i in range(1, n):
		b[i] += b[i - 1]
	mp = 0
	l = 0
	if c:
		end = c[-1] + 1
		l = max(0, end - k + 1)
		mp = b[end] - b[l]
		for i in c[::-1][1:]:
			end = i + 1
			tl = max(0, end - k + 1)
			tmp = b[end] - b[tl]
			if tmp >= mp:
				l = tl
				mp = tmp
	print(mp + 1, l + 1)


res = []
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ml = 1
	curr = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			curr += 1
	m = curr
	for l in range(1, n - k + 1):
		if a[l] > a[l - 1] and a[l] > a[l + 1]:
			curr -= 1
		if a[l + k - 2] > a[l + k - 1] and a[l + k - 2] > a[l + k - 3]:
			curr += 1
		if curr > m:
			m = curr
			ml = l + 1
	res.append([m + 1, ml])
for i in res:
	print(*i)


t = int(input())
for q in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	lis = [0]
	t = 1
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			lis.append(lis[-1] + 1)
		else:
			lis.append(lis[-1])
	lis.append(lis[-1])
	ans = [1, 1]
	m = 0
	for i in range(n - k + 1):
		temp = lis[i + k - 1] - lis[i]
		if lis[i] > lis[i - 1]:
			temp -= 1
		if lis[i + k - 1] > lis[i + k - 2]:
			temp -= 1
		if temp > m:
			ans = [temp + 1, i + 1]
			m = temp
	print(*ans)


import sys
input = sys.stdin.readline
t = int(input())
while t != 0:
	t -= 1
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			p[i] = 1
	sua = [0] * n
	s = sum(p[1:k - 1])
	for j in range(n - k + 1):
		sua[j] = s
		s -= p[j + 1]
		s += p[j + k - 1]
	m = -1
	mi = -1
	for i in range(n):
		if sua[i] > m:
			m = sua[i]
			mi = i
	print(m + 1, mi + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	for i in range(1, n):
		peaks[i] += peaks[i - 1]
	ans = 0
	ll = 0
	i = 0
	rr = 0
	while i + k <= n:
		l = i
		r = i + k - 1
		summ = peaks[r - 1] - peaks[l]
		if summ > ans:
			ans = summ
			ll = l
			rr = r
		i += 1
	print(ans + 1, ll + 1)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]

def main():
	for _ in range(II()):
		(n, k) = MI()
		aa = LI()
		pp = [0] * n
		for i in range(1, n - 1):
			if aa[i - 1] < aa[i] > aa[i + 1]:
				pp[i] = 1
		s = sum(pp[1:k - 1])
		mx = s
		l = 0
		for i in range(1, n - k + 1):
			s += pp[i + k - 2] - pp[i]
			if s > mx:
				mx = s
				l = i
		print(mx + 1, l + 1)
main()


def solve(n, k, a):
	peakSet = set()
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peakSet.add(i)
	mem = [0] * n
	for peak in peakSet:
		mem[max(0, peak - k + 2)] += 1
		mem[peak] -= 1
	for i in range(1, n):
		mem[i] += mem[i - 1]
	ans = maxPeak = 0
	for i in range(n - k + 1):
		if mem[i] > maxPeak:
			maxPeak = mem[i]
			ans = i
	print(maxPeak + 1, ans + 1)

def main():
	t = int(input())
	for i in range(t):
		(n, k) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		solve(n, k, a)
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(_) for _ in input().split()]
	aa = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			aa[i] = 1
	num = 0
	for i in range(0, k):
		num += aa[i]
	numnum = num
	if aa[0] == 1:
		numnum -= 1
	if aa[k - 1] == 1:
		numnum -= 1
	max_num = numnum
	max_idx = 0
	for i in range(k, n):
		num = num + aa[i] - aa[i - k]
		numnum = num
		if aa[i - k + 1] == 1:
			numnum -= 1
		if aa[i] == 1:
			numnum -= 1
		if max_num < numnum:
			max_num = numnum
			max_idx = i - k + 1
	print(max_num + 1, max_idx + 1)


def peaks(a):
	yield False
	for i in range(1, len(a) - 1):
		yield (a[i] > a[i - 1] and a[i] > a[i + 1])
	yield False

def solve(a, k):
	peaks_of_a = list(peaks(a))
	curr_peaks = sum(peaks_of_a[1:k - 1])
	max_peaks = curr_peaks
	max_l = 0
	for i in range(1, len(a) - k + 1):
		if peaks_of_a[i]:
			curr_peaks -= 1
		if peaks_of_a[i + k - 2]:
			curr_peaks += 1
		if curr_peaks > max_peaks:
			max_peaks = curr_peaks
			max_l = i
	return (max_peaks + 1, max_l + 1)
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	print(' '.join(map(str, solve(a, k))))


import sys
input = lambda : sys.stdin.readline().rstrip()
inp = sys.stdin.buffer.readline

def I():
	return list(map(int, inp().split()))
for _ in range(I()[0]):
	(n, k) = I()
	a = I()
	peak = [0] * n
	flag = 0
	for i in range(len(a) - 1):
		if a[i + 1] > a[i]:
			flag = 1
			continue
		if flag == 1 and a[i] > a[i + 1]:
			peak[i] += 1
			flag = 0
	np = sum(peak[1:k - 1])
	l = 0
	maxx = np
	for i in range(1, n - k + 2):
		if np - peak[i] + peak[i + k - 2] > maxx:
			l = i
			maxx = max(maxx, np - peak[i] + peak[i + k - 2])
		np = np - peak[i] + peak[i + k - 2]
	print(maxx + 1, l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	for i in range(1, n - 1):
		peaks[i] += peaks[i - 1]
	ans = 0
	l = 0
	for i in range(n - k + 1):
		x = peaks[i + k - 2] - peaks[i]
		if x > ans:
			ans = x
			l = i
	print(ans + 1, l + 1)


def solve(n, k, a):
	p = [0] * (n + 1)
	ans = -1
	anst = 1
	for i in range(2, n):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = 1
		p[i] += p[i - 1]
	for i in range(1, n + 1):
		(l, r) = (i - k + 1, i)
		if l >= 1:
			s = p[r - 1] - p[l] + 1
			if s > ans:
				(ans, anst) = (s, l)
	print(ans, anst)

def main():
	inp = lambda : [int(x) for x in input().split()]
	tc = int(input())
	for _ in range(tc):
		(n, k) = inp()
		arr = [0] + inp()
		solve(n, k, arr)
main()


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			b[i + 1] = 1
	for i in range(1, n):
		b[i] = b[i] + b[i - 1]
	ma = 0
	l = 0
	for i in range(2, n - k + 3):
		if ma < b[i + k - 3] - b[i - 1]:
			ma = b[i + k - 3] - b[i - 1]
			l = i - 2
	print(ma + 1, l + 1)


from sys import stdin
number = int(stdin.readline().strip('\n'))
for j in range(number):
	(mountains_num, heart_length) = (int(value) for value in stdin.readline().strip('\n').split())
	array = [int(value) for value in stdin.readline().strip('\n').split()]
	tail_flag = 0
	head_flag = 1
	tail_pick = 0
	head_pick = 0
	max_picks = head_pick
	current_picks = head_pick
	pos = 0
	for i in range(mountains_num):
		if head_flag - tail_flag + 1 >= heart_length:
			tail_flag += 1
			head_flag += 1
			current_picks -= tail_pick
		else:
			head_flag += 1
		if head_flag == mountains_num:
			break
		if head_flag - tail_flag >= 2:
			if array[head_flag - 1] > array[head_flag] and array[head_flag - 1] > array[head_flag - 2]:
				current_picks += 1
			if array[tail_flag + 1] > array[tail_flag] and array[tail_flag + 1] > array[tail_flag + 2]:
				tail_pick = 1
			else:
				tail_pick = 0
			if current_picks > max_picks:
				max_picks = current_picks
				pos = tail_flag
	print(max_picks + 1, pos + 1)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1]:
			if a[i] > a[i + 1]:
				peaks[i] = 1
	(l, p) = (0, 0)
	sums = [0] * n
	s = 0
	for i in range(1, n):
		if peaks[i]:
			s = s + 1
		sums[i] = s
	for i in range(0, n - k + 1):
		temp = sums[i + k - 1] - sums[i]
		if peaks[i + k - 1]:
			temp = temp - 1
		if p < temp:
			l = i
			p = temp
	print(p + 1, l + 1)


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

def gift():
	for _ in range(t):
		(n, k) = list(map(int, input().split()))
		mounts = list(map(int, input().split()))
		peak = [0] * n
		for i in range(1, n - 1):
			if mounts[i] > mounts[i - 1] and mounts[i] > mounts[i + 1]:
				peak[i] = 1
		fk = sum(peak[1:k - 1])
		ans = 1
		fktemp = fk
		for i in range(1, n - k + 1):
			fiip = peak[i - 1]
			fii = peak[i]
			fikp = peak[k + i - 2]
			fik = peak[k + i - 1]
			fktemp += fikp - fii
			if fktemp > fk:
				ans = i + 1
				fk = fktemp
		yield (str(fk + 1) + ' ' + str(ans))
t = int(input())
ans = gift()
print(*ans, sep='\n')


t = int(input())
while t:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0 for i in range(n)]
	c = 0
	m = 0
	l = 0
	for i in range(2, n):
		if a[i - 1] > a[i] and a[i - 1] > a[i - 2]:
			b[i - 1] = 1
			c += 1
		else:
			b[i] = 0
		if i >= k:
			c -= b[i - k + 1]
		if c > m:
			m = c
			l = max(0, i - k + 1)
	print(m + 1, l + 1)
	t -= 1


for _ in range(int(input())):
	(n, k) = [int(i) for i in input().split()]
	k = k - 1
	array = [int(i) for i in input().split()]
	maxCount = 0
	index = -1
	parts = 0
	start = 0
	end = 0
	count = 0
	flag = True
	while start != n - 2:
		if end > k:
			if array[end] < array[end - 1] and array[end - 1] > array[end - 2] and flag:
				if end == n - 1:
					flag = False
				count += 1
			if start < n - 2:
				start += 1
				if array[start] > array[start - 1] and array[start] > array[start + 1]:
					count -= 1
			if maxCount < count:
				maxCount = count
				parts = count + 1
				index = start + 1
			if end < n - 1:
				end += 1
		else:
			if end == k:
				for x in range(1, len(array[start:end + 1]) - 1):
					if array[x] > array[x - 1] and array[x] > array[x + 1]:
						count += 1
						maxCount = count
						parts = count + 1
						index = start + 1
			end += 1
			if end == n:
				break
	parts = parts if index != -1 else 1
	index = index if index != -1 else 1
	print(f'{parts} {index}')


t = int(input())
for test in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	peaks = set()
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks.add(i)
	till = [0] * n
	x = 0
	for i in range(n - 1, -1, -1):
		if i in peaks:
			x += 1
		till[i] = x
	ans = []
	for i in range(n):
		if i + k - 1 < n:
			c = till[i] - till[i + k - 1]
			if i in peaks:
				c -= 1
			ans.append((c, i + 1))
		else:
			break
	ans.sort(key=lambda x: (-x[0], x[1]))
	print(ans[0][0] + 1, ans[0][1])


for t in range(int(input())):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	l = 0
	r = l + k - 1
	idx = 0
	t = 0
	ans = 0
	for i in range(1, r):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			t = t + 1
	ans = t
	r += 1
	l += 1
	while r < n:
		if a[l - 1] < a[l] and a[l] > a[l + 1]:
			t -= 1
		if a[r - 1] > a[r] and a[r - 1] > a[r - 2]:
			t += 1
		if ans < t:
			ans = t
			idx = l
		l += 1
		r += 1
	print(str(ans + 1) + ' ' + str(idx + 1))


t = int(input())
for ii in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().rstrip().split()))
	peak = 0
	maxi = 0
	start = 0
	peaki = [0] * n
	piche = 1
	for i in range(1, k - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			peaki[i] += 1
			peak += 1
		if peak > 0:
			end = i
	maxi = max(maxi, peak)
	for i in range(k - 1, n - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			peaki[i] += 1
			peak += 1
		if peaki[piche] == 1:
			peak -= 1
		if peak > maxi:
			maxi = max(maxi, peak)
			start = piche
		piche += 1
	print(maxi + 1, start + 1)


for _ in range(int(input())):
	(n, k) = tuple(map(int, input().split()))
	arr = list(map(int, input().split()))
	peaks = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks[i] = 1
	cnt = 0
	max_peaks = 0
	answer = 0
	for i in range(k - 1):
		cnt += peaks[i]
		max_peaks += peaks[i]
	for i in range(k - 1, n - 1):
		cnt -= peaks[i - k + 2]
		cnt += peaks[i]
		if cnt > max_peaks:
			max_peaks = cnt
			answer = i - k + 2
	print(max_peaks + 1, answer + 1)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
from queue import PriorityQueue
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	cnt = 0
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			cnt += 1
	i = 1
	j = k
	maxi = cnt
	index = 0
	while j < n:
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			cnt -= 1
		z = j - 1
		if l[z] > l[z - 1] and l[z] > l[z + 1]:
			cnt += 1
		z = maxi
		maxi = max(cnt, maxi)
		if maxi != z:
			index = i
		i += 1
		j += 1
	print(maxi + 1, index + 1)


def f(l, k):
	maxPeakCount = 0
	maxPeakLeftIndex = 0
	leftIndex = 0
	rightIndex = leftIndex + k - 1
	currPeakCount = 0
	peakSet = set()
	index = leftIndex + 1
	while index < len(l):
		if index >= rightIndex:
			if currPeakCount > maxPeakCount:
				maxPeakCount = currPeakCount
				maxPeakLeftIndex = leftIndex
			if index == len(l) - 1:
				break
			leftIndex += 1
			rightIndex += 1
			if leftIndex in peakSet:
				currPeakCount -= 1
		if l[index] > l[index + 1] and l[index] > l[index - 1]:
			currPeakCount += 1
			peakSet.add(index)
		index += 1
	return (maxPeakCount + 1, maxPeakLeftIndex + 1)
t = int(input())
for _ in range(t):
	(_, k) = tuple(map(int, input().split()))
	l = list(map(int, input().split()))
	res = f(l, k)
	print(res[0], res[1])


for _ in range(int(input())):
	(t, b) = map(int, input().split())
	a = list(map(int, input().split()))
	v = [0]
	ans = 0
	for i in range(1, t - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			v.append(1)
		else:
			v.append(0)
	v.append(0)
	(out, ind) = (1, 1)
	for i in range(b - 1):
		out += v[i]
	mx = 1
	for k in range(b - 1, t):
		out -= v[k - b + 1]
		if out > mx:
			mx = out
			ind = k - b + 2
		out += v[k]
	print(mx, ind)


from sys import stdin
inp = stdin.readline
t = int(inp().strip())
for _ in range(t):
	(n, k) = [int(x) for x in inp().strip().split()]
	a = [int(x) for x in inp().strip().split()]
	answer = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			answer[i] = 1
	sums = [0] * n
	count = 0
	index = 0
	for j in range(n):
		if j >= k - 1:
			count -= answer[j - (k - 1)]
			sums[j - (k - 1)] = count
		count += answer[j]
	bestSum = 0
	for i in range(n):
		if sums[i] > bestSum:
			bestSum = sums[i]
			index = i
	print(bestSum + 1, index + 1)


import sys

class BNastyaAndDoor:

	def solve(self, tc=0):
		for _ in range(int(input())):
			(n, k) = [int(_) for _ in input().split()]
			a = [int(_) for _ in input().split()]
			pre = [0] * n
			for i in range(1, n - 1):
				if a[i] > a[i - 1] and a[i] > a[i + 1]:
					pre[i] = 1
			for i in range(n):
				pre[i] += pre[i - 1]
			ans = 0
			start = 0
			for i in range(k - 1, n):
				r = i - 1
				l = i - k + 1
				if pre[r] - pre[l] > ans:
					start = i - k + 1
					ans = pre[r] - pre[l]
			print(ans + 1, start + 1)
solver = BNastyaAndDoor()
input = sys.stdin.readline
solver.solve()


T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split())
	heights = list(map(int, input().split()))
	peaks = [0] * N
	for i in range(1, N - 1):
		if heights[i - 1] < heights[i] > heights[i + 1]:
			peaks[i] = 1
	curPeaks = peaks[1:K - 1].count(1)
	maxPeaks = curPeaks
	minL = 1
	for i in range(1, N - K + 1):
		curPeaks += peaks[i + K - 2] - peaks[i]
		if curPeaks > maxPeaks:
			minL = i + 1
			maxPeaks = curPeaks
	print(maxPeaks + 1, minL)


from math import ceil
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = [0 for i in range(n)]
	for i in range(1, n - 1):
		if l[i] > l[i + 1] and l[i] > l[i - 1]:
			p[i] = 1
	a = []
	c = 0
	for i in range(n):
		c += p[i]
		a.append(c)
	m = a[k - 2] - a[0]
	a1 = 0
	for i in range(1, n - k + 1):
		temp = a[i + k - 2] - a[i]
		if temp > m:
			m = temp
			a1 = i
	print(m + 1, a1 + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a1 = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			a1[i] += 1
	for i in range(1, n):
		a1[i] += a1[i - 1]
	max_parts = -1
	min_r = -1
	a1 = [0] + a1
	for i in range(k, n + 1):
		if a1[i - 1] - a1[i + 1 - k] > max_parts:
			max_parts = a1[i - 1] - a1[i + 1 - k]
			min_r = i
	(print(max_parts + 1),)
	print(min_r - k + 1)


t = int(input())
for tt in range(t):
	(n, k) = [int(i) for i in str.split(input(), ' ')]
	a = [int(i) for i in str.split(input(), ' ')]
	peaks = []
	peaks.append(0)
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	accums = []
	ctr = 0
	for i in range(0, len(peaks)):
		accums.append(ctr + peaks[i])
		ctr += peaks[i]
	maxs = []
	max_val = 0
	max_pos = 0
	for i in range(0, len(accums) - k + 1):
		cur_max = accums[i + k - 1] - accums[i]
		if peaks[i]:
			cur_max -= 1
		if peaks[i + k - 1]:
			cur_max -= 1
		maxs.append(cur_max)
	print(max(maxs) + 1, maxs.index(max(maxs)) + 1)


t = int(input())
for tt in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	pks = 0
	b = False
	l = -1
	peaks = []
	if n == k:
		for i in range(1, n - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				pks += 1
		print(pks + 1, 1)
	else:
		pks = 0
		for i in range(1, k - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				pks += 1
		peaks.append(pks)
		pks = 0
		for i in range(1, len(a) - k + 1):
			pks = peaks[-1]
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				pks -= 1
			if a[i + k - 2] > a[i + k - 1] and a[i + k - 2] > a[i + k - 3]:
				pks += 1
			peaks.append(pks)
		max1 = -1
		maxi = 0
		for i in range(len(peaks)):
			if peaks[i] > max1:
				max1 = peaks[i]
				maxi = i + 1
		print(max1 + 1, maxi)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().split()]

def st():
	return input()

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	(n, k) = li()
	l = li()
	curr = 0
	dp = [0] * n
	for i in range(1, n - 1):
		dp[i] = 1 if l[i] > l[i - 1] and l[i] > l[i + 1] else 0
	ans = {}
	count = 1
	s = sum(dp[:k - 1])
	ans[s] = 1
	for i in range(k - 1, n - 1):
		count += 1
		s -= dp[i - (k - 1) + 1]
		s += dp[i]
		if s not in ans:
			ans[s] = count
	print(max(ans) + 1, ans[max(ans)])


from _collections import deque
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = deque([])
	ma = 0
	ans = 0
	i = 1
	while i < n:
		while i < n and a[i] < a[i - 1]:
			i += 1
		while i < n and a[i] > a[i - 1]:
			i += 1
		if i < n and a[i] < a[i - 1]:
			if not b or i + 2 - b[0] <= k:
				b.append(i - 1)
			else:
				b.popleft()
				b.append(i - 1)
			if len(b) > ma:
				ans = b[-1]
				ma = len(b)
	print(ma + 1, max(ans - k + 3, 1))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	max_l = 0
	cum = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			cum[i] += 1
	max_peak_counter = sum(cum[:k - 1]) + 1
	ans = max_peak_counter
	for i in range(k, len(cum)):
		ans += cum[i - 1]
		ans -= cum[i - k + 1]
		if ans > max_peak_counter:
			max_peak_counter = ans
			max_l = i - k + 1
	print(max_peak_counter, max_l + 1)


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	h = [int(x) for x in input().split()]
	peak = [0] * (n + 1)
	for i in range(1, n - 1):
		if h[i - 1] < h[i] and h[i] > h[i + 1]:
			peak[i + 1] = 1
	for i in range(1, n + 1):
		peak[i] += peak[i - 1]
	start = 1
	cmax = 0
	left = 1
	while True:
		end = start + k - 1
		if end > n:
			break
		diff = peak[end - 1] - peak[start]
		if cmax < diff:
			cmax = diff
			left = start
		start += 1
	print(cmax + 1, left)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	m = list(map(int, input().split()))
	c = [0] * len(m)
	h = [0] * len(m)
	for i in range(1, len(m) - 1):
		if m[i] > m[i - 1] and m[i] > m[i + 1]:
			c[i] += c[i - 1] + 1
			h[i] += 1
		else:
			c[i] += c[i - 1]
	c[-1] = c[-2]
	max = -1
	bi = -1
	i = 0
	for i in range(len(c) - (k - 1)):
		if c[i + k - 2] - c[i] - h[i] > max:
			max = c[i + k - 2] - c[i] - h[i]
			bi = i
	print(max + 1, bi + 1)


ans = []
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	u = list(map(int, input().split()))
	cur = 0
	a = 0
	for i in range(1, k - 1):
		if u[i - 1] < u[i] > u[i + 1]:
			cur += 1
	mcur = cur
	for i in range(k, n):
		if u[i - k] < u[i - k + 1] > u[i - k + 2]:
			cur -= 1
		if u[i - 2] < u[i - 1] > u[i]:
			cur += 1
		if cur > mcur:
			a = i - k + 1
			mcur = cur
	ans.append(str(mcur + 1) + ' ' + str(a + 1))
print('\n'.join(ans))


N = int(input())
for i in range(N):
	h = list(map(int, input().rstrip().split()))
	[n, k] = h
	a = list(map(int, input().rstrip().split()))
	peak = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak[i] = 1
	npeak = sum(peak[1:k - 1])
	maxpeak = npeak
	maxl = 1
	for i in range(k - 1, n - 1):
		npeak += peak[i]
		npeak -= peak[i - (k - 1) + 1]
		if npeak > maxpeak:
			maxpeak = npeak
			maxl = i + 1 - (k - 1) + 1
	print(maxpeak + 1, maxl)


t = int(input())
while t:
	arr = []
	(n, k) = [int(x) for x in input().split()]
	arr = [int(i) for i in input().split()]
	hash = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			hash[i] = 1
	local_sum = 0
	index = 0
	for i in range(0, k - 1):
		local_sum = local_sum + hash[i]
	maxPeaks = local_sum
	L = index
	for i in range(k, n):
		index = i - k + 1
		local_sum = local_sum - hash[index] + hash[i - 1]
		if local_sum > maxPeaks:
			maxPeaks = local_sum
			L = index
	print(maxPeaks + 1, ' ', L + 1)
	t = t - 1


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = dict()
	d[0] = 0
	result = 0
	for i in range(1, len(l) - 1):
		if l[i] > l[i + 1] and l[i] > l[i - 1]:
			result += 1
			d[i] = result
		else:
			d[i] = result
	d[len(l) - 1] = result
	(i, j) = (0, k - 1)
	r = []
	if d[j] == d[j - 1]:
		a = d[j]
	else:
		a = d[j] - 1
	x = (a, i)
	r.append(x)
	i += 1
	j += 1
	while j < len(l):
		if d[j] == d[j - 1]:
			a = d[j]
		else:
			a = d[j] - 1
		if d[i] == d[i + 1]:
			b = d[i]
		else:
			b = d[i]
		x = (a - b, i)
		r.append(x)
		i += 1
		j += 1
	r = sorted(r, reverse=True)
	(pieces, left) = (r[0][0], r[0][1])
	for (i, j) in r:
		if i == pieces and left > j:
			left = j
	print(pieces + 1, left + 1)


def isPeak(arr, n, num, i, j):
	if i >= 0 and arr[i] > num:
		return False
	if j < n and arr[j] > num:
		return False
	return True
t = int(input())
for _ in range(t):
	(n, rl) = map(int, input().split())
	arr = list(map(int, input().split()))
	fpeaks = [0] * n
	for i in range(1, n - 1):
		if isPeak(arr, n, arr[i], i - 1, i + 1):
			fpeaks[i] = 1
	(currmax, maxsofar, length) = (0, 0, 0)
	sumarr = [[0, sum(fpeaks[:rl]) - fpeaks[0] - fpeaks[rl - 1]]]
	maxsofar = 0
	for i in range(1, n - rl + 1):
		tempsum = sumarr[i - 1][1]
		sumarr.append([i, tempsum + fpeaks[i + rl - 2] - fpeaks[i]])
	res = 0
	for (idx, each) in enumerate(sumarr):
		if each[1] > maxsofar:
			res = idx
			maxsofar = each[1]
	print(maxsofar + 1, res + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	pref = [0] * n
	curr = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			curr += 1
		pref[i] = curr
	pref[-1] = curr
	best = 0
	bestl = 0
	for i in range(0, n - k + 1):
		if pref[i + k - 2] - pref[i] > best:
			best = pref[i + k - 2] - pref[i]
			bestl = i
	print(best + 1, bestl + 1)


from sys import stdin, stdout
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	mx = -1
	ind = -1
	cn = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			cn += 1
	mx = cn
	ind = 1
	for j in range(k - 1, n - 1):
		u = j - k + 2
		if a[u] > a[u - 1] and a[u] > a[u + 1]:
			cn -= 1
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			cn += 1
		if cn > mx:
			mx = cn
			ind = j - k + 3
	stdout.write(str(mx + 1) + ' ' + str(ind) + '\n')


from collections import deque
t = int(input())
rez = []
for i in range(t):
	A = input().split(' ')
	n = int(A[0])
	k = int(A[1])
	a = input().split(' ')
	for j in range(n):
		a[j] = int(a[j])
	dek = deque()
	st = []
	st.append(0)
	l = 0
	tt = 0
	for j in range(1, k - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			st[0] += 1
			dek.append(j)
	if st[0] > tt:
		tt = st[0]
		l = 0
	for j in range(1, n - k + 1):
		st.append(st[j - 1])
		if len(dek) != 0:
			pik = dek[0]
			if pik == j:
				st[j] -= 1
				dek.popleft()
		if a[j + k - 2] > a[j + k - 3] and a[j + k - 2] > a[j + k - 1]:
			dek.append(j + k - 2)
			st[j] += 1
		if st[j] > tt:
			tt = st[j]
			l = j
	rez.append(str(tt + 1) + ' ' + str(l + 1))
for i in range(t):
	print(rez[i])


def solution():
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	a = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			a[i] = 1
	l1 = 0
	r = l1 + k - 1
	cnt = 0
	i = 0
	j = 0
	ans = []
	while i < n and j < n:
		while i < k - 2:
			if a[i] == 1:
				cnt += 1
			i += 1
		cnt -= a[j]
		cnt += a[i]
		ans.append((cnt, j))
		j += 1
		i += 1
	ans.sort()
	ans.reverse()
	m = ans[0][1]
	for i in range(len(ans)):
		if ans[i][0] == ans[0][0]:
			m = min(ans[i][1], m)
	print(ans[0][0] + 1, m + 1)
for _ in range(int(input())):
	solution()


for i in range(int(input())):
	(n, k) = input().split(' ')
	(n, k) = (int(n), int(k))
	A = input().split(' ')
	for i in range(n):
		A[i] = int(A[i])
	B = [0] * n
	for i in range(1, n - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			B[i] = 1
	l = 1
	t = sum(B[l:k + l - 2])
	s = sum(B[l:k + l - 2])
	for j in range(2, n - k + +2):
		s = s - B[j - 1] + B[j + k - 3]
		if t < s:
			t = s
			l = j
	print(t + 1, l)


t = int(input())
for pp in range(0, t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	md = {}
	for i in range(0, n):
		if i == 0 or i == n - 1:
			md[i] = 0
		else:
			ele = arr[i]
			prev = arr[i - 1]
			nxt = arr[i + 1]
			if prev < ele and ele > nxt:
				md[i] = 1
			else:
				md[i] = 0
	ans = 0
	dp = [0 for x in range(0, n)]
	c = 0
	for i in range(0, 0 + k):
		if not (i == 0 or i == 0 + k - 1):
			if md[i] == 1:
				c = c + 1
	prev = 0
	dp[0] = c
	for i in range(1, n):
		if i + k - 1 < n:
			prev = dp[i - 1]
			if md[i] == 1:
				prev = prev - 1
			if md[i + k - 2] == 1:
				prev = prev + 1
		dp[i] = prev
	count = max(dp) + 1
	index = dp.index(count - 1)
	print(count, end=' ')
	print(index + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	aa = list(map(int, input().split()))
	tot = 0
	ind = 1
	for i in range(1, k - 1):
		if aa[i] > aa[i - 1] and aa[i] > aa[i + 1]:
			tot += 1
	ma = tot + 1
	for i in range(1, n):
		if i + k - 1 >= n:
			continue
		if aa[i] > aa[i - 1] and aa[i] > aa[i + 1]:
			tot -= 1
		if aa[i + k - 2] > aa[i + k - 3] and aa[i + k - 2] > aa[i + k - 1]:
			tot += 1
		if tot + 1 > ma:
			ma = tot + 1
			ind = i + 1
	print(ma, ind)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	f = [0] * n
	for i in range(n):
		if i != 0:
			f[i] = f[i - 1]
			if i != n - 1 and a[i] > a[i - 1] and (a[i] > a[i + 1]):
				f[i] += 1
	(res, l) = (-1, 0)
	for i in range(n - k + 1):
		g = f[i + k - 2] - f[i]
		if g > res:
			res = g
			l = i + 1
	print(res + 1, l)


n = int(input())
for i in range(n):
	(n, k) = map(int, input().split())
	b = list(map(int, input().split()))
	d = dict()
	j = 1
	p = 0
	a = [0] * (n + 1)
	while j < n - 1:
		if b[j] == max(b[j - 1], b[j], b[j + 1]):
			d[b[j]] = 1
			p += 1
		else:
			d[b[j]] = 0
		a[j] = p
		j += 1
	j = n - k
	m = -1
	l = 0
	d = 0
	while j >= 0:
		r = a[j + k - 2] - a[j]
		if r >= m:
			m = r
			d = j
			l = r + 1
		j += -1
	print(l, d + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	peaks = 0
	for i in range(1, k - 1):
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			peaks += 1
	ind = 0
	mp = peaks
	for i in range(k - 1, n - 1):
		l = i - k + 2
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			peaks += 1
		if A[l - 1] < A[l] and A[l] > A[l + 1]:
			peaks -= 1
		if peaks > mp:
			mp = peaks
			ind = l
	print(mp + 1, ind + 1)


outputs = []
for __ in range(int(input())):
	(N, K) = (int(num) for num in input().split())
	A = [int(num) for num in input().split()]
	d = {}
	for i in range(1, K - 1):
		if A[i] > A[i + 1] and A[i] > A[i - 1]:
			d[1] = d.get(1, 0) + 1
	last = K - 1
	for i in range(2, 2 + N - K):
		if A[i - 1] > A[i] and A[i - 1] > A[i - 2]:
			d[i] = d.get(i - 1, 0) - 1
		elif d.get(i - 1, -1) == -1:
			pass
		else:
			d[i] = d.get(i - 1)
		if A[last] > A[last - 1] and A[last] > A[last + 1]:
			d[i] = d.get(i, 0) + 1
		last += 1
	if len(d.keys()) == 0:
		outputs.append('1 1')
	else:
		req = sorted(d.keys(), key=lambda t: (d[t], -1 * t), reverse=True)
		outputs.append(f'{d[req[0]] + 1} {req[0]}')
for output in outputs:
	print(output)


numTest = int(input())

def test():
	(n, k) = list(map(int, input().split(' ')))
	data = list(map(int, input().split(' ')))
	peaks = [0]
	for i in range(1, n - 1):
		if data[i] > data[i - 1] and data[i] > data[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	parts = []
	counter = 0
	for i in range(0, n):
		if i >= k - 1:
			counter -= peaks[i - k + 1]
			parts.append(counter)
		counter += peaks[i]
	maxVal = max(parts)
	print(maxVal + 1, parts.index(maxVal) + 1)
for _ in range(0, numTest):
	test()


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	index = [0] * n
	i = 0
	for i in range(1, len(arr) - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			index[i] = 1
	t = sum(index[1:k - 1])
	s = t
	ind = 0
	for i in range(1, n - k + 1):
		s -= index[i] - index[k - 2 + i]
		if s > t:
			t = s
			ind = i
	print(t + 1, ind + 1)


import sys
from math import inf

def noop(*object):
	return

def main():
	T = read_int()
	for case_idx in range(T):
		ans = solve_case()
		sys.stdout.write('{}\n'.format(ans))

def solve_case():
	(n, k) = read_int_list()
	a = read_int_list()
	a = [inf] + a + [inf]
	peaks_before = [0] * (n + 2)
	for i in range(1, n + 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			peaks_before[i + 1] = peaks_before[i] + 1
		else:
			peaks_before[i + 1] = peaks_before[i]
	ans_l = 1
	ans_peaks = 0
	for l in range(1, n + 1):
		r = min(l + k, n + 1)
		peaks = peaks_before[r - 1] - peaks_before[l + 1]
		if peaks > ans_peaks:
			ans_peaks = peaks
			ans_l = l
	return '{} {}'.format(ans_peaks + 1, ans_l)

def read_str():
	return input()

def read_int():
	return int(input())

def read_str_list():
	return input().split(' ')

def read_int_list():
	return list(map(int, input().split(' ')))

def read_lines(n, read_func):
	return [read_func() for _ in range(n)]

def list_to_str(l, sep=' '):
	return sep.join(map(str, l))
l2s = list_to_str

def make_list(shape, value=None):
	if len(shape) == 1:
		return [value] * shape[0]
	return [make_list(shape[1:], value) for _ in range(shape[0])]
sys.setrecursionlimit(1000000)
main()


def main():
	(n, k) = map(int, input().split())
	lst = list(map(int, input().split()))
	picks = []
	max_item = 0
	for i in range(1, n - 1):
		if lst[i - 1] < lst[i] and lst[i] > lst[i + 1]:
			picks.append(i + 1)
	if len(picks) == 0:
		print(1, 1)
		return
	picked = [[picks[0], 0]]
	to_del = 0
	mx = 0
	for i in range(len(picks)):
		for r in range(picked[-1][1] + 1, len(picks)):
			if picks[r] <= picks[i] + k - 3:
				picked.append([picks[r], r])
			else:
				break
		cur = len(picked) - i
		if mx < cur:
			max_item = picked[-1][0]
			mx = cur
	print(mx + 1, max(1, max_item - k + 2))
t = int(input())
for i in range(t):
	main()


def main_function():
	from sys import stdin
	from sys import stdout
	input = stdin.readline
	print = stdout.write
	t = int(input())
	for _ in range(t):
		(n, k) = list(map(int, input().split()))
		mountains = list(map(int, input().split()))
		picks = [0] * n
		for i in range(1, n - 1):
			if mountains[i - 1] < mountains[i] > mountains[i + 1]:
				picks[i] = 1
		current_sum = sum(picks[1:k - 1])
		max_parts = current_sum
		ix_max_parts = 0
		for i in range(1, n - k + 1):
			current_sum -= picks[i]
			current_sum += picks[i + k - 2]
			if current_sum > max_parts:
				max_parts = current_sum
				ix_max_parts = i
		print(f'{max_parts + 1} {ix_max_parts + 1}\n')
main_function()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	d = dict()
	i = 0
	c = 0
	while i <= k - 1:
		if i == 0 or i == n - 1 or i == k - 1:
			pass
		elif a[i] > a[i - 1] and a[i] > a[i + 1]:
			c += 1
		i += 1
	d[0] = c
	l = 1
	r = k
	ind = 0
	pieces = 0
	if pieces < c:
		pieces = c
		ind = 0
	while r < n:
		if a[l] > a[l - 1] and a[l] > a[l + 1]:
			c -= 1
		if a[r - 1] > a[r - 2] and a[r - 1] > a[r]:
			c += 1
		d[l] = c
		if pieces < c:
			pieces = c
			ind = l
		l += 1
		r += 1
	print(pieces + 1, ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	counter = 0
	l = 0
	j = 1
	back = 1
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			counter += 1
	count = counter
	for i in range(k - 1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			count += 1
		if arr[back] > arr[back - 1] and arr[back] > arr[back + 1]:
			count -= 1
		if count > counter:
			counter = count
			j = back + 1
		back += 1
	print(counter + 1, j)


from collections import deque
t = int(input())

def sol():
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = deque()
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.append(i)
	pM = len(peaks)
	l = 0
	for i in range(k, n):
		if peaks and peaks[0] == i - k + 1:
			peaks.popleft()
		if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
			peaks.append(i - 1)
		if len(peaks) > pM:
			pM = len(peaks)
			l = i - k + 1
	return (pM + 1, l + 1)
for i in range(t):
	(u, v) = sol()
	print(u, v)


t = input()
for _ in range(int(t)):
	(n, k) = map(int, input().split())
	a = input().split()
	pref = [0] * n
	ispeak = [0] * n
	a = [int(i) for i in a]
	for i in range(1, n - 1):
		pref[i] = pref[i - 1]
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			pref[i] += 1
			ispeak[i] = 1
	pref[n - 1] = pref[n - 2]
	ans = 0
	for i in range(0, n - k + 1):
		peaks = pref[i + k - 1] - pref[i] - ispeak[i + k - 1]
		ans = max(ans, peaks)
	for i in range(0, n - k + 1):
		if pref[i + k - 1] - pref[i] - ispeak[i + k - 1] == ans:
			l = i + 1
			break
	print(f'{ans + 1} {l}')


import bisect
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq as hq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
for _ in range(iinput()):
	(n, k) = rinput()
	a = rlinput()
	peaks = [0] * (n + 1)
	for i in range(2, n):
		if a[i - 2] < a[i - 1] > a[i]:
			peaks[i] = 1
	for i in range(2, n):
		peaks[i] += peaks[i - 1]
	d = defaultdict(list)
	d[peaks[k - 1]].append(1)
	for i in range(2, n + 1):
		try:
			d[peaks[i + k - 2] - peaks[i]].append(i)
		except Exception:
			break
	mx = max(d.keys())
	print(mx + 1, min(d[mx]))


cases = int(input())
for t in range(cases):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	t = 0
	u = set()
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			u.add(i)
	v = 0
	for i in range(1, k - 1):
		v += int(i in u)
	maxi = v
	mid = 0
	for i in range(n - k + 1):
		v -= int(i + 1 in u)
		v += int(i + k - 1 in u)
		if v > maxi:
			maxi = v
			mid = i + 1
	print(maxi + 1, mid + 1)


from sys import stdin
for j in range(int(stdin.readline())):
	[n, k] = [int(x) for x in stdin.readline().split()]
	a = [int(x) for x in stdin.readline().split()]
	b = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b.append(1)
		else:
			b.append(0)
	b.append(0)
	l = 0
	t = sum(b[1:k - 1])
	s = sum(b[1:k - 1])
	for i in range(1, n - k + 1):
		s = s - b[i] + b[k - 2 + i]
		if s > t:
			t = s
			l = i
	print(t + 1, l + 1)


t = int(input())
while t > 0:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	dp = [0] * (n + 1)
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			dp[i] = dp[i - 1] + 1
		else:
			dp[i] = dp[i - 1]
	dif = 0
	s = 0
	for i in range(n):
		if i + k - 1 > n - 1:
			break
		if dp[i + k - 1 - 1] - dp[i] > dif:
			dif = dp[i + k - 1 - 1] - dp[i]
			s = i
	print(dif + 1, s + 1)
	t -= 1


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	A = list(map(int, input().strip().split()))
	peaks = []
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			peaks.append(i)
	(NosMax, lmin) = (-1, 0)
	(Nos, SetPeaks) = (0, [])
	t1 = 0
	for i in range(n - k + 1):
		strt = i
		last = strt + k - 1
		if i == 0:
			for j in range(len(peaks)):
				if peaks[j] > strt and peaks[j] < last:
					Nos += 1
					SetPeaks.append([peaks[j], j])
					t1 += 1
				if peaks[j] >= last:
					break
		else:
			if len(SetPeaks) != 0:
				if strt == SetPeaks[0][0]:
					SetPeaks.remove(SetPeaks[0])
					Nos -= 1
			if len(peaks) > t1:
				if last - 1 == peaks[t1]:
					SetPeaks.append([last - 1, t1])
					t1 += 1
					Nos += 1
		if Nos > NosMax:
			lmin = strt
			NosMax = Nos
	print(NosMax + 1, lmin + 1)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def check(n, k, A):
	s = 0
	cur_peaks = 0
	M = 0
	l = 0
	for e in range(0, n):
		if e - s + 1 < k + 1:
			if e - 1 > 0 and A[e - 1] > A[e - 2] and (A[e - 1] > A[e]):
				cur_peaks += 1
				M = cur_peaks
			continue
		if A[s] < A[s + 1] and A[s + 1] > A[s + 2]:
			cur_peaks -= 1
		if A[e - 2] < A[e - 1] and A[e - 1] > A[e]:
			cur_peaks += 1
		s += 1
		if cur_peaks > M:
			M = cur_peaks
			l = s
	return (M + 1, l)

def from_file(f):
	return f.readline
t = inp()
for _ in range(t):
	(n, k) = invr()
	A = inlt()
	(t, l) = check(n, k, A)
	print(f'{t} {l + 1}')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peak = [0 for i in range(n)]
	v = [False] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i + 1] and arr[i] > arr[i - 1]:
			peak[i] = peak[i - 1] + 1
			v[i] = True
		else:
			peak[i] = peak[i - 1]
	peak[n - 1] = peak[n - 2]
	ans = 0
	ind = 0
	for i in range(n - k + 1):
		if v[i + k - 1] == True:
			var = peak[i + k - 1] - peak[i] - 1
		else:
			var = peak[i + k - 1] - peak[i]
		if var > ans:
			ans = var
			ind = i
	print(ans + 1, ind + 1)


from collections import defaultdict
for _ in range(int(input())):
	dc = defaultdict(int)
	(n, k) = map(int, input().split())
	ar = [int(x) for x in input().split()]
	ct = 0
	l = 0
	mx = 0
	for i in range(1, k):
		if i != k - 1:
			if ar[i] > ar[i - 1] and ar[i] > ar[i + 1]:
				dc[i] = 1
				ct += 1
	j = 0
	mx = ct
	for i in range(k - 1, n - 1):
		if ar[i] > ar[i - 1] and ar[i] > ar[i + 1]:
			ct += 1
			dc[i] = 1
		j += 1
		if dc[j] == 1:
			dc[j] = 0
			ct -= 1
		if mx < ct:
			l = j
			mx = ct
	print(mx + 1, l + 1)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def intersection(l1, r1, l2, r2):
	if l1 <= l2:
		if l2 <= r1:
			return True
		else:
			return False
	elif l1 <= r2:
		return True
	else:
		return False

def s(n):
	return n * (n + 1) // 2
t = I()
for _ in range(t):
	(n, k) = M()
	l = L()
	x = [0]
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			x.append(x[-1] + 1)
		else:
			x.append(x[-1])
	x.append(x[-1])
	ans = 0
	key = 1
	for i in range(n - k + 1):
		w = x[k + i - 2] - x[i]
		if w > ans:
			key = i + 1
			ans = w
	print(ans + 1, key)


t = int(input())
for x in range(t):
	(n, k) = list(map(int, input().split()))
	m = list(map(int, input().split()))
	peaks = [0] * n
	for x in range(1, n - 1):
		if m[x] > m[x + 1] and m[x] > m[x - 1]:
			peaks[x] += 1
	p = -1
	position = -1
	sums = [0] * (n + 1)
	sums[0] = 0
	sums[1] = peaks[0]
	for i in range(2, n + 1):
		sums[i] = peaks[i - 1] + sums[i - 1]
	for l in range(n - k + 1):
		ls = sums[l + k - 1] - sums[l + 1]
		if ls > p:
			position = l
			p = ls
	print(p + 1, position + 1, end=' ')
	print()


t = int(input())
for _t in range(t):
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	ans = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			ans[i] = 1
	tmp = [ans[0]]
	for a in ans[1:]:
		tmp += [tmp[-1] + a]
	(i, maxs) = (0, -1)
	while i + k - 2 < n:
		if tmp[i + k - 2] - tmp[i] > maxs:
			maxs = tmp[i + k - 2] - tmp[i]
		i += 1
	i = 0
	while i + k - 2 < n:
		if tmp[i + k - 2] - tmp[i] == maxs:
			print(maxs + 1, i + 1)
			break
		i += 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = []
	for i in range(n):
		if i == 0 or i == n - 1:
			peaks.append(0)
		elif arr[i - 1] < arr[i] > arr[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	(count, l, min_l, ans) = (peaks[:k].count(1) - peaks[k - 1], 0, 0, 0)
	ans = max(ans, count)
	for r in range(k, n):
		l += 1
		if peaks[l] == 1:
			count -= 1
		if peaks[r - 1] == 1:
			count += 1
		if ans < count:
			ans = count
			min_l = l
	print(ans + 1, min_l + 1)


from itertools import accumulate

class inp:

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def ilist():
		return list(map(int, input().split()))

	@staticmethod
	def imap():
		return map(int, input().split())

def main():
	t = inp.int()
	for _ in range(t):
		(n, k) = inp.imap()
		a = inp.ilist()
		peaks = list(accumulate([0] + [a[i - 1] < a[i] and a[i] > a[i + 1] for i in range(1, n - 1)] + [0]))
		np = -1
		l = -1
		for i in range(n):
			if i + k - 2 > n - 1:
				break
			pt = peaks[i + k - 2] - peaks[i]
			if pt > np:
				l = i
				np = pt
		print(np + 1, l + 1)
main()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	nums = list(map(int, input().split()))
	prefix = [0] * (len(nums) + 1)
	for i in range(1, len(nums) - 1):
		if nums[i] > nums[i - 1] and nums[i] > nums[i + 1]:
			prefix[i + 1] = 1
	prefix2 = prefix[:]
	for i in range(1, len(prefix2)):
		prefix2[i] += prefix2[i - 1]
	maxpeak = 0
	maxi = 0
	maxj = k - 1
	for j in range(k, len(prefix2)):
		if prefix[j] == 1 and prefix[j - k + 1] == 1:
			if prefix2[j] - prefix2[j - k] - 2 > maxpeak:
				maxpeak = prefix2[j] - prefix2[j - k] - 2
				maxj = j - 1
				maxi = j - k
		elif prefix[j] == 1 or prefix[j - k + 1] == 1:
			if prefix2[j] - prefix2[j - k] - 1 > maxpeak:
				maxpeak = prefix2[j] - prefix2[j - k] - 1
				maxj = j - 1
				maxi = j - k
		elif prefix2[j] - prefix2[j - k] > maxpeak:
			maxpeak = prefix2[j] - prefix2[j - k]
			maxj = j - 1
			maxi = j - k
	print(maxpeak + 1, maxi + 1)


import sys
input = sys.stdin.buffer.readline

def I():
	return list(map(int, input().split()))

def sieve(n):
	a = [1] * n
	for i in range(2, n):
		if a[i]:
			for j in range(i * i, n, i):
				a[j] = 0
	return a
for __ in range(int(input())):
	(n, k) = I()
	arr = I()
	peaks = [0] * (n + 1)
	p = [0] * n
	c = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i + 1] < arr[i]:
			peaks[i] = peaks[i - 1] + 1
			p[i] = 1
		else:
			peaks[i] = peaks[i - 1]
			p[i] = 0
	peaks[n - 1] = peaks[n - 2]
	m = 0
	idx = 0
	for i in range(n - k + 1):
		m_curr = peaks[k + i - 1] - peaks[i - 1]
		m_curr -= p[k + i - 1] + p[i]
		if m_curr > m:
			m = m_curr
			idx = i
	print(m + 1, idx + 1)


for q in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	k -= 2
	l_max = 1
	count = 0
	max_count = 0
	for i in range(1, k + 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			count += 1
	max_count = count
	for i in range(k + 1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			count += 1
		if a[i - k] > a[i - k - 1] and a[i - k] > a[i - k + 1]:
			count -= 1
		if count > max_count:
			l_max = i - k + 1
			max_count = count
	print(max_count + 1, l_max)


from sys import stdin, stdout
for testcases in range(int(stdin.readline())):
	(n, k) = map(int, stdin.readline().split())
	arr = list(map(int, stdin.readline().split()))
	maxPeaks = 0
	index = 0
	totalpeaks = 0
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			totalpeaks += 1
	maxPeaks = totalpeaks
	for i in range(k, n):
		p = totalpeaks
		if arr[i - k + 1] > arr[i - k] and arr[i - k + 1] > arr[i - k + 2]:
			p -= 1
		if arr[i - 1] > arr[i] and arr[i - 1] > arr[i - 2]:
			p += 1
		if p > maxPeaks:
			maxPeaks = p
			index = i - k + 1
		totalpeaks = p
	stdout.write(str(maxPeaks + 1) + ' ' + str(index + 1) + '\n')


import sys
input = sys.stdin.readline
t = int(input())
for i1 in range(t):
	(n, k) = list(map(int, input().split(' ')))
	l = list(map(int, input().split(' ')))
	pre = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i] > l[i + 1]:
			pre[i] = pre[i - 1] + 1
		else:
			pre[i] = pre[i - 1]
	pre[n - 1] = pre[n - 2]
	a1 = 0
	a2 = 0
	for i in range(n):
		left = i
		right = i + k - 1
		if right < n:
			z = pre[right - 1] - pre[left]
			if z > a1 and z != 0:
				a1 = z
				a2 = left
	print(a1 + 1, a2 + 1)


tc = int(input().strip())

def solve():
	(n, k) = map(int, input().strip().split())
	ll = list(map(int, input().strip().split()))
	peaks = [i != 0 and i != len(ll) - 1 and (ll[i - 1] < ll[i]) and (ll[i + 1] < ll[i]) for i in range(len(ll))]
	peaks_num = [0 for i in range(len(ll))]
	for i in range(len(ll)):
		if i != 0:
			peaks_num[i] += 1 if peaks[i - 1] else 0
			peaks_num[i] += peaks_num[i - 1]
	min_ind = 0
	max_peaks = 0
	for i in reversed(range(len(ll) - k + 1)):
		end_v = peaks_num[i + k - 1]
		start_v = peaks_num[i + 1]
		if max_peaks <= end_v - start_v:
			max_peaks = end_v - start_v
			min_ind = i
	print(max_peaks + 1, min_ind + 1)
for t in range(1, tc + 1):
	solve()


def main():
	t = int(input())
	for _ in range(t):
		(n, k) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		M = 0
		idx = 0
		peaks = set()
		for i in range(1, k - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				peaks.add(i)
				M += 1
		for j in range(k - 1, n):
			if j - k + 1 in peaks:
				peaks.remove(j - k + 1)
			if a[j - 1] > a[j - 2] and a[j - 1] > a[j]:
				peaks.add(j - 1)
			if len(peaks) > M:
				M = len(peaks)
				idx = j - k + 1
		print(M + 1, idx + 1)
main()


T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	B = [0 for i in range(n)]
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			B[i] = 1
	l = 1
	mp = 0
	for i in range(k - 1):
		if B[i] == 1:
			mp = mp + 1
	mp1 = mp
	for i in range(k - 1, n):
		mp1 = mp1 - B[i - k + 2] + B[i]
		if mp1 > mp:
			mp = mp1
			l = i - k + 3
	print(mp + 1, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] += 1
		b[i] += b[i - 1]
	(f1, f2) = (0, 0)
	for j in range(0, n - k + 1):
		t = b[j + k - 2] - b[j]
		l = j
		if t > f1:
			f1 = t
			f2 = l
	print(f1 + 1, f2 + 1)


n = int(input())
for ewr in range(n):
	(a, b) = list(map(int, input().split(' ')))
	temp = list(map(int, input().split(' ')))
	t1 = []
	t1.append(0)
	for i in range(1, a - 1):
		if temp[i] > temp[i - 1] and temp[i] > temp[i + 1]:
			t1.append(1)
		else:
			t1.append(0)
	t1.append(0)
	t2 = []
	t2.append(0)
	for i in range(1, a):
		if t1[i] == 1:
			t2.append(t2[i - 1] + 1)
		else:
			t2.append(t2[i - 1])
	max = 0
	ans = 0
	b -= 1
	sr = 0
	while b < a:
		if t2[b - 1] - t2[sr] > max:
			max = t2[b - 1] - t2[sr]
			ans = sr
		b += 1
		sr += 1
	print(max + 1, end=' ')
	print(ans + 1)


T = int(input())
for t in range(T):
	(n, k) = list(map(int, input().strip().split(' ')))
	heights = list(map(int, input().strip().split(' ')))
	peaks = [0 for _ in heights]
	for i in range(1, n - 1):
		peaks[i] = 1 if heights[i] > heights[i - 1] and heights[i] > heights[i + 1] else 0
	max_parts = 1
	left = -1
	for k_ in range(0, k - 1 - 1 + 1):
		max_parts += peaks[k_]
		left = 0
	curr_parts = max_parts
	for l in range(1, n):
		if l + k - 1 >= n:
			break
		curr_parts -= peaks[l]
		curr_parts += peaks[l + k - 1 - 1]
		if curr_parts > max_parts:
			left = l
			max_parts = curr_parts
	print(max_parts, left + 1)


import sys
input = sys.stdin.readline
from collections import defaultdict as dd
t = int(input())
while t:
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	pre = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			pre[i + 1] = 1
	for i in range(1, n):
		pre[i] = pre[i] + pre[i - 1]
	i = 0
	j = k - 1
	mx = 0
	ll = 0
	while j < n:
		if i == 0:
			a = pre[j]
		else:
			a = pre[j] - pre[i + 1]
		if mx < a:
			mx = a
			ll = i
		i += 1
		j += 1
	print(mx + 1, ll + 1)
	t -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	ar = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			ar[i] = 1
	peaks = 0
	prefix = [0] * n
	for i in range(n):
		if ar[i] == 1:
			peaks += 1
		prefix[i] = peaks
	(min_idx, el) = (-1, -1)
	for i in range(n - k + 1):
		if prefix[i + k - 2] - prefix[i] > el:
			el = prefix[i + k - 2] - prefix[i]
			min_idx = i
	print(el + 1, min_idx + 1)


def solve(tc):
	(n, k) = [int(x) for x in input().split()]
	lst = [int(x) for x in input().split()]
	peaks = [False for x in lst]
	for i in range(1, len(lst) - 1):
		if lst[i] > lst[i - 1] and lst[i] > lst[i + 1]:
			peaks[i] = True
	(i, j) = (0, 0)
	ans = 0
	cur = 0
	l = 0
	while j < n:
		if peaks[j]:
			cur += 1
		j += 1
		if j - i >= k:
			if peaks[i]:
				cur -= 1
			i += 1
		tmp_cur = cur
		if j < len(peaks) and peaks[j]:
			tmp_cur -= 1
		if peaks[i]:
			tmp_cur -= 1
		if tmp_cur > ans:
			ans = tmp_cur
			l = i
	print(ans + 1, l + 1)
t = int(input())
for tc in range(1, t + 1):
	solve(tc)


import sys

def main():
	test_cases = int(sys.stdin.readline())
	for test_case in range(test_cases):
		line = sys.stdin.readline().split()
		n = int(line[0])
		k = int(line[1])
		line = sys.stdin.readline().split()
		mountain_heights = [int(el) for el in line]
		is_peak = [False]
		for i in range(1, len(mountain_heights) - 1):
			if mountain_heights[i - 1] < mountain_heights[i] > mountain_heights[i + 1]:
				is_peak.append(True)
			else:
				is_peak.append(False)
		is_peak.append(False)
		l = 0
		cur_peaks = 0
		for i in range(1, k - 1):
			if is_peak[i]:
				cur_peaks += 1
		max_peaks = cur_peaks
		for i in range(1, n - k + 1):
			if is_peak[i]:
				cur_peaks -= 1
			if is_peak[i + k - 2]:
				cur_peaks += 1
			if cur_peaks > max_peaks:
				max_peaks = cur_peaks
				l = i
		print(str(max_peaks + 1) + ' ' + str(l + 1))
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
	j = k
	i = 0
	s = sum(b[i + 1:j - 1])
	maxp = s
	mini = 1
	while j < n:
		s -= b[i + 1]
		i += 1
		s += b[j - 1]
		j += 1
		if s > maxp:
			maxp = s
			mini = i + 1
	print(maxp + 1, mini)


from array import array
from math import log

def solve(n, k, data):
	peaks = array('i', [0 for _ in data])
	for i in range(1, len(data) - 1):
		if data[i] > data[i - 1] and data[i] > data[i + 1]:
			peaks[i] = 1
	prefix = array('i', [0 for _ in data])
	for i in range(1, n):
		prefix[i] = prefix[i - 1] + peaks[i]
	cur_max = None
	l = None
	for i in range(k - 1, n):
		cur = prefix[i] - prefix[i - k + 1] - peaks[i] - peaks[i - k + 1]
		if cur_max is None or cur > cur_max:
			cur_max = cur
			l = i - k + 1
	print(cur_max + 1, l + 1)
test_cases = int(input())
for i in range(test_cases):
	(n, k) = [int(a) for a in input().split(' ')]
	data = array('i', [int(a) for a in input().split(' ')])
	solve(n, k, data)


import sys
input = sys.stdin.buffer.readline
from itertools import accumulate
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	B = [0] * n
	for i in range(1, n - 1):
		if A[i - 1] < A[i] and A[i] > A[i + 1]:
			B[i] = 1
	C = [0] + B
	C = list(accumulate(C))
	anst = -1
	ansl = -1
	for l in range(n - k + 1):
		temp = C[l + k] - C[l]
		if B[l] == 1:
			temp -= 1
		if B[l + k - 1] == 1:
			temp -= 1
		if temp + 1 > anst:
			anst = temp + 1
			ansl = l + 1
	print(anst, ansl)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	maxe = 0
	ll = 1
	pref = [0 for i in range(n)]
	for j in range(1, n - 1):
		if arr[j - 1] < arr[j] > arr[j + 1]:
			pref[j] = pref[j - 1] + 1
		else:
			pref[j] = pref[j - 1]
	pref[n - 1] = pref[n - 2]
	for l in range(n - k + 1):
		count = pref[l + k - 2] - pref[l]
		if count > maxe:
			maxe = count
			ll = l + 1
	print(maxe + 1, ll)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	pick = []
	for j in range(1, n - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			pick.append(j)
	if len(pick) == 0:
		print(1, 1)
	else:
		l = max(pick[0] - k + 2, 0)
		ans_l = l
		ind_i = 0
		ind_j = 0
		while ind_j < len(pick) and pick[ind_j] < l + k - 1:
			ind_j += 1
		ind_j -= 1
		ans = ind_j - ind_i + 1
		for j in range(l + 1, n - k + 1):
			if j >= pick[ind_i]:
				ind_i += 1
			while ind_j < len(pick) and pick[ind_j] < j + k - 1:
				ind_j += 1
			ind_j -= 1
			if ind_j - ind_i + 1 > ans:
				ans = ind_j - ind_i + 1
				ans_l = j
			if ind_j >= len(pick) - 1:
				break
		print(ans + 1, ans_l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	m = list(map(int, input().split()))
	peaks = []
	peaks.append(0)
	for i in range(1, n - 1):
		if m[i] > m[i - 1] and m[i] > m[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	minidx = 0
	d = 1
	prefix = [0]
	for i in peaks:
		prefix.append(prefix[-1] + i)
	for l in range(n - (k - 1)):
		if prefix[l + k - 1] - prefix[l + 1] + 1 > d:
			d = prefix[l + k - 1] - prefix[l + 1] + 1
			minidx = l
	print(d, minidx + 1)


t = int(input())
for test in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	a_cumulative = [0] * len(a)
	is_peak_a = [0] * len(a)
	num_peaks = 0
	for i in range(1, len(a) - 1):
		a_cumulative[i] = num_peaks
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			num_peaks += 1
			is_peak_a[i] = 1
	a_cumulative[-1] = num_peaks
	segments_left_num_peaks = [0] * (len(a) - k + 1)
	for i in range(len(segments_left_num_peaks)):
		segments_left_num_peaks[i] = a_cumulative[i + k - 1] - a_cumulative[i]
		if is_peak_a[i] == 1:
			segments_left_num_peaks[i] -= 1
	max_peaks = segments_left_num_peaks[-1]
	max_peaks_left_index = len(segments_left_num_peaks) - 1
	for i in range(len(segments_left_num_peaks) - 1, -1, -1):
		if segments_left_num_peaks[i] >= max_peaks:
			max_peaks = segments_left_num_peaks[i]
			max_peaks_left_index = i
	print(max_peaks + 1, max_peaks_left_index + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	for i in range(n - 2):
		if a[i] < a[i + 1] and a[i + 1] > a[i + 2]:
			p[i + 1] = 1
	count1 = p[1:k - 1].count(1)
	ans = count1
	l = 0
	for i in range(n - k):
		if p[i + k - 1] == 1:
			count1 += 1
		if p[i + 1] == 1:
			count1 -= 1
		if count1 > ans:
			ans = count1
			l = i + 1
	print(ans + 1, l + 1)


def solve(ls, n, m):
	mx = 0
	ans = 0
	c = 0
	a = []
	for i in range(1, n - 1):
		if ls[i] > ls[i - 1] and ls[i] > ls[i + 1]:
			a.append(i - 1)
			c += 1
	if c > 0:
		j = 0
		i = 1
		mx = 1
		ans = max(0, a[0] - m + 3)
		while i < c:
			p = a[i] - a[j] + 3
			if p <= m and i - j + 1 > mx:
				mx = i - j + 1
				ans = max(0, a[i] - m + 3)
				i += 1
				continue
			while a[i] - a[j] + 3 > m and j < i:
				j += 1
			i += 1
	print(mx + 1, ans + 1)
for lo in range(int(input())):
	(n, m) = map(int, input().split())
	ls = [int(x) for x in input().split()]
	solve(ls, n, m)


from itertools import accumulate

def mains():
	for ekbaar in range(1):
		for tini in range(int(input())):
			(n, k) = map(int, input().split())
			a = list(map(int, input().split()))
			b = [0] * n
			for _ in range(1, len(a) - 1):
				if a[_] > a[_ - 1] and a[_] > a[_ + 1]:
					b[_] = 1
			b.insert(0, 0)
			c = list(accumulate(b))
			c = c[:-1]
			d = []
			for _ in range(k - 1, len(c)):
				d.append([_ - k + 2, c[_] - c[_ - k + 2]])

			def sort1(val):
				return val[1]
			d.sort(key=sort1)
			x = d[-1][1]
			v = []
			for _ in range(len(d)):
				if d[_][1] == x:
					v.append(d[_][0])
			print(x + 1, min(v))
mains()


t = int(input())
while t != 0:
	(n, k) = map(int, input().split())
	ans = 1
	l = 1
	value = []
	peak = [0]
	peak.insert(0, 0)
	value = list(map(int, input().strip().split()))
	for i in range(1, n - 1):
		if value[i] > value[i - 1] and value[i] > value[i + 1]:
			peak.insert(i, 1)
		else:
			peak.insert(i, 0)
	for i in range(1, n):
		peak[i] += peak[i - 1]
	for i in range(k - 1, n):
		if peak[i - 1] - peak[i - k + 1] + 1 > ans:
			ans = peak[i - 1] - peak[i - k + 1] + 1
			l = i - k + 1 + 1
	print(ans, ' ', l)
	t -= 1


numTests = int(input())
for a in range(numTests):
	(n, k) = tuple((int(i) for i in input().split(' ')))
	mountains = [int(i) for i in input().split(' ')]
	peaks = [0] * len(mountains)
	isPeak = [0] * len(mountains)
	numPeaks = 0
	for i in range(1, len(mountains) - 1):
		if mountains[i] > mountains[i + 1] and mountains[i] > mountains[i - 1]:
			isPeak[i] = 1
			numPeaks += 1
		peaks[i] += numPeaks
	peaks[len(mountains) - 1] += numPeaks
	maximum = 0
	pieces = 1
	l = 0
	for a in range(len(mountains) - k + 1):
		if peaks[a + k - 1] - isPeak[a + k - 1] - (peaks[a] + isPeak[a]) > maximum:
			maximum = peaks[a + k - 1] - isPeak[a + k - 1] - (peaks[a] + isPeak[a])
			l = a
	print(maximum + 1, l + 1)


import sys
from collections import *
from bisect import *
from math import *
input = sys.stdin.readline
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ind = []
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			ind.append(i + 1)
	pe = 0
	s = 0
	l = float('inf')
	for i in range(n - k + 1):
		ll = bisect_right(ind, i + 1)
		rr = bisect_left(ind, i + k)
		d = rr - ll
		if d > pe:
			pe = d
			s = i + 1
	if s == 0:
		s = 1
	print(pe + 1, s)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = [0] * n
	l2 = [0] * n
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			l1[i] = 1
	for i in range(1, n - 1):
		l2[i + 1] = l2[i] + l1[i]
	c = 0
	p = 0
	for i in range(k - 1, n):
		temp = l2[i] - l2[i - k + 2]
		if temp > c:
			c = temp
			p = i - k + 1
	print(c + 1, p + 1)


for test in range(int(input())):
	(n, k) = map(int, input().split())
	heights = [None] + list(map(int, input().split()))
	baseValue = 0
	for mountain in range(2, k):
		if heights[mountain - 1] < heights[mountain] and heights[mountain + 1] < heights[mountain]:
			baseValue += 1
	score = baseValue
	answer = 1
	for i in range(2, n - k + 2):
		if heights[i] > heights[i - 1] and heights[i] > heights[i + 1]:
			baseValue -= 1
		if heights[i + k - 2] > heights[i + k - 1] and heights[i + k - 2] > heights[i + k - 3]:
			baseValue += 1
		if baseValue > score:
			score = baseValue
			answer = i
	print(score + 1, answer)


from sys import stdin, stdout
from collections import defaultdict
input = stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	arr = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			arr.append(1)
		else:
			arr.append(0)
	arr += [0]
	i = 0
	j = k - 1
	mx = sum(arr[i + 1:j])
	mxi = 0
	val = mx
	while 1:
		i += 1
		j += 1
		if j == n:
			break
		val -= arr[i]
		val += arr[j - 1]
		if val > mx:
			mx = val
			mxi = i
	print(mx + 1, mxi + 1)


def yes(x):
	global a
	return a[x - 1] < a[x] > a[x + 1]
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = [0] + list(map(int, input().split()))
	left = 2
	cur = 0
	for i in range(2, k):
		if yes(i):
			cur += 1
	t = cur
	i = 3
	j = k
	while j < n:
		if yes(i - 1):
			cur -= 1
		if yes(j):
			cur += 1
		if cur > t:
			t = cur
			left = i
		i += 1
		j += 1
	print(t + 1, left - 1)


t = int(input())
while t:
	t = t - 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0]
	c = [0]
	cnt = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			cnt += 1
			b.append(1)
			c.append(cnt)
		else:
			b.append(0)
			c.append(cnt)
	b.append(0)
	peak = 0
	l = 0
	for i in range(n - k + 1):
		x = c[i + k - 2] - c[i]
		if x + 1 > peak:
			peak = x + 1
			l = i + 1
	print(peak, l)


from collections import deque
n_cases = int(input())
for case_num in range(n_cases):
	(n, k) = [int(x) for x in input().split()]
	heights = [int(x) for x in input().split()]
	left = 0
	peaks = deque()
	best_left = 0
	best_peaks = 0
	for i in range(1, n - 1):
		if i >= left + k - 1:
			if len(peaks) > best_peaks:
				best_left = left
				best_peaks = len(peaks)
			left += 1
			if peaks and peaks[0] <= left:
				peaks.popleft()
		y = heights[i]
		x = heights[i - 1]
		z = heights[i + 1]
		if y > x and y > z:
			peaks.append(i)
	if len(peaks) > best_peaks:
		best_left = left
		best_peaks = len(peaks)
	print('{} {}'.format(best_peaks + 1, best_left + 1))


T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	mountains = list(map(int, input().split()))
	peaks = [0] * (n + 1)
	for i in range(n - 1):
		peaks[i] = peaks[i - 1]
		if mountains[i] > mountains[i - 1] and mountains[i] > mountains[i + 1]:
			peaks[i] += 1
	peaks[n - 1] = peaks[n - 2]
	x = 0
	max_peaks = -1
	for i in range(n - k + 1):
		temp = peaks[i + k - 1] - peaks[i]
		if peaks[i + k - 1] > peaks[i + k - 2]:
			temp -= 1
		if temp > max_peaks:
			max_peaks = temp
			x = i
	print(max_peaks + 1, x + 1)


t = int(input())
for m in range(t):
	(n, k) = list(map(int, input().split()))
	nums = list(map(int, input().split()))
	peaks = [0]
	for i in range(1, n - 1):
		if nums[i - 1] < nums[i] > nums[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	cur = 0
	last = k - 2
	startCount = peaks[:k - 1].count(1)
	ma = (cur, startCount)
	while last + 1 < len(peaks):
		cur += 1
		last += 1
		if peaks[cur] == 1:
			startCount -= 1
		if peaks[last] == 1:
			startCount += 1
		if startCount > ma[1]:
			ma = (cur, startCount, last)
	print(ma[1] + 1, ma[0] + 1)


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]

def is_overlapping(x1, x2, y1, y2):
	return max(x1, y1) <= min(x2, y2)
t = read_int()
for i in range(t):
	(n, k) = read_int_line()
	a = read_int_line()
	dp = [0] * n
	count = 0
	for i in range(1, k - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			count += 1
	dp[0] = count
	for i in range(1, n - k + 1):
		dp[i] = dp[i - 1]
		if a[i + k - 3] < a[i + k - 2] and a[i + k - 2] > a[i + k - 1]:
			dp[i] += 1
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			dp[i] -= 1
	t = max(dp)
	l = dp.index(t)
	print(t + 1, l + 1)


q = int(input())
for _ in range(q):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	d = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			d[i] = 1
	for i in range(1, n):
		d[i] += d[i - 1]
	mp = 0
	for l in range(n - k + 1):
		p = d[l + k - 2] - d[l]
		mp = max(p, mp)
	for l in range(n - k + 1):
		p = d[l + k - 2] - d[l]
		if p == mp:
			print(p + 1, l + 1)
			break


import collections
import operator
n = int(input())
for i in range(n):
	mk = [int(i) for i in input().split(' ')]
	m = mk[0]
	k = mk[1]
	pk = [int(i) for i in input().split(' ')]
	temp = [0] * (m + 1)
	for i in range(1, m - 1):
		if pk[i] > pk[i - 1] and pk[i] > pk[i + 1]:
			temp[i + 1] += 1
			if i + k - 1 < m + 1:
				temp[i + k - 1] -= 1
	for i in range(1, m):
		temp[i] += temp[i - 1]
	mx = -1
	idxm = 0
	for i in range(1, m):
		if temp[i] > mx:
			mx = temp[i]
			idxm = i
	print(mx + 1, max(1, idxm + 2 - k))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	c = [0] * (n + 1)
	d = [0] * (n + 1)
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			c[i + 2] = 1
	for i in range(1, n + 1):
		c[i] += c[i - 1]
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			d[i] = 1
	for i in range(1, n + 1):
		d[i] += d[i - 1]
	(ans, e) = (0, 0)
	for i in range(n - k + 1):
		j = i + k
		m = c[j] - d[i]
		if m > ans:
			ans = m
			e = i
	print(ans + 1, e + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	s = [0 for _ in range(n + 1)]
	for i in range(n):
		if 0 < i < n - 1:
			if a[i - 1] < a[i] and a[i] > a[i + 1]:
				s[i + 1] += 1
		s[i + 1] += s[i]
	t = [s[i + k - 2] - s[i] for i in range(1, n - k + 2)]
	(ans_t, ans_l) = (0, 0)
	for i in range(len(t)):
		if t[i] > ans_t:
			ans_t = t[i]
			ans_l = i
	print(ans_t + 1, ans_l + 1)


import math
import sys
from collections import defaultdict
from collections import Counter
from collections import deque
import bisect
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	pf = [0] * n
	t = 0
	for i in range(1, n - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			t += 1
		pf[i] = t
	Ans = []
	p = k - 2
	for i in range(p, n):
		Ans.append((pf[i] - pf[i - p], i - p + 1))
	Ans.sort(reverse=True)
	t = -10 * 18
	l = 10 * 18
	for i in Ans:
		if i[0] >= t:
			t = i[0]
			l = i[1]
	print(t + 1, l)


def peaks(a):
	p = 0
	b = [0] * len(a)
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
	return b
t = int(input())
for q in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	b = peaks(l)
	p = b[1:k - 1].count(1)
	tot = p
	index = 1
	for i in range(1, n - k + 1):
		p += b[i + k - 2] - b[i]
		if tot < p:
			tot = p
			index = i + 1
	print(tot + 1, index)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	run_start = best_start = 0
	run_peaks = best_peaks = 0
	for i in range(n):
		if i > 1:
			if a[i - 2] < a[i - 1] > a[i]:
				run_peaks += 1
			if i > k - 1:
				if a[i - k] < a[i - k + 1] > a[i - k + 2]:
					run_peaks -= 1
			if run_peaks > best_peaks:
				best_peaks = run_peaks
				best_start = max(0, i - k + 1)
	print(best_peaks + 1, best_start + 1)


import sys

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = map(int, sys.stdin.readline().split())
		nums = list(map(int, sys.stdin.readline().split()))
		peakCheck = [False] * n
		for i in range(1, n - 1):
			if nums[i] > nums[i - 1] and nums[i] > nums[i + 1]:
				peakCheck[i] = True
		maxVal = sum(peakCheck[1:k - 1])
		ans = 0
		temp = maxVal
		for i in range(k, n):
			if peakCheck[i - k + 1]:
				temp -= 1
			if peakCheck[i - 1]:
				temp += 1
			if maxVal < temp:
				ans = i - k + 1
				maxVal = temp
		print(maxVal + 1, ans + 1)
	return
main()


from bisect import bisect_left as bl
from bisect import bisect_right as bb
s = []
for hhjhj in range(int(input())):
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	p = []
	c = [0, 0]
	for i in range(1, n - 1):
		if x[i] > x[i - 1] and x[i] > x[i + 1]:
			p.append(i)
	for i in range(0, n):
		u = bb(p, i)
		v = bl(p, i + k - 1)
		if v - u + 1 > c[0]:
			c[1] = i + 1
			c[0] = v - u + 1
	s.append(c)
for i in s:
	for j in i:
		print(j, end=' ')
	print()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	max_peaks = 0
	peaks_p = [0] * (n + 1)
	peaks = [0] * n
	for i in range(0, n - 1):
		peaks_p[i + 1] = peaks_p[i]
		if a[i - 1] < a[i] > a[i + 1]:
			peaks_p[i + 1] += 1
			peaks[i] = 1
	peaks_p[-1] = peaks_p[-2]
	ind = None
	for i in range(n - k + 1):
		p = peaks_p[i + k] - peaks_p[i]
		if peaks[i]:
			p -= 1
		if peaks[i + k - 1]:
			p -= 1
		p += 1
		if p > max_peaks:
			max_peaks = p
			ind = i + 1
	print(max_peaks, ind)


import sys
from collections import deque
t = int(sys.stdin.readline())
for _ in range(t):
	(n, k) = map(int, sys.stdin.readline().split())
	list_num = list(map(int, sys.stdin.readline().split()))
	list_peaks = [0] * n
	for i in range(1, n - 1):
		if list_num[i - 1] < list_num[i] and list_num[i] > list_num[i + 1]:
			list_peaks[i] = 1
	result = 0
	now_count = 0
	now_l = 0
	k -= 2
	list_k = deque([0] * k)
	for i in range(n):
		save = list_k.popleft()
		if save:
			now_count -= 1
		list_k.append(list_peaks[i])
		if list_peaks[i]:
			now_count += 1
		if i + 1 - k > 0 and now_count > result:
			result = now_count
			now_l = i - k
	print(result + 1, now_l + 1)


def p(val, i, a, l, r):
	if i != l and i != r:
		if val > a[i + 1] and val > a[i - 1]:
			return 1
	return 0

def pp(val, i, a):
	if i != 0 and i != len(a) - 1:
		if val > a[i + 1] and val > a[i - 1]:
			return 1
	return 0
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = []
	aa = 0
	l = 0
	r = k - 1
	for i in range(1, k):
		if p(a[i], i, a, l, r):
			aa += 1
	ans.append(aa)
	for i in range(k, n):
		l += 1
		r += 1
		aa = ans[-1]
		if pp(a[l], l, a):
			aa -= 1
		if pp(a[r - 1], r - 1, a):
			aa += 1
		ans.append(aa)
	print(max(ans) + 1, ans.index(max(ans)) + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			ans[i] = 1
	for i in range(1, n):
		ans[i] += ans[i - 1]
	i = 0
	l = 0
	m = 0
	k -= 1
	while i + k < n:
		val = ans[i + k - 1] - ans[i]
		if val > m:
			m = val
			l = i
		i += 1
	print(m + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	x = list(map(int, input().split()))
	arr = [0] * n
	for i in range(1, n - 1):
		if x[i] > x[i - 1] and x[i] > x[i + 1]:
			arr[i] = 1
	res1 = 0
	j = 1
	while j < k - 1:
		if arr[j] == 1:
			res1 += 1
		j += 1
	var1 = res1
	b1 = 0
	i = k
	while i < n:
		if arr[i - k + 1] == 1:
			res1 -= 1
		if arr[i - 1] == 1:
			res1 += 1
		if res1 > var1:
			var1 = res1
			b1 = i - k + 1
		i += 1
	print(var1 + 1, b1 + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0] * n
	sum1 = []
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peak[i] = 1
	for i in range(1, len(peak)):
		peak[i] = peak[i - 1] + peak[i]
	for i in range(n - k + 1):
		sum1.append(peak[i + k - 2] - peak[i])
	max_ans = max(sum1)
	print(max_ans + 1, sum1.index(max_ans) + 1)


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	s = list(map(int, input().split()))
	li = []
	for i in range(1, n - 1):
		if s[i] > s[i - 1] and s[i] > s[i + 1]:
			li.append(i)
	l = 0
	r = l + k - 1
	p = len(li)
	index = 0
	index2 = 0
	ans1 = 0
	ans2 = 0
	while True:
		flag = 0
		while index < len(li) and li[index] <= l:
			index += 1
		while index2 < len(li) and li[index2] < r:
			index2 += 1
		if index2 - index > ans1:
			ans1 = index2 - index
			ans2 = l
		l += 1
		r += 1
		if r >= n or flag == 1 or index2 == len(li):
			break
	print(ans1 + 1, ans2 + 1)


T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [False] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			peak[i] = True
	c = 0
	for i in range(k):
		if peak[i]:
			c += 1
	if peak[k - 1]:
		c -= 1
	ans = c
	l = 1
	for i in range(k, n):
		if peak[i - k + 1]:
			c -= 1
		if peak[i - 1]:
			c += 1
		if c > ans:
			l = i - k + 1 + 1
		ans = max(ans, c)
	print(ans + 1, l)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	f = 1
	c = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			c += 1
	r = c
	for i in range(k, n):
		if a[i - 1] > a[i - 2] and a[i - 1] > a[i]:
			c += 1
		if a[i - k + 1] > a[i - k] and a[i - k + 1] > a[i - k + 2]:
			c -= 1
		if c > r:
			r = c
			f = i - k + 2
	print(r + 1, f)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	data = list(map(int, input().split()))
	peaks = set()
	for i in range(1, n - 1):
		if data[i - 1] < data[i] and data[i] > data[i + 1]:
			peaks.add(i)
	end = 0
	peak_count = 0
	result = 0
	index = 0
	for start in range(n):
		while end < n and end - start < k:
			if end in peaks:
				peak_count += 1
			additional = 0
			if start in peaks:
				additional -= 1
			if end in peaks:
				additional -= 1
			if end - start == k - 1:
				if result < peak_count + additional:
					result = peak_count + additional
					index = start
			if start in peaks:
				peak_count -= 1
			end += 1
	print(result + 1, index + 1)


t = int(input())
for q in range(t):
	(n, k) = map(int, input().split())
	mass = [int(x) for x in input().split()]
	local = 0
	for i in range(1, k - 1):
		if mass[i] > mass[i - 1] and mass[i] > mass[i + 1]:
			local += 1
	Max = local
	l = 1
	for i in range(k - 1, n - 1):
		if mass[i] > mass[i - 1] and mass[i] > mass[i + 1]:
			local += 1
		if mass[i - k + 2] > mass[i - k + 1] and mass[i - k + 2] > mass[i - k + 3]:
			local -= 1
		if local > Max:
			l = i - k + 3
			Max = local
	print(Max + 1, l)


def solve(n, k, a):
	peak = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peak[i] = 1
	t = 1
	l = 1
	for i in range(k):
		if i == 0 or i == k - 1:
			continue
		if peak[i] == 1:
			t += 1
	temp = t
	for ll in range(1, n - k + 1):
		if peak[ll] == 1:
			temp -= 1
		if peak[ll + k - 2] == 1:
			temp += 1
		if temp > t:
			t = temp
			l = ll + 1
	return (t, l)

def main():
	tc = int(input())
	for _ in range(tc):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		print(*solve(n, k, a))

def test_solve():
	n = 8
	k = 6
	a = [1, 2, 4, 1, 2, 4, 1, 2]
	print(*solve(n, k, a))
main()


import math
import sys
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(item) for item in input().split()]
	p = [0] * n
	for i in range(n - 2):
		if a[i] < a[i + 1] and a[i + 1] > a[i + 2]:
			p[i + 1] = 1
	count1 = p[1:k - 1].count(1)
	ans = count1
	l = 0
	for i in range(n - k):
		if p[i + k - 1] == 1:
			count1 += 1
		if p[i + 1] == 1:
			count1 -= 1
		if count1 > ans:
			ans = count1
			l = i + 1
	print(ans + 1, l + 1)


import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7
INF = float('inf')

def getlist():
	return list(map(int, input().split()))

def main():
	T = int(input())
	for _ in range(T):
		(N, K) = getlist()
		A = getlist()
		B = [0] * N
		for i in range(1, N - 1):
			if A[i] > A[i - 1] and A[i] > A[i + 1]:
				B[i] = 1
		for i in range(N - 1):
			B[i + 1] += B[i]
		ansL = INF
		ansT = -1
		for i in range(N - K + 2):
			var = B[i + K - 2] - B[i]
			if var > ansT:
				ansT = var
				ansL = i
		print(ansT + 1, ansL + 1)
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = set()
	for i in range(1, len(arr) - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks.add(i)
	(l, r) = (0, k - 1)
	currpeaks = 0
	for i in range(1, k - 1):
		if i in peaks:
			currpeaks += 1
	(mxpeaks, mxl) = (0, 0)
	while r < len(arr):
		if currpeaks > mxpeaks:
			mxl = l
			mxpeaks = currpeaks
		if l + 1 in peaks:
			currpeaks -= 1
		if r in peaks:
			currpeaks += 1
		l += 1
		r += 1
	print(mxpeaks + 1, mxl + 1)


from collections import Counter
import math
mod = 10 ** 9 + 7
for i in range(int(input())):
	(n, k) = map(int, input().split())
	arr = [int(i) for i in input().split()]
	index = 1
	peak = 0
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peak += 1
	peak1 = peak
	for i in range(k, n):
		p = peak1
		if arr[i - k + 1] > arr[i - k] and arr[i - k + 1] > arr[i - k + 2]:
			p -= 1
		if arr[i - 1] > arr[i - 2] and arr[i - 1] > arr[i]:
			p += 1
		if p > peak:
			peak = p
			index = i - k + 2
		peak1 = p
	print(peak + 1, index)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [False] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = True
	totalnumofpeaks = peaks.count(True)
	numofpeaks = peaks[1:k - 1].count(True)
	temp = numofpeaks
	l = 0
	for i in range(1, n - k + 1):
		temp += peaks[i + k - 2] - peaks[i]
		if temp > numofpeaks:
			numofpeaks = temp
			l = i
			if numofpeaks == totalnumofpeaks:
				break
	print(numofpeaks + 1, l + 1)


t = int(input())
for qq in range(t):
	(n, k) = map(int, input().split())
	m = list(map(int, input().split()))
	p = 0
	for i in range(n - k + 1, n - 1):
		if m[i] > m[i - 1] and m[i] > m[i + 1]:
			p += 1
	mp = p
	ii = n - k + 1
	for i in range(n - k, 0, -1):
		if m[i] > m[i - 1] and m[i] > m[i + 1]:
			p += 1
		if m[i + k - 2] > m[i + k - 3] and m[i + k - 2] > m[i + k - 1]:
			p -= 1
		if p >= mp:
			mp = p
			ii = i
	print(mp + 1, ii)


t = int(input())
for _ in range(t):
	(n, k) = (int(i) for i in input().split())
	a = [int(i) for i in input().split()]
	maxPeaks = 0
	peaks = 0
	prev = False
	l = -1
	for i in range(1, k - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peaks += 1
	if peaks > maxPeaks:
		maxPeaks = peaks
		l = 1
	if a[0] < a[1] and a[1] > a[2]:
		prev = True
	for i in range(1, n - k + 1):
		if a[i + k - 3] < a[i + k - 2] and a[i + k - 2] > a[i + k - 1]:
			peaks += 1
		if prev:
			peaks = peaks - 1
			prev = False
		if a[i] < a[i + 1] and a[i + 1] > a[i + 2]:
			prev = True
		if peaks > maxPeaks:
			maxPeaks = peaks
			l = i + 1
	if maxPeaks == 0:
		print('1 1')
	else:
		print(maxPeaks + 1, l)


import sys
from math import log2, floor, ceil, sqrt
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
for _ in range(int(ri())):
	(n, k) = Ri()
	a = Ri()
	no = 0
	arr = [0] * n
	for i in range(1, n - 1):
		arr[i] = no
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			no += 1
	arr[n - 1] = no
	maxp = -1
	l = -1
	for i in range(n - k + 1):
		left = i
		right = i + k - 1
		if arr[right] - arr[left + 1] > maxp:
			maxp = arr[right] - arr[left + 1]
			l = left
	print(maxp + 1, l + 1)


def main():
	for _ in range(int(input())):
		(n, k) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		(l, x) = ([], [0] * n)
		for i in range(1, n - 1):
			if a[i - 1] < a[i] and a[i] > a[i + 1]:
				x[i] = 1
		k -= 2
		maxi = x[1:k + 1].count(1)
		c = x[1:k + 1].count(1)
		ans = 0
		for i in range(k + 1, n - 1):
			if x[i] == 1:
				c += 1
			if x[i - k] == 1:
				c -= 1
			if maxi < c:
				maxi = c
				ans = i - k
		print(maxi + 1, ans + 1)
main()


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	d = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			d[i] = 1
	pref = [0 for i in range(n)]
	for i in range(1, n):
		pref[i] = pref[i - 1] + d[i]
	ans = 0
	index = 0
	anst = 0
	for l in range(n - k + 1):
		if pref[l + k - 2] - pref[l] > ans:
			ans = pref[l + k - 2] - pref[l]
			index = l
	print(ans + 1, index + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	mts = list(map(int, input().split()))
	peaks = [0]
	for i in range(1, n - 1):
		if mts[i] > mts[i - 1] and mts[i] > mts[i + 1]:
			peaks.append(1 + peaks[-1])
		else:
			peaks.append(0 + peaks[-1])
	peaks.append(peaks[-1])
	maxm = 0
	la = -1
	for l in range(0, n - k + 1):
		if peaks[l + k - 2] - peaks[l] + 1 > maxm:
			maxm = peaks[l + k - 2] - peaks[l] + 1
			la = int(l + 1)
	print(maxm, la)


import sys
input = sys.stdin.readline
for i in ' ' * int(input()):
	(n, k) = map(int, input().split())
	L = list(map(int, input().split()))
	mxL = [0]
	ct = 0
	for i in range(1, n - 1):
		if L[i] > L[i - 1] and L[i] > L[i + 1]:
			ct += 1
		mxL.append(ct)
	mxL.append(ct)
	mx = 0
	mxmem = 0
	for i in range(n - k + 1):
		t = mxL[i + k - 1] - mxL[i]
		if mxL[i + k - 1] == mxL[i + k - 2] + 1:
			t -= 1
		if t > mx:
			mx = t
			mxmem = i
	print(mx + 1, mxmem + 1)


import sys, math, cmath, time
start_time = time.time()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())

def solve():
	(n, k) = invr()
	a = inlt()
	q = [0]
	qw = 0
	c = 0
	w = []
	for i in range(1, len(a) - 1):
		if a[i + 1] < a[i] and a[i - 1] < a[i]:
			c = c + 1
		q.append(c)
	q.append(q[-1])
	for i in range(len(q)):
		if i + k > n:
			break
		if i == 0:
			if q[i + k - 1] == q[i + k - 2]:
				w.append(q[i + k - 1] - q[i])
			else:
				w.append(q[i + k - 1] - q[i] - 1)
		elif q[i + k - 1] == q[i + k - 2] and q[i] == q[i - 1]:
			w.append(q[i + k - 1] - q[i])
		elif q[i + k - 1] == q[i + k - 2] or q[i] == q[i - 1]:
			w.append(q[i + k - 1] - q[i] - 1)
		else:
			w.append(q[i + k - 1] - q[i] - 2)
	print(max(w) + 1, w.index(max(w)) + 1)
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = sys.stdin.readline
t = 1
t = inp()
for tt in range(t):
	solve()
if not ONLINE_JUDGE:
	print('Time Elapsed:', time.time() - start_time, 'seconds')
sys.stdout.close()


from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(t,) = rl()
for _ in range(t):
	(n, k) = rl()
	a = rl()
	p = [a[i] > a[i - 1] and a[i] > a[i + 1] for i in range(1, n - 1)]
	bl = 1
	bt = t = sum(p[:k - 2]) + 1
	for l in range(2, n - k + 2):
		if p[l - 2]:
			t -= 1
		if p[l + k - 4]:
			t += 1
		if t > bt:
			bt = t
			bl = l
	print(bt, bl)


def f(i):
	if i - 1 >= 0 and i + 1 <= n - 1:
		if a[i - 1] < a[i] > a[i + 1]:
			return True
		else:
			return False
	else:
		return False
for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	(p, l) = (0, 0)
	for i in range(1, k - 1):
		if f(i):
			p += 1
	m = p
	for i in range(k - 1, n - 1):
		if f(i):
			p += 1
		if f(i - k + 2):
			p -= 1
		if p > m:
			m = p
			l = i - k + 2
	print(m + 1, l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	li = []
	pi = []
	c = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			c[i] = 1
		else:
			c[i] = 0
	p = c[1:k - 1].count(1)
	pi.append(p)
	li.append(1)
	for l in range(1, n - k + 1):
		p = p - c[l] + c[l + k - 2]
		pi.append(p)
		li.append(l + 1)
	p = max(pi)
	l = li[pi.index(p)]
	print(p + 1, l)


peak = []

def ispeak(x):
	l = 0
	r = len(peak) - 1
	while l <= r:
		mid = l + (r - l) // 2
		if peak[mid] == x:
			return 1
		elif peak[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return 0
for _ in range(int(input())):
	peak = []
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 0
	r = k - 1
	c = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak.append(i)
	for i in range(l + 1, r):
		if ispeak(i):
			c += 1
	curr = l
	r += 1
	l += 1
	t = c
	while r <= n - 1:
		if ispeak(r - 1):
			t += 1
		if ispeak(l):
			t -= 1
		if t > c:
			curr = l
			c = t
		l += 1
		r += 1
	print(str(c + 1) + ' ' + str(curr + 1))


import sys
from bisect import bisect_right as br
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(N, K) = map(int, input().split())
	a = list(map(int, input().split()))
	table = []
	minus = [0] * N
	for i in range(1, N - 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			table.append(i + 1)
			minus[i] += 1
	x = -1
	res = 0
	for l in range(N - K + 1):
		i = br(table, l)
		j = br(table, l + K - 1)
		if j - i - minus[l] > x:
			x = j - i - minus[l]
			res = l + 1
	print(x + 1, res)


import sys
stdin = sys.stdin
ns = lambda : stdin.readline().rstrip()
ni = lambda : int(stdin.readline().rstrip())
nm = lambda : map(int, stdin.readline().split())
nl = lambda : list(map(int, stdin.readline().split()))

def solve():
	(n, k) = nm()
	a = nl()
	b = [0] * n
	for i in range(1, n - 1):
		b[i] = (a[i - 1] < a[i] > a[i + 1]) + b[i - 1]
	b[-1] += b[-2]
	mx = 0
	mi = 0
	for i in range(n - k + 1):
		if b[i + k - 2] - b[i] > mx:
			mx = b[i + k - 2] - b[i]
			mi = i
	print(mx + 1, mi + 1)
	return
t = ni()
for _ in range(t):
	solve()


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
	c = b[:k - 1].count(1)
	d = []
	d.append([c, -1])
	for i in range(1, n - k + 1):
		if b[i] == 1:
			c = c - 1
		if b[i + k - 2] == 1:
			c = c + 1
		d.append([c, -1 * (i + 1)])
	e = max(d)
	print(e[0] + 1, e[1] * -1)


t = int(input())
for i10 in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * len(a)
	s = 0
	l = 1
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			s += 1
			b[i] = 1
	s1 = s
	for i in range(2, n - k + 3):
		if b[i - 1] == 1:
			s1 -= 1
		if a[i + k - 3] > a[i + k - 4] and i + k - 3 < len(a) - 1 and (a[i + k - 3] > a[i + k - 2]):
			b[i + k - 3] = 1
			s1 += 1
		if s1 > s:
			s = s1
			l = i
	print(s + 1, l)


from itertools import accumulate
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	q = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			p[i] = 1
			q[i + 1] = 1
	p = list(accumulate(p))
	q = list(accumulate(q))
	maxi = 0
	for i in range(n - k, -1, -1):
		if q[i + k - 1] - p[i] >= maxi:
			maxi = q[i + k - 1] - p[i]
			idx = i + 1
			count = q[i + k - 1] - p[i]
	print(count + 1, idx)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	mounts = list(map(int, input().split()))
	peaks = [False for _ in range(n)]
	for i in range(n - 2):
		peaks[i + 1] = mounts[i] < mounts[i + 1] and mounts[i + 1] > mounts[i + 2]
	maxpeaks = sum(peaks[:k - 1])
	currpeaks = maxpeaks
	l = 0
	for i in range(1, n - k + 1):
		currpeaks += peaks[i + k - 2]
		currpeaks -= peaks[i]
		if maxpeaks < currpeaks:
			maxpeaks = currpeaks
			l = i
	print(maxpeaks + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = 0
	peakf = 0
	indf = 0
	li = l[:k]
	for ii in range(1, k - 1):
		if li[ii] > li[ii - 1] and li[ii] > li[ii + 1]:
			peak += 1
	if peak > peakf:
		peakf = peak
		indf = 0
	if peakf == k // 2:
		print(peakf + 1, indf + 1)
		continue
	for i in range(1, n - k + 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			peak -= 1
		if l[i + k - 2] > l[i + k - 1] and l[i + k - 2] > l[i + k - 3]:
			peak += 1
		if peak > peakf:
			peakf = peak
			indf = i
		if peakf == k // 2:
			break
	print(peakf + 1, indf + 1)


import io
import os
from collections import Counter, defaultdict, deque

def solve(N, K, A):
	cumsum = [0]
	for i in range(N):
		if i >= 1 and i <= N - 2 and (A[i - 1] < A[i] > A[i + 1]):
			cumsum.append(cumsum[-1] + 1)
		else:
			cumsum.append(cumsum[-1])
	bestLen = 1
	bestIndex = 1
	for i in range(K, N + 1):
		val = cumsum[i - 1] - cumsum[i - K + 1] + 1
		if bestLen < val:
			bestLen = val
			bestIndex = i - K + 1
	return str(bestLen) + ' ' + str(bestIndex)
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
T = int(input())
for t in range(T):
	(N, K) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	ans = solve(N, K, A)
	print(ans)


for t in range(int(input())):
	(n, k) = [int(s) for s in input().split()]
	A = [int(s) for s in input().split()]
	memo = [0] * n
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			memo[i] = 1
	i = 1
	j = k - 2
	cur = 0
	for _ in range(i, j + 1):
		if memo[_]:
			cur += 1
	ans0 = cur
	ans1 = 0
	while j < n - 1:
		if memo[i]:
			cur -= 1
		i += 1
		j += 1
		if memo[j]:
			cur += 1
		if cur > ans0:
			ans0 = cur
			ans1 = i - 1
	print('{} {}'.format(ans0 + 1, ans1 + 1))


def solve(arr, n, k):
	maxPeaks = 0
	peakCnt = 0
	start = 0
	(i, j) = (0, 1)
	while j < n - 1:
		if j - i + 1 < k:
			if j - 1 >= 0 and j + 1 <= n - 1:
				if arr[j - 1] < arr[j] and arr[j] > arr[j + 1]:
					peakCnt += 1
			j += 1
		else:
			if maxPeaks < peakCnt:
				maxPeaks = peakCnt
				start = i
			i += 1
			if i - 1 >= 0 and i + 1 <= n - 1:
				if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
					peakCnt -= 1
			if j - 1 >= 0 and j + 1 <= n - 1:
				if arr[j - 1] < arr[j] and arr[j] > arr[j + 1]:
					peakCnt += 1
				j += 1
	if maxPeaks < peakCnt:
		maxPeaks = peakCnt
		start = i
	return (maxPeaks + 1, start + 1)
t = int(input())
while t:
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	(cnt, idx) = solve(arr, n, k)
	print(cnt, idx)
	t -= 1


for q in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	cu = 0
	MAX = -1
	seen = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			seen[i] = 1
	for i in range(1, k - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			cu += 1
	if cu > MAX:
		MAX = cu
		L = 0
	ll = 0
	rr = k - 1
	for i in range(n - k):
		ll += 1
		if seen[ll] == 1:
			cu -= 1
		if seen[rr] == 1:
			cu += 1
		rr += 1
		if cu > MAX:
			MAX = cu
			L = ll
	print(MAX + 1, L + 1)


from bisect import bisect_left, bisect_right
t = int(input())
while t != 0:
	t -= 1
	(n, k) = map(int, input().split())
	lt = [int(x) for x in input().split()]
	ind = []
	ind.append(0)
	for i in range(1, n - 1):
		if lt[i - 1] < lt[i] and lt[i] > lt[i + 1]:
			ind.append(1)
		else:
			ind.append(0)
	ind.append(0)
	pref = []
	pref.append(ind[0])
	for x in ind[1:]:
		pref.append(pref[-1] + x)
	ans = []
	for i in range(n - k + 1):
		l = [-pref[i + k - 2] + pref[i], i + 1]
		ans.append(l)
	ans.sort()
	print(-ans[0][0] + 1, ans[0][1])


import math
from collections import Counter
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()
mod = 10 ** 9 + 7

def s(a):
	print(' '.join(list(map(str, a))))
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			b.append(b[i - 1] + 1)
		else:
			b.append(b[i - 1])
	ans = 0
	l = 1
	for i in range(0, n - k + 1):
		if ans < b[i + k - 2] - b[i]:
			ans = b[i + k - 2] - b[i]
			l = i + 1
	print(ans + 1, l)


t = int(input())
ans = []
for g in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = 0
	for i in range(1, k - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			p += 1
	mx = p
	l = 0
	for i in range(2, n - k + 2):
		p += int(a[i + k - 4] < a[i + k - 3] > a[i + k - 2]) - int(a[i - 2] < a[i - 1] > a[i])
		if p > mx:
			mx = p
			l = i - 1
	ans.append([mx + 1, l + 1])
for i in ans:
	print(' '.join(map(str, i)))


def is_peak(mountain, k):
	if mountain[k] > mountain[k - 1] and mountain[k] > mountain[k + 1]:
		return True
	else:
		return False
t = int(input())
for case in range(t):
	(n, k) = map(int, input().split())
	mountain = [int(x) for x in input().split()]
	if k == n:
		answer = 1
		for i in range(1, n - 1):
			if is_peak(mountain, i):
				answer += 1
		print('{} 1'.format(answer))
	else:
		cur_max = 0
		for i in range(1, k - 1):
			if is_peak(mountain, i):
				cur_max += 1
		cur_peaks = cur_max
		cur_max_index = 1
		scores = [cur_peaks]
		for i in range(1, n - k + 1):
			if is_peak(mountain, i):
				cur_peaks -= 1
			if is_peak(mountain, i + k - 2):
				cur_peaks += 1
			scores.append(cur_peaks)
			if cur_peaks > cur_max:
				cur_max = cur_peaks
				cur_max_index = i + 1
		print('{} {}'.format(cur_max + 1, cur_max_index))


for v in range(int(input())):
	(n, k) = map(int, input().split())
	x = [int(q) for q in input().split()]
	p = [0] * (n + 1)
	for i in range(1, n - 1):
		if x[i - 1] < x[i] > x[i + 1]:
			p[i + 1] = 1
	r = [p[0]]
	for i in range(1, len(p)):
		r.append(r[-1] + p[i])
	ans = []
	for i in range(n - k + 1):
		j = r[i + k - 1] - r[i + 1]
		ans.append(j)
	print(max(ans) + 1, ans.index(max(ans)) + 1)


def np(arr):
	n = len(arr)
	s = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			s[i] = s[i - 1] + 1
		else:
			s[i] = s[i - 1]
	return s
for _ in range(int(input())):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	left = 0
	maxi = 0
	q = np(arr)
	for i in range(n):
		if i + k > n:
			break
		a = i
		b = i + k
		peaks = q[b - 2] - q[a]
		if peaks > maxi:
			maxi = peaks
			left = a
	print(maxi + 1, left + 1)


t = int(input())
while t:
	(n, k) = input().split(' ')
	(n, k) = (int(n), int(k))
	a = input().split(' ')
	for i in range(n):
		a[i] = int(a[i])
	i = 0
	x = []
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			x.append(i)
	i = 0
	j = 0
	max = 0
	l = 0
	p = [0, 0]
	while i < len(x):
		if x[i] - x[j] + 3 <= k:
			i += 1
		else:
			c = i - j
			if c > max:
				max = c
				l = x[j]
				p = [j, i - 1]
			j += 1
		if i == len(x):
			c = i - j
			if c > max:
				max = c
				l = x[j]
				p = [j, i - 1]
			j += 1
	if len(x) == 0:
		print(1, 1)
	else:
		dif = x[p[1]] - x[p[0]]
		p = k - dif - 3
		if l == 1:
			print(max + 1, l)
		elif l - p <= 1:
			print(max + 1, 1)
		else:
			print(max + 1, l - p)
	t -= 1


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	peaks = [0 for j in range(n)]
	for j in range(n):
		if j - 1 >= 0 and j + 1 < n:
			if l[j - 1] < l[j] and l[j] > l[j + 1]:
				peaks[j] = 1
	p1 = 0
	p2 = k - 1
	ct = 0
	for j in range(p1, p2 + 1):
		if j != p2:
			ct += peaks[j]
	ansct = ct
	ansl = 0
	for j in range(1, n - k + 1):
		p1 += 1
		p2 += 1
		ct += peaks[p2 - 1]
		ct -= peaks[p1]
		if ct > ansct:
			ansl = p1
			ansct = ct
	print(ansct + 1, ansl + 1)


def findPeak(heights, ind_peaks, n, k):
	p1 = 0
	p2 = 0
	count = 0
	max_count = 0
	max_p1 = 0
	for i in range(1, k):
		if i - 1 in ind_peaks:
			count += 1
			if count > max_count:
				max_count = count
				max_p1 = p1
	p1 += 1
	p2 = k
	while p2 <= len(heights):
		if p1 in ind_peaks:
			count -= 1
		if p2 - 1 in ind_peaks:
			count += 1
			if count > max_count:
				max_count = count
				max_p1 = p1
		p2 += 1
		p1 += 1
	return (max_count + 1, max_p1 + 1)
t = int(input(''))
res = []
for _ in range(t):
	(n, k) = [int(x) for x in input('').split(' ')]
	heights = [int(x) for x in input('').split(' ')]
	ind_peaks = set()
	for i in range(n):
		if i == 0 or i == n - 1:
			pass
		elif heights[i - 1] < heights[i] and heights[i] > heights[i + 1]:
			ind_peaks.add(i)
	(a, b) = findPeak(heights, ind_peaks, n, k)
	res.append(str(a) + ' ' + str(b))
for i in res:
	print(i)


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def main():
	ntest = int(stdin.readline())
	for testcase in range(ntest):
		(n, k) = [int(x) for x in stdin.readline().split()]
		a = [int(x) for x in stdin.readline().split()]
		maxp = -1
		posmax = 1
		p = 0
		up = False
		dn = False
		seq = deque()
		seq.append(a[0])
		for (pos, x) in enumerate(a[1:], 2):
			last = seq[-1]
			if last > x:
				if up == True:
					p += 1
				up = False
				dn = True
			if last < x:
				up = True
				dn = False
			seq.append(x)
			while len(seq) > k:
				if seq[0] < seq[1] and seq[1] > seq[2]:
					p -= 1
				seq.popleft()
			if len(seq) == k:
				if maxp < p:
					maxp = p
					posmax = pos - k + 1
		stdout.write('%d %d\n' % (maxp + 1, posmax))
	return 0
main()


import sys, random
from bisect import bisect_left, bisect_right
input = sys.stdin.readline

def main():
	inf = 10 ** 20
	t = int(input())
	for _ in range(1, t + 1):
		(n, k) = map(int, input().split())
		a = [int(x) for x in input().split()]
		p = [0] * n
		for i in range(1, n - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				p[i] = 1
		ans = [0, 1]
		for i in range(k - 1):
			if p[i]:
				ans[1] += 1
		now = ans[1]
		for i in range(1, n - k + 1):
			if p[i]:
				now -= 1
			if p[i + k - 2]:
				now += 1
			if now > ans[1]:
				ans = [i, now]
		print(ans[1], ans[0] + 1)
main()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = [0]
	c = 0
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			c += 1
		l1.append(c)
	l1.append(c)
	l2 = []
	ans = 0
	for i in range(k - 2, n):
		l2.append([l1[i - 1] - l1[max(0, i - k + 1)], max(0, i - k + 1)])
		ans = max(ans, l1[i - 1] - l1[max(0, i - k + 1)])
	x = n
	for i in l2:
		if i[0] == ans:
			x = min(x, i[1])
	print(ans + 1, x + 1)


t = int(input())
while t != 0:
	(n, k) = map(int, input().split())
	list1 = list(map(int, input().split()))
	i = 0
	opti_m = 0
	oti_n = 0
	list2 = list()
	list2.append(0)
	for i in range(1, n - 1):
		if list1[i] > list1[i - 1] and list1[i] > list1[i + 1]:
			list2.append(1 + list2[i - 1])
		else:
			list2.append(list2[i - 1])
	list2.append(list2[-1])
	for i in range(0, n - k + 1):
		if list2[i + k - 1] - list2[i] > opti_m:
			p = 0
			if list2[i + k - 1] != list2[i + k - 2]:
				p = list2[i + k - 1] - 1
			else:
				p = list2[i + k - 1]
			if p - list2[i] > opti_m:
				opti_m = p - list2[i]
				oti_n = i
	print(opti_m + 1, oti_n + 1)
	t -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	x = [int(x) for x in input().split()]
	x = [0] + x
	(mp, p) = ([0] * (n + 1), 0)
	for i in range(2, len(x) - 1):
		if x[i] > x[i - 1] and x[i] > x[i + 1]:
			mp[i] = 1
	for i in range(1, 1 + k):
		if mp[i] == 1 and i != 1 and (i != 1 + k - 1):
			p += 1
	maxpeak = p
	index = 1
	j = 2
	while j + k - 1 <= n:
		if mp[j] == 1:
			p -= 1
		if mp[j + k - 2] == 1:
			p += 1
		if p > maxpeak:
			maxpeak = p
			index = j
		j += 1
	print(maxpeak + 1, index)


t = int(input())
for T in range(t):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	a = [0] + a + [0]
	csum = (n + 1) * [0]
	for i in range(1, n + 1, 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			csum[i] = 1
	for i in range(1, n + 1, 1):
		csum[i] += csum[i - 1]
	(t_ans, l_ans) = (-1, -1)
	for l in range(1, n - k + 2, 1):
		r = l + k - 1
		peak_num = csum[r - 1] - csum[l]
		if peak_num > t_ans:
			t_ans = peak_num
			l_ans = l
	print(t_ans + 1, l_ans)


from collections import deque

def solve(n, window, array):
	peaks = [0] * n
	for i in range(1, n - 1, 1):
		if array[i] > array[i - 1] and array[i] > array[i + 1]:
			peaks[i] = 1
	queue = deque()
	max_peaks = 0
	peaks_in_queue = 0
	start = 1
	for i in range(0, n, 1):
		queue.appendleft(i)
		if peaks[i] == 1:
			peaks_in_queue += 1
		if len(queue) == window - 2 or i == n - 1:
			first_element = queue.pop()
			if peaks_in_queue > max_peaks:
				max_peaks = peaks_in_queue
				start = max(1, first_element)
			if peaks[first_element] == 1:
				peaks_in_queue -= 1
	print(max_peaks + 1, start)
testCases = int(input())
while testCases:
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	solve(n, k, arr)
	testCases -= 1


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peaks.append(peaks[-1] + 1)
		else:
			peaks.append(peaks[-1])
	peaks.append(peaks[-1])
	maxi = 0
	maxv = 0
	for l in range(n - k + 1):
		if peaks[l + k - 2] - peaks[l] > maxv:
			maxv = peaks[l + k - 2] - peaks[l]
			maxi = l
	print(maxv + 1, maxi + 1)


T = int(input())
while T:
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	P = [0 for i in range(n)]
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			P[i] = 1
	for i in range(1, n):
		P[i] = P[i] + P[i - 1]
	D = [0 for i in range(n)]
	for i in range(n - k + 1):
		D[i] = P[i + k - 2] - P[i]
	M = max(D)
	L = D.index(M)
	print(M + 1, L + 1)
	T = T - 1


t = int(input())
while t > 0:
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	ans = -1
	min_l = 0
	peak = [0 for i in range(n)]
	for i in range(1, n - 1):
		peak[i] += peak[i - 1]
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peak[i] = peak[i] + 1
	for i in range(n + 1 - k):
		val = peak[i + k - 2] + 1 - peak[i]
		if ans < val:
			min_l = i + 1
			ans = val
	print(ans, min_l)
	t -= 1


import sys
import math

def ii():
	return sys.stdin.readline().strip()

def idata():
	return [int(x) for x in ii().split()]

def bfs(graph, start_ver):
	visited = set()
	queue = [[start_ver, 0]]
	visited.add(start_ver)
	(ans_way_length, ans_ver) = (0, 1)
	while queue:
		ver = queue[0]
		queue = queue[1:]
		for new_ver in graph[ver[0]]:
			if new_ver not in visited:
				visited.add(new_ver)
				queue += [[new_ver, ver[1] + 1]]
				if ans_way_length < ver[1] + 1:
					(ans_ver, ans_way_length) = (new_ver, ver[1] + 1)
	return (ans_ver, ans_way_length)

def dfs(graph, ver):
	used_v = set()
	depth = [0] * (len(graph) + 1)
	level = [ver]
	num_of_level = 0
	while level:
		new_level = []
		for v in level:
			depth[v] = num_of_level
			used_v.add(v)
			for v1 in graph[v]:
				if v1 not in used_v:
					new_level += [v1]
		level = new_level
		num_of_level += 1
	return depth

def binary_search(array, x):
	(left, right) = (-1, len(array))
	while left + 1 != right:
		middle = (left + right) // 2
		if array[middle] >= x:
			right = middle
		elif array[middle] < x:
			left = middle
	return right

def c_mod(n1, k1, mod1):
	num = den = 1
	for i in range(n1 - k1):
		num = num * (n1 - i) % mod1
		den = den * (i + 1) % mod1
	return num * pow(den, mod1 - 2, mod1) % mod1

def c(n1, k1):
	num = den = 1
	for i in range(n1 - k1):
		num = num * (n1 - i)
		den = den * (i + 1)
	return num // den

def v_sistemu(x, k):
	x = int(x)
	z = ''
	while x:
		z += str(x % k)
		x //= k
	return z[::-1]

def iz_sistemi(x, k):
	x = str(x)[::-1]
	ans = 0
	for i in range(len(x)):
		ans += int(x[i]) * pow(k, i)
	return ans

def solve_of_problem():
	(n, k) = idata()
	data = idata()
	data1 = [0] * n
	for i in range(1, n - 1):
		if data[i] > data[i - 1] and data[i] > data[i + 1]:
			data1[i] = 1
	maxx = sum(data1[0:k - 1])
	summ = maxx
	l = 0
	for i in range(n - k + 1):
		if data1[i + 1] < data1[i + k - 1]:
			summ += 1
		elif data1[i + 1] > data1[i + k - 1]:
			summ -= 1
		if summ > maxx:
			l = i + 1
			maxx = summ
	print(maxx + 1, l + 1)
	return
for ______ in range(int(ii())):
	solve_of_problem()


from collections import deque
t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split(' ')]
	a = [int(i) for i in input().split(' ')]
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			peaks[i] = 1
	pref = [0] * n
	for i in range(1, n):
		pref[i] = pref[i - 1] + peaks[i]
	c_max = 0
	c_l = 0
	for l in range(0, n - k + 1):
		if pref[l + k - 2] - pref[l] > c_max:
			c_max = pref[l + k - 2] - pref[l]
			c_l = l
	print(c_max + 1, c_l + 1)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	l = []
	for i in range(n):
		l.append([0, 0])
	for i in range(1, n):
		if i != n - 1:
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				l[i][0] = 1
				l[i][1] = l[i - 1][1] + 1
			else:
				l[i][1] = l[i - 1][1]
		else:
			l[i][1] = l[i - 1][1]
	p = 0
	r = 1
	for i in range(n - k + 1):
		d = l[i + k - 1][1] - l[i][1]
		if l[i + k - 1][0] == 1 or l[i][0] == 1:
			d = d - 1
		if d > p:
			p = d
			r = i + 1
	print(p + 1, r)


for _ in range(int(input())):
	a = list(map(int, input().split()))
	k = a[1]
	l = list(map(int, input().split()))
	(i, t, f) = (1, [], 0)
	t.append(0)
	while i < len(l):
		if l[i] > l[i - 1]:
			if i - 2 >= 0:
				if l[i - 2] < l[i - 1]:
					t[i - 1] = 0
			t.append(1)
		else:
			t.append(0)
		i += 1
	summ = [0] * len(t)
	t[-1] = 0
	i = 1
	summ[0] = t[0]
	while i < len(t):
		summ[i] = summ[i - 1] + t[i]
		i += 1
	i = k - 1
	(maxi, index) = (0, 0)
	while i < len(summ):
		if summ[i] == summ[i - 1] + 1:
			if summ[i - 1] - summ[i - k + 1] > maxi:
				maxi = summ[i - 1] - summ[i - k + 1]
				index = i - k + 1
		elif summ[i] - summ[i - k + 1] > maxi:
			index = i - k + 1
			maxi = summ[i] - summ[i - k + 1]
		i += 1
	print(maxi + 1, index + 1)


q = int(input())
while q > 0:
	q -= 1
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a.insert(0, 0)
	res = -2
	u = 0
	p = [0] * (n + 5)
	for i in range(2, n):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			p[i] = p[i - 1] + 1
		else:
			p[i] = p[i - 1]
	for i in range(1, n + 1):
		if i + k - 1 > n:
			break
		if res < p[i + k - 2] - p[i]:
			res = p[i + k - 2] - p[i]
			u = i
	print(res + 1, u)


def task(n, k, a):
	peeks = {}
	for i in range(0, n):
		if i == 0 or i == n - 1:
			continue
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peeks[i] = True
	current_peeks = 0
	for i in range(1, k - 1):
		if i in peeks:
			current_peeks += 1
	best = current_peeks
	best_l = 0
	for l in range(1, n - k + 1):
		if l in peeks:
			current_peeks -= 1
		r = l + k - 1
		if r - 1 in peeks:
			current_peeks += 1
		if current_peeks > best:
			best = current_peeks
			best_l = l
	print(best + 1, best_l + 1)
t = int(input())
for i in range(0, t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	task(n, k, a)


printn = lambda x: print(x, end='')
inn = lambda : int(input())
inl = lambda : list(map(int, input().split()))
inm = lambda : map(int, input().split())
ins = lambda : input().strip()
DBG = True
BIG = 10 ** 18
R = 10 ** 9 + 7

def ddprint(x):
	if DBG:
		print(x)
t = inn()
for tt in range(t):
	(n, k) = inm()
	a = inl()
	acc = [0] * n
	for i in range(1, n - 1):
		acc[i] = acc[i - 1]
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			acc[i] += 1
	mx = 0
	mxi = 1
	for i in range(0, n - k + 1):
		if acc[i + k - 2] - acc[i] > mx:
			mx = acc[i + k - 2] - acc[i]
			mxi = i + 1
	print('{} {}'.format(mx + 1, mxi))


t = int(input())
for i in range(t):
	(n, k) = map(int, input().strip().split(' '))
	a = [int(x) for x in input().split()]
	b = [0 for j in range(n)]
	for j in range(1, n - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			b[j] = b[j - 1] + 1
		else:
			b[j] = b[j - 1]
	res = []
	for j in range(n - k + 1):
		res.append(b[j + k - 2] - b[j])
	m = res[0]
	ind = 0
	for j in range(len(res)):
		if res[j] > m:
			m = res[j]
			ind = j
	print(m + 1, ind + 1)


t = int(input())

def isPeak(m, i):
	return m[i] > m[i - 1] and m[i] > m[i + 1]
for _ in range(t):
	(n, k) = map(int, input().split())
	m = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		p[i] = 1 if m[i] > m[i - 1] and m[i] > m[i + 1] else 0
	l = 0
	r = l + k - 1
	peaks = 0
	maxPeaks = 0
	sol_l = 0
	for i in range(l + 1, r):
		peaks += p[i]
	maxPeaks = max(maxPeaks, peaks)
	while l < n - k:
		peaks -= p[l + 1]
		peaks += p[r]
		l += 1
		r += 1
		if peaks > maxPeaks:
			maxPeaks = peaks
			sol_l = l
	print(maxPeaks + 1, sol_l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	b = list(map(int, input().split()))
	peak = [0] * n
	for i in range(1, n - 1):
		if b[i] > b[i - 1] and b[i] > b[i + 1]:
			peak[i] = 1
	count = sum(peak[1:k - 1])
	ind = 0
	initial = count
	for i in range(1, n - k + 1):
		initial -= peak[i] - peak[k - 2 + i]
		if initial > count:
			count = initial
			ind = i
	print(count + 1, ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	ans = 0
	p = 0
	peak = [False]
	for i in range(1, n - 1):
		if ar[i] > ar[i + 1] and ar[i] > ar[i - 1]:
			peak.append(True)
		else:
			peak.append(False)
	initial_window = 0
	for i in range(1, k - 1):
		if ar[i] > ar[i - 1] and ar[i] > ar[i + 1]:
			initial_window += 1
	pc = initial_window
	ans = 1
	peak.append(False)
	for i in range(2, n - 1):
		l = i
		r = l + k - 2 - 1
		if r >= n:
			break
		prel = l - 1
		prer = r - 1
		if peak[prel]:
			initial_window -= 1
		if peak[r]:
			initial_window += 1
		if initial_window > pc:
			pc = initial_window
			ans = i
	print(pc + 1, ans)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	s = [int(i) for i in input().split()]
	d = [0 for i in range(n)]
	for i in range(1, n - 1):
		if s[i] > s[i - 1] and s[i] > s[i + 1]:
			d[i] = 1
	e = [sum(d[0:k - 1])]
	for i in range(1, n - k + 1):
		e.append(e[-1] - d[i] + d[i + k - 2])
	a = max(e)
	for i in range(len(e)):
		if e[i] == a:
			print(a + 1, i + 1)
			break


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	l = 0
	r = k - 1
	cur_peak = 0
	for i in range(l + 1, r):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			cur_peak += 1
	max_peak = cur_peak
	(optimal_l, optimal_r) = (l, r)
	l += 1
	r += 1
	while r <= len(arr) - 1:
		if arr[l] > arr[l - 1] and arr[l] > arr[l + 1]:
			cur_peak -= 1
		if arr[r - 2] < arr[r - 1] and arr[r - 1] > arr[r]:
			cur_peak += 1
		if max_peak < cur_peak:
			max_peak = cur_peak
			(optimal_l, optimal_r) = (l, r)
		l += 1
		r += 1
	print(max_peak + 1, optimal_l + 1)


def check(x, peaks, index, k):
	l = peaks[index] - 1
	r = peaks[x] + 1
	if r - l + 1 <= k:
		return True
	return False

def find(peaks, index, k):
	ans = index
	low = index
	high = len(peaks) - 1
	while low <= high:
		mid = (low + high) // 2
		if check(mid, peaks, index, k):
			ans = mid
			low = mid + 1
		else:
			high = mid - 1
	return ans

def solve(arr, n, k, ans):
	max_peaks = 0
	peaks = []
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks.append(i)
	l = 1
	for i in range(len(peaks)):
		index = find(peaks, i, k)
		if index - i + 1 > max_peaks:
			r = peaks[index] + 1
			l = max(1, r - k + 2)
			max_peaks = index - i + 1
	ans.append(str(max_peaks + 1) + ' ' + str(l))

def main():
	t = int(input())
	ans = []
	for i in range(t):
		(n, k) = map(int, input().split())
		arr = list(map(int, input().split()))
		solve(arr, n, k, ans)
	for i in ans:
		print(i)
main()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peak = [0 for _ in range(n)]
	p = [0 for _ in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = p[i - 1] + 1
			peak[i] = 1
		else:
			p[i] = p[i - 1]
	p[n - 1] = p[n - 2]
	ans = 0
	l = 1
	for i in range(n - k + 1):
		m = p[i + k - 1] - p[i]
		if peak[i + k - 1] == 1 and i + k - 1 != n - 1:
			m = m - 1
		if m > ans:
			ans = m
			l = i + 1
	print(ans + 1, l)


T = int(input())
for test_no in range(T):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	b = [False] * n
	ans = 1
	c = 1
	x = 1
	for i in range(1, n - 1):
		if l[i - 1] < l[i] and l[i + 1] < l[i]:
			b[i] = True
	for i in range(1, k - 1):
		c += b[i]
	ans = max(ans, c)
	for i in range(2, n - k + 2):
		c -= b[i - 1]
		c += b[i + k - 3]
		if c > ans:
			ans = max(ans, c)
			x = i
	print(ans, x)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	peaks_left = [0] * n
	for i in range(1, len(a) - 1):
		if a[i - 1] < a[i] and a[i + 1] < a[i]:
			peaks_left[i] = peaks_left[i - 1] + 1
		else:
			peaks_left[i] = peaks_left[i - 1]
	peaks_left[-1] = peaks_left[-2]
	mx = 0
	index = 0
	try:
		for i in range(n):
			curr = peaks_left[i + k - 2] - peaks_left[i]
			if curr > mx:
				mx = curr
				index = i
	except:
		pass
	print(mx + 1, index + 1)


def countpeaks(s):
	ans = 0
	for i in range(1, k - 1):
		if s[i - 1] < s[i] > s[i + 1]:
			ans += 1
	return ans
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 0
	s = a[:k]
	peaks = countpeaks(s)
	newpeaks = peaks
	for i in range(1, n - k + 1):
		if a[i - 1] < a[i] > a[i + 1]:
			newpeaks -= 1
		if a[i + k - 1] < a[i + k - 2] > a[i + k - 3]:
			newpeaks += 1
		if newpeaks > peaks:
			l = i
			peaks = newpeaks
	print(peaks + 1, l + 1)


def door(n, k, mountains):
	m = [0 for i in range(n - 1)]
	i = 0
	while i < n - 2:
		if mountains[i] < mountains[i + 1] and mountains[i + 1] > mountains[i + 2]:
			m[i] = 1
			i += 1
		i += 1
	maximum = sum(m[:k - 2])
	current = maximum
	index = 0
	for i in range(1, n - k + 1):
		current = current - m[i - 1] + m[i + k - 3]
		if current > maximum:
			maximum = current
			index = i
	return (maximum + 1, index + 1)
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	mountains = list(map(int, input().split()))
	print(*door(n, k, mountains))


from collections import deque
import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = deque([])
	ans = 0
	i = 0
	while i < k:
		p.append(l[i])
		i += 1
	for e in range(1, len(p) - 1):
		if p[e] > p[e - 1] and p[e] > p[e + 1]:
			ans += 1
	j = i
	i = 0
	left = 0
	po = ans
	while j < n:
		cnt = 0
		if p[1] > p[0] and p[1] > p[2]:
			cnt += 1
		tans = po - cnt
		cnt = 0
		p.append(l[j])
		p.popleft()
		if p[-2] > p[-1] and p[-2] > p[-3]:
			cnt += 1
		tans += cnt
		if tans > ans:
			left = i + 1
			ans = tans
		j = j + 1
		i = i + 1
		po = tans
	print(ans + 1, left + 1)


def f(a, k):
	pref = [0] * len(a)
	n = len(a)
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			pref[i] += 1
	for i in range(1, len(a)):
		pref[i] += pref[i - 1]
	mx = max(pref)
	ind = None
	mx = -float('inf')
	for i in range(0, n - k + 1):
		if mx < pref[i + k - 2] - pref[i]:
			mx = pref[i + k - 2] - pref[i]
			ind = i
	return (mx + 1, ind + 1)
for i in range(int(input())):
	(a, b) = map(int, input().strip().split())
	l = list(map(int, input().strip().split()))
	print(*f(l, b))


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	countpeaks = 0
	rindex = k - 1
	currpeaks = 0
	peaks = [0 for i in range(n)]
	arr.reverse()
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			countpeaks += 1
			peaks[i] = 1
	currpeaks = countpeaks
	j = 0
	for i in range(k, n):
		if arr[i - 1] > arr[i] and arr[i - 1] > arr[i - 2]:
			currpeaks += 1
		if arr[j + 1] > arr[j + 2] and arr[j + 1] > arr[j]:
			currpeaks -= 1
		if currpeaks >= countpeaks:
			countpeaks = currpeaks
			rindex = i
		j += 1
	print(countpeaks + 1, n - rindex)


import math
LI = lambda : list(map(int, input().split()))
MI = lambda : map(int, input().split())
yes = lambda : print('YES')
no = lambda : print('NO')
I = lambda : list(input())
J = lambda x: ''.join(x)
II = lambda : int(input())
SI = lambda : input()
t = II()
for q in range(t):
	(n, k) = MI()
	a = LI()
	count = 0
	aa = [0] * n
	m = 0
	ind = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			count += 1
		aa[i] = count
	for i in range(n - k + 1):
		if aa[i + k - 2] - aa[i] + 1 > m:
			m = aa[i + k - 2] - aa[i] + 1
			ind = i
	print(m, ind + 1)


from collections import defaultdict
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	pre = [0]
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			pre.append(pre[-1] + 1)
		else:
			pre.append(pre[-1])
	pre.append(pre[-1])
	di = defaultdict(list)
	for i in range(n - k + 1):
		m = pre[i + k - 2] - pre[i]
		di[m].append([i, i + k - 1])
	di = sorted(di.items(), key=lambda kv: kv[0], reverse=True)
	print(di[0][0] + 1, di[0][1][0][0] + 1)


for Z in range(int(input())):
	(n, k) = map(int, input().split())
	D = [0] * (n + 1)
	for (count, i) in enumerate(input().split()):
		i = int(i)
		if count == 0:
			prev = i
		elif count == 1:
			A = i
		else:
			nxt = i
			if A > nxt and A > prev:
				D[count] = 1 + D[count - 1]
			else:
				D[count] = D[count - 1]
			prev = A
			A = nxt
	lmax = n - k + 1
	s = D[-2] + 1
	t = 0
	l = 0
	for i in range(1, lmax + 1):
		m = D[i + k - 2] - D[i] + 1
		if m == s:
			l = i
			t = m
			break
		if m > t:
			l = i
			t = m
	print(t, l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	b[0] = 1
	for i in range(1, n):
		if a[i] > a[i - 1]:
			b[i] = b[i - 1] + 1
		else:
			b[i] = 0
	peak = [0] * n
	peak[0] = 0
	peak[1] = 0
	for i in range(2, n):
		if b[i - 1] > b[i]:
			peak[i] = peak[i - 1] + 1
		else:
			peak[i] = peak[i - 1]
	ind = 0
	maxx = 0
	for i in range(n - k + 1):
		if peak[i + k - 1] - peak[i + 1] > maxx:
			maxx = peak[i + k - 1] - peak[i + 1]
			ind = i
	print(maxx + 1, ind + 1)


from collections import deque
t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().strip().split()))
	arr = list(map(int, input().strip().split()))
	(start, end) = (0, 1)
	q = deque()
	while end < k - 1:
		if arr[end - 1] < arr[end] and arr[end] > arr[end + 1]:
			q.append(end)
		end += 1
	(ans, ind) = (len(q), start)
	while end < n - 1:
		if q and q[0] == start + 1:
			q.popleft()
		if arr[end - 1] < arr[end] and arr[end] > arr[end + 1]:
			q.append(end)
		start += 1
		end += 1
		if len(q) > ans:
			ans = len(q)
			ind = start
	print(str(ans + 1) + ' ' + str(ind + 1))


def binarySearch(arr, l, r, x):
	if r >= l:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return binarySearch(arr, l, mid - 1, x)
		else:
			return binarySearch(arr, mid + 1, r, x)
	else:
		return -1
from bisect import bisect_left
for _ in range(int(input())):
	(N, K) = list(map(int, input().split()))
	A = list(map(int, input().split()))
	peaks = []
	for i in range(1, N - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			peaks.append(i + 1)
	if len(peaks) == 0:
		print(1, 1)
	elif len(peaks) == 1:
		if peaks[0] + 2 - K > 0:
			print(2, peaks[0] + 2 - K)
		else:
			print(2, 1)
	else:
		maxpeak = []
		for i in range(1, N - K + 2):
			if binarySearch(peaks, 0, len(peaks) - 1, i) == -1:
				b = i + K - 1
				count = bisect_left(peaks, b) - bisect_left(peaks, i)
				maxpeak.append((count, i))
		maxpeak.sort()
		a = maxpeak[-1][0]
		ans = []
		for i in range(len(maxpeak) - 1, -1, -1):
			r = maxpeak[i][0]
			if r == a:
				ans.append((maxpeak[i][1], maxpeak[i][0]))
		ans.sort()
		print(ans[0][1] + 1, ans[0][0])


t = int(input())
for y in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ct = 0
	for i in range(1, k - 1):
		if a[i] >= a[i - 1] and a[i] >= a[i + 1]:
			ct += 1
	ans = ct
	lb = 0
	for i in range(k, n):
		if a[i - 1] >= a[i - 2] and a[i - 1] >= a[i]:
			ct += 1
		if a[i - k + 1] >= a[i - k] and a[i - k + 1] >= a[i - k + 2]:
			ct -= 1
		if ct > ans:
			ans = ct
			lb = i - k + 1
	print(ans + 1, lb + 1)


import sys
lines = sys.stdin.readlines()
T = int(lines[0].strip())
for t in range(T):
	(n, k) = list(map(int, lines[2 * t + 1].strip().split(' ')))
	nums = list(map(int, lines[2 * t + 2].strip().split(' ')))
	peaks = [0 for _ in range(n)]
	for i in range(1, n - 1):
		if nums[i] > nums[i - 1] and nums[i] > nums[i + 1]:
			peaks[i] = 1
	for i in range(1, n):
		peaks[i] += peaks[i - 1]
	maxP = -1
	maxIndex = -1
	for i in range(n - k + 1):
		if peaks[i + k - 2] - peaks[i] > maxP:
			maxP = peaks[i + k - 2] - peaks[i]
			maxIndex = i
	print('{} {}'.format(maxP + 1, maxIndex + 1))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peaks = [0]
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	presum = [0] * n
	for i in range(1, n):
		presum[i] = presum[i - 1] + peaks[i]
	ans = [-float('inf'), -1]
	for i in range(n - k + 1):
		temp = presum[i + k - 1] - presum[i] - peaks[i + k - 1]
		if temp > ans[0]:
			ans[0] = temp
			ans[1] = i
	print(ans[0] + 1, ans[1] + 1)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	ans = [0 for _ in range(n)]
	for j in range(1, n - 1):
		if s[j + 1] < s[j] > s[j - 1]:
			ans[j] = 1
	maxx = 0
	idd = 1
	for j in range(k - 1):
		maxx += ans[j]
	am = maxx
	for j in range(1, n - k + 1):
		if ans[j] == 1:
			am -= 1
		if s[j + k - 3] < s[j + k - 2] > s[j + k - 1]:
			am += 1
		if am > maxx:
			maxx = am
			idd = j + 1
	print(maxx + 1, idd)


y = int(input())
for i in range(y):
	al = input().split()
	m = list(map(int, al))
	n = m[0]
	k = m[1]
	al = input().split()
	m = list(map(int, al))
	p = [0]
	pl = 0
	for j in range(1, n - 1):
		if m[j - 1] < m[j] and m[j + 1] < m[j]:
			pl += 1
		p.append(pl)
	p.append(pl)
	kk = []
	for j in range(1, n + 2 - k):
		if p[j + k - 2] > p[j + k - 3]:
			kk.append(p[j + k - 2] - p[j - 1] - 1)
			continue
		kk.append(p[j + k - 2] - p[j - 1])
	max = 0
	ind = 0
	for j in range(len(kk)):
		if kk[j] > max:
			max = kk[j]
			ind = j
	print(max + 1, ind + 1)


T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	ispeak = [0] * n
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			ispeak[i] = 1
	mx = 0
	ind = 0
	cnt = 0
	for i in range(1, k - 1):
		if ispeak[i] == 1:
			cnt += 1
	mx = cnt
	for i in range(k - 1, n):
		if ispeak[i] == 1:
			cnt += 1
		if ispeak[i - k + 2] == 1:
			cnt -= 1
		if cnt > mx:
			mx = cnt
			ind = i - k + 2
	print(mx + 1, ind + 1)


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	h = list(map(int, input().split()))
	p = [0]
	for i in range(1, n - 1):
		if h[i] > max(h[i - 1], h[i + 1]):
			p.append(1)
		else:
			p.append(0)
	p.append(0)
	best_ps = sum(p[1:k - 1])
	l = 0
	cur_sum = best_ps
	for i in range(n - k):
		cur_sum = cur_sum - p[i + 1] + p[k + i - 1]
		if best_ps < cur_sum:
			best_ps = cur_sum
			l = i + 1
	print('{} {}'.format(best_ps + 1, l + 1))


import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().split()]
	ht = [int(x) for x in input().split()]
	peaks = []
	for i in range(1, n - 1):
		if ht[i - 1] < ht[i] > ht[i + 1]:
			peaks.append(i)
	ans = (0, 0)
	j = 0
	for i in range(len(peaks)):
		while peaks[i] - peaks[j] >= k - 2:
			j += 1
		nPeaks = i - j + 1
		if nPeaks > ans[0]:
			ans = (nPeaks, peaks[i])
	if ans[0] == 0:
		print('1 1')
		continue
	brokenPieces = ans[0] + 1
	left = ans[1] + 1 - k + 1
	if left < 0:
		left = 0
	left += 1
	print('{} {}'.format(brokenPieces, left))


m = int(input())
for i in range(0, m):
	(n, k) = map(int, input().split())
	cp = [0]
	l = list(map(int, input().strip().split()))[:n]
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			cp.append(1)
		else:
			cp.append(0)
	cp.append(0)
	for i in range(1, n):
		cp[i] = cp[i] + cp[i - 1]
	m = cp[k - 2] - cp[0]
	sol = 1
	l = 2
	while l < n - k + 2:
		if m < cp[l + k - 3] - cp[l - 1]:
			m = cp[l + k - 3] - cp[l - 1]
			sol = l
		l = l + 1
	print(str(m + 1) + ' ' + str(sol))


for _ in range(int(input())):
	X = list(map(int, input().split()))
	Peaks = list(map(int, input().split()))
	(Check, DP) = ([False] * X[0], [0] * X[0])
	for i in range(1, X[0] - 1):
		DP[i] = DP[i - 1]
		if Peaks[i] > Peaks[i - 1] and Peaks[i] > Peaks[i + 1]:
			Check[i] = True
			DP[i] += 1
	DP[-1] = DP[-2]
	(Max, Index) = (0, 0)
	for i in range(X[0] - X[1] + 1):
		Number = DP[i + X[1] - 1] - DP[i]
		if Check[i]:
			Number -= 1
		if Check[i + X[1] - 1]:
			Number -= 1
		if Number > Max:
			Max = Number
			Index = i
	print(Max + 1, Index + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [0] * n
	for i in range(1, n - 1):
		b[i] = b[i - 1]
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] += 1
	b[n - 1] = b[n - 2]
	b.insert(0, 0)
	maxi = -1
	l = -1
	for i in range(1, n - k + 2):
		ans = b[i + k - 1] - b[i]
		if b[i] != b[i - 1]:
			ans -= 1
		if b[i + k - 1] != b[i + k - 2]:
			ans -= 1
		if ans > maxi:
			maxi = ans
			l = i
	print(maxi + 1, l)


from collections import defaultdict, deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
sqrt = math.sqrt

def LI():
	return list(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def LI_():
	return list(map(lambda x: int(x) - 1, input().split()))

def II():
	return int(input())

def IF():
	return float(input())

def S():
	return input().rstrip()

def LS():
	return S().split()

def IR(n):
	return [II() for _ in range(n)]

def LIR(n):
	return [LI() for _ in range(n)]

def FR(n):
	return [IF() for _ in range(n)]

def LFR(n):
	return [LI() for _ in range(n)]

def LIR_(n):
	return [LI_() for _ in range(n)]

def SR(n):
	return [S() for _ in range(n)]

def LSR(n):
	return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

def solve():
	(n, k) = LI()
	a = LI()
	dp = [0] * n
	for i in range(1, n - 1):
		dp[i] = a[i + 1] < a[i] and a[i] > a[i - 1]
	dp = list(itertools.accumulate(dp))
	ans = [1, 1]
	for i in range(n - k + 1):
		if ans[0] < dp[i + k - 2] - dp[i] + 1:
			ans = [dp[i + k - 2] - dp[i] + 1, i + 1]
	print(ans[0], ans[1])
	return
for _ in range(II()):
	solve()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i + 1] < a[i] > a[i - 1]:
			b[i] = 1
	ind = 0
	t = sum(b[1:k - 1])
	s = t
	for i in range(1, n - k + 1):
		s -= b[i] - b[k - 2 + i]
		if s > t:
			t = s
			ind = i
	print(t + 1, ind + 1)


import sys
input = sys.stdin.readline
t = int(input())
while t > 0:
	t -= 1
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	d = {}
	l = 0
	r = 1
	c = 0
	maxi = 0
	lp = 1
	while r < n - 1:
		if a[r - 1] < a[r] > a[r + 1]:
			d[r] = 1
			c += 1
		r += 1
		if r + 1 - l == k:
			if maxi < c:
				maxi = c
				lp = l + 1
			if l + 1 in d:
				c -= 1
			l += 1
	print(maxi + 1, lp)


tc = int(input())
for _ in range(tc):
	(n, k) = map(int, input().split())
	arr = [int(x) for x in input().split()]
	mx = 0
	p = [0] * n
	for x in range(1, n - 1):
		if arr[x] > arr[x - 1] and arr[x] > arr[x + 1]:
			p[x] = 1
	for i in range(1, n):
		p[i] += p[i - 1]
	index = 0
	for L in range(0, n - k + 1):
		p[L] = p[L + k - 2] - p[L]
		if p[L] > mx:
			mx = p[L]
			index = L
	print(mx + 1, index + 1)


T = int(input())
for test in range(T):
	(N, K) = list(map(int, input().split()))
	heightsarray = list(map(int, input().split()))
	peakscount = []
	for n in range(N):
		if n == 0:
			peakscount.append(0)
		elif n == N - 1:
			peakscount.append(peakscount[-1])
		elif heightsarray[n] > heightsarray[n - 1] and heightsarray[n] > heightsarray[n + 1]:
			peakscount.append(peakscount[-1] + 1)
		else:
			peakscount.append(peakscount[-1])
	maxpeaks = 0
	startindex = 0
	for index in range(N - 1, K - 2, -1):
		peaks = peakscount[index - 1] - peakscount[index - K + 1]
		if peaks >= maxpeaks:
			maxpeaks = peaks
			startindex = index - K + 1
	pieces = maxpeaks + 1
	startpos = startindex + 1
	print(pieces, startpos)


def func(k, mount):
	peaks = [0] * len(mount)
	for i in range(1, len(mount) - 1):
		if mount[i - 1] < mount[i] and mount[i + 1] < mount[i]:
			peaks[i] = 1
	cur_peaks = sum(peaks[:k - 1])
	max_peaks = cur_peaks
	idx_max = 0
	for i in range(1, len(peaks) - k + 1):
		cur_peaks -= peaks[i]
		cur_peaks += peaks[i + k - 2]
		if cur_peaks > max_peaks:
			max_peaks = cur_peaks
			idx_max = i
	pass
	return '{0} {1}'.format(str(max_peaks + 1), str(idx_max + 1))
t = int(input())
out = []
for _ in range(t):
	(n, k) = tuple(map(int, input().split(' ')))
	mount = list(map(int, input().split(' ')))
	out.append(func(k, mount))
for e in out:
	print(e)


import sys
input = sys.stdin.readline
for t in range(int(input())):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	mountains = {0: 0, n - 1: 0}
	for j in range(1, len(a) - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			mountains[j] = 1
		else:
			mountains[j] = 0
	currentMax = -1
	currentVal = 0
	l = 0
	for f in range(1, k - 1):
		currentVal = currentVal + mountains[f]
	currentMax = currentVal
	for go in range(n - k + 1):
		currentVal = currentVal + mountains[go + k - 1] - mountains[go + 1]
		if currentVal > currentMax:
			currentMax = currentVal
			l = go + 1
	print(str(currentMax + 1) + ' ' + str(l + 1))


def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	(n, k) = read_ints()
	a = read_ints()
	peaks = 0
	max_peaks = 0
	left_index = 0
	j = 0
	for i in range(n - k + 1):
		for j in range(j, i + k):
			if j > 0 and j < i + k - 1 and (a[j - 1] < a[j] > a[j + 1]):
				peaks += 1
		if peaks > max_peaks:
			max_peaks = peaks
			left_index = i
		if a[i] < a[i + 1] > a[i + 2]:
			peaks -= 1
	return f'{max_peaks + 1} {left_index + 1}'
T = read_int()
for _ in range(T):
	print(solve())


t = int(input())
for br in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	max_ind = 0
	max_k = 0
	p_k = 0
	prev = [0] * n
	for j in range(1, n - 1):
		bool1 = a[j] > a[j - 1] and a[j] > a[j + 1]
		if bool1:
			p_k += 1
		prev[j] = p_k
	prev[n - 1] = p_k
	for i in range(n - k + 2):
		prev_k = prev[i + k - 2] - prev[i]
		if prev_k > max_k:
			max_k = prev_k
			max_ind = i
	print(max_k + 1, max_ind + 1)


import sys
import bisect
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	pref = [0] * n
	peak = [0] * n
	for i in range(n):
		if i != 0 and i != n - 1:
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				peak[i] = 1
				pref[i] = 1
	for i in range(1, n):
		pref[i] += pref[i - 1]
	maxi = 0
	ind = 0
	for i in range(n - k + 1):
		if i == 0:
			pref[k - 1] - peak[0] - peak[k - 1]
			if maxi < pref[k - 1] - peak[0] - peak[k - 1]:
				maxi = pref[k - 1] - peak[0] - peak[k - 1]
				ind = i + 1
		elif pref[i + k - 1] - pref[i - 1] - peak[i + k - 1] - peak[i] > maxi:
			maxi = pref[i + k - 1] - pref[i - 1] - peak[i + k - 1] - peak[i]
			ind = i + 1
	if ind == 0:
		ind = 1
	print(maxi + 1, ind)


import sys
input = sys.stdin.readline
from collections import *
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	is_peak = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			is_peak[i] = 1
	acc = [0] * (n + 1)
	for i in range(n):
		acc[i + 1] = acc[i] + is_peak[i]
	M = 0
	for i in range(n - k + 1):
		M = max(M, acc[i + k - 1] - acc[i + 1] + 1)
	for i in range(n - k + 1):
		if acc[i + k - 1] - acc[i + 1] + 1 == M:
			print(M, i + 1)
			break


t = int(input())
while t:
	(n, k) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	picos = [0] * n
	for i in range(1, n):
		picos[i] += picos[i - 1]
		if i < n - 1 and arr[i] > arr[i - 1] and (arr[i] > arr[i + 1]):
			picos[i + 1] += 1
	mx = 0
	i = 0
	start = 0
	while i + k - 1 < n:
		if picos[i + k - 1] - picos[i + 1] > mx:
			start = i
			mx = picos[i + k - 1] - picos[i + 1]
		i += 1
	print(mx + 1, start + 1)
	t -= 1


t = input()
t = int(t)
while t:
	t -= 1
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	arr = list(map(int, input().split()))
	s = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			s[i] = s[i - 1] + 1
		else:
			s[i] = s[i - 1]
	s[n - 1] = s[n - 2]
	ans = 0
	ansl = 0
	for l in range(0, n - k + 1):
		r = l + k - 1
		if s[l] >= s[l + 1]:
			low = s[l + 1]
		else:
			low = s[l]
		peaks = s[r - 1] - low
		if peaks > ans:
			ansl = l
			ans = peaks
	anst = ans + 1
	print(anst, ansl + 1)


t = int(input())
for inp in range(t):
	(n, k) = map(int, input().split())
	l = [int(x) for x in input().split()]
	p = [0 for i in range(len(l))]
	for i in range(1, len(l) - 1):
		if l[i] > l[i + 1] and l[i] > l[i - 1]:
			p[i] = p[i - 1] + 1
		else:
			p[i] = p[i - 1]
	p[n - 1] = p[n - 2]
	m = p[k - 2] - p[0]
	index = 0
	for i in range(n - k + 1):
		if m < p[i + k - 2] - p[i]:
			m = p[i + k - 2] - p[i]
			index = i
	print(m + 1, index + 1)


import sys
readline = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, readline().split())
	a = list(map(int, readline().split()))
	peaks_l = [0] * n
	peaks_r = [0] * n
	for i in range(n - 3, -1, -1):
		peaks_l[i] = peaks_l[i + 1] + (1 if a[i] < a[i + 1] > a[i + 2] else 0)
	for i in range(n - 2, -1, -1):
		peaks_r[i] = peaks_r[i + 1] + (1 if a[i - 1] < a[i] > a[i + 1] else 0)
	ans = 1
	ans_i = 1
	for (l, r) in zip(range(n), range(k - 1, n)):
		if ans < peaks_l[l] - peaks_r[r] + 1:
			ans = peaks_l[l] - peaks_r[r] + 1
			ans_i = l + 1
	print(ans, ans_i)


import sys
from operator import add
input = sys.stdin.buffer.readline
INF = 2 ** 62 - 1

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

class SegmentTree:

	def __init__(self, array, operator, identity_element):
		_len = len(array)
		self.__op = operator
		self.__size = 1 << (_len - 1).bit_length()
		self.__tree = [identity_element] * self.__size + array + [identity_element] * (self.__size - _len)
		self.__ie = identity_element
		for i in range(self.__size - 1, 0, -1):
			self.__tree[i] = operator(self.__tree[i * 2], self.__tree[i * 2 + 1])

	def update(self, i, v):
		i += self.__size
		self.__tree[i] = v
		while i:
			i //= 2
			self.__tree[i] = self.__op(self.__tree[i * 2], self.__tree[i * 2 + 1])

	def query(self, l, r):
		l += self.__size
		r += self.__size
		ret = self.__ie
		while l < r:
			if l & 1:
				ret = self.__op(ret, self.__tree[l])
				l += 1
			if r & 1:
				r -= 1
				ret = self.__op(ret, self.__tree[r])
			l //= 2
			r //= 2
		return ret

def slv(N, K, A):
	p = [0] * N
	for i in range(1, N - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			p[i] = 1
	sp = [0]
	for a in p:
		sp.append(sp[-1] + a)
	ans = (-1, -1)
	for i in range(N - K + 1):
		v = sp[min(i + K - 1, N)] - sp[i + 1]
		if v > ans[0]:
			ans = (v, i)
	return (ans[0] + 1, ans[1] + 1)

def main():
	T = read_int()
	for _ in range(T):
		(N, K) = read_int_n()
		A = read_int_n()
		print(*slv(N, K, A))
main()


t = int(input())
for i in range(t):
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	s = [0] * n
	for j in range(1, n - 1):
		if a[j - 1] < a[j] and a[j + 1] < a[j]:
			s[j] = 1
	temp = sum(s[:k - 1])
	p = [0] * n
	if k != 2:
		p[0] = temp
		for j in range(1, n - k + 1):
			temp -= s[j]
			temp += s[j + k - 2]
			p[j] = temp
		mx = max(p)
		for j in range(len(p)):
			if p[j] == mx:
				print(p[j] + 1, j + 1)
				break
	else:
		print(0, 1)


from math import *
for zz in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(i) for i in input().split()]
	d = {}
	for i in range(n):
		d[a[i]] = 0
	st = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			st[i] = 1
	ca = st[1:k - 1].count(1)
	ci = 0
	m = ca
	for i in range(1, n - k + 1):
		ca -= st[i]
		ca += st[i + k - 2]
		if ca > m:
			m = ca
			ci = i
	print(m + 1, ci + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	arr = [False] * n
	count = 0
	start_index = 0
	min_index = 0
	maxi = 0
	for i in range(1, n - 1):
		if a[i + 1] < a[i] and a[i] > a[i - 1]:
			arr[i] = True
			count += 1
		if i >= k - 1:
			if arr[i] == True:
				if count - 1 > maxi:
					maxi = count - 1
					min_index = start_index
			elif count > maxi:
				maxi = count
				min_index = start_index
			if arr[start_index + 1] == True:
				count -= 1
			start_index += 1
	if count > maxi:
		maxi = count
		min_index = start_index
	print(maxi + 1, min_index + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	res = 0
	cnt = 0
	ind = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			cnt += 1
	res = cnt
	for i in range(k, n):
		l = i - k + 1
		r = i - 1
		if a[l] > a[l - 1] and a[l] > a[l + 1]:
			cnt -= 1
		if a[r] > a[r - 1] and a[r] > a[r + 1]:
			cnt += 1
		if cnt > res:
			res = cnt
			ind = i - k + 1
	print(res + 1, ind + 1)


from bisect import bisect_left, bisect_right
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = []
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks.append(i)
	max = 0
	left = 0
	for i in range(n):
		temp = bisect_left(peaks, i + k - 1) - bisect_right(peaks, i)
		if max < temp:
			max = temp
			left = i
	print(max + 1, left + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	t = [0] * n
	for x in range(1, n - 1):
		if l[x - 1] < l[x] > l[x + 1]:
			t[x] = 1
	su = sum(t[1:k - 1])
	s = sum(t[1:k - 1])
	ind = 0
	for z in range(1, n - k + 1):
		su += t[z + k - 2] - t[z]
		if su > s:
			ind = z
		s = max(s, su)
	print(s + 1, ind + 1)


from sys import stdin, gettrace
if not gettrace():

	def input():
		return next(stdin)[:-1]

def main():

	def solve():
		(n, k) = map(int, input().split())
		aa = [int(a) for a in input().split()]
		peaks = [0] * n
		for i in range(1, n - 1):
			if aa[i - 1] < aa[i] and aa[i] > aa[i + 1]:
				peaks[i] = peaks[i - 1] + 1
			else:
				peaks[i] = peaks[i - 1]
		best = 0
		bestl = 1
		for i in range(0, n - k + 1):
			if peaks[i + k - 2] - peaks[i] > best:
				best = peaks[i + k - 2] - peaks[i]
				bestl = i + 1
		print(best + 1, bestl)
	q = int(input())
	for _ in range(q):
		solve()
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	c = 0
	for i in range(1, k - 1):
		if a[i] > a[i + 1] and a[i] > a[i - 1]:
			c += 1
	a1 = c
	a2 = 0
	l = 0
	r = k - 1
	while r < n - 1:
		l += 1
		r += 1
		if a[l] > a[l + 1] and a[l] > a[l - 1]:
			c -= 1
		if a[r - 1] > a[r] and a[r - 1] > a[r - 2]:
			c += 1
		if c > a1:
			a1 = c
			a2 = l
	print(a1 + 1, a2 + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	index = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			index[i] = 1
	s = sum(index[1:k - 1])
	m = [s, 0]
	for i in range(n - k):
		s += index[i + k - 1]
		s -= index[i + 1]
		if s > m[0]:
			m[0] = s
			m[1] = i + 1
	print(m[0] + 1, m[1] + 1)


import collections
t = int(input())

def solve(arr, k):
	peaks = []
	for i in range(1, len(arr) - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	best = (0, 1)
	window = collections.deque()
	ones = collections.deque()
	bound = [1, 1]
	for i in range(0, len(peaks)):
		if len(window) < k - 2:
			window.append(peaks[i])
			bound[1] += 1
		else:
			v = window.popleft()
			if v == 1:
				ones.popleft()
			window.append(peaks[i])
			bound[0] += 1
			bound[1] += 1
		if peaks[i] == 1:
			ones.append(peaks[i])
		if len(ones) > best[0] and len(window) == k - 2:
			best = (len(ones), bound[0])
	print(best[0] + 1, best[1])
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	solve(arr, k)


t = int(input())
for dobpt in range(t):
	(n, k) = map(int, input().split())
	mas = list(map(int, input().split()))
	pics = [0] * (n + k)
	for i in range(1, n - 1):
		if mas[i] > mas[i - 1] and mas[i] > mas[i + 1]:
			pics[i] = 1
	s = [0] * (n + k)
	f = 0
	for i in range(n):
		f += pics[i]
		f -= pics[i - k]
		s[i - k + 1] = f
	for i in range(n):
		s[i - k + 1] -= pics[i]
		s[i] -= pics[i]
	answer = 0
	ind = 0
	for i in range(len(s)):
		if s[i] > answer:
			answer = s[i]
			ind = i
	print(answer + 1, ind + 1)


t = int(input())
while t:
	t = t - 1
	l = list(map(int, input().split()))
	(n, k) = (l[0], l[1])
	l1 = list(map(int, input().split()))
	l = [0] * n
	for w in range(1, n - 1):
		if l1[w - 1] < l1[w] and l1[w] > l1[w + 1]:
			l[w] = 'p'
	(c, d) = (0, 1)
	for w in range(1, k - 1):
		if l[w] == 'p':
			c += 1
	a = c
	for w in range(2, n):
		if w + k - 3 < n:
			if l[w - 1] == 'p':
				if l[w] != 'p':
					a -= 1
			if l[w + k - 3] == 'p':
				a += 1
			if a > c:
				c = a
				d = w
		else:
			break
	print(c + 1, d)


import math
import bisect
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	dp = [0] * n
	fin = 0
	ind = 0
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			dp[i] = dp[i - 1] + 1
		else:
			dp[i] = dp[i - 1]
	for i in range(k - 1, n):
		if dp[i - 1] - dp[i - (k - 1)] > fin:
			fin = dp[i - 1] - dp[i + 1 - k]
			ind = i - k + 1
	print(fin + 1, ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	mx = 0
	left = 0
	l = 0
	r = k - 1
	while l <= len(arr) - k:
		if l == 0:
			i = 1
			peek = 0
			while i < k - 1:
				if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
					peek += 1
				i += 1
			mx = peek
		else:
			if arr[l] > arr[l - 1] and arr[l] > arr[l + 1]:
				peek -= 1
			if arr[r - 1] > arr[r] and arr[r - 1] > arr[r - 2]:
				peek += 1
			if peek > mx:
				mx = peek
				left = l
		(l, r) = (l + 1, r + 1)
	if mx == 0:
		print(1, 1)
	else:
		print(mx + 1, left + 1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def outln(var):
	sys.stdout.write(str(var) + '\n')

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	(n, k) = sp()
	k -= 1
	arr = l()
	window = deque()
	dp = dd(int)
	for i in range(1, k):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			window.append(i)
	dp[0] = len(window)
	for i in range(k, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			window.append(i)
		if not window:
			pass
		elif window[0] <= i - k + 1:
			window.popleft()
		dp[i - k + 1] = len(window)
	(answer, length) = (0, -1)
	for i in dp.keys():
		if dp[i] > length:
			answer = i
			length = dp[i]
	print(length + 1, answer + 1)


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations
from itertools import combinations

def li():
	return list(map(int, sys.stdin.readline().split()))

def num():
	return map(int, sys.stdin.readline().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	gg = find_gcd(x, y)
	return x * y // gg
mm = 1000000007

def solve():
	t = nu()
	for tt in range(t):
		(n, k) = num()
		a = li()
		b = [0] * n
		z = [0] * n
		cc = 0
		for i in range(1, k - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				b[i] = 1
				z[i] = 1
				cc = cc + 1
		for i in range(1, n):
			b[i] = b[i - 1] + b[i]
		mx = cc + 1
		ind = 1
		for i in range(1, n - k + 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				cc -= 1
			op = i + k - 2
			if a[op] > a[op - 1] and a[op] > a[op + 1]:
				cc += 1
			if cc + 1 > mx:
				mx = cc + 1
				ind = i + 1
		print(mx, ind)
solve()


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	APeak = [0] * n
	maxPeak = 0
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			APeak[i] = 1
	maxPeak = 0
	minInd = 0
	for i in range(1, k - 1):
		if APeak[i] == 1:
			maxPeak += 1
	lastPeak = maxPeak
	for i in range(1, n - k + 1):
		p = lastPeak
		if APeak[i] == 1:
			p -= 1
		if APeak[i + k - 2] == 1:
			p += 1
		if p > maxPeak:
			maxPeak = p
			minInd = i
		lastPeak = p
	print(maxPeak + 1, minInd + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	d = {}
	li = 0
	c = 0
	m = 0
	for i in range(n - k + 1):
		if i == 0:
			for j in range(i + 1, i + k - 1):
				if l[j] > l[j - 1] and l[j] > l[j + 1]:
					d[j] = 1
					c += 1
		else:
			j = i + k - 2
			if l[j] > l[j - 1] and l[j] > l[j + 1]:
				d[j] = 1
				c += 1
			try:
				if d[i] == 1:
					c -= 1
			except:
				d[i] = 0
		if c > m:
			m = c
			li = i
	print(m + 1, li + 1)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [0, 0]
	c = [0, 0]
	for x in range(1, n - 1):
		if a[x - 1] < a[x] and a[x] > a[x + 1]:
			b.append(1)
		else:
			b.append(0)
	b.append(0)
	for x in range(2, n + 1):
		c.append(c[-1] + b[x])
	m = 0
	idx = 1
	for x in range(1, n - k + 2):
		if c[x + k - 2] - c[x] > m:
			m = c[x + k - 2] - c[x]
			idx = x
	print(m + 1, idx)


from sys import stdin, stdout
from math import *
for __ in range(int(input())):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if ar[i - 1] < ar[i] > ar[i + 1]:
			p[i] = 1
		p[i] += p[i - 1]
	p[-1] = p[-2]
	x = 0
	y = k - 1
	ans = 0
	ind = 0
	while y < n:
		if p[y - 1] - p[x] > ans:
			ans = p[y - 1] - p[x]
			ind = x
		x += 1
		y += 1
	print(ans + 1, ind + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	mx = 0
	peak_index = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peak_index[i] += 1
	for i in range(1, n):
		peak_index[i] += peak_index[i - 1]
	l = 0
	for i in range(0, n - k + 1):
		peaks = peak_index[i + k - 2] - peak_index[i]
		if peaks > mx:
			mx = peaks
			l = i
	print(mx + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = 0
	start = 1
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			peak += 1
	window = peak
	for i in range(1, n - k + 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			window -= 1
		if l[i + k - 2] > l[i + k - 3] and l[i + k - 2] > l[i + k - 1]:
			window += 1
		if window > peak:
			peak = window
			start = i + 1
	print(peak + 1, start, sep=' ')


def solve():
	(n, k) = [int(v) for v in input().split()]
	arr = [int(v) for v in input().split()]
	i = 0
	j = k - 1
	peaks = 0
	for z in range(1, j):
		if arr[z] > arr[z - 1] and arr[z] > arr[z + 1]:
			peaks += 1
	mxpeaks = peaks
	i = 1
	l = 1
	for j in range(k - 1, n):
		if arr[j - 1] < arr[j] and j < n - 1 and (arr[j] > arr[j + 1]):
			peaks += 1
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks -= 1
		i += 1
		if peaks > mxpeaks:
			l = i
			mxpeaks = peaks
	print(mxpeaks + 1, l)
t = int(input())
for _ in range(t):
	solve()


def solve(a, k):
	summits = [0 for x in range(len(a))]
	s = 0
	for n in range(1, len(a) - 1):
		if a[n] > a[n - 1] and a[n] > a[n + 1]:
			s += 1
		summits[n] = s
	summits[-1] = summits[-2]
	m = 0
	ind = 0
	for i in range(0, len(a) - k + 1):
		nr_sum = summits[i + k - 1] - summits[i]
		if summits[i + k - 2] < summits[i + k - 1]:
			nr_sum -= 1
		if nr_sum > m:
			m = nr_sum
			ind = i
	print('{} {}'.format(m + 1, ind + 1))

def main():
	t = int(input())
	for _ in range(t):
		(n, k) = [int(x) for x in input().split()]
		a = [int(x) for x in input().split()]
		solve(a, k)
main()


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()
t = int(input())
while t > 0:
	t -= 1
	(n, k) = listIn()
	arr = listIn()
	li = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			li[i] = 1
	dp = [0] * n
	for i in range(1, n):
		dp[i] = dp[i - 1] + li[i]
	ans = float('-inf')
	left = -1
	for l in range(n - k + 1):
		parts = dp[l + k - 2] - dp[l]
		if parts > ans:
			ans = parts
			left = l
	print(ans + 1, left + 1)


def solve():
	peaks = [0] * len(a)
	for i in range(1, len(a) - 1):
		if a[i + 1] < a[i] > a[i - 1]:
			peaks[i] += 1
	s = sum(peaks[0:k])
	ms = s - (peaks[0] + peaks[k - 1])
	ind = 0
	for i in range(1, n - k + 1):
		s += peaks[i + k - 1]
		s -= peaks[i - 1]
		num_peaks = s - (peaks[i + k - 1] + peaks[i])
		if num_peaks > ms:
			ms = num_peaks
			ind = i
	print(ms + 1, ind + 1, sep=' ')
	return
t = int(input())
for i in range(1, t + 1):
	(n, k) = [int(s) for s in input().split(' ')]
	a = [int(s) for s in input().split(' ')]
	solve()


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	lt = [0]
	for j in range(1, n - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			lt.append(1)
		else:
			lt.append(0)
	lt.append(0)
	currentsum = 0
	for j in range(1, k - 1):
		currentsum += lt[j]
	max = currentsum
	l = 0
	for j in range(1, n - k + 1):
		if lt[j] == 1:
			currentsum -= 1
		if lt[j + k - 2] == 1:
			currentsum += 1
		if currentsum > max:
			l = j
			max = currentsum
	print(max + 1, l + 1)


from math import *
from random import *
for t in range(int(input())):
	(n, k) = map(int, input().split())
	mas = list(map(int, input().split()))
	pick = [0 for i in range(n)]
	for i in range(1, n - 1):
		pick[i] = pick[i - 1]
		if mas[i] > mas[i - 1] and mas[i] > mas[i + 1]:
			pick[i] += 1
	if n > 1:
		pick[n - 1] = pick[n - 2]
	mx = 0
	mxotv = 0
	for i in range(0, n - k + 1):
		if i + k - 2 < 0:
			continue
		res = pick[i + k - 2]
		res -= pick[i]
		if res > mx:
			mx = res
			mxotv = i
	print(mx + 1, mxotv + 1)


from collections import defaultdict

def main():
	cc = int(input())
	for ccc in range(cc):
		(n, k) = [int(v) for v in input().split()]
		data = [int(v) for v in input().split()]
		s = [0 for _ in range(n)]
		for i in range(2, n):
			if data[i - 1] > data[i - 2] and data[i - 1] > data[i]:
				s[i] = s[i - 1] + 1
			else:
				s[i] = s[i - 1]
		m = 0
		r = 0
		for i in range(n - k + 1):
			v = s[i + k - 1] - s[i + 1]
			if v > m:
				m = v
				r = i
		print(m + 1, r + 1)
main()


import sys
import itertools
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(N, K) = [int(x) for x in input().split()]
		A = [int(x) for x in input().split()]
		AP = [0] * N
		i = 1
		for (a, b, c) in zip(A, A[1:], A[2:]):
			if a < b > c:
				AP[i] = 1
			i += 1
		ruiseki = list(itertools.accumulate(AP))
		ans = 0
		ansi = 0
		for i in range(N - K + 1):
			tmp = ans
			ans = max(ans, ruiseki[i + K - 2] - ruiseki[i])
			if tmp != ans:
				ansi = i
		print(ans + 1, ansi + 1)
main()


t = int(input())
for _ in range(t):
	(n, k) = input().split(' ')
	k = int(k)
	n = int(n)
	c = [int(x) for x in input().split(' ')]
	d = []
	g = 0
	f = 0
	e = 1
	for i in range(n):
		if i > 0 and i < n - 1 and (c[i - 1] < c[i]) and (c[i] > c[i + 1]):
			g += 1
		d.append(g)
		if i >= k - 1:
			if d[i - 1] - d[i - k + 1] > f:
				e = i - k + 2
				f = d[i - 1] - d[i - k + 1]
	print(f + 1, e)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = 1
	k -= 2
	(l, t) = (1, sum(p[1:k + 1]))
	s = (t, l)
	while l + k < n:
		t += p[l + k] - p[l]
		l += 1
		if t > s[0]:
			s = (t, l)
	print(s[0] + 1, s[1])


import collections
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split(' '))
	heights = list(map(int, input().split(' ')))
	de = collections.deque([])
	max = -1
	pos = 0
	for j in range(len(heights) - 1):
		if j == 0:
			continue
		while len(de) > 0 and de[0] + k - 1 <= j:
			de.popleft()
		if len(de) > max and j - k + 1 >= 0:
			max = len(de)
			pos = j - k + 1 + 1
		if heights[j - 1] < heights[j] and heights[j] > heights[j + 1]:
			de.append(j)
	j = len(heights) - 1
	while len(de) > 0 and de[0] + k - 1 <= j:
		de.popleft()
	if len(de) > max and j - k + 1 >= 0:
		max = len(de)
		pos = j - k + 1 + 1
	print(str(max + 1) + ' ' + str(pos))


t = int(input())
for _ in range(t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = [0] * n
	max = 0
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			max += 1
		b[i] = max
	max = 0
	index = 0
	for i in range(0, len(a) - k + 1):
		if b[i + k - 2] - b[i] > max:
			index = i
			max = b[i + k - 2] - b[i]
	print('{} {}'.format(max + 1, index + 1))


cases = int(input())
for c in range(0, cases):
	raw1 = input().split(' ')
	n = int(raw1[0])
	k = int(raw1[1])
	arr = []
	cumPeaks = [0]
	numPeaks = 0
	for idx in input().split(' '):
		arr.append(int(idx))
	for idx in range(1, n - 1):
		if arr[idx] > arr[idx - 1] and arr[idx] > arr[idx + 1]:
			numPeaks = numPeaks + 1
		cumPeaks.append(numPeaks)
	cumPeaks.append(numPeaks)
	l = 0
	r = k - 1
	resL = l
	resNum = 0
	while r < n:
		if cumPeaks[r - 1] - cumPeaks[l] > resNum:
			resNum = cumPeaks[r - 1] - cumPeaks[l]
			resL = l
		l = l + 1
		r = r + 1
	print(str(resNum + 1) + ' ' + str(resL + 1))


from collections import deque
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	(*arr,) = map(int, input().split())
	peaks = []
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			peaks.append(i)
	queue = deque()
	end = k - 1
	ansend = end
	ans = 0
	ind = 0
	for i in range(k):
		if ind == len(peaks):
			break
		if peaks[ind] < i:
			queue.append(peaks[ind])
			ind += 1
	ans = len(queue)
	start = k
	for i in range(start, n):
		if len(queue) > 0 and queue[0] <= i - k + 1:
			queue.popleft()
		if ind < len(peaks) and peaks[ind] < i:
			queue.append(peaks[ind])
			ind += 1
		if len(queue) > ans:
			ans = len(queue)
			ansend = i
	print(ans + 1, ansend - k + 2)


t = int(input())
matrix = [0 for i in range(200006)]
while t > 0:
	try:
		(max, pos, cnt) = (0, 1, 0)
		(n, k) = map(int, input().split())
		ls = list(map(int, input().split()))
		ls = [0] + ls + [0]
		for i in range(1, n + 1):
			if ls[i] > ls[i - 1] and ls[i] > ls[i + 1]:
				cnt += 1
			matrix[i] = cnt
		for i in range(1, n - k + 2):
			cnt = matrix[i + k - 2] - matrix[i]
			if cnt > max:
				max = cnt
				pos = i
		print(max + 1, pos)
		t -= 1
	except:
		break


t = int(input())
while t:
	(n, k) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	counter = 0
	B = []
	i = 0
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			B.append(i)
	B = set(B)
	i = 0
	j = i + k - 1
	for tt in range(0, j + 1):
		if tt in B and tt != j:
			counter += 1
	max_counter = counter
	max_ind = 0
	j += 1
	i += 1
	while i < n and j < n:
		if j - 1 in B:
			counter += 1
		if i in B:
			counter -= 1
		if counter > max_counter:
			max_counter = counter
			max_ind = i
		i += 1
		j += 1
	print(max_counter + 1, max_ind + 1)
	t -= 1


t = int(input())
for z in range(t):
	(n, k) = map(int, input().split())
	k -= 2
	a = list(map(int, input().split()))
	p = [0 for i in range(len(a))]
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = 1
	t = 0
	li = 0
	for i in range(0, k):
		t += p[i]
	now = t
	for i in range(k, len(p)):
		now += p[i]
		now -= p[i - k]
		if now > t:
			t = now
			li = i - k
	print(t + 1, li + 1)


import math
t = int(input(''))
while t > 0:
	(n, k) = map(int, input().split())
	mountains = list(map(int, input().split()))
	least_l = n
	maxpeak = 0
	peak_count = 0
	subpeak = 0
	prefix_mountains = [0] * len(mountains)
	for peak_id in range(1, len(mountains) - 1):
		if abs(mountains[peak_id]) > abs(mountains[peak_id + 1]) and abs(mountains[peak_id]) > abs(mountains[peak_id - 1]):
			mountains[peak_id] *= -1
			peak_count += 1
		prefix_mountains[peak_id + 1] = peak_count
	for subfixer in range(n - 1, k - 2, -1):
		subpeak = prefix_mountains[subfixer] - prefix_mountains[subfixer - k + 2]
		if subpeak >= maxpeak:
			maxpeak = subpeak
			least_l = subfixer - k + 1
	print(maxpeak + 1, least_l + 1)
	t -= 1


t = input()
t = int(t)
for i in range(t):
	(n, k) = map(int, input().split())
	arr = []
	arr.append(0)
	arr2 = [int(x) for x in input().split()]
	co = 0
	for j in range(1, n - 1):
		arr.append(co)
		if arr2[j] > arr2[j - 1] and arr2[j] > arr2[j + 1]:
			co += 1
	arr.append(co)
	ma = 0
	l = 0
	for j in range(0, n - k + 1):
		pe = arr[j + k - 1] - arr[j + 1]
		if pe > ma:
			ma = pe
			l = j
	print(ma + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	b = [0] * n
	for i in range(k):
		if i == 0 or i == k - 1:
			continue
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
			ans += 1
	m = ans
	mi = 0
	for i in range(k, n):
		if b[i - k + 1] == 1:
			ans -= 1
		if i - 1 > i - k + 1 and i - 2 >= 0:
			if a[i - 2] < a[i - 1] and a[i - 1] > a[i]:
				b[i - 1] = 1
				ans += 1
		if m < ans:
			mi = i - k + 1
			m = ans
	print(m + 1, mi + 1)


T = int(input())
for t in range(T):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	t = 0
	u = [0] * n
	for i in range(1, n - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			u[i] = 1
	v = 0
	for i in range(1, k - 1):
		v += u[i]
	m = v
	mid = 0
	for i in range(n - k + 1):
		v -= u[i + 1]
		v += u[i + k - 1]
		if v > m:
			m = v
			mid = i + 1
	print(m + 1, mid + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = 1
	s = [0]
	for i in range(1, n):
		s.append(s[i - 1] + p[i])
	l = 1
	l_ = 1
	r = l + k - 1
	ma = 0
	while r < n + 1:
		m = s[r - 1] - s[l - 1]
		if p[r - 1] == 1:
			m -= 1
		if m > ma:
			ma = m
			l_ = l
		l += 1
		r = l + k - 1
	print(ma + 1, l_)


def find_pick(arr, l):
	counter = 0
	for i in range(1, l):
		if arr[i] > arr[i + 1] and arr[i] > arr[i - 1]:
			counter += 1
	return counter

def func(arr, k, n):
	counter_max = find_pick(arr[:k], k - 1)
	counter = find_pick(arr[:k], k - 1)
	left = 1
	for i in range(1, n - k + 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			counter -= 1
		if arr[i + k - 2] > arr[i + k - 1] and arr[i + k - 2] > arr[i + k - 3]:
			counter += 1
		if counter > counter_max:
			left = i + 1
			counter_max = counter
	print(counter_max + 1, left)

def main():
	m = int(input())
	for i in range(m):
		(n, k) = map(int, input().split())
		mount = list(map(int, input().split()))
		func(mount, k, n)
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peak = 0
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			peak += 1
	maxpeak = peak
	index = 1
	start = 1
	end = k
	while end < n:
		if l[start] > l[start - 1] and l[start] > l[start + 1]:
			peak -= 1
		if l[end - 1] > l[end - 2] and l[end - 1] > l[end]:
			peak += 1
		if peak > maxpeak:
			maxpeak = peak
			index = start + 1
		start += 1
		end += 1
	print(maxpeak + 1, index)


for t in range(int(input())):
	(n, k) = [int(i) for i in input().split(' ')]
	As = [int(i) for i in input().split(' ')]
	peaks = set([])
	pc = 0
	pcmax = 0
	l = 1
	for i in range(n):
		if i - 1 >= 0 and i < n - 1 and (As[i - 1] < As[i]) and (As[i] > As[i + 1]):
			pc += 1
			peaks.add(i)
		if i - k + 2 in peaks:
			peaks.remove(i - k + 2)
			pc -= 1
		if i - k + 3 > 0 and pc > pcmax:
			pcmax = pc
			l = i - k + 3
	print(str(pcmax + 1) + ' ' + str(l))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	L = [0] * n
	R = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			L[i - 1] += 1
			R[i + 1] += 1
	LL = [0] * (n + 1)
	RR = [0] * (n + 1)
	for i in range(n):
		RR[i + 1] = R[i] + RR[i]
	for i in range(n - 1, -1, -1):
		LL[i] = L[i] + LL[i + 1]
	ans = 0
	id = 0
	for i in range(n - k + 1):
		if min(RR[i + k] - RR[i + 1], LL[i] - LL[i + k - 1]) > ans:
			ans = min(RR[i + k] - R[i + 1], LL[i] - LL[i + k - 1])
			id = i
	print(ans + 1, id + 1)


x = int(input())
for i in range(x):
	s = input()
	abcd = list(map(int, s.split()))
	(n, k) = (abcd[0], abcd[1])
	ss = input()
	mount = list(map(int, ss.split()))
	peak = []
	for i in range(1, n - 1):
		if mount[i] > mount[i - 1] and mount[i] > mount[i + 1]:
			peak.append(i)
	best_i = 0
	best_len = 0
	peaks_set = set(peak)
	for i in range(1, k - 1):
		if i in peaks_set:
			best_len += 1
	peaks_count = best_len
	for i in range(1, n - k + 1):
		if i in peaks_set:
			peaks_count = peaks_count - 1
		if i + k - 2 in peaks_set:
			peaks_count = peaks_count + 1
		if peaks_count > best_len:
			best_len = peaks_count
			best_i = i
	print(best_len + 1, best_i + 1)


for _ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	p = [0] * (n + 1)
	d = 0
	s = 0
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			p[i] = p[i - 1] + 1
		else:
			p[i] = p[i - 1]
	for i in range(n):
		if i + k - 1 > n - 1:
			break
		if p[i + k - 1 - 1] - p[i] > d:
			d = p[i + k - 1 - 1] - p[i]
			s = i
	print(d + 1, s + 1)


t = int(input())
for q in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	a = [0, 0]
	q = [False] * n
	for i in range(1, len(l) - 1):
		if l[i - 1] < l[i] > l[i + 1]:
			a.append(a[-1] + 1)
			q[i] = True
		else:
			a.append(a[-1])
	a.append(a[-1])
	tekpic = 0
	maxi = 0
	ind = 0
	for i in range(len(a) - k):
		x = q[i + k - 1]
		w = 0
		y = q[i]
		if x:
			w += 1
		if y:
			w += 1
		if a[i + k] - a[i] - w > maxi:
			maxi = a[i + k] - a[i] - w
			ind = i
	print(maxi + 1, ind + 1)


import sys
input = sys.stdin.buffer.readline
T = int(input())
for testcase in range(T):
	(n, k) = map(int, input().split())
	a = tuple(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			b[i] = 1
	idx = 1
	ma = 0
	tmp = 0
	k -= 2
	for i in range(1, k + 1):
		tmp += b[i]
	ma = tmp
	for i in range(k + 1, n - 1):
		tmp += b[i] - b[i - k]
		if tmp > ma:
			ma = tmp
			idx = i - k + 1
	print(ma + 1, idx)


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = []
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def c(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def main():
	(n, k) = vars()
	arr = array()
	peaks = 0
	for i in range(1, k - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peaks += 1
	ans = (peaks + 1, 1)
	l = 0
	r = l + k - 1
	while r < n:
		l += 1
		if arr[l - 1] < arr[l] > arr[l + 1]:
			peaks -= 1
		if r + 1 < n and arr[r - 1] < arr[r] > arr[r + 1]:
			peaks += 1
		r += 1
		if peaks + 1 > ans[0]:
			ans = (peaks + 1, l + 1)
	print(*ans)
t = int(input())
for _ in range(t):
	main()


def f():
	t = int(input())
	while t != 0:
		t = t - 1
		(n, a, b, c, d) = map(int, input().split())
		minsum = c - d
		maxsum = c + d
		gw1 = n * a
		gw2 = n * (a - b)
		gw3 = n * (a + b)
		if gw2 < minsum:
			if gw3 >= minsum:
				print('Yes')
			else:
				print('No')
		elif gw2 > maxsum:
			print('No')
		else:
			print('Yes')

def B():
	t = int(input())
	while t != 0:
		t = t - 1
		(n, k) = map(int, input().split())
		Arr = [int(i) for i in input().split(' ')]
		A = [False] * len(Arr)
		m = 0
		l = 0
		i = 0
		for i in range(1, len(Arr) - 1):
			if Arr[i - 1] < Arr[i] and Arr[i] > Arr[i + 1]:
				A[i] = True
		for i in range(1, k - 1):
			if A[i] == True:
				m = m + 1
		i = 0
		i = 1
		peaks = m
		while i + (k - 1) < len(Arr):
			if A[i] == True:
				peaks -= 1
			if A[i + (k - 1) - 1] == True:
				peaks += 1
			if peaks > m:
				l = i
				m = peaks
			i = i + 1
		if m == 0:
			print(1, 1)
		else:
			print(m + 1, l + 1)
B()


from collections import Counter
from _collections import defaultdict
import math
rs = lambda : input().strip()
ri = lambda : int(input())
rl = lambda : list(map(int, input().split()))
rls = lambda : list(map(str, input().split()))
t = int(input())
for _ in range(0, t):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	d = [0] * (n + 1)
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			d[i] = d[i - 1] + 1
		else:
			d[i] = d[i - 1]
	mx = 0
	l = 0
	for i in range(0, n):
		if i + k - 1 > n - 1:
			break
		if d[i + k - 1 - 1] - d[i] > mx:
			mx = d[i + k - 1 - 1] - d[i]
			l = i
	print(mx + 1, l + 1)


t = int(input())
sol = []
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] and arr[i + 1] < arr[i]:
			peaks[i] = 1
	cum_peaks = [0] * n
	for i in range(1, n):
		cum_peaks[i] = cum_peaks[i - 1] + peaks[i]
	max_peaks = 0
	idx = 0
	for l in range(n - k + 1):
		npeaks = cum_peaks[l + k - 2] - cum_peaks[l]
		if npeaks > max_peaks:
			max_peaks = npeaks
			idx = l
	sol.append((max_peaks + 1, idx + 1))
for s in sol:
	print(*s)


from sys import stdin, stdout
import bisect

def main():
	for _ in range(int(stdin.readline())):
		(n, k) = map(int, stdin.readline().split())
		arr = [int(k) for k in stdin.readline().split()]
		count = 2
		p = 0
		ind = 0
		resind = 0
		resp = 0
		for i in range(2, n):
			if count < k:
				if arr[i - 1] > arr[i - 2] and arr[i - 1] > arr[i]:
					p += 1
					count += 1
				else:
					count += 1
					continue
			else:
				if p > resp:
					resp = p
					resind = ind
				ind += 1
				if arr[ind] > arr[ind - 1] and arr[ind] > arr[ind + 1]:
					p -= 1
				if arr[i - 1] > arr[i - 2] and arr[i - 1] > arr[i]:
					p += 1
		if p > resp:
			resp = p
			resind = ind
		print(resp + 1, resind + 1)
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
	c = [0]
	for i in range(1, n):
		c.append(c[-1] + b[i])
	ans = 0
	for i in range(n - k + 1):
		ans = max(ans, c[i + k - 1] - c[i] - b[i + k - 1] - b[i])
	for i in range(n - k + 1):
		if c[i + k - 1] - c[i] - b[i + k - 1] - b[i] == ans:
			print(ans + 1, i + 1)
			break


R = lambda : map(int, input().split())
(t,) = R()
for _ in [0] * t:
	(n, k) = R()
	m = -1
	r = [m] * (k - 2)
	a = (*R(),)
	i = 3 - k
	for (x, y, z) in zip(a, a[1:], a[2:]):
		i += 1
		r += (r[-1] + (x < y > z),)
		l = r[-1] - r[1 - k]
		if l > m:
			m = l
			j = i
	print(m + 1, max(1, j))


from collections import defaultdict
import bisect
import sys
input = sys.stdin.readline

def solve(n, k, a):
	ans = 1
	peaks = set([])
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.add(i)
	lp = len(peaks)
	for i in range(1, n - k + 1):
		if i in peaks:
			peaks.remove(i)
		if a[i + k - 2] > a[i + k - 3] and a[i + k - 2] > a[i + k - 1]:
			peaks.add(i + k - 2)
		if len(peaks) > lp:
			ans = i + 1
			lp = len(peaks)
	print(lp + 1, ans)

def main():
	t = int(input())
	for i in range(t):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		solve(n, k, a)
main()


def solve():
	(n, k) = map(int, input().split())
	x = [0 for i in range(n - k + 1)]
	a = list(map(int, input().split()))
	l = 0
	r = k - 2
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			x[l] += 1
	for i in range(n - k):
		l += 1
		r += 1
		x[l] = x[l - 1]
		x[l] -= a[l - 1] < a[l] > a[l + 1]
		x[l] += a[r - 1] < a[r] > a[r + 1]
	m = max(x)
	print(max(x) + 1, end=' ')
	for i in range(n - k + 1):
		if x[i] == m:
			print(i + 1)
			break
t = int(input())
for i in range(t):
	solve()


import sys
input = sys.stdin.readline
a = int(input())
for i in range(a):
	(n, k) = map(int, input().split())
	z = list(map(int, input().split()))
	ans = []
	count = 0
	for i in range(1, k - 1):
		if z[i] > z[i - 1] and z[i] > z[i + 1]:
			count += 1
	ans.append(count)
	for i in range(1, len(z) - k + 1):
		if z[i] > z[i - 1] and z[i] > z[i + 1]:
			count -= 1
		if z[i + k - 2] > z[i + k - 3] and z[i + k - 2] > z[i + k - 1]:
			count += 1
		ans.append(count)
	t = max(ans)
	print(t + 1, ans.index(t) + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	pea = []
	ze = 0
	for j in range(1, k - 1):
		if l[j] > l[j - 1] and l[j] > l[j + 1]:
			ze += 1
	pea.append(ze)
	for j in range(2, n - k + 2):
		if l[j - 1] > l[j - 2] and l[j - 1] > l[j]:
			ze -= 1
		if l[j + k - 3] > l[j + k - 2] and l[j + k - 3] > l[j + k - 4]:
			ze += 1
		pea.append(ze)
	ma = max(pea)
	print(ma + 1, pea.index(ma) + 1)


T = int(input())
results = []
for i in range(T):
	(n, k) = [int(i) for i in input().split()]
	mountains = [int(i) for i in input().split()]
	dp = [0] * n
	for i in range(1, n - 1):
		if mountains[i - 1] < mountains[i] > mountains[i + 1]:
			dp[i] = -1
			dp[i + 1] = 1
	su = 0
	for i in range(k - 1):
		su += int(dp[i] == 1)
	best = su
	index = 0
	for i in range(n - k + 1):
		l = i
		r = l + k - 1
		su += int(dp[r] == 1) - int(dp[l] == -1)
		if su > best:
			best = su
			index = l
	results.append([best + 1, index + 1])
for result in results:
	print(' '.join([str(i) for i in result]))


leng = int(input())
for i in range(leng * 2):
	z = input().split()
	z = [int(x) for x in z]
	if i % 2 == 0:
		(n, k) = (z[0], z[1])
	if i % 2 == 1:
		peaks = [0 for x in range(n)]
		for j in range(1, n - 1):
			if z[j - 1] < z[j] and z[j] > z[j + 1]:
				peaks[j] = 1
		cur_peaks = sum(peaks[1:k - 1])
		max_peaks = cur_peaks
		for j in range(1, n - k + 1):
			max_peaks = max(cur_peaks, max_peaks)
			cur_peaks += peaks[k + j - 2]
			cur_peaks -= peaks[j]
			max_peaks = max(cur_peaks, max_peaks)
		cur_peaks = sum(peaks[1:k - 1])
		if cur_peaks == max_peaks:
			print(max_peaks + 1, 1)
		else:
			for j in range(1, n - k + 1):
				if cur_peaks == max_peaks:
					print(max_peaks + 1, j + 1)
					break
				cur_peaks += peaks[k + j - 2]
				cur_peaks -= peaks[j]
				if cur_peaks == max_peaks:
					print(max_peaks + 1, j + 1)
					break


t = int(input())
for test in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	dp = [0 for i in range(n + 2)]
	dp[0] = 0
	peak = [False for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			dp[i] += 1
			peak[i] = True
	for i in range(1, n):
		dp[i] += dp[i - 1]
	mp = dp[k - 1]
	if peak[k - 1]:
		mp -= 1
	mi = 0
	for i in range(1, n - k + 1):
		temp = dp[i + k - 1] - dp[i]
		if peak[i + k - 1]:
			temp -= 1
		if temp > mp:
			mp = temp
			mi = i
	print(mp + 1, mi + 1)


import sys, bisect
from math import gcd
input = sys.stdin.readline

def inp():
	return int(input().rstrip())

def inlt():
	return list(map(int, input().rstrip().split()))

def insr():
	s = input().rstrip()
	return s[:len(s) - 1]

def invr():
	return map(int, input().rstrip().split())
times = 60
t = inp()
for _ in range(t):
	(n, k) = invr()
	nums = inlt()
	nums.reverse()
	peaks = [0 for i in range(n)]
	left = 0
	peak = 0
	ri = 1
	while ri < k - 1:
		if nums[ri - 1] < nums[ri] and nums[ri] > nums[ri + 1]:
			peaks[ri] = 1
			peak += 1
		ri += 1
	p_max = peak
	right = k - 1
	ll = right
	while right < n - 1:
		if peaks[left + 1] == 1:
			peak -= 1
		if nums[right - 1] < nums[right] and nums[right] > nums[right + 1]:
			peak += 1
			peaks[right] = 1
		left += 1
		right += 1
		if peak >= p_max:
			p_max = peak
			ll = right
	print(p_max + 1, n - ll)


from itertools import accumulate
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(1000000000.0 + 1)] + list(map(int, input().split())) + [int(1000000000.0 + 1)]
	dp = list(accumulate(map(lambda x: 1 if x[1] > x[0] and x[1] > x[2] else 0, zip(a, a[1:], a[2:]))))
	(t, l) = (0, -1)
	for i in range(0, len(dp) - k + 2):
		(t, l) = max((t, l), (dp[i + k - 2] - dp[i], -(i + 1)))
	print(' '.join(map(str, (t + 1, -l))))


from sys import stdin, stdout
import math, collections
mod = 10 ** 9 + 7
for _ in range(int(stdin.readline())):
	(n, k) = map(int, stdin.readline().split())
	arr = list(map(int, stdin.readline().split()))
	a = [0]
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			a.append(1)
		else:
			a.append(0)
	a.append(0)
	temp = sum(a[:k])
	if a[k - 1] == 1:
		ans = [temp - 1]
	else:
		ans = [temp]
	for i in range(1, n - k + 1):
		temp = temp - a[i - 1] - a[i]
		ans.append(temp)
		temp += a[i + k - 1] + a[i]
	t = max(ans)
	print(t + 1, ans.index(t) + 1)


t = int(input())
for _ in range(t):
	(n, k) = [int(p) for p in input().split()]
	arr = [int(p) for p in input().split()]
	peaks = [0] * n
	curr = 0
	for i in range(1, len(arr) - 1):
		if arr[i - 1] < arr[i] and arr[i] > arr[i + 1]:
			curr += 1
			peaks[i] = curr
		else:
			peaks[i] = curr
	ans = 0
	index = 0
	for i in range(len(arr) - k + 2):
		prev = ans
		ans = max(ans, peaks[i + k - 2] - peaks[i])
		if prev != ans:
			index = i
	print(ans + 1, index + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().strip().split())
	arr = list(map(int, input().strip().split()))
	pre = [0] * n
	peak = dict()
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			pre[i] += 1
			if i + k <= n - 1:
				pre[i + k] -= 1
			peak[i] = 1
	for i in range(1, n):
		pre[i] = pre[i] + pre[i - 1]
	raj = dict()
	chk = 0
	for i in range(k - 1, n):
		x = pre[i]
		if peak.get(i) != None:
			x -= 1
		if peak.get(i - k + 1) != None:
			x -= 1
		chk = max(chk, x)
		if raj.get(x) == None:
			raj[x] = [i]
		else:
			raj[x].append(i)
	print(chk + 1, raj.get(chk)[0] - k + 2)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a.append(float('inf'))
	l = a[:k]
	p = 0
	ans = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p += 1
	m = p
	p1 = a[1] > a[0] and a[1] > a[2]
	p2 = a[k - 1] > a[k - 2] and a[k - 1] > a[k]
	for i in range(1, n - k + 1):
		if p1:
			p -= 1
		if p2:
			p += 1
		if p > m:
			ans = i
			m = p
		p1 = a[i + 1] > a[i] and a[i + 1] > a[i + 2]
		p2 = a[k + i - 1] > a[k + i - 2] and a[k + i - 1] > a[k + i]
	print(m + 1, ans + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	c = 0
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			c = c + 1
	ma = c
	k1 = 0
	for i in range(1, n - k + 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			c = c - 1
		if l[i + k - 2] > l[i + k - 3] and l[i + k - 2] > l[i + k - 1]:
			c = c + 1
		if ma < c:
			ma = c
			k1 = i
	print(ma + 1, k1 + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	ar = list(map(int, input().split()))
	peak = [0] * n
	se = set({})
	for i in range(1, n - 1):
		if ar[i] > ar[i - 1] and ar[i] > ar[i + 1]:
			peak[i + 1] = 1
			se.add(i)
	for i in range(1, n):
		peak[i] += peak[i - 1]
	ans = 0
	l = 1
	for i in range(n - k + 1):
		xx = peak[i + k - 1] - peak[i]
		if i in se:
			xx -= 1
		if xx > ans:
			ans = xx
			l = i + 1
	print(ans + 1, l)


test = int(input())
while test:
	test -= 1
	(n, k) = map(int, input().split())
	ls = list(map(int, input().split()))
	ar = [0] * n
	ans = 0
	ind = 0
	for i in range(1, n - 1):
		if ls[i] > ls[i - 1] and ls[i] > ls[i + 1]:
			ar[i] = 1
	for i in range(1, n):
		ar[i] += ar[i - 1]
	for i in range(n - k + 1):
		temp = ar[i + k - 2] - ar[i]
		if temp > ans:
			ans = temp
			ind = i + 1
	if ans == 0:
		print(1, 1)
	else:
		print(ans + 1, ind)


t = int(input())
for a in range(t):
	(n, k) = map(int, input().split())
	nums = list(map(int, input().split()))
	peaks = [False for i in range(n)]
	for b in range(1, n - 1):
		if nums[b - 1] < nums[b] > nums[b + 1]:
			peaks[b] = True
	currentPieces = 1
	for b in range(1, k - 1):
		if peaks[b]:
			currentPieces += 1
	maxPieces = currentPieces
	spot = 1
	for b in range(k - 1, n):
		if peaks[b]:
			currentPieces += 1
		if peaks[b - (k - 2)]:
			currentPieces -= 1
		if currentPieces > maxPieces:
			maxPieces = currentPieces
			spot = b - (k - 3)
	print(maxPieces, spot)


t = int(input())
for q in range(t):
	nk = list(map(int, input().split()))
	(n, k) = nk
	mont = list(map(int, input().split()))
	peak_list = [0] * n
	for (i, h) in enumerate(mont):
		if i == 0 or i == len(mont) - 1:
			continue
		if mont[i - 1] < h and h > mont[i + 1]:
			peak_list[i] += 1
	num_peaks = [0] * n
	current_tot = 0
	for i in range(1, k - 1):
		current_tot += peak_list[i]
	for i in range(len(mont)):
		if i + k - 1 >= len(mont):
			break
		num_peaks[i] = current_tot
		current_tot -= peak_list[i + 1]
		current_tot += peak_list[i + k - 1]
	print(max(num_peaks) + 1, num_peaks.index(max(num_peaks)) + 1)


import sys
input = sys.stdin.readline
mod = 1000000007

def power(x, y):
	res = 1
	while y > 0:
		if y & 1 == 1:
			res = res * x % m
		y = y >> 1
		x = x * x % m
	return res % m
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = l[:]
	for i in range(1, n - 1):
		if l1[i - 1] < l1[i] and l1[i + 1] < l1[i]:
			l[i] = 1
		else:
			l[i] = 0
	l[0] = 0
	l[n - 1] = 0
	l2 = l[:]
	for i in range(1, n):
		if l[i] == 1:
			l[i] = l[i - 1] + 1
		else:
			l[i] = l[i - 1]
	m = 0
	f = 1
	for i in range(0, n - k + 1):
		if i != 0:
			c = l[i + k - 1] - l[i - 1]
			c = c - l2[i] - l2[i + k - 1]
		else:
			c = l[i + k - 1]
			c = c - l2[i] - l2[i + k - 1]
		if c > m:
			m = c
			f = i + 1
	print(m + 1, f)


t = int(input())
for _ in range(t):
	(n, d) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 1
	p = 0
	was = [0] * n
	ma = 0
	for i in range(2, d):
		if a[i - 2] < a[i - 1] > a[i]:
			p += 1
			was[i - 1] = 1
	if p > ma:
		l = 1
		ma = p
	for i in range(d, n):
		if was[i - d + 1]:
			was[i - d + 1] = 0
			p -= 1
		if a[i - 2] < a[i - 1] > a[i]:
			was[i - 1] = 1
			p += 1
		if p > ma:
			l = i - d + 1 + 1
			ma = p
	print(1 + ma, l)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	ispeak = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			ispeak[i] = 1
	ans = {}
	c = 0
	for j in range(0, k - 1):
		c += ispeak[j]
	ans[0] = c
	i = 1
	while i < n - k + 1:
		c = c - ispeak[i] + ispeak[i + k - 2]
		ans[i] = c
		i += 1
	mini = 0
	for i in ans:
		if ans[i] > ans[mini]:
			mini = i
	print(ans[mini] + 1, mini + 1)


def peak(l, i):
	return l[i] > l[i - 1] and l[i] > l[i + 1]
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = 0
	left = 0
	for i in range(1, k - 1):
		if peak(l, i):
			s += 1
	maxi = s
	left = 0
	left_maxi = 0
	for i in range(k - 1, n - 1):
		left += 1
		s += peak(l, i) - peak(l, left)
		if s > maxi:
			maxi = s
			left_maxi = left
	print(maxi + 1, left_maxi + 1)


INT_MAX = 10 ** 11 + 7
MOD = 10 ** 9 + 7

def INPUT():
	return list((int(i) for i in input().split()))

def LIST_1D_ARRAY(n):
	return [0 for _ in range(n)]

def LIST_2D_ARRAY(m, n):
	return [[0 for _ in range(n)] for _ in range(m)]
GETA = 123
import bisect

def cal(n, k, A):
	P = [0]
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			P.append(P[-1] + 1)
		else:
			P.append(P[-1])
	P.append(P[-1])
	maxlenght = 0
	minind = 0
	for i in range(n - k + 1):
		prev = maxlenght
		maxlenght = max(maxlenght, abs(P[i] - P[i + k - 2]))
		if prev < maxlenght:
			minind = i + 1
	if minind == 0:
		print(maxlenght + 1, 1)
	else:
		print(maxlenght + 1, minind)
for _ in range(int(input())):
	(n, k) = INPUT()
	A = INPUT()
	cal(n, k, A)


T = int(input())
for t in range(T):
	(N, K) = [int(i) for i in input().split()]
	A = [int(i) for i in input().split()]
	peaks = 0
	answer = (-1, -1)
	for L in range(N - 3, -1, -1):
		if L + K < N:
			if A[L + K - 1] > A[L + K] and A[L + K - 1] > A[L + K - 2]:
				peaks -= 1
		if A[L + 1] > A[L + 2] and A[L + 1] > A[L]:
			peaks += 1
		if peaks >= answer[0]:
			answer = (peaks, L + 1)
	print(answer[0] + 1, answer[1])


for f in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = 1
	pm = 0
	p = 1
	l = 1
	for i in range(k - 1):
		p += peaks[i]
	pm = p
	for i in range(n - k):
		p -= peaks[i + 1]
		p += peaks[i + k - 1]
		if p > pm:
			pm = p
			l = i + 2
	print(pm, l)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [False]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.append(True)
		else:
			peaks.append(False)
	peaks.append(False)
	s = sum(peaks[1:k - 1])
	max_i = 0
	max_s = s
	for i in range(1, n - k + 1):
		s -= peaks[i]
		s += peaks[i + k - 2]
		if s > max_s:
			max_s = s
			max_i = i
	print(max_s + 1, max_i + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	pref = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			pref[i] = 1
	for i in range(1, n):
		pref[i] = pref[i - 1] + 1 if pref[i] else pref[i - 1]
	maxv = float('-inf')
	maxi = -1
	for i in range(n - k + 1):
		if pref[i + k - 2] - pref[i] > maxv:
			maxv = pref[i + k - 2] - pref[i]
			maxi = i
	print(maxv + 1, maxi + 1)


t = int(input())
for i in range(t):
	(n, k) = [int(k) for k in input().split()]
	ar = [int(k) for k in input().split()]
	cr = 0
	mx = 0
	mi = 0
	i = 0
	j = 1
	yes = [0 for i in range(n)]
	while j < k - 1:
		if ar[j - 1] < ar[j] and ar[j] > ar[j + 1]:
			yes[j] = 1
			cr += 1
		j += 1
	if cr > mx:
		mx = cr
		mi = i
	while j < n - 1:
		i += 1
		if yes[i] == 1:
			cr -= 1
		if ar[j - 1] < ar[j] and ar[j] > ar[j + 1]:
			cr += 1
			yes[j] = 1
		j += 1
		if cr > mx:
			mx = cr
			mi = i
	print(mx + 1, mi + 1)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import math

def fact(x):
	if x == 0:
		return 1
	else:
		return x * fact(x - 1)

def abs(x):
	return x if x >= 0 else -x

def sumelem(x, start, end):
	sum = 0
	for i in range(start, end + 1):
		sum += x[i]
	return sum
for t in range(int(input())):
	(n, k) = list(map(int, input().split()))
	heights = list(map(int, input().split()))
	pref = [0] * n
	for i in range(1, n - 1):
		if heights[i] > heights[i - 1] and heights[i] > heights[i + 1]:
			pref[i] = 1
		pref[i] += pref[i - 1]
	pref[-1] += pref[-2]
	maxi = -1
	for i in range(k - 1, n):
		no_peaks = pref[i - 1] - pref[i - k + 1]
		if no_peaks > maxi:
			maxi = no_peaks
			l = i - k + 2
	print(maxi + 1, l)


t = int(input())
for l in range(0, t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	bin = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			bin[i] = 1
	l = 0
	r = l + k
	peaks = 0
	(m, ml) = (0, 0)
	for i in range(0, r):
		if bin[i] == 1:
			peaks += 1
		if i == r - 1 and bin[i] == 1:
			m = peaks - 1
		else:
			m = peaks
	for l in range(1, n - k + 1):
		if bin[l] == 1:
			peaks -= 1
		if m < peaks:
			m = peaks
			ml = l
		if bin[r] == 1:
			peaks += 1
		r += 1
	print(m + 1, ml + 1)


t = int(input())
for _ in range(t):
	(n, k) = tuple(map(int, input().split()))
	mnts = list(map(int, input().split()))
	peaks = 0
	for i in range(1, k - 1):
		if mnts[i - 1] < mnts[i] > mnts[i + 1]:
			peaks += 1
	best = None
	for i in range(0, n - k + 1):
		if best is None or best[1] < peaks + 1:
			best = (i, peaks + 1)
		if mnts[i] < mnts[i + 1] > mnts[i + 2]:
			peaks -= 1
		if i + k < n and mnts[i + k - 2] < mnts[i + k - 1] > mnts[i + k]:
			peaks += 1
	print('%d %d' % (best[1], best[0] + 1))


T = int(input())
while T:
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = []
	for i in range(1, len(a) - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks.append(i)
	peaks.sort()
	v = [0] * n
	j = 0
	for i in range(1, len(v)):
		if j >= len(peaks) or i != peaks[j]:
			v[i] = v[i - 1]
		else:
			j += 1
			v[i] = v[i - 1] + 1
	maxp = 0
	maxl = 0
	for i in range(len(v) - k + 1):
		if v[i + k - 2] - v[i] > maxp:
			maxp = v[i + k - 2] - v[i]
			maxl = i
	print(maxp + 1, maxl + 1)
	T -= 1


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	ans = 0
	up = 0
	c = []
	flag = False
	for j in range(1, n - 1):
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			c.append(1)
		else:
			c.append(0)
	no = k - 2
	up = 1
	for i in range(k - 2):
		ans += c[i]
	tmp = ans
	i = k - 2
	while i < len(c):
		tmp += c[i] - c[i - k + 2]
		if ans < tmp:
			ans = tmp
			up = i - k + 4
		i += 1
	print(ans + 1, up)


T = int(input())
for _ in range(T):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	peak = []
	for i in range(n):
		if i > 0 and i < n - 1 and (a[i] > a[i - 1]) and (a[i] > a[i + 1]):
			peak.append(1)
		else:
			peak.append(0)
	f = [0] * n
	for i in range(1, n):
		if peak[i]:
			f[i] = f[i - 1] + 1
		else:
			f[i] = f[i - 1]
	ansl = f[k - 1]
	ansl -= peak[0] + peak[k - 1]
	ansi = 0
	for i in range(k, n):
		tmp = f[i] - f[i - k]
		tmp -= peak[i] + peak[i - k + 1]
		if tmp > ansl:
			ansl = tmp
			ansi = i - k + 1
	print(ansl + 1, ansi + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	s = list(map(int, input().split()))
	ps = [0, 0]
	for i in range(1, n - 1):
		if s[i] > s[i - 1] and s[i] > s[i + 1]:
			ps.append(ps[-1] + 1)
		else:
			ps.append(ps[-1])
	ps.append(ps[-1])
	mx = 0
	ans = 1
	for i in range(len(ps) - k + 1):
		p = ps[i + k - 1] - ps[i + 1]
		if p > mx:
			ans = i + 1
			mx = p
	print(mx + 1, ans)


import atexit
import io
import sys
input = sys.stdin.readline
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

def is_peak(x):
	if 0 < x < n - 1:
		if l[x - 1] < l[x] and l[x + 1] < l[x]:
			return True
	return False
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	h = [0] * n
	max_val = 0
	left = 0
	for i in range(1, n - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			h[i] = 1
	for i in range(0, n - k + 1):
		if i == 0:
			a = h[i + 1:i + k - 1]
			val = sum(a)
		else:
			val += h[i + k - 2] - h[i]
		if val > max_val:
			max_val = val
			left = i
	print(max_val + 1, left + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			p[i] = 1
	for i in range(1, n):
		p[i] += p[i - 1]
	(x, y) = (0, 0)
	for i in range(k - 1, n):
		b = p[i - 1] - p[i - k + 1] + 1
		if b > x:
			x = b
			y = i - k + 1
	print(x, y + 1)


for i in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	ans = [0] * n
	asu = 0
	m = 0
	ind = 1
	for j in range(1, k - 1):
		if l[j] > l[j - 1] and l[j] > l[j + 1]:
			ans[j] = 1
			asu += 1
	if asu > m:
		ind = 1
	m = max(asu, m)
	for j in range(k - 1, n - 1):
		if l[j] > l[j - 1] and l[j] > l[j + 1]:
			ans[j] = 1
			asu += 1
		asu -= ans[j - k + 2]
		if asu > m:
			ind = j - k + 3
		m = max(asu, m)
	print(m + 1, ind)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	t = 0
	l = 0
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			t += 1
	(i, j) = (1, k - 1)
	cur = t
	while j < n - 1:
		if arr[j] > arr[j - 1] and arr[j] > arr[j + 1]:
			cur += 1
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			cur -= 1
		if cur > t:
			t = cur
			l = i
		i += 1
		j += 1
	print(t + 1, l + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ind = 0
	ans = 0
	mountain = [0]
	prefixSum = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			mountain.append(1)
			prefixSum.append(prefixSum[-1] + mountain[-1])
		else:
			mountain.append(0)
			prefixSum.append(prefixSum[-1] + mountain[-1])
	mountain.append(0)
	prefixSum.append(mountain[-1] + prefixSum[-1])
	for l in range(len(prefixSum) - k + 1):
		val = prefixSum[l + k - 2] - prefixSum[l]
		if val > ans:
			ans = val
			ind = l
		elif val == ans:
			ind = min(l, ind)
	print(ans + 1, ind + 1)


def solve(n, k, a):
	low = 0
	high = k - 1
	local_peak = 0
	max_peak = 0
	peak_set = set()
	for i in range(1, high):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			local_peak += 1
			peak_set.add(i)
	max_peak = local_peak
	min_l = 0
	ind = high
	if 1 in peak_set:
		local_peak -= 1
	low += 1
	while ind < n - 1:
		if a[ind] > a[ind - 1] and a[ind] > a[ind + 1]:
			local_peak += 1
			peak_set.add(ind)
		if local_peak > max_peak:
			max_peak = local_peak
			min_l = low
		ind += 1
		low += 1
		if low in peak_set:
			local_peak -= 1
	return (max_peak + 1, min_l + 1)
t = int(input())
for _ in range(t):
	(n, k) = input().split()
	a = list(map(int, input().split()))
	(p, l) = solve(int(n), int(k), a)
	print('{} {}'.format(p, l))


def solve(n, k):
	a = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		peaks[i] = peaks[i - 1]
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] += 1
	(ml, mp) = (0, 0)
	for l in range(0, n - k + 1):
		p = peaks[l + k - 2] - peaks[l]
		if p > mp:
			ml = l
			mp = p
	return f'{mp + 1} {ml + 1}'
[print(solve(*map(int, input().split()))) for _ in range(int(input()))]


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	S = [0] * n
	h = 0
	mh = 0
	l = 0
	state = True
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			S[i] = 1
			h += 1
		if i < k - 1:
			if h > mh:
				mh = h
		else:
			if state == True:
				j = 1
				state = False
			else:
				j += 1
			h -= S[j]
			if h > mh:
				mh = h
				l = j
	print(mh + 1, l + 1)


class Solution:

	def solve(self, n, k, a):
		peak = [0 for i in range(0, n)]
		total = [0 for i in range(0, n)]
		for i in range(1, n):
			if i + 1 < n and a[i] > a[i - 1] and (a[i] > a[i + 1]):
				peak[i] = 1
			total[i] = total[i - 1] + peak[i]
		(largest, pos) = (-1, -1)
		for i in range(k - 1, n):
			peaks = total[i] - (total[i - k] if i >= k else 0) - peak[i - k + 1] - peak[i]
			if peaks > largest:
				largest = peaks
				pos = i - k + 2
		return (largest + 1, pos)

	def __init__(self):
		test = int(input())
		for t in range(0, test):
			(n, k) = list(map(int, input().split()))
			a = list(map(int, input().split()))
			(largest, pos) = self.solve(n, k, a)
			print(largest, pos)
Solution()


t = int(input())
for oo in range(t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	b = [0] * n
	l = 1
	p = 0
	maxl = 0
	maxp = 0
	e = 0
	j = 1
	while j < n - 1:
		if a[j] > a[j - 1] and a[j] > a[j + 1]:
			b[j] = 1
			j += 1
		j += 1
	p = sum(b[:k - 1])
	maxp = p
	while l + k - 1 < n:
		p += b[l + k - 2]
		p -= b[l]
		if p > maxp:
			maxp = p
			maxl = l
		l += 1
	print(maxp + 1, maxl + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	a.append(a[-1])
	peak_n = 0
	for i in range(1, k - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peak_n += 1
	l = 0
	peak_sol = peak_n
	for i in range(1, n - k + 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peak_n -= 1
		if a[i + k - 3] < a[i + k - 2] and a[i + k - 2] > a[i + k - 1]:
			peak_n += 1
		if peak_sol < peak_n:
			l = i
			peak_sol = peak_n
	print(peak_sol + 1, l + 1)


t = int(input())
for _ in range(t):
	(n, k) = [int(x) for x in input().strip().split()]
	a = [int(x) for x in input().strip().split()]
	b = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[i] = 1
	curr = sum(b[:k])
	if b[k - 1] == 1:
		curr -= 1
	res = curr
	ri = 0
	end = k - 1
	for i in range(1, n - k + 1):
		if b[i] == 1:
			curr -= 1
		if b[end] == 1:
			curr += 1
		if curr > res:
			res = curr
			ri = i
		end += 1
	print(res + 1, ri + 1)


T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	hs = list(map(int, input().split()))
	assert len(hs) == n
	peak = [False] * n
	for i in range(1, n - 1):
		if hs[i] > hs[i - 1] and hs[i] > hs[i + 1]:
			peak[i] = True
	apeak = [0] * n
	for i in range(1, n):
		apeak[i] = apeak[i - 1] + peak[i]
	maxp = -1
	maxr = None
	for i in range(k - 2, n):
		p = apeak[i] - apeak[i - k + 2]
		if maxp < p:
			maxp = p
			maxr = i
	print(maxp + 1, maxr + 3 - k)


t = int(input())
while t:
	(n, k) = map(int, input().split())
	mountain = list(map(int, input().split()))
	prefix = [0] * n
	peaks = 0
	for i in range(1, n - 1):
		if mountain[i] > mountain[i - 1] and mountain[i] > mountain[i + 1]:
			peaks += 1
		prefix[i] = peaks
	prefix[n - 1] = peaks
	max_p = -1
	p_index = n
	for l in range(n - k + 1):
		r = l + k - 2
		p = prefix[r] - prefix[l]
		if p > max_p:
			max_p = p
			p_index = l
	print(max_p + 1, p_index + 1)
	t -= 1


import math

def task_1343_c():
	b = int(input())
	array = [int(num) for num in input().split()]
	maxPositive = 0
	minNegative = -10000000000
	res = 0
	for i in range(b):
		if array[i] < 0:
			if i != 0 and array[i - 1] >= 0:
				res += maxPositive
				maxPositive = 0
			minNegative = max(minNegative, array[i])
		elif i != 0 and array[i - 1] < 0:
			res += minNegative
			minNegative = -10000000000
		maxPositive = max(maxPositive, array[i])
	if minNegative == -10000000000:
		res += maxPositive
	else:
		res += maxPositive + minNegative
	print(res)

def task_1341_b():
	(n, k) = map(int, input().split())
	heights = [int(a) for a in input().split()]
	peaks = [0 for i in range(n)]
	a = 0
	for i in range(1, n - 1):
		if heights[i - 1] < heights[i] and heights[i] > heights[i + 1]:
			a += 1
		peaks[i] = a
	peaks[n - 1] = a
	max_count = 0
	pos = 0
	for i in range(n - k + 2):
		local = peaks[i + k - 2] - peaks[i]
		if local > max_count:
			max_count = local
			pos = i
	print(max_count + 1, pos + 1)

def task_1340_a():
	n = int(input())
	array = [int(i) for i in input().split()]
	for i in range(n - 1):
		if array[i] < array[i + 1]:
			if array[i] + 1 != array[i + 1]:
				print('No')
				return
	print('Yes')

def task_1339_b():
	n = int(input())
	array = [int(num) for num in input().split()]
	array.sort()
	output = [0 for i in range(0, n)]
	i = 0
	h = 0
	j = n - 1
	while i <= j:
		output[h] = array[i]
		h += 1
		i += 1
		if h < n:
			output[h] = array[j]
			h += 1
			j -= 1
	for val in reversed(output):
		print(val, end=' ')

def task_1338_a():
	n = int(input())
	inputArr = [int(num) for num in input().split()]
	max_sec = 0
	for i in range(1, n):
		local_sec = 0
		a = inputArr[i - 1] - inputArr[i]
		if a <= 0:
			continue
		else:
			b = math.floor(math.log2(a))
			local_sec = b + 1
			for j in range(b, -1, -1):
				if a < pow(2, j):
					continue
				inputArr[i] += pow(2, j)
				a -= pow(2, j)
			if local_sec > max_sec:
				max_sec = local_sec
	print(max_sec)

def task_1334_d():
	(n, l, r) = map(int, input().split())
	res = []
	count = 0
	start_pos = l
	for i in range(1, n + 1):
		count += (n - i) * 2
		if count >= l:
			for j in range(n - i):
				res.append(i)
				res.append(j + i + 1)
		else:
			start_pos -= (n - i) * 2
		if count >= r:
			break
	res.append(1)
	for i in range(start_pos - 1, start_pos + (r - l)):
		print(res[i], end=' ')
	print()
a = int(input())
for i in range(a):
	task_1341_b()


import random, math
from copy import deepcopy as dc
from bisect import bisect_left, bisect_right

def solution(li, k):
	peaks = [0] * len(li)
	s = 0
	for i in range(1, len(li) - 1):
		if li[i - 1] < li[i] > li[i + 1]:
			s += 1
		peaks[i] = s + 1 - 1
	peaks[-1] = s + 1 - 1
	fin = -1
	l = len(li) - k + 1
	for i in range(len(li) - k + 1):
		num = peaks[i + k - 2] - peaks[i]
		if fin < num + 1:
			fin = num + 1
			l = i + 1
		elif fin == num + 1:
			l = min(l, i + 1)
	return [fin, l]

def input_test():
	for _ in range(int(input())):
		(n, k) = map(int, input().strip().split(' '))
		li = list(map(int, input().strip().split(' ')))
		out = solution(li, k)
		print(*out)

def test():
	pass
input_test()


import sys
input = sys.stdin.readline
from collections import Counter

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def print_list_int(l):
	print(''.join(map(str, map(int, l))))
t = inp()
for test in range(t):
	(n, k) = inlt()
	arr = inlt()
	last_peak = -1
	num_peaks_in_window = 0
	best_window = 0
	max_peaks_in_any_window = 0
	last = arr[0]
	for i in range(1, k - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			num_peaks_in_window += 1
	max_peaks_in_any_window = num_peaks_in_window
	best_window = 0
	for i in range(1, n - k + 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			num_peaks_in_window -= 1
		if arr[i + k - 2] > arr[i + k - 3] and arr[i + k - 2] > arr[i + k - 1]:
			num_peaks_in_window += 1
		if num_peaks_in_window > max_peaks_in_any_window:
			max_peaks_in_any_window = num_peaks_in_window
			best_window = i
	print(str(max_peaks_in_any_window + 1) + ' ' + str(best_window + 1))


t = int(input())
for i in range(t):
	(n, k) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	lis = []
	num = [0]
	for j in range(1, n - 1):
		if arr[j] > arr[j - 1] and arr[j] > arr[j + 1]:
			lis.append(j)
			num.append(1)
		else:
			num.append(0)
	num.append(0)
	a = num[:k - 1].count(1)
	ans = [a]
	if num[k - 1] == 1:
		a += 1
	for j in range(k, n):
		if num[j - k + 1] == 1:
			a -= 1
		ans.append(a)
		if num[j] == 1:
			a += 1
	b = max(ans)
	l = -1
	p = len(ans)
	for j in range(p):
		if ans[j] == b:
			l = j + 1
			break
	print(b + 1, l)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(ri()):
		(n, k) = ria()
		a = ria()
		z = k - 2
		c = 0
		cumpeak = []
		for i in range(1, n - 1):
			if a[i] > max(a[i - 1], a[i + 1]):
				c += 1
			cumpeak.append(c)
		sn = cumpeak[z - 1]
		m = sn
		l = 1
		i = 0
		while True:
			i += 1
			if i + z - 1 < len(cumpeak):
				sn = cumpeak[i + z - 1]
				sn -= cumpeak[i - 1]
				if sn > m:
					m = sn
					l = i + 1
			else:
				break
		print(m + 1, l)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import sys, inspect
ints = (int(x) for x in sys.stdin.read().split())
ntc = next(ints)
for tc in range(1, ntc + 1):
	(n, k) = (next(ints) for i in range(2))
	a = [next(ints) for i in range(n)]
	peaks = [0 < i < n - 1 and a[i - 1] < a[i] > a[i + 1] for i in range(n)]
	cp = [0] * (n + 1)
	ans = [0] * (n - k + 1)
	for i in range(n):
		cp[i + 1] = peaks[i] + cp[i]
	for i in range(n - k + 1):
		ans[i] = 1 + cp[i + k] - cp[i] - peaks[i] - peaks[i + k - 1]
	l = max(range(n - k + 1), key=lambda i: (ans[i], -i))
	print(ans[l], l + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	prefix_sum = [0] * n
	for i in range(1, n):
		if i < n - 1 and a[i] > a[i - 1] and (a[i] > a[i + 1]):
			prefix_sum[i] = 1
		prefix_sum[i] += prefix_sum[i - 1]
	ans = -1
	for l in range(n - k + 1):
		np = prefix_sum[l + k - 2] - prefix_sum[l]
		if np > ans:
			ans = np
			strt = l
	print(ans + 1, strt + 1)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split(' '))
	a = list(map(int, input().split()))
	arr = [0] * n
	i = 2
	while i < n:
		if a[i - 2] < a[i - 1] > a[i]:
			arr[i] = arr[i - 1] + 1
		else:
			arr[i] = arr[i - 1]
		i += 1
	ans = [0, 1]
	i = k - 1
	while i < n:
		x = arr[i] - arr[i - k + 2]
		if ans[0] < x:
			ans[0] = x
			ans[1] = i - k + 2
		i += 1
	print(ans[0] + 1, ans[1])


t = int(input())
for j in range(t):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	peaks = []
	num_peaks = 0
	for j in range(1, n - 1):
		if l[j - 1] < l[j] > l[j + 1]:
			peaks.append(j)
			num_peaks += 1
	parts = 0
	ind = n + 1
	curr = []
	m = 0
	length = 0
	while m < k - 1:
		if num_peaks > 0 and m == peaks[0]:
			curr.append(m)
			length += 1
			peaks.pop(0)
			num_peaks -= 1
		m += 1
	for j in range(n + 1 - k):
		if num_peaks > 0 and j + k - 1 > peaks[0]:
			curr.append(peaks[0])
			peaks.pop(0)
			num_peaks -= 1
			length += 1
		if length > 0 and j == curr[0]:
			curr.pop(0)
			length -= 1
		if length > parts:
			parts = length
			ind = j
	if ind == n + 1:
		print(parts + 1, 1)
	else:
		print(parts + 1, ind + 1)


list_ans = []
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	list1 = list(map(int, input().split()))
	list2 = [0] * n
	list3 = [0] * n
	a = 0
	for i in range(1, n - 1):
		if list1[i - 1] < list1[i] and list1[i] > list1[i + 1]:
			a += 1
		list2[i + 1] = a
		list3[i] = a
	ans = 0
	pos = 1
	for j in range(n - k + 1):
		if list2[j + k - 1] - list3[j] > ans:
			ans = list2[j + k - 1] - list3[j]
			pos = j + 1
	ans += 1
	list_ans.append([ans, pos])
for item in list_ans:
	print(*item)


t = int(input())
ans = []
for i in range(t):
	counter = 0
	(n, k) = map(int, input().split())
	moun = list(map(int, input().split()))
	for j in range(1, k - 1):
		if j < k and moun[j - 1] < moun[j] > moun[j + 1]:
			counter += 1
	max_res = counter
	index = 1
	for j in range(k - 1, n - 1):
		if moun[j - 1] < moun[j] > moun[j + 1]:
			counter += 1
		if moun[j - k + 1] < moun[j - k + 2] > moun[j - k + 3]:
			counter -= 1
		if counter > max_res:
			max_res = counter
			index = j - k + 3
	ans.append((max_res + 1, index))
for i in ans:
	print(i[0], i[1])


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b[max(0, i - k + 2)] += 1
			b[i] -= 1
	for i in range(1, n):
		b[i] += b[i - 1]
	i = 0
	l = 0
	mx = -1
	while i < n:
		if b[i] > mx:
			l = i + 1
			mx = b[i]
		i += 1
	print(mx + 1, l)


t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	dp = [0] * n
	prefix_arr = [0] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			dp[i] = dp[i - 1] + 1
	for i in range(1, n):
		prefix_arr[i] = dp[i] + prefix_arr[i - 1]
	m = []
	for i in range(0, n - k + 1):
		m.append((prefix_arr[i + k - 2] - prefix_arr[i], i + 1))
	ans = 0
	ind = 1
	for i in range(len(m)):
		if m[i][0] > ans:
			ans = m[i][0]
			ind = m[i][1]
	print(ans + 1, ind)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split(' '))
	l = list(map(int, input().split(' ')))
	pd = [0] * (n + 1)
	m = 0
	if k <= n:
		for d in range(1, n - 1):
			if l[d] > l[d - 1] and l[d] > l[d + 1]:
				pd[d + 1] = m + 1
				m = pd[d + 1]
			else:
				pd[d + 1] = m
		max = 0
		lo = 1
		res = n - k + 1
		min = k - 1
		for pa in range(1, res + 1):
			r = pa + min
			c = pd[r - 1] - pd[pa]
			if c > max:
				max = c
				lo = pa
		print(max + 1, lo)


for _ in range(int(input())):
	(N, K) = map(int, input().split())
	L = list(map(int, input().split()))
	count = 0
	L.insert(0, float('inf'))
	L.append(float('inf'))
	for i in range(1, K):
		if L[i] > L[i - 1] and L[i] > L[i + 1]:
			count += 1
	M = count
	index = 1
	for i in range(2, N - K + 2):
		pre = count
		if L[i - 1] < L[i] and L[i] > L[i + 1]:
			pre -= 1
		if L[i + K - 2] > L[i + K - 3] and L[i + K - 1] < L[i + K - 2]:
			pre += 1
		if pre > M:
			index = i
			M = pre
		count = pre
	print(M + 1, index)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			if i < k - 1:
				p[0] += 1
			else:
				p[i - k + 2] += 1
			p[i] -= 1
	for i in range(1, n):
		p[i] += p[i - 1]
	m = p[0]
	idx = 1
	for i in range(n):
		if m < p[i]:
			idx = i + 1
			m = p[i]
	print(m + 1, idx)


import sys
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	input = sys.stdin.readline

def takeInput():
	return [int(x) for x in input().strip().split()]
t = int(input())
while t != 0:
	t -= 1
	(n, k) = takeInput()
	a = takeInput()
	peaks = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peaks[i] = 1
	p = 0
	window_size = k - 2
	peaks_found = 0
	for i in range(1, window_size + 1):
		if peaks[i]:
			peaks_found += 1
	current_ans = peaks_found
	start = 0
	for i in range(window_size + 1, n):
		peaks_found -= peaks[i - window_size]
		peaks_found += peaks[i]
		if peaks_found > current_ans:
			current_ans = peaks_found
			start = i - window_size
	print(current_ans + 1, start + 1)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	mountain = list(map(int, input().split()))
	peak = [False for j in range(n)]
	min_index = 1
	peak_count = 0
	for j in range(1, k - 1):
		if mountain[j] > mountain[j - 1] and mountain[j] > mountain[j + 1]:
			peak[j] = True
			peak_count += 1
	max_peak_count = peak_count
	for j in range(k - 1, n - 1):
		if peak[j - k + 2] == True:
			peak_count -= 1
		if mountain[j] > mountain[j - 1] and mountain[j] > mountain[j + 1]:
			peak_count += 1
			peak[j] = True
			if peak_count > max_peak_count:
				max_peak_count = peak_count
				min_index = j - k + 3
	print(max_peak_count + 1, min_index)


from math import *
from collections import *
from itertools import *
from bisect import *
from heapq import *
from operator import *

def io():
	return map(int, input().split())

def op():
	return list(map(int, input().split()))
for _ in range(int(input())):
	(n, k) = io()
	l = op()
	(l1, l2, l3) = ([0] * n, [0] * n, [0] * n)
	for i in range(1, n - 1):
		if l[i - 1] <= l[i] >= l[i + 1]:
			l1[i] = 1
	l2 = list(accumulate(l1))
	for i in range(n):
		if i == n - k + 1:
			break
		temp = l2[i + k - 1]
		if i > 0:
			temp -= l2[i - 1]
		if l1[i] == 1 or l1[i + k - 1] == 1:
			temp -= 1
		l3[i] = temp
	x = max(l3)
	print(max(l3) + 1, l3.index(x) + 1)


from math import *
from bisect import bisect_left, bisect_right
from queue import Queue
from sys import stdin, stdout
from collections import Counter
input = lambda : stdin.readline().strip()
fast_print = stdout.write
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	ls = list(map(int, input().split()))
	peaks = {}
	for i in range(n):
		peaks[i] = False
	cnt = 0
	for i in range(1, k - 1):
		if ls[i - 1] < ls[i] > ls[i + 1]:
			peaks[i] = True
			cnt += 1
	M = cnt + 1
	ans = 1
	for i in range(k - 1, n - 1):
		if ls[i - 1] < ls[i] > ls[i + 1]:
			peaks[i] = True
			cnt += 1
		if peaks[i - k + 2]:
			cnt -= 1
		if cnt + 1 > M:
			M = cnt + 1
			ans = i - k + 3
	fast_print(str(M) + ' ' + str(ans) + '\n')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	left = 0
	right = left + k - 1
	maxpeaks = 0
	l = 0
	for i in range(left + 1, right):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			maxpeaks += 1
	peaks = maxpeaks
	for i in range(1, n - k + 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks -= 1
		if a[i + right - 1] > a[i - 2 + right] and a[i + right - 1] > a[i + right]:
			peaks += 1
		if peaks > maxpeaks:
			maxpeaks = peaks
			l = i
	print(maxpeaks + 1, l + 1)


t = int(input())
for v in range(t):
	(n, k) = list(map(int, input().split(' ')))
	li = list(map(int, input().split(' ')))
	b = [0] * n
	pr = [0] * n
	for i in range(1, n - 1):
		if li[i] > li[i - 1] and li[i] > li[i + 1]:
			b[i] = 1
	for z in range(1, n):
		pr[z] = b[z] + pr[z - 1]
	left = 0
	ans = 0
	j = 0
	while j < n - k + 1:
		right = j + k - 1
		count = pr[right] - pr[j] - b[right]
		if count > ans:
			ans = count
			left = j
		j += 1
	print(f'{ans + 1} {left + 1}')


t = int(input())
for i in range(0, t):
	(n, k) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	l1 = []
	for j in range(0, n):
		l1.append(0)
	for j in range(1, n - 1):
		if l[j] > l[j - 1] and l[j] > l[j + 1]:
			l1[j] = 1
	m = 0
	s = 0
	c = 0
	for j in range(1, k - 1):
		if l1[j] == 1:
			c += 1
	if c > m:
		m = c
		s = 1
	s1 = 2
	e = k - 1
	while e < n - 1:
		if l1[s1 - 1] == 1:
			c -= 1
		if l1[e] == 1:
			c += 1
		if c > m:
			m = c
			s = s1
		s1 += 1
		e += 1
	if m == 0:
		s = 1
	print(m + 1, s)


m = 10 ** 9 + 7
t = int(input())
while t:
	t -= 1
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	l.insert(0, 0)
	count = 0
	ans = 0
	j = 1
	for i in range(2, k):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			count += 1
	ans = count
	for i in range(2, n - k + 2):
		if l[i + k - 2] > l[i + k - 3] and l[i + k - 2] > l[i + k - 1]:
			count += 1
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			count -= 1
		if ans < count:
			ans = count
			j = i
	print(ans + 1, j)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	peaks = [False] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			peaks[i] = True
	cnt = 0
	for i in range(k - 1):
		cnt += peaks[i]
	(left, right) = (0, k - 1)
	(mx_cnt, mx_left) = (cnt, left)
	while right < n:
		left += 1
		cnt -= peaks[left]
		cnt += peaks[right]
		right += 1
		if cnt > mx_cnt:
			(mx_cnt, mx_left) = (cnt, left)
	print(mx_cnt + 1, mx_left + 1)


import sys
import math
from collections import defaultdict

def solve(t):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	p = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = p[i - 1] + 1
		else:
			p[i] = p[i - 1]
	p[-1] = p[-2]
	i = 0
	j = k - 1
	ans = 0
	res = i
	if p[j] > p[j - 1]:
		ans = max(0, p[j - 1])
	else:
		ans = max(0, p[j])
	i += 1
	j += 1
	while j < n:
		rec = p[j] - p[i]
		if p[j] > p[j - 1]:
			rec -= 1
		if rec > ans:
			ans = rec
			res = i
		i += 1
		j += 1
	print(ans + 1, res + 1)
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


from sys import *
from math import *
from bisect import *
t = int(stdin.readline())
for _ in range(t):
	(n, k) = map(int, stdin.readline().split())
	a = list(map(int, stdin.readline().split()))
	k -= 1
	b = [0]
	x = 0
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			x += 1
		b.append(x)
	b.append(x)
	ans = 0
	m = 0
	for i in range(n - k):
		if b[i + k - 1] - b[i] > ans:
			ans = b[i + k - 1] - b[i]
			m = i
	print(ans + 1, m + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	mxl = 0
	ans = [-1, -1]
	si = 0
	ei = 0
	peak = set()
	for i in range(1, k):
		if a[i] > a[i - 1] and i + 1 < k and (a[i] > a[i + 1]):
			peak.add(i - 1)
	ei = k
	ans = [si, ei - 1]
	mxl = len(peak)
	while ei < len(a):
		if a[ei] < a[ei - 1] and a[ei - 1] > a[ei - 2]:
			peak.add(ei - 2)
		if si in peak:
			peak.remove(si)
		si += 1
		if len(peak) > mxl:
			ans = [si, ei]
			mxl = len(peak)
		ei += 1
	if mxl == 0:
		print(1, 1)
		continue
	print(mxl + 1, ans[0] + 1)


for test_i in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = 0
	cur = 0
	for i in range(1, k - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			cur += 1
	ans_i = 0
	ans = cur
	for i in range(k, n):
		if arr[i - 2] < arr[i - 1] > arr[i]:
			cur += 1
		if arr[i - k] < arr[i - k + 1] > arr[i - k + 2]:
			cur -= 1
		if cur > ans:
			ans = cur
			ans_i = i - k + 1
	print(ans + 1, ans_i + 1)


def peaks(s, n, k):
	count = 0
	left = 0
	for j in range(1, k - 1):
		if s[j] > s[j - 1] and s[j] > s[j + 1]:
			count += 1
	temp_cnt = count
	for i in range(k, n):
		if s[i - 1] > s[i - 2] and s[i - 1] > s[i]:
			temp_cnt += 1
		if s[i - k + 1] > s[i - k + 2] and s[i - k + 1] > s[i - k]:
			temp_cnt -= 1
		if count < temp_cnt:
			left = i - k + 1
			count = temp_cnt
	return (count + 1, left + 1)
T = int(input())
for t in range(T):
	(n, k) = map(int, input().strip().split())
	S = list(map(int, input().strip().split()))
	(parts, l) = peaks(S, n, k)
	print(f'{parts} {l}')


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	p = [0] * n
	i = 1
	while i < n - 1:
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			p[i] = 1
		i += 1
	x = [0]
	for i in range(1, n):
		x.append(x[-1] + p[i])
	(peak, ind) = (-1, 0)
	for i in range(0, n - k + 1):
		if i == 0:
			if x[i + k - 2] > peak:
				peak = x[i + k - 2]
				ind = i
		elif x[i + k - 2] - x[i] > peak:
			peak = x[i + k - 2] - x[i]
			ind = i
	print(peak + 1, ind + 1)


for __ in range(int(input())):
	(n, k) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	l = [0] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			l[i] = 1
	p = [0] * n
	j = 1
	s = 0
	for i in range(2, n):
		if i >= k:
			s -= l[i - k + 1]
		s += l[i - 1]
		p[i] = s
	segs = p[k - 1:n + 1]
	t = max(segs)
	print(t + 1, segs.index(t) + 1)


for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	cnt = [0 for i in range(n)]
	for i in range(1, n - 1):
		if arr[i] > arr[i + 1] and arr[i] > arr[i - 1]:
			cnt[i] = 1
	ans = 0
	idx = 1
	for i in range(1, m - 1):
		if cnt[i] == 1:
			ans += 1
	sh = ans
	for i in range(1, n - m + 1):
		if cnt[i] == 1:
			sh -= 1
		if cnt[i + m - 2] == 1:
			sh += 1
		if sh > ans:
			ans = sh
			idx = i + 1
	print(ans + 1, idx)


def func(a, l, r):
	answer = 0
	for i in range(l + 1, r):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			answer += 1
	return answer

def check(a, r):
	if r == 0 or r == len(a) - 1:
		return 0
	else:
		if a[r] > a[r - 1] and a[r] > a[r + 1]:
			return 1
		return 0
tt = int(input())
for i in range(tt):
	(n, k) = map(int, input().split())
	a = [int(el) for el in input().split()]
	ans = func(a, 0, 0 + k - 1)
	left = 0
	t = func(a, 0, 0 + k - 1)
	f = {}
	f[0] = ans
	for l1 in range(1, n - k + 1):
		t = t - check(a, l1) + check(a, l1 + k - 2)
		if t > ans:
			ans = t
			left = l1
	print(ans + 1, left + 1)


from collections import defaultdict as dc
from heapq import *
import math
import bisect
import sys
from collections import deque as dq
from heapq import heapify, heappush, heappop
mod = 10 ** 12

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p

def read_mat():
	n = inp()
	a = []
	for i in range(n):
		a.append(line())
	return a

def digit(n):
	s = str(n)
	p = 0
	for i in s:
		p += int(i) ** 2
	return p

def check(a, b):
	for i in range(26):
		for j in range(len(a) + 1):
			q = a[:j] + chr(97 + i) + a[j:]
			if q == b:
				return 1
	return 0

def solve(n, a, k):
	p = [0]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			p.append(1)
		else:
			p.append(0)
	p.append(0)
	for i in range(1, n):
		p[i] = p[i - 1] + p[i]
	ans = 0
	l = 1
	for i in range(n - k + 1):
		x = p[i]
		y = p[i + k - 2]
		if ans < y - x:
			ans = y - x
			l = i + 1
	return (ans + 1, l)
for _ in range(inp()):
	(n, k) = line()
	a = line()
	l = solve(n, a, k)
	print(*l)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [0]
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			b.append(1)
		else:
			b.append(0)
	b.append(0)
	l = 0
	ans = 0
	i = 0
	t = sum(b[i:k + i]) - b[i] - b[k + i - 1] + 1
	ans = t
	l = i
	t += b[i] + b[k + i - 1] - 1
	mx = [ans]
	ls = [0]
	for i in range(1, n - k + 1):
		t += b[i + k - 1] - b[i - 1]
		nt = t - b[i] - b[i + k - 1] + 1
		mx.append(nt)
		ls.append(i)
		if ans < nt:
			ans = nt
	for i in range(len(mx)):
		if mx[i] == ans:
			l = ls[i]
			break
	print(ans, l + 1)


t = int(input())
r = 10 ** 5
for i in range(t):
	c = 0
	m = 0
	ss = 0
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	l = a[0]
	a[0] = r
	for j in range(1, n - 1):
		x = a[j]
		if a[j] > l and a[j] > a[j + 1]:
			c += 1
			a[j] = 2 * r + c
		else:
			a[j] = 1 * r + c
		l = x
		if j >= k - 1:
			p = a[j] % r - a[j - k + 1] % r
			if a[j] // r == 2:
				p -= 1
			if a[j - k + 1] // r == 2:
				p -= 1
			if p > m:
				m = p
				ss = j - k + 1
	p = c - a[n - k] % r
	if a[n - k] // r == 2:
		p -= 1
	if p > m:
		m = p
		ss = n - k
	print(m + 1, end=' ')
	print(ss + 1)


for _ in range(int(input())):
	(l, ws) = map(int, input().split())
	arr = list(map(int, input().split()))
	sp = 0
	for i in range(1, ws - 1):
		if arr[i - 1] < arr[i] and arr[i + 1] < arr[i]:
			sp += 1
	lw = 0
	rw = ws - 1
	maxsp = 0
	cp = sp
	while rw != l - 1:
		lw += 1
		if arr[lw - 1] < arr[lw] and arr[lw + 1] < arr[lw]:
			sp -= 1
		if arr[rw - 1] < arr[rw] and arr[rw + 1] < arr[rw]:
			sp += 1
		rw += 1
		if cp < sp:
			cp = sp
			maxsp = lw
	print(cp + 1, maxsp + 1)


import math
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = [0]
	for i in range(1, n - 1):
		if a[i] > max(a[i - 1], a[i + 1]):
			ans.append(ans[-1] + 1)
		else:
			ans.append(ans[-1])
	b = -1
	zz = len(ans)
	ll = 0
	for i in range(zz):
		if i + k - 2 == zz:
			break
		kk = max(b, ans[i + k - 2] - ans[i])
		if kk > b:
			b = kk
			ll = i + 1
	print(b + 1, ll)


from pprint import pprint
import sys
input = sys.stdin.readline
q = int(input())
for _ in range(q):
	(n, k) = map(int, input().split())
	dat = list(map(int, input().split()))
	peak = [0] * n
	for i in range(1, n - 1):
		if dat[i - 1] < dat[i] and dat[i] > dat[i + 1]:
			peak[i] += 1
	total = sum(peak[0:k])
	(l, r) = (0, k - 1)
	if peak[l] == 1:
		total -= 1
	if peak[r] == 1:
		total -= 1
	resl = l + 1
	resv = total
	for i in range(n - k):
		total -= peak[l + 1]
		l += 1
		r += 1
		total += peak[r - 1]
		if total > resv:
			resv = total
			resl = l + 1
	print('{0} {1}'.format(resv + 1, resl))


import sys
t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	k -= 2
	d = [0] * n
	mx = res = 0
	for i in range(1, n - 1):
		d[i] = d[i - 1]
		if a[i] > max(a[i - 1], a[i + 1]):
			d[i] += 1
		l = max(0, i - k)
		if d[i] - d[l] > mx:
			mx = d[i] - d[l]
			res = l
	print(mx + 1, max(1, res + 1))


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	resT = resL = 0
	peaks = [0] * n
	suffix = [0] * (n + k + 1)
	for i in range(1, n - 1):
		if A[i] > A[i - 1] and A[i] > A[i + 1]:
			peaks[i] = 1
			suffix[i] = 1
	for i in range(n + k - 1, -1, -1):
		suffix[i] = suffix[i] + suffix[i + 1]
	for i in range(n):
		T = suffix[i] - suffix[i - 1 + k] - peaks[i]
		if T > resT:
			resT = T
			resL = i
	print(resT + 1, resL + 1)


t = int(input())
for you in range(t):
	l = input().split()
	n = int(l[0])
	k = int(l[1])
	l = input().split()
	li = [int(i) for i in l]
	arr = [0 for i in range(n)]
	sumi = 0
	for i in range(1, n - 1):
		if li[i] > li[i - 1] and li[i] > li[i + 1]:
			sumi += 1
		arr[i] = sumi
	arr[n - 1] = sumi
	maxa = 0
	ans = 0
	for i in range(n - k + 1):
		if i == 0:
			if k == 1:
				continue
			elif arr[i + k - 2] - arr[i] > maxa:
				maxa = arr[i + k - 2] - arr[i]
				ans = i
		elif arr[i + k - 2] - arr[i] > maxa:
			maxa = arr[i + k - 2] - arr[i - 1]
			ans = i
	print(maxa + 1, ans + 1)


from math import *
from collections import *
from operator import itemgetter
import bisect
ii = lambda : int(input())
iia = lambda : list(map(int, input().split()))
isa = lambda : list(input().split())
I = lambda : list(map(int, input().split()))
chrIdx = lambda x: ord(x) - 96
idxChr = lambda x: chr(96 + x)
t = ii()
for _ in range(t):
	(n, m) = iia()
	a = iia()
	x = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			x[i] = 1
	xx = x.copy()
	for i in range(1, n):
		x[i] = x[i] + x[i - 1]
	maxi = 0
	left = 0
	l = 0
	r = m - 1
	while r < n:
		if l == 0:
			maxi = max(maxi, x[r] - xx[r])
			left = 0
		elif x[r] - x[l - 1] - xx[l] - xx[r] > maxi:
			ans = x[r] - x[l - 1] - xx[l] - xx[r]
			maxi = max(maxi, ans)
			left = l
		l += 1
		r += 1
	print(maxi + 1, left + 1)


for cases in range(int(input())):
	(n, height) = map(int, input().split())
	arr = list(map(int, input().split()))
	peaks = [0] * n
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			peaks[i] = 1
	idx = 0
	ans = sum(peaks[1:height - 1])
	temp = ans
	for i in range(n - height + 1):
		temp -= peaks[i + 1]
		temp += peaks[i + height - 1]
		if temp > ans:
			ans = temp
			idx = i + 1
	print(ans + 1, idx + 1)


from collections import defaultdict
t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	peak = [0]
	dct = defaultdict(lambda : 0)
	for i in range(1, n - 1):
		if arr[i] > arr[i + 1] and arr[i] > arr[i - 1]:
			peak.append(1)
		else:
			peak.append(0)
	peak.append(0)
	s = sum(peak[1:k - 1])
	dct[0] = s
	for i in range(1, n - k + 1):
		s += peak[k + i - 2]
		s -= peak[i]
		dct[i] = s
	key_max = max(dct.keys(), key=lambda k: dct[k])
	maxi = dct[key_max]
	for (keys, values) in dct.items():
		if values == maxi:
			print(values + 1, keys + 1)
			break


test = int(input())
for i in range(test):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	k1 = []
	a = l[0:k]
	(c, c1) = (0, 0)
	for i in range(1, len(a) - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			c += 1
			k1.append(1)
		else:
			k1.append(0)
	(ans, ind) = (0, 0)
	x = len(k1)
	for i in range(len(l) - k + 1):
		if c > ans:
			ans = c
			ind = i
		if k1[i] == 1:
			c -= 1
		if i + k != len(l):
			if l[i + k - 2] < l[i + k - 1] and l[i + k - 1] > l[i + k]:
				c += 1
				k1.append(1)
			else:
				k1.append(0)
	print(ans + 1, end=' ')
	print(ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	(peaks, left) = ([0] * n, 0)
	for i in range(1, n - 1):
		peaks[i] = peaks[i - 1]
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			peaks[i] = peaks[i - 1] + 1
	peaks[n - 1] = peaks[n - 2]
	pmax = left = -1
	for i in range(0, n - k + 1):
		if peaks[i + k - 2] - peaks[i] > pmax:
			left = i
			pmax = peaks[i + k - 2] - peaks[i]
	print(pmax + 1, left + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = {}
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			p[i] = p.get(i, 0) + 1
	m = 0
	l = {}
	cnt = 0
	for i in range(1, k - 1):
		if p.get(i, 0) > 0:
			l[i] = l.get(i, 0) + 1
			cnt += 1
	m = cnt
	le = 1
	for i in range(1, n - k + 1):
		if l.get(i, 0) > 0:
			l[i] = 0
			cnt -= 1
		if p.get(i + k - 2, 0) > 0:
			l[i + k - 2] = l.get(i + k - 2, 0) + 1
			cnt += 1
		if m < cnt:
			le = i + 1
			m = cnt
	print(m + 1, le)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = [int(x) for x in input().split()]
	t = 0
	for j in range(1, k - 1):
		if a[j - 1] < a[j] > a[j + 1]:
			t += 1
	l = 0
	m = t
	for i in range(1, n - k + 1):
		if a[i - 1] < a[i] > a[i + 1]:
			t -= 1
		if a[i + k - 3] < a[i + k - 2] > a[i + k - 1]:
			t += 1
		if t > m:
			l = i
			m = t
	print(m + 1, l + 1)


for t in range(int(input())):
	(n, k) = map(int, input().split())
	heights = [int(x) for x in input().split()]
	for i in range(1, n - 1):
		if heights[i] > heights[i - 1] and heights[i] > heights[i + 1]:
			heights[i] = 10 ** 9
	peak = 0
	l = 1
	for i in range(1, k - 1):
		if heights[i] == 10 ** 9:
			peak += 1
	max_peak = peak
	a = k - 1
	while a < n - 1:
		if heights[a - (k - 2)] == 10 ** 9:
			peak -= 1
		if heights[a] == 10 ** 9:
			peak += 1
		if peak > max_peak:
			max_peak = peak
			l = a - (k - 2) + 1
		a += 1
	print(max_peak + 1, l)


T = int(input())
for _ in range(T):
	(n, k) = map(int, input().split())
	nums = list(map(int, input().split()))
	initial = 0
	for i in range(1, k - 1):
		if nums[i + 1] < nums[i] > nums[i - 1]:
			initial += 1
	ans = initial
	l = 0
	for i in range(1, n - k + 1):
		if nums[i + 1] < nums[i] > nums[i - 1]:
			initial -= 1
		if nums[i + (k - 1)] < nums[i + k - 2] > nums[i + (k - 3)]:
			initial += 1
		if initial > ans:
			ans = initial
			l = i
	print(ans + 1, l + 1)


from sys import setrecursionlimit
from collections import deque
import heapq
import functools

def IntInput():
	return int(input())

def M_IntInput():
	return map(int, input().split())

def M_StrInput():
	return map(int, input().split())

def IntArrayInput():
	return list(map(int, input().split()))

def modInverse(p, a, m):
	return p % m * pow(a % m, m - 2, m) % m

def compare(item1, item2):
	return item2[0] - item1[0] if item1[0] != item2[0] else item1[1] - item2[1]

def DFS(s, n, paths, answer):
	visited = [False] * (n + 1)
	stack = []
	stack.append(s)
	visited[s] = True
	DFSArray = []
	while stack:
		s = stack.pop()
		DFSArray.append(s)
		flag = 0
		for i in paths[s]:
			if visited[i] == False:
				flag = 1
				stack.append(i)
				visited[i] = True
		if not flag:
			answer[s - 1][1] = 0
	while DFSArray != []:
		s = DFSArray.pop()
		if answer[s - 1][1] < 0:
			answer[s - 1][1] = 0
			for i in paths[s]:
				if answer[i - 1][1] >= 0:
					answer[s - 1][1] += answer[i - 1][1] + 1
	return answer

def BFS(s, n, paths, answer):
	visited = [False] * (n + 1)
	answer[s - 1][0] = 0
	queue = deque()
	queue.append(s)
	visited[s] = True
	while queue:
		s = deque.popleft(queue)
		for i in paths[s]:
			if visited[i] == False:
				queue.append(i)
				answer[i - 1][0] = answer[s - 1][0] + 1
				visited[i] = True
	return answer
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
for _ in range(int(input())):
	(n, k) = M_IntInput()
	array = IntArrayInput()
	Peaks = [0] * n
	for i in range(1, n - 1):
		if array[i - 1] < array[i] and array[i] > array[i + 1]:
			Peaks[i] = 1
	ans = 1
	for i in range(1, k - 1):
		if Peaks[i] == 1:
			ans += 1
	temp = ans
	ans_index = 1
	for i in range(1, n - k + 1):
		if Peaks[i] == 1:
			temp -= 1
		if Peaks[i + k - 2] == 1:
			temp += 1
		if temp > ans:
			ans = temp
			ans_index = i + 1
	print(ans, ans_index)


import sys
t = int(sys.stdin.readline())
ans_arr = []
for i in range(t):
	[n, k] = [int(j) for j in sys.stdin.readline().split()]
	a = [int(g) for g in sys.stdin.readline().split()]
	peaks = [0] * n
	for g in range(1, n - 1):
		if a[g] > a[g - 1] and a[g] > a[g + 1]:
			peaks[g] = 1
	pre = [0]
	for h in range(n):
		pre.append(peaks[h] + pre[h])
	maxi = -2
	left = 0
	for p in range(n - k + 1):
		tmp = pre[p + k] - pre[p]
		if peaks[p] == 1:
			tmp -= 1
		if peaks[p + k - 1] == 1:
			tmp -= 1
		if tmp > maxi:
			maxi = tmp
			left = p
	ans_arr.append(str(maxi + 1) + ' ' + str(left + 1))
print('\n'.join(ans_arr))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	A = list(map(int, input().split()))
	pf = [0] * n
	t = 0
	for i in range(1, n - 1):
		if A[i - 1] < A[i] > A[i + 1]:
			t += 1
		pf[i] = t
	Ans = []
	p = k - 2
	for i in range(p, n):
		Ans.append((pf[i] - pf[i - p], i - p + 1))
	Ans.sort(reverse=True)
	t = -10 ** 18
	l = 10 ** 18
	for i in Ans:
		if i[0] >= t:
			t = i[0]
			l = i[1]
	print(t + 1, l)


for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	b = [0] * n
	c = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			c += 1
		b[i] = c
	(peak, peakIndex) = (0, 0)
	slide = n - m + 1
	for i in range(slide):
		if b[i + m - 2] - b[i] > peak:
			peak = b[i + m - 2] - b[i]
			peakIndex = i
	print(peak + 1, peakIndex + 1)


from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def powmod(a, b):
	a %= mod
	if a == 0:
		return 0
	res = 1
	while b > 0:
		if b & 1:
			res = res * a % mod
		a = a * a % mod
		b >>= 1
	return res

def main():
	for _ in range(ii()):
		(n, k) = mi()
		a = li()
		pref = [0] * n
		for i in range(1, n - 1):
			if a[i - 1] < a[i] and a[i] > a[i + 1]:
				pref[i] = pref[i - 1] + 1
			else:
				pref[i] = pref[i - 1]
		p = [0] * n
		for i in range(n - k + 1):
			x = pref[i + k - 2] - pref[i]
			p[i] = x
		x = max(p)
		for i in range(n - k + 1):
			if p[i] == x:
				print(x + 1, i + 1)
				break
main()


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	m = [0] + [*map(int, input().split())]
	p = 0
	for i in range(1, k + 1):
		if i != 1 and i != k:
			if m[i] > m[i - 1] and m[i] > m[i + 1]:
				p += 1
	max_peaks = p
	min_l = 1
	(l, r) = (1, k)
	while r <= n:
		l += 1
		if m[l] > m[l - 1] and m[l] > m[l + 1]:
			p -= 1
		if r < n and m[r] > m[r - 1] and (m[r] > m[r + 1]):
			p += 1
		r += 1
		if p > max_peaks:
			max_peaks = p
			min_l = l
	print(max_peaks + 1, min_l)


def mult_input():
	return map(int, input().split())

def list_input():
	return list(map(int, input().split()))
for nt in range(int(input())):
	(n, k) = mult_input()
	l = list(map(int, input().split()))
	ans = 0
	for i in range(1, k - 1):
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			ans += 1
	ind = 1
	i = 1
	count = ans
	while i < n - k + 1:
		if l[i] > l[i - 1] and l[i] > l[i + 1]:
			count -= 1
		if l[i + k - 2] > l[i + k - 3] and l[i + k - 2] > l[i + k - 1]:
			count += 1
		if count > ans:
			ans = count
			ind = i + 1
		i += 1
	print(ans + 1, ind)


t = int(input())
for _ in range(t):
	(n, k) = [int(el) for el in input().split()]
	a = [int(el) for el in input().split()]
	p = [0 for i in range(n)]
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			p[i] = 1
	ps = [0 for i in range(n + 1)]
	for i in range(1, n):
		ps[i] = ps[i - 1] + p[i]
	best = 0
	best_l = 0
	for l in range(n - k + 1):
		if ps[l + k - 1] - ps[l] - p[l + k - 1] > best:
			best = ps[l + k - 1] - ps[l] - p[l + k - 1]
			best_l = l
	print(best + 1, best_l + 1)


t = int(input())
for _ in range(t):
	(n, k) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	pref = [0] * (n + 1)
	for i in range(n):
		if i == 0:
			pref[i] = 0
		if i == n - 1:
			pref[i] = pref[i - 1]
		else:
			pref[i] += 1 + pref[i - 1] if a[i - 1] < a[i] > a[i + 1] else 0 + pref[i - 1]
	stmax = 0
	maxi = 0
	st = 0
	end = 0
	while st <= n - k + 1:
		end = st + k - 1
		if pref[end - 1] - pref[st] > maxi:
			maxi = pref[end - 1] - pref[st]
			stmax = st
		st += 1
	print(maxi + 1, stmax + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	s = set()
	ind = 1
	i = 0
	j = k - 1
	ans = 0
	maxe = 0
	for t in range(1, j):
		if l[t - 1] < l[t] > l[t + 1]:
			s.add(t)
			ans += 1
			if maxe < ans:
				maxe = ans
				ind = j - k + 2
	i += 1
	j += 1
	while j < n:
		if i in s:
			s.remove(i)
			ans -= 1
		if l[j - 2] < l[j - 1] > l[j]:
			s.add(j - 1)
			ans += 1
			if maxe < ans:
				maxe = ans
				ind = j - k + 2
		i += 1
		j += 1
	print(maxe + 1, ind)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 0
	r = k - 1
	cur = 0
	for m in range(l + 1, r):
		if a[m - 1] < a[m] > a[m + 1]:
			cur += 1
	maxC = (cur, 1)
	while r < n - 1:
		l += 1
		if a[l - 1] < a[l] > a[l + 1]:
			cur -= 1
		if a[r - 1] < a[r] > a[r + 1]:
			cur += 1
		r += 1
		if cur > maxC[0]:
			maxC = (cur, l + 1)
	print(maxC[0] + 1, maxC[1])


for t in range(int(input())):
	(n, k) = map(int, input().strip().split())
	arr = list(map(int, input().strip().split()))
	brr = [False] * n
	for i in range(1, n - 1):
		if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:
			brr[i] = True
	l = 1
	m = brr[1:k - 1].count(True)
	prev = m
	i = 1
	j = i + k - 1
	while i < n - k + 1:
		c = prev
		if brr[i] == True:
			c -= 1
		if brr[j - 1] == True:
			c += 1
		if c > m:
			l = i + 1
			m = c
		prev = c
		i += 1
		j += 1
	print(1 + m, l)


from collections import deque
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	arr = list(map(int, input().split()))
	cnt = 0
	have = deque()
	for i in range(m):
		have.append(i)
		if 0 < i - 1 < n - 1 and arr[i - 2] < arr[i - 1] and (arr[i] < arr[i - 1]):
			cnt += 1
	res = cnt
	l = 0
	for i in range(m, n):
		have.append(i)
		if 0 < i - 1 < n - 1 and arr[i - 2] < arr[i - 1] and (arr[i] < arr[i - 1]):
			cnt += 1
		ind = have.popleft()
		if 0 < ind + 1 < n - 1 and arr[ind] < arr[ind + 1] and (arr[ind + 2] < arr[ind + 1]):
			cnt -= 1
		if cnt > res:
			res = cnt
			l = i - (m - 1)
	print(res + 1, l + 1)


(_max, _sum, _int, _range) = (max, sum, int, range)

def solution():
	for _ in _range(_int(input())):
		(n, k) = [_int(i) for i in input().split()]
		arr = [_int(i) for i in input().split()]
		peak = [0] * n
		for i in _range(1, n - 1):
			if arr[i - 1] < arr[i] > arr[i + 1]:
				peak[i] = 1
		summary = [0] * n
		for i in _range(1, n):
			summary[i] = summary[i - 1] + peak[i]
		(_max_index, _max) = (0, 0)
		for i in _range(0, n - k + 1):
			if summary[i + k - 2] - summary[i] > _max:
				_max = summary[i + (k - 2)] - summary[i]
				_max_index = i
		print(_max + 1, _max_index + 1)
solution()


(_range, _sum, _max, _int) = (range, sum, max, int)
from sys import stdout, stdin
(_input, _print) = (stdin.buffer.readline, stdout.write)

def solution():
	for _ in _range(_int(_input())):
		(n, k) = [_int(i) for i in _input().split()]
		arr = [_int(i) for i in _input().split()]
		peak = [0] * n
		for i in _range(1, n - 1):
			if arr[i - 1] < arr[i] > arr[i + 1]:
				peak[i] = 1
		summary = [0] * n
		for i in _range(1, n):
			summary[i] = summary[i - 1] + peak[i]
		(_max_index, _max) = (0, 0)
		for i in _range(0, n - k + 1):
			if summary[i + k - 2] - summary[i] > _max:
				_max = summary[i + (k - 2)] - summary[i]
				_max_index = i
		print(_max + 1, _max_index + 1)
solution()


t = int(input())
res = []

def get_peaks(a):
	temp = [0]
	for i in range(1, len(a) - 1):
		if a[i - 1] < a[i] and a[i] > a[i + 1]:
			temp.append(1)
		else:
			temp.append(0)
	temp.append(0)
	count = 0
	pref = []
	for i in range(len(temp)):
		count += temp[i]
		pref.append(count)
	return (temp, pref)
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	(peaks, pref) = get_peaks(arr)
	m = 0
	m_i = 0
	for i in range(n - k + 1):
		e = i + k - 1
		t = pref[e] - pref[i] - peaks[i] - peaks[e] + 1
		if t > m:
			m = t
			m_i = i + 1
	res.append([m, m_i])
for r in res:
	print(r[0], r[1])


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = [False] * n
	for j in range(1, n - 1):
		if a[j - 1] < a[j] > a[j + 1]:
			b[j] = True
	tmp = sum(b[1:k - 1])
	s = tmp
	l = 0
	for j in range(1, n - k + 1):
		tmp -= b[j]
		tmp += b[j + k - 2]
		if tmp > s:
			s = tmp
			l = j
	print(s + 1, end=' ')
	print(l + 1)


from sys import stdin
for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	v = ['0'] * n
	for i in range(1, n - 1):
		if a[i - 1] < a[i] > a[i + 1]:
			v[i] = '1'
	v = ''.join(v)
	ans = ans1 = v[:k - 1].count('1')
	lst = 1
	if ans:
		lst = max(0, v[:k - 1].rindex('1') - k + 3)
	for i in range(k, n):
		if v[i - 1] == '1':
			ans1 += 1
		if v[i - k + 1] == '1':
			ans1 -= 1
		if ans1 > ans:
			ans = ans1
			lst = i - k + 2
	print(ans + 1, max(1, lst))


inf = float('inf')
en = lambda x: list(enumerate(x))
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())

def solve():
	(n, k) = r()
	arr = rr()
	brr = [0] * n
	c = 0
	for i in range(1, n - 1):
		if arr[i - 1] < arr[i] > arr[i + 1]:
			c += 1
		brr[i] = c
	ans = -inf
	l = -1
	for i in range(n - k + 2):
		if ans < brr[i + k - 2] - brr[i]:
			ans = brr[i + k - 2] - brr[i]
			l = i
	print(ans + 1, l + 1)
for _ in range(ii()):
	solve()


from collections import deque

def main():
	for _ in range(int(input())):
		(n, k) = map(int, input().split())
		a = list(map(int, input().split()))
		peaks = [0] * (n + 1)
		for i in range(1, n - 1):
			if a[i] > a[i - 1] and a[i] > a[i + 1]:
				peaks[i + 1] = 1
		lvalue = [0] * n
		count = 0
		for i in range(2, 1 + k - 1):
			if peaks[i] == 1:
				count += 1
		lvalue[1] = count
		for i in range(2, n - k + 2):
			if peaks[i] == 1:
				count -= 1
			if peaks[i + k - 2] == 1:
				count += 1
			lvalue[i] = count
		m = max(lvalue)
		for i in range(1, n - k + 2):
			if m == lvalue[i]:
				ans = i
				break
		print(m + 1, ans)
main()


from sys import stdin

def solve(n, k, a):
	f = [0] * (n + 1)
	g = set()
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			f[i + 1] = 1
			g.add(i + 1)
	for i in range(1, n + 1):
		f[i] += f[i - 1]
	ans = -1
	idx = 1
	for i in range(1, len(f) - k + 1):
		t = (1 if i in g else 0) + (1 if i + k - 1 in g else 0)
		if f[i + k - 1] - f[i - 1] - t > ans:
			ans = f[i + k - 1] - f[i - 1] - t
			idx = i
	print(ans + 1, idx)

def main():
	inp = stdin.readline
	for _ in range(int(inp())):
		(n, k) = map(int, inp().split())
		a = list(map(int, inp().split()))
		solve(n, k, a)
main()


def solve(n, k, m):
	peak = [0] * n
	count = [0, 0]
	for i in range(1, n - 1):
		if m[i] > m[i + 1] and m[i] > m[i - 1]:
			peak[i] += 1
	for i in range(1, n):
		peak[i] += peak[i - 1]
	for i in range(0, n - k + 1):
		if not i == 0:
			s = peak[i + k - 1] - peak[i - 1]
		else:
			s = peak[i + k - 1] - peak[i]
		if peak[i + k - 1] - peak[i + k - 2] == 1:
			s -= 1
		if not i == 0:
			if peak[i] - peak[i - 1] == 1:
				s -= 1
		if s <= count[0]:
			continue
		count = [s, i]
	print('{} {}'.format(count[0] + 1, count[1] + 1))
	return None
no = int(input())
for s in range(no):
	(n, k) = tuple(map(int, input().strip().split()))
	m = list(map(int, input().strip().split()))
	solve(n, k, m)


t = int(input())
for hh in range(0, t):
	(n, k) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	dp = [0] * n
	for i in range(1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			dp[i] = 1
	pre = [0] * n
	mx = 0
	start = 0
	for i in range(1, n):
		pre[i] = pre[i - 1] + dp[i]
	for i in range(0, n):
		j = i + k - 1
		if j >= n:
			break
		val = pre[j - 1] - pre[i]
		if val > mx:
			mx = val
			start = i
	print(mx + 1, start + 1)


from sys import stdin, stdout
q = int(input())
for i in range(q):
	(n, k) = list(map(int, stdin.readline().split()))
	m = list(map(int, stdin.readline().split()))
	cumu = [0 for i in range(n)]
	visited = [0 for i in range(n)]
	for i in range(1, n - 1):
		if m[i] > m[i - 1] and m[i] > m[i + 1]:
			visited[i] = 1
			cumu[i] = cumu[i - 1] + 1
		else:
			cumu[i] = cumu[i - 1]
	cumu[n - 1] = cumu[n - 2]
	maxi = 0
	maxiind = 1
	for i in range(n - k + 1):
		if cumu[i + k - 1] - cumu[i] - visited[i + k - 1] - visited[i] > maxi:
			maxi = cumu[i + k - 1] - cumu[i] - visited[i + k - 1] - visited[i]
			maxiind = i + 1
	print(maxi + 1, end=' ')
	print(maxiind)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	p = [0] * n
	for i in range(n):
		if 0 < i < n - 1 and a[i] > a[i - 1] and (a[i] > a[i + 1]):
			p[i] = 1
	ans = 0
	ind = 1
	pi = 0
	for i in range(1, k - 1):
		if p[i] == 1:
			pi += 1
	ans = pi
	for i in range(k, n):
		if p[i - k + 1] == 1 and p[i - 1] == 0:
			pi -= 1
		elif p[i - k + 1] == 0 and p[i - 1] == 1:
			pi += 1
			if ans < pi:
				ind = i - k + 2
			ans = max(ans, pi)
	print(ans + 1, ind)


for _ in range(int(input())):
	(n, k) = [int(s) for s in input().split()]
	arr = [int(s) for s in input().split()]
	peak = [0] * n
	pref = [0] * n
	for i in range(1, len(arr) - 1):
		if arr[i - 1] < arr[i] and arr[i + 1] < arr[i]:
			peak[i] = 1
	pref[0] = peak[0]
	for i in range(1, len(peak)):
		pref[i] = peak[i] + pref[i - 1]
	maxi = 0
	ind = -1
	for i in range(n - k + 1):
		x = pref[i + k - 1] - pref[i] - peak[i + k - 1]
		if x > maxi:
			maxi = x
			ind = i
	if ind == -1:
		print(1, 1)
	else:
		print(maxi + 1, ind + 1)


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	pre = [0] * n
	maxi = 0
	pos = 1
	count = 0
	for i in range(1, k - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			pre[i] = 1
			count += 1
	if count > maxi:
		maxi = count
		pos = 1
	for i in range(k - 1, n - 1):
		if a[i] > a[i - 1] and a[i] > a[i + 1]:
			pre[i] = 1
			count += 1
		count -= pre[i - k + 2]
		if count > maxi:
			pos = i - k + 3
			maxi = count
	print(maxi + 1, pos)


for _ in range(0, int(input())):
	nk = list(map(int, input().split()))
	n = nk[0]
	k = nk[1]
	heights = list(map(int, input().split()))
	peaks = [0]
	for i in range(1, len(heights) - 1):
		if heights[i] > heights[i - 1] and heights[i] > heights[i + 1]:
			peaks.append(1)
		else:
			peaks.append(0)
	peaks.append(0)
	max = 0
	left = 0
	check = 0
	for i in range(1, k - 1):
		max += peaks[i]
		check += peaks[i]
	for i in range(2, len(peaks) - k + 2):
		check -= peaks[i - 1]
		check += peaks[i + k - 3]
		if check > max:
			max = check
			left = i - 1
	print(max + 1, left + 1)