codeforces-scrape

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

130F.md (785B)


      1 Source: https://codeforces.com/problemset/problem/130/F
      2 
      3 F. Prime factorization
      4 
      5 time limit per test
      6 
      7 2 seconds
      8 
      9 memory limit per test
     10 
     11 64 megabytes
     12 
     13 input
     14 
     15 stdin
     16 
     17 output
     18 
     19 stdout
     20 
     21 You are given an integer *n*. Output its prime factorization.
     22 
     23 If *n* = *a*1*b*1*a*2*b*2 ... *a**k**b**k*, where *a**k* are prime numbers, the output of your program should look as follows: *a*1 *a*1 ... *a*1 *a*2 *a*2 ... *a*2 ... *a**k* *a**k* ... *a**k*, where factors are ordered in non-decreasing order, and each factor *a**i* is printed *b**i* times.
     24 
     25 Input
     26 
     27 The only line of input contains an integer *n* (2 ≤ *n* ≤ 250).
     28 
     29 Output
     30 
     31 Output the prime factorization of *n*, as described above.
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 245
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 5 7 7
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 13
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 13
     57 ```