#include #include #include #include #include #include using namespace std; void check(int n) { vector f(n+1, 0); for (int i = 1; i <= n; i++) { f[i] = f[i/2] + (i%2); } for (int i = 0; i <= n; i++) { printf("%2d, %2d\n", i, f[i]); } } int main() { // check(100); int x; cin >> x; vector nums(x); x = min(x, 31 - x); for (int i = 0; i < x; i++) { nums[i] = 31 - i; } int gcd; for (int i = x; i >= 2; i--) { int tmp = i; for (int j = 0; j < x; j++) { gcd = __gcd(nums[j], tmp); nums[j] /= gcd; tmp /= gcd; if (tmp == 1) { break; } } } long long n = accumulate(nums.begin(), nums.end(), 1LL, std::multiplies()); long long val = n * x; cout << n << " " << val << endl; return 0; }