#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair Pr; int main() { int m, n; cin >> n >> m; int a = n / m; if (n % m != 0)a++; if (n <= m || n%2 == 0){ int b = n / 2; if (n <= m) cout << 1 << endl; else if (b <= m || (n % m == 0 && n / m == 2)) cout << 2 << endl; else cout << -1 << endl; } else { cout << -1 << endl; } return 0; }