#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int asdf = 0; asdf < t; ++asdf) {
    int n, k, d;
    cin >> n >> k >> d;
    vector<int> series(n);
    for (int i = 0; i < n; ++i) {
      cin >> series[i];
    }
    int mn = 100000000;
    for (int i = 0; i <= n - d; ++i) {
      map<int, int> a;
      int cnt = 0;
      for (int j = i; j < i + d; ++j) {
        if (a[series[j]] != 1) {
          a[series[j]] = 1;
          cnt++;
        }
      }
      mn = min(mn, cnt);
    }
    cout << mn << endl;
  }
  return 0;
}
