#include #include using namespace std; static void setup() { cin.tie(0); ios::sync_with_stdio(false); } static void run() { int l, k; cin >> l >> k; // 割り切れる場合 → ユウちゃんが1回分少なくなる // 割り切れない場合 → 割り切れる文だけユウちゃんが食べる const auto c = k * 2; /* if ((l % c) == 0) { cout << (l/c - 1) * k << endl; } else { cout << l/c*k << endl; } */ cout << (l - 1) / c * k << endl; } int main(int argc, char **argv) { setup(); run(); return 0; }