import Control.Monad import Data.List import Data.Maybe import qualified Data.ByteString.Char8 as BS import Data.Time import Data.Time.Calendar import Data.Char tuplify2 (x:y:_) = (x,y) tuplify2 _ = undefined --Input functions with ByteString readInt = fst . fromJust . BS.readInteger readIntTuple = tuplify2 . map readInt . BS.words readIntList = map readInt . BS.words getInt = readInt <$> BS.getLine getIntList = readIntList <$> BS.getLine getIntNList n = map readIntList <$> replicateM (fromIntegral n) BS.getLine getIntMatrix = map readIntList . BS.lines <$> BS.getContents getIntTuple = readIntTuple <$> BS.getLine getIntNTuples n = map readIntTuple <$> replicateM (fromIntegral n) BS.getLine getIntTuples = map readIntTuple . BS.lines <$> BS.getContents p :: (Show a)=>a->IO () p=putStrLn.show ps=putStrLn main=do [l,k]<-map (read::String->Int).words<$>getLine let (d,m)=divMod l (2*k) putStrLn.show$(if (m==0) then (d-1)*k else d*k)