#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, k, d, i, j, c = 0, ans = 0;
  scanf("%lld", &t);
  map<long long, long long> mp;
  while (t--) {
    ans = INT_MAX;
    c = 0;
    scanf("%lld", &n);
    vector<long long> v(n + 1);
    scanf("%lld", &k), scanf("%lld", &d);
    for (i = 1; i <= n; i++) scanf("%lld", &v[i]);
    for (i = 1; i <= n - d + 1; i++) {
      mp.clear();
      c = 0;
      for (j = i; j <= i + d - 1; j++) {
        if (mp[v[j]] == 0) {
          mp[v[j]] = 1;
          c++;
        }
      }
      ans = min(c, ans);
    }
    printf("%lld ", ans);
    printf("\n");
  }
  return 0;
}
