Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM_0004 - NUMBER GAME |
Vasya, a school whiz kid, feels bored during math classes, so he occasionally plays different games with Petya, a non-achiever who shares a desk with him.
Once, Vasya proposed to play the following game. Petya picks two successive prime numbers, multiplies them and tells the product to Vasya, who is to find out the numbers. First, Vasya had to explain that two primes are successive if there are no other primes between them.
Petya was surprised to see how quickly Vasya figured out the numbers. Then Vasya proposed that they switch roles. Please help Petya to find the chosen numbers.
Write a program to find two successive prime numbers x and y given their product.
Input
The input file contains a single integer, the arithmetical product of x and y (2 ≤ x < y ≤ 106, x, y are successive prime numbers).
Output
The output file should contain two space-delimited integers x and y, the least of them going first.
Example
№
stdin
stdout
1
15
3 5
2
35
5 7
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2013-12-02 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Central QF 2013.E |