package main import . "fmt" func main() { var a,b int Scan(&a,&b) c:= ((a+b-1)/b/2-1)*b Println(c) }