#include using namespace std; using ll = long long; void solve() { int n,x; cin>>n>>x; n=n-2; int f; if(n%x==0) f=n/x+1; else f=n/x+2; cout<> TC; cin.ignore(); while (TC--) solve(); }