using System; using System.Collections.Generic; using System.Linq; public class Program { public static List NumbersFromString(string input, char delimitor) { return input.Split( delimitor ).ToList().ConvertAll( int.Parse ); } private static List NumbersFromConsole(char delimitor = ' ') { return NumbersFromString( Console.ReadLine(), delimitor ); } private static void Main() { var v = NumbersFromConsole(); int quotient = Math.DivRem( v[ 0 ], v[ 1 ]*2, out int remainder ); Console.WriteLine( remainder ==0?(quotient-1)*v[1]:quotient *v[1]); } }