#include <bits/stdc++.h>
using namespace std;
template <class T>
istream &operator>>(istream &is, vector<T> &a) {
  for (int i = 0; i < a.size(); ++i) is >> a[i];
  return is;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  for (int ii = 0; ii < t; ++ii) {
    int n, k, d;
    cin >> n >> k >> d;
    vector<int> a(n);
    cin >> a;
    int ans = 0x3f3f3f3f;
    set<int> cur;
    for (int i = 0; i <= n - d; ++i) {
      for (int j = i; j < i + d; ++j) cur.insert(a[j]);
      ans = min(ans, (int)cur.size());
      cur.clear();
    }
    cout << ans << "\n";
  }
}
