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:
Fence
Remove Duplicates
Gambling Nim
Meeting Her
Search the subarray with the maximum/minimum sum
Levels and Regions
Circle-Line Intersection
Welfare State
Morning run
0-1 BFS
K-Complete Word
New Year and Social Network
Rooks and Rectangles
Prefix-Suffix Palindrome (Easy version)
Zuma
Design Tutorial: Inverse the Problem
Minus and Minus Give Plus
Long number
Bear and Colors
Alyona and a Narrow Fridge
Equalize
Prefix-Suffix Palindrome (Hard version)
Linova and Kingdom
Arkady and a Nobody-men
Search for a pair of intersecting segments
King Escape
Orac and LCM
Xenon's Attack on the Gangs
Attack on Red Kingdom
Wise Men (Easy Version)
R3D3’s Summer Adventure
Cow and Fields