#include int main(){ int L,K,i=0; scanf("%d %d",&L,&K); do{ L=L-2*K; i++; }while(L>2*K); if(i==1 && L<=0)i=0; printf("%d",i*K); }