#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, k, d;
    cin >> n >> k >> d;
    int a[n];
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    int check_ele = 0;
    int count = 0, ans = 0, ans_final = 10000, o = 0;
    for (int i = 1; i <= n - d + 1; i++) {
      map<int, int> mp;
      for (int j = i; j <= d + i - 1; j++) mp[a[j]]++;
      ans_final = min(ans_final, (int)mp.size());
    }
    cout << ans_final << endl;
  }
  return 0;
}
