#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  int n, k, val, d, arr[105];
  while (tc--) {
    int cnt = 0, value = 10000;
    cin >> n >> k >> d;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    arr[n] = 0;
    if (n == d) {
      for (int i = 0; i < n; i++) {
        int j;
        for (j = 0; j < i; j++)
          if (arr[i] == arr[j]) break;
        if (i == j) cnt++;
      }
      cout << cnt << endl;
    } else {
      for (int i = 0; i <= n - d; i++) {
        cnt = 0;
        for (int j = i; j < i + d; j++) {
          int p;
          for (p = i; p < j; p++) {
            if (arr[j] == arr[p]) {
              break;
            }
          }
          if (p == j) cnt++;
        }
        if (value > cnt) {
          value = cnt;
        }
      }
      cout << value << endl;
    }
  }
  return 0;
}
