-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA_Split_the_Multiset.cpp
More file actions
38 lines (33 loc) · 840 Bytes
/
Copy pathA_Split_the_Multiset.cpp
File metadata and controls
38 lines (33 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define vc vector<char>
#define pyes cout << "YES";
#define pno cout << "NO";
#define ff() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define mod (int)(1e9 + 7)
#define input(start, end, arr) { for(int i = start; i < end; ++i) cin >> arr[i]; }
#define f(i, x, n) for (int i = x; i < n; i++)
#define rf(i, x, n) for (int i = x; i >= n; i--)
#define sz(a) (int) a.size()
#define ppc __builtin_popcount
#define ppcll __builtin_popcountll
#define pi (3.141592653589)
#define INF 1e18
#define nl '\n'
void solve() {
int n,k;
cin>>n>>k;
cout<<(n-1+k-1-1)/(k-1);
}
int32_t main(){
ff();
int tc;
cin>>tc;
while(tc--){
solve();
cout<<nl;
}
}