initial commit
This commit is contained in:
parent
eb5fe51644
commit
8e05300eba
33
1426A Floor Number/1426A.cpp
Normal file
33
1426A Floor Number/1426A.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
using ll = long long;
|
||||
|
||||
void solve()
|
||||
{
|
||||
int n, x;
|
||||
cin >> n >> x;
|
||||
if (n < 3)
|
||||
cout << "1" << endl;
|
||||
else
|
||||
{
|
||||
n = n - 2;
|
||||
int f;
|
||||
if (n % x == 0)
|
||||
f = n / x + 1;
|
||||
else
|
||||
f = n / x + 2;
|
||||
cout << f << endl;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
ios_base::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int TC = 1;
|
||||
cin >> TC;
|
||||
cin.ignore();
|
||||
while (TC--)
|
||||
solve();
|
||||
}
|
Loading…
Reference in New Issue
Block a user