package main import . "fmt" import . "sort" func main() { var a,b int Scan(&a,&b) a+=(b-a%b)%b c:=Search(a/b+1,func(i int)bool{ return i+i>a/b }) Println(a-c*b) }