#include using namespace std; int main() { int n, m; cin >> n >> m; int k = min(m, n / 2); if (k == 0) { cout << -1 << endl; return 0; } cout << (n + k - 1) / k << endl; return 0; }