package main import ( "bufio" "fmt" "os" ) func main() { defer writer.Flush() T := ReadInt() for t := 0; t < T; t++ { A, B := ReadInt(), ReadInt() solve(A, B) } } func solve(A, B int) { ans := make([]int, 0) for A < B { max := B - A for i := 1; i <= B; i++ { j := B / i if j <= max && B%i == 0 { ans = append(ans, j) B -= j break } } } Println(len(ans)) for i := 0; i < len(ans); i++ { if i > 0 { Printf(" ") } Printf("%d", ans[len(ans)-i-1]) } Println() } var reader = bufio.NewReader(os.Stdin) func Scan(a ...interface{}) { if _, err := fmt.Fscan(reader, a...); err != nil { panic(err) } } func ReadInt() (i int) { Scan(&i); return } func ReadString() (s string) { Scan(&s); return } func ReadInts(n int) (a []int) { for i := 0; i < n; i++ { a = append(a, ReadInt()) } return } var writer = bufio.NewWriter(os.Stdout) func Printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) } func Println(a ...interface{}) { fmt.Fprintln(writer, a...) }