#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int k;
  cin >> k;
  std::vector<long long int> vec(n, 0);
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  for (int i = 0; i < n - 1; i++)
    if (vec[i] < vec[i + 1]) ans++;
  k--;
  if (ans == 0) {
    cout << "1"
         << "\n";
    return;
  }
  if (k == 0)
    cout << "-1"
         << "\n";
  else {
    cout << (ans + k - 1) / k << "\n";
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
