#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k, d;
    cin >> n >> k >> d;
    int arr[n];
    for (int i = 1; i <= n; i++) {
      cin >> arr[i];
    }
    set<int> s;
    vector<int> v;
    for (int i = 1; i <= n - d + 1; i++) {
      for (int j = i; j <= i + d - 1; j++) {
        s.insert(arr[j]);
      }
      int x = s.size();
      v.push_back(x);
      s.clear();
    }
    sort(v.begin(), v.end());
    cout << v[0] << endl;
    v.clear();
  }
  return 0;
}
