/* -*- coding: utf-8 -*- * * 1063.cc: No.1063 ルートの計算 / Sqrt Calculation - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int n; scanf("%d", &n); int a = 1, b = n; for (int x = 1; x * x <= n; x++) if (n % x == 0) { int y = n / x; int rx = sqrt(0.5 + x), ry = sqrt(0.5 + y); if (rx * rx == x && b > y) a = rx, b = y; if (ry * ry == y && b > x) a = ry, b = x; } printf("%d %d\n", a, b); return 0; }