There was once young lass called Mary,
Whose jokes were occasionally scary.
On this April's Fool
Fixed limerick rules
Allowed her to trip the unwary.
Can she fill all the lines
To work at all times?
On juggling the words
Right around two-thirds
She nearly ran out of rhymes.
Input
The input contains a single integer $a$ ($4 \le a \le 998$). Not every integer in the range is a valid input for the problem; you are guaranteed that the input will be a valid integer.Output
Output a single number.
Examples input
35
output
57
input
57
output
319
input
391
output
1723
Solution:
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; for (int i = 2; i <= n; i++) { while (n % i == 0) { cout << i; n /= i; } } return 0; }
Related posts:
Kuroni and the Gifts
Disjoint Set Union
New Year Tree Decorations
Decreasing Debts
Dexterina’s Lab
Dome
Cards
Egor and an RPG game
Producing Snow
Let Them Slide
Count the Arrays
Dima and Two Sequences
The Brand New Function
Circle of Monsters
Finding Bridges Online
Purification
International Olympiad
Suffix Array
Robot Rapping Results Report
Cow and Friend
Primality tests
Gennady and a Card Game
Longest Saw
The Values You Can Make
Bears and Juice
Double Permutation Inc
Kirchhoff's theorem. Finding the number of spanning trees
Robots on a Grid
Dungeons and Candies
New Year and Fireworks
Numbers
Robots protection