fun main() { val builder = StringBuilder() val n = readInputLine().toInt() repeat(n) { val (a, b) = readInputLine().split(" ").map { it.toLong() } val ansRev = mutableListOf() var current = b while (current != a) { var maxDiv = 1L for (i in LongRange(1L, current)) { if (i * i > current || current - i < a) { break } if (current % i != 0L) { continue } if (current - i >= a) { maxDiv = i } if (current - current / i >= a) { maxDiv = current / i break } } ansRev.add(maxDiv) current -= maxDiv } builder.appendln(ansRev.size) builder.appendln(ansRev.reversed().joinToString(" ")) } print(builder.toString()) } fun readInputLine(): String { return readLine()!! }