using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukicoder { class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] t = s.Split(' '); int L = int.Parse(t[0]); int K = int.Parse(t[1]); int haruka = 0; int c = L; while(0 < c) { if(c - (K * 2) <= 0) { haruka += c; c = 0; } else { c -= (K * 2); haruka += K; } } Console.WriteLine("{0}", (L - haruka)); //Console.ReadLine(); } } }