#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int n, k, d;
    cin >> n;
    cin >> k;
    cin >> d;
    int nums[n];
    for (int x = 0; x < n; x++) {
      cin >> nums[x];
    }
    vector<int> mines;
    for (int x = 0; x < n - d + 1; x++) {
      set<int> cset;
      for (int y = x; y < d + x; y++) {
        cset.insert(nums[y]);
      }
      mines.push_back(cset.size());
    }
    int answ = mines[0];
    for (int i = 1; i < mines.size(); i++) {
      answ = min(answ, mines[i]);
    }
    cout << answ << endl;
  }
  return 0;
}
