codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

1285C.md (1072B)


      1 Source: https://codeforces.com/problemset/problem/1285/C
      2 
      3 C. Fadi and LCM
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 Today, Osama gave Fadi an integer $X$, and Fadi was wondering about the minimum possible value of $max(a, b)$ such that $LCM(a, b)$ equals $X$. Both $a$ and $b$ should be positive integers.
     22 
     23 $LCM(a, b)$ is the smallest positive integer that is divisible by both $a$ and $b$. For example, $LCM(6, 8) = 24$, $LCM(4, 12) = 12$, $LCM(2, 3) = 6$.
     24 
     25 Of course, Fadi immediately knew the answer. Can you be just like Fadi and find any such pair?
     26 
     27 Input
     28 
     29 The first and only line contains an integer $X$ ($1 \le X \le 10^{12}$).
     30 
     31 Output
     32 
     33 Print two positive integers, $a$ and $b$, such that the value of $max(a, b)$ is minimum possible and $LCM(a, b)$ equals $X$. If there are several possible such pairs, you can print any.
     34 
     35 Examples
     36 
     37 Input
     38 
     39 ```
     40 2
     41 ```
     42 
     43 Output
     44 
     45 ```
     46 1 2
     47 ```
     48 
     49 Input
     50 
     51 ```
     52 6
     53 ```
     54 
     55 Output
     56 
     57 ```
     58 2 3
     59 ```
     60 
     61 Input
     62 
     63 ```
     64 4
     65 ```
     66 
     67 Output
     68 
     69 ```
     70 1 4
     71 ```
     72 
     73 Input
     74 
     75 ```
     76 1
     77 ```
     78 
     79 Output
     80 
     81 ```
     82 1 1
     83 ```