#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include <iostream>
using namespace std;


void main()
{
	FILE *in;
   int a,q,i,j,n,k,t; float *c,z;
	in=fopen("ladder.in","r");
	fscanf(in,"%d",&t);
	for(i=0;i<t;i++)
	{
			fscanf(in,"%d",&n);
					fscanf(in,"%d",&k);
		c=new float(n);
		for(j=0;j<n;j++)
		{
				fscanf(in,"%f",&c[j]);
		}
		z=0;a=0;j=0;
		while(j<=n)
		{
			for(q=k-1;q>=0;q--)
			{	
				if(j+q<n)
				{
					if(c[j+q]>z)
					{
					z=c[j+q];	
					a=j+q;
					j=j+q;
			
					}
				}
			}
			j++;

		}
		cout<<a+1<<endl;
	}



	fclose(in);





}