#include int main(void) { int L, K; int Y; Y = 0; scanf("%d %d", &L, &K); Y = K * (L / (2 * K)); if((L % (2*K)) == 0) { Y -= K; } printf("%d\n",Y); return 0; }