#include<iostream> #include<cstdio> #include<vector> using namespace std; vector<int> e; vector<int> g; int main() { int sum; for (int i = 2; i <= 60; ++i) { sum=1; for (int j = 2; j <= i / 2; ++j) { if (i % j == 0) { sum += j; } } if (sum == i) { e.push_back(i); } if (sum > i) { g.push_back(i); } } cout << "E:"; for (int i = 0; i < e.size(); ++i) { printf(" %d", e[i]); } printf("\n"); cout << "G:"; for (int i = 0; i < g.size(); ++i) { printf(" %d", g[i]); } printf("\n"); }