package main import . "fmt" import . "sort" func main() { var s int64 Scan(&s) x:=[]int64{} for s>0 { e:=f(s) e*=e s-=e x=append(x,e) } Println(len(x)) for i,v:=range x { if i>0 { Print(" ") } Print(v) } Println() } func f(n int64) int64 { x:=Search(1e9+1,func(i int)bool { return int64(i)*int64(i)>=n }) return int64(x) }