#include #include using namespace std; int main(){ // input int L,K; cin >> L>>K; int totalcount =0; totalcount = (L + K -1) / K ; int yuucount = totalcount / 2; int ans = K * yuucount; if(L % (2*K)==0){ ans -= K; } cout << ans << endl; // output }