#include #include #include int main() { int length = 0; int eatLength = 0; int eatCnt = 0; scanf("%d", &length); scanf("%d", &eatLength); while (true) { double len = (double)length / 2.0f; if (eatCnt + eatLength < len) { eatCnt += eatLength; } else { printf("%d\n", eatCnt); return 0; } } }