AcWing 3655. 楼层 Posted on 2021-06-10 Edited on 2024-11-24 In AcWing 1234567891011#include <iostream>using namespace std;int main() { int T, n, x; cin >> T; while (T--) { cin >> n >> x; cout << (n <= 2 ? 1 : (n - 3 + x) / x + 1) << endl; } return 0;}