package main import ( "fmt" ) func resolve(L, K int) int { if L%(2*K) == 0 { L -= 1 } return K * (L / (2 * K)) } func main() { var L, K int fmt.Scanf("%d %d\n", &L, &K) fmt.Println(resolve(L, K)) }