using System; using System.Collections.Generic; using System.Linq; namespace lecture { class MainClass { public static void Main(string[] args) { int[] tmp = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); int L = tmp[0]; int K = tmp[1]; int count = 0; while(L > 0) { L -= 2 * K; count += K; } if (L/2 < count) { count -= K; } Console.WriteLine(count); } } }