package main import ( "fmt" "math" ) func main() { var w, d float64 fmt.Scan(&w, &d) D := int(d) fmt.Println(w, d, D) for i := 0; i < D-1; i++ { //fmt.Println(i, D, w/(math.Pow(d, 2))) w -= float64(int(w / (math.Pow(d, 2)))) d -= 1 } fmt.Println(int(w)) }