Submission #16755913
Source Code Expand
#include <bits/stdc++.h>
#define INF 1e9
#define INFLL 1ull<<60u
using namespace std;
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
typedef long long ll;
void solve() {
    int N,K; cin >> N >> K;
    cout << ((N - K + K -2)/(K-1))+1 << endl;
}
int main() {
    solve();
    return 0;
}
			Submission Info
| Submission Time | |
|---|---|
| Task | C - Minimization | 
| User | reud | 
| Language | C++ (GCC 9.2.1) | 
| Score | 300 | 
| Code Size | 673 Byte | 
| Status | AC | 
| Exec Time | 5 ms | 
| Memory | 3636 KiB | 
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status | 
										
											
											
  | 
								
									
										
											
											
  | 
								
							
| Set Name | Test Cases | 
|---|---|
| Sample | sample1.txt, sample2.txt, sample3.txt | 
| All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt | 
| Case Name | Status | Exec Time | Memory | 
|---|---|---|---|
| 1.txt | AC | 5 ms | 3636 KiB | 
| 10.txt | AC | 3 ms | 3580 KiB | 
| 2.txt | AC | 3 ms | 3436 KiB | 
| 3.txt | AC | 2 ms | 3440 KiB | 
| 4.txt | AC | 2 ms | 3408 KiB | 
| 5.txt | AC | 2 ms | 3524 KiB | 
| 6.txt | AC | 2 ms | 3404 KiB | 
| 7.txt | AC | 2 ms | 3436 KiB | 
| 8.txt | AC | 2 ms | 3392 KiB | 
| 9.txt | AC | 2 ms | 3564 KiB | 
| sample1.txt | AC | 4 ms | 3592 KiB | 
| sample2.txt | AC | 2 ms | 3632 KiB | 
| sample3.txt | AC | 2 ms | 3596 KiB |