Submission #16755913


Source Code Expand

Copy
#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 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 16
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 KB
10.txt AC 3 ms 3580 KB
2.txt AC 3 ms 3436 KB
3.txt AC 2 ms 3440 KB
4.txt AC 2 ms 3408 KB
5.txt AC 2 ms 3524 KB
6.txt AC 2 ms 3404 KB
7.txt AC 2 ms 3436 KB
8.txt AC 2 ms 3392 KB
9.txt AC 2 ms 3564 KB
sample1.txt AC 4 ms 3592 KB
sample2.txt AC 2 ms 3632 KB
sample3.txt AC 2 ms 3596 KB