#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, k, d;
    cin >> n >> k >> d;
    long long a[n + 1];
    for (long long i = 1; i < n + 1; i++) cin >> a[i];
    long long mn = INT_MAX;
    for (long long i = 1; i < n + 1; i++) {
      set<long long> s;
      if (i + d - 1 < n + 1) {
        for (long long j = i; j < i + d; j++) {
          s.insert(a[j]);
        }
        mn = min(mn, (long long)s.size());
      }
    }
    cout << mn << "\n";
  }
}
