#include <bits/stdc++.h> using namespace std; # define int long long
const int N = 1e5 + 10; const int M = 2e5 + 10; const int inf = 0x3f3f3f3f; const int mod = 998244353;
int n, m;
set<int> yueshu(int x) { set<int> st; for (int i = 1; i * i <= x; i++) { if (x % i == 0){//这个大括号很重要,我debug的一个多小时的罪魁祸首 st.insert(i); if (i * i != x) st.insert(x / i);} } return st; }
signed main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false);
int t; t = 1; //cin>>t; while (t--) { int a, b; cin >> a >> b; set<int> s1, s2, ans; s1 = yueshu(a); s2 = yueshu(b); for (auto x : s1) { for (auto y : s2) { ans.insert(x * y); } } cout << ans.size() << endl; for (auto x : ans) cout << x << " "; } return 0; }
#include <bits/stdc++.h> using namespace std; # define int long long typedef pair<int,int>pii; const int N = 1e5 + 10; const int M = 2e5 + 10; const int inf = 0x3f3f3f3f; const int mod = 998244353;