#include using namespace std; int main(){ int T; cin >> T; vector a(T), b(T); for (int i = 0; i < T;i++){ cin >> a[i] >> b[i]; } for (int i = 0; i < T; i++){ int c = 0; vector v(0); for (int k = 0;;k++){ if(a[i]==b[i]){ break; } for (long long j = 1; j *j<= min(a[i], b[i] - a[i]); j++) { if (a[i] % j == 0 && a[i] + a[i] / j <= b[i]) { c++; v.push_back(a[i] / j); a[i] += a[i] / j; break; } } if(v.size()!=k+1){ continue; } for (long long j =sqrt(min(a[i], b[i] - a[i])); 0 < j;j--){ if (a[i] % j == 0 && a[i] + j <= b[i]) { c++; a[i] += j; v.push_back(j); break; } } } cout << c << endl; for (int p = 0; p < v.size(); p++) { if (p == v.size() - 1) { cout << v[p] << endl; } else { cout << v[p] << ' '; } } } cout << endl; }