#include #include #include #include using namespace std; using ll = long long; int main() { int res = 0; int turn = 0; // 0: you for(int i=0; i<1000; ++i) { ll N, K; cin >> N >> K; if(turn == 0) { if(N <= K || N % (K+1) != 0) { res++; turn = 1; } else { turn = 0; } } else { if(N <= K || N % (K+1) != 0) { turn = 0; } else { res++; turn = 1; } } } cout << res << endl; }