#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k, d, ans = 1e9;
    cin >> n >> k >> d;
    vector<int> A(n);
    for (int i = 0; i < n; i++) cin >> A[i];
    for (int i = 0; i < n - d + 1; i++) {
      int j = 0;
      set<int> B;
      for (int u = i; u < i + d; u++)
        if (B.find(A[u]) == B.end()) B.insert(A[u]), j++;
      ans = min(ans, j);
    }
    cout << ans << endl;
  }
  return 0;
}
