#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, k, d;
    cin >> n >> k >> d;
    int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
    }
    int minn = INT_MAX;
    for (int i = 0; i < n - d + 1; i++) {
      set<int> s(a + i, a + i + d);
      minn = min(minn, int(s.size()));
    }
    cout << minn << endl;
  }
}
