#include #include typedef long long int ll; using namespace std; using namespace atcoder; const int MOD = 1000000007; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { ll a, b; cin >> a >> b; int count = 0; vector ans; while (a != b) { vector yakusuu; for (ll i = 1; i * i <= a; i++) { if (a % i == 0) { yakusuu.push_back(i); yakusuu.push_back(a / i); } } sort(yakusuu.begin(), yakusuu.end()); for (int i = yakusuu.size() - 1; i >= 0; i--) { if (a + yakusuu[i] <= b) { a = a + yakusuu[i]; ans.push_back(yakusuu[i]); break; } } count++; } cout << count << endl; for (int i = 0; i < ans.size(); i++) { cout << ans[i] << " "; } cout << endl; } return 0; }