#include <bits/stdc++.h>
using namespace std;
using ll = long long;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, k;
    cin >> n >> k;
    vector<int> A;
    for (int i = 0; i < n; i++) {
      int a;
      cin >> a;
      A.push_back(a);
    }
    int incs = 0;
    for (int i = 1; i < n; i++) {
      if (A[i] > A[i - 1]) incs++;
    }
    for (int m = 1; m <= n; m++) {
      int cur = 1;
      cur += int(incs / m);
      if (incs % m != 0) cur++;
      if (cur <= k) {
        cout << m << "\n";
        break;
      }
      if (m == n) {
        cout << "-1\n";
      }
    }
  }
}
