#include #include #include #include #include #include #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define rep(i,n) FOR(i,0,n) #define DEBUG(x) cout<<#x<<": "< #define vdouble vector #define vstring vector using namespace std; #include #include #include typedef long long ll; typedef unsigned long long ull; const int MAX_N = 1000000; int main() { ll L, K; cin >> L >> K; ll t = L / (2 * K); ll r = L - t; if (r == 0) t--; cout << t * K << endl; }