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