Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int c;
- cin >> c;
- for (int i = 0; i < c; ++i) {
- int n;
- cin >> n;
- int p = 0;
- for (int m = 2; m <= 100000; ++m) {
- if (n % m == 0) {
- p = m;
- break;
- }
- }
- if (p == 0) {
- p = n;
- }
- cout << n / p << " " << n - (n / p) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement