#include #include int main(void) { int l, k, byte; int *w; scanf("%d", &l); scanf("%d", &k); byte = l / (2 * k); if (l % (2 * k) == 0) { printf("%d", (byte - 1) * k); } else { printf("%d", byte * k); } return 0; }