#include <bits/stdc++.h>
void prmin(int* a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (a[0] > a[i]) a[0] = a[i];
  }
  printf("%d\n", a[0]);
}
int sort(int* b, int n, int m) {
  int sum = 1, i, j, k;
  int a[100];
  for (i = n; i < m; i++) a[i] = b[i];
  for (i = n; i < m; i++) {
    for (j = i; j < m; j++) {
      if (a[i] > a[j]) {
        k = a[i];
        a[i] = a[j];
        a[j] = k;
      }
    }
  }
  for (i = n; i < m - 1; i++) {
    if (a[i] != a[i + 1])
      sum = sum + 1;
    else
      sum = sum;
  }
  return sum;
}
int main() {
  int t, n, k, d, i, j;
  int a[100];
  int sum[100];
  scanf("%d", &t);
  for (i = 0; i < t; i++) {
    scanf("%d%d%d", &n, &k, &d);
    for (j = 0; j < n; j++) scanf("%d", &a[j]);
    for (j = 0; j < n - d + 1; j++) sum[j] = sort(a, j, j + d);
    prmin(sum, n - d + 1);
  }
  return 0;
}
