output stringlengths 52 181k | instruction stringlengths 296 182k |
|---|---|
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int main() {
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
vector<long long> v;
for (long long i = 2; i * i <= n; i++) {
if (v.size() == 2) {
break;
} else if (n % i == 0) {
n = n / ... | ### Prompt
In CPP, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma warning(disable : 6031)
int main() {
int c;
scanf("%d", &c);
int ans[3];
while (c--) {
memset(ans, 0, sizeof(ans));
int n, now = -1;
scanf("%d", &n);
for (int t = 2; t <= sqrt(n); t++) {
if (n % t == 0) {
now++;
... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long int n, a, b, c;
cin >> n;
int flag = 0;
for (long long int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
a = i;
flag = 1;
break;
};
}
if (flag == 0) {
... | ### Prompt
Generate a CPP solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 1000005;
const double PI = acos(-1.0);
int SetBit(int n, int X) { return n | (1 << X); }
int ClearBit(int n, int X) { return n & ~(1 << X); }
int ToggleBit(int n, int X) { return n ^ (1 << X); }
bool CheckBit(int n, int X) { retur... | ### Prompt
Please formulate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, a = 1, b = 1, c = 1;
set<int> s;
cin >> n;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
a = i;
n /= a;
s.insert(a);
break;
}
}
for (int i = a... | ### Prompt
In cpp, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, a;
cin >> t;
while (t--) {
cin >> a;
int f1 = 0, f2 = 0, rs1, rs2, rs3;
for (int i = 2; i < min(a, 100000); i++) {
if (a % i == 0) {
a = a / i;
f1 = 1;
rs1 = i;
for (int j = i + 1; j < min(a, 100000... | ### Prompt
Generate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t = 0;
cin >> t;
while (t--) {
int n = 0;
int a = 0, b = 0, c = 0;
cin >> n;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
a = i;
n /= i;
break;
}
}
for (int i = a + 1; i * i <= n; i++... | ### Prompt
Develop a solution in cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using edge = tuple<int, int, int, int>;
using graph = vector<vector<edge>>;
void go() {
ll n;
cin >> n;
ll a, b, c, m;
for (a = 2; a * a <= n; a++) {
if (n % a == 0) {
m = n / a;
... | ### Prompt
Generate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
void parr(int arr[], int n, string name) {
int i;
for (i = 0; i < n; i++) cout << arr[i] << " ";
cout << "\n";
}
template <typename T>
void p(T x, string name = " ") {
cout << name << " : " << x << "\n";
}
void fn(int n) {
int a, b, c;
int i, j, temp;
bool fou... | ### Prompt
Generate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
long long t, n, z, x, c, s;
int main() {
cin >> t;
while (t--) {
cin >> n;
long long f = 0;
for (int i = 2; i * i <= n; i++) {
for (int j = i + 1; j * j <= (n / i); j++) {
z = i * j;
x = n / z;
s = i * j * x;
if (s == n)... | ### Prompt
Develop a solution in cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int factor(int y, int z) {
for (int i = z + 1; i * i <= y; i++) {
if (y % i == 0) return i;
}
return 0;
}
int main() {
int t;
cin >> t;
while (t > 0) {
int n;
cin >> n;
int x = factor(n, 1);
if (x >= 2) {
int m = factor(n / x, x);
... | ### Prompt
Please formulate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
while (t--) {
int n, a = 0, b = 0,... | ### Prompt
In CPP, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, i = 2, a = 0, b = 0, c = 0, k = 0;
cin >> n;
for (; i <= sqrt(n); i++)
if (n % i == 0) break;
n /= i;
a = i++;
for (; i <= sqrt(n); i++)
if (n % i == 0) {
k = 1;
bre... | ### Prompt
In CPP, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int x;
int t;
cin >> t;
for (int k = 0; k < t; k++) {
cin >> x;
int a = 0, b = 0, c = 0;
for (int i = 2; i < sqrt(x); i++) {
if (x % i == 0) {
for (int j = i + 1; j < sqrt(x / i); j++) {
if ((x / i) % j == 0 && x / i ... | ### Prompt
Construct a cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
int a = -1, b = -1, c = -1;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
a = i;
break;
}
}
if (a == -1)
printf("NO\n");
els... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
set<int> v;
void solve() {
int n;
cin >> n;
int nn = n;
v.clear();
for (int i = 2; i * i <= n; i++)
if (n % i == 0) {
v.insert(i);
n /= i;
}
if (n > 1) v.insert(n);
if (v.size() <= 2) {
cout << "NO" << endl;
return;
}
cout << "Y... | ### Prompt
Please formulate a CPP solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
using namespace std;
void solve() {
int n;
cin >> n;
int arr[3];
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
arr[0] = i;
n /= i;
break;
}
}
bool good1 = false;
for (int j = 2; j <= sqrt(n); j++) {
if (n % j == 0) {
... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
for (; b; a %= b, swap(a, b))
;
return a;
}
vector<long long> pr;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
pr.push_back(2);
for (long long i = 3; i * i <= 1000000000; i++) {
bool flag = fals... | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long int n;
cin >> n;
for (long long int i = 0; i < n; i++) {
long long int a, x;
cin >> a;
x = a;
vector<int> v;
for (long long int i = 2; i <= sqrt(a); i++) {
if... | ### Prompt
Generate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
long long n, m, ni, mi;
long long cn;
string s;
long long num[100005];
long long ok = false;
deque<long long> v;
map<string, bool> M;
map<string, bool> MC;
long long sch(long long a, long long b, long long c, long long i) {
string s = to_string(a) + " " + to_string(b) + "... | ### Prompt
Please formulate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
double squrt(int64_t num) {
double high = num, low = 0, mid;
while (high - low > 0.00001) {
mid = low + (high - low) / 2;
if (mid * mid > num) {
high = mid;
} else {
low = mid;
}
}
return mid;
}
void solve() {
int64_t num;
cin >> num;... | ### Prompt
Create a solution in Cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int add(int a, int b) {
long long x = a + b;
if (x >= 1000000007) x -= 1000000007;
if (x < 0) x += 1000000007;
return x;
}
long long mul(long long a, long long b) { return (a * b) % 1000000007; }
long long pw(long long a, long long b) {
... | ### Prompt
Develop a solution in Cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = -1;
const int inf = 2e9 + 19;
vector<long long> vec;
void primeDiv(long long n) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
while (n % i == 0) vec.push_back(i), n /= i;
}
}
if (n) vec.push_back(n);
}
int main() {
ios::sync_... | ### Prompt
Your task is to create a CPP solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using lli = long long int;
using ld = long double;
const int N = 2e5 + 5, inf = 2e9;
bool valid(int a, int b, int c) {
if (a == b || b == c || a == c) return false;
return true;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.ti... | ### Prompt
In CPP, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
const int max6 = 1e6 + 6;
map<int, int> rem;
int e[max6], p[max6];
int main() {
int tests;
scanf("%d", &tests);
for (int i = 1; i <= 1000000; ++i) e[i] = i;
int sl = 0;
for (int i = 2; i <= 1000000; ++i)
if (e[i] == i) {
p[++sl] = i;
for (int j = 1... | ### Prompt
In Cpp, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n;
scanf("%d", &n);
int flag, a, b, c;
flag = 1;
if (n % 2 == 0) {
a = 2;
flag = 0;
} else
for (a = 3; a * a * a <= n; a += 2)
if (n % a == 0) {
flag = 0;
break;
... | ### Prompt
Please provide a Cpp coded solution to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int T;
cin >> T;
while (T--) {
long long int n, k = 0, i, j, b, c, flag = 0, p = 0;
cin >> n;
vector<int> a;
for (int i = 1; i <= sqrt(n); i++) {
if (n % i == 0) {
if (n / i == i)
a.push_back(i);
e... | ### Prompt
Generate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
inline void setPrecision(int n) { cout.precision(n); }
long long int INF = 1e10;
int MOD = 1e9 + 7;
inline bool same2(int x, int y, int z) {
return (x == y) || (y == z) || (z == x);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int tt;
cin... | ### Prompt
Your task is to create a CPP solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int a, b, c, c1 = 0;
for (int i = 2; i < sqrt(n) + 1; i++) {
if (n % i == 0) {
if (c1 == 0) {
a = i;
c1++;
n = n / i;
} else if (c1 == 1) {... | ### Prompt
In CPP, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
int main() {
int t;
std::cin >> t;
for (; t > 0; t--) {
long n;
std::cin >> n;
int i = 2;
std::vector<int> primes;
while (i * i <= n) {
if (n % i == 0) {
while (n % i == 0) {
primes.push_back(i);
n /= i;
}
}
i++;
... | ### Prompt
Your task is to create a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, i;
long n, d, arr[2];
cin >> t;
while (t--) {
cin >> n;
i = 0;
for (d = 2; d * d < n && i < 2; d++) {
if (n % d == 0) {
arr[i++] = d;
n /= d;
}
}
if (i == 2)
cout << "YES\n" << arr[0] << ' ' <... | ### Prompt
Please create a solution in Cpp to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, q;
cin >> q;
while (q--) {
cin >> n;
vector<int> res;
for (int i = 2; res.size() < 2 && i * i < n; ++i) {
if (n % i == 0) {
res.push_back(i);
n /= i;
}
... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int q;
cin >> q;
for (int i = 0; i < q; ++i) {
int n;
cin >> n;
set<int> used;
for (int i = 2; i * i <= n; ++i) {
if (n % i == 0 && !used.count(i)) {
used.insert(i);
n /= i;
break;
}
}
for (int i... | ### Prompt
Your task is to create a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long int t = 1;
cin >> t;
while (t--) {
long long int n;
cin >> n;
vector<long long int> v;
long long int x = n;
while (n % 2 == 0) {
v.push_back(2);
... | ### Prompt
Your task is to create a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
bool test(void) {
long long N;
scanf("%lld", &N);
long long u = N;
vector<pair<long long, int>> A;
for (long long i = 2; i * i <= u; ++i) {
int q = 0;
while (u % i == 0) {
++q;
u /= i;
}
if (q) {
A.push_back({i, q});
}
}
i... | ### Prompt
In cpp, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, arr[10];
cin >> n;
int cnt = 0;
for (int i = 2; i < sqrt(n); i++) {
if (n % i == 0 && ((n / i) != i)) {
arr[0] = i;
n = n / i;
cnt = 5;
break;
}
}
if... | ### Prompt
Your challenge is to write a CPP solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n;
cin >> t;
while (t--) {
cin >> n;
set<int> values;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
values.insert(i);
n /= i;
break;
}
}
for (int i = 2; i * i <= n; i++) {
if (n %... | ### Prompt
Create a solution in cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1e6 + 1, mod = 1e9 + 7;
int t;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> divisors;
int d = n, s = sqrt(n);
for (int i = 2; i <= s; i++) {
if (d % i ==... | ### Prompt
Construct a cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
long long t;
cin >> t;
while (t--) {
long long n, f = 0;
cin >> n;
long long i = 2;
while (i * i < n) {
if (n % i == 0) {
f = 1;
break;
}
... | ### Prompt
Develop a solution in cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
int n;
while (t--) {
cin >> n;
vector<int> v;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
v.push_back(i);
n /= i;
}
if (v.size() == 2) break;
}
if (n != 1) v.push_back(n);
... | ### Prompt
In CPP, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
using vi = vector<long long int>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vld = vector<long double>;
using pii = pair<long long int, long long int>;
using psi = pair<string, long long int>;
using pci = pair<... | ### Prompt
Your task is to create a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
const long long int mod = 1e9 + 7;
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
long long int t = 0;
cin >> t;
while (t--) {
long long int n = 0;
cin >> n;
if (n < 24) {
cout << "NO\n";
continue;
} else {
vector<long lon... | ### Prompt
Construct a Cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
using db = double;
using vint = vector<int>;
using vlli = vector<vint>;
using vvint = vector<vint>;
using vvlli = vector<vlli>;
using cd = complex<double>;
const int inf = 1e9 + 5;
const lli infl = 1e18 + 5;
vo... | ### Prompt
Please formulate a CPP solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n;
cin >> n;
int cnt = 0;
vector<long long> ans;
for (long long i = 2; i * i <= n; i++) {
if (n % i == 0) {
if (cnt == 0) {
ans.push_back(i);
n = n / i;
... | ### Prompt
Your task is to create a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
using namespace std;
string chk[10] = {"1110111", "0010010", "1011101", "1011011", "0111010",
"1101011", "1101111", "1010010", "1111111", "1111011"};
void solve() {
long long n;
cin >> n;
for (int a = 2; a * (a + 1) * (a + 2) <= n; a++)
if (n % a... | ### Prompt
Your challenge is to write a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, t;
cin >> T;
for (t = 0; t < T; t++) {
int n, i;
cin >> n;
int numPrime = 0;
int num = n;
int f = 1;
vector<int> v;
map<int, int> mp;
for (i = 2; i <= sqrt(n); i++) {
f = 1;
if (num % i == 0) {
f ... | ### Prompt
Construct a Cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int isPrime(int n) {
if (n <= 1) return 0;
for (int i = 2; i * i <= n; i++)
if (n % i == 0) return 0;
return 1;
}
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
if (isPrime(n))
cout << "NO\n";
else {
int c = 0;
... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
const int INF = 1 << 29;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
map<string, long long int> m;
void solve() {
int n;
cin >> n;
int i;
set<int> s;
for (i = 2; i * i <= n; i++) {
if (n % i == 0 && !s.count(i)) {
s.insert(i);
n /= i;
break;
}
}
for (i = 2; i * i <= n; i++) {
if (n % i == 0 && !s.c... | ### Prompt
Please create a solution in CPP to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n, k = 2, a[3], q, c = 0;
cin >> n;
for (long long i = 2; i * i < n && c < 2; i++) {
if (n % i == 0) {
a[c++] = i;
n = n / i;
}
}
if (c != 2)
cout << "NO"... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
int main() {
int t, n, m, s, s1, i, j, p;
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
s = pow(n, 1.0 / 3);
p = 0;
for (i = 2; i <= s + 1; i++) {
if (n % i != 0) continue;
m = n / i;
s1 = sqrt(m);
for (j = i + 1; j <= s1; j++)
if (m % j =... | ### Prompt
Generate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> vp;
for (int i = 2; i <= sqrt(n); i++) {
while (n % i == 0) {
vp.push_back(i);
n /= i;
}
}
if (n > 1) {
vp.push_back(n);
}
sort(v... | ### Prompt
Construct a cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> v;
int m = n;
for (int i = 2; i <= sqrt(m); i++) {
if (m % i == 0) {
v.push_back(i);
m /= i;
break;
}
}
for (int i = 2; i <= sqrt(m... | ### Prompt
In cpp, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long t;
cin >> t;
map<long long, long long> cn;
set<long long> fac;
while (t--) {
fac.clear();
cn.clear();
long long n;
cin >> n;
long long temp = n;
f... | ### Prompt
Please create a solution in Cpp to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int test;
cin >> test;
while (test--) {
long long int n;
cin >> n;
long long int a = 0, b = 0;
for (long int i = 2; i * i <= n; i++) {
if (n % i == 0) {
a = i;
n = n / i;
... | ### Prompt
Generate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
long long t;
cin >> t;
while (t--) {
long long n, a, b, bit1 = 0, bit2 = 0;
cin >> n;
for (long long i = 2; i * i <= n; i++)
if (n % i == 0 && i != n / i) {
a = i;
b = n / i;
bit1++;
break;
}
... | ### Prompt
Please formulate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long a = 0, b = 0, c, d, e, f = 0, l, g, m, n, k, i, j, t, p, q;
cin >> t;
while (t--) {
cin >> n;
f = 0;
v.clear();
for (i = 2; f < 2 && i <=... | ### Prompt
Please create a solution in Cpp to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
vector<long long> ans;
pair<long long, long long> a[N];
long long n, T;
void f(long long n) {
ans.clear();
long long x = n;
for (long long i = 2; i * i <= x; i++) {
while (x % i == 0) {
ans.push_back(i);
x = x / i;
}
... | ### Prompt
Develop a solution in Cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
using namespace std;
const int MAXN = 1000;
int prime[MAXN + 1];
void getPrime() {
memset(prime, 0, sizeof(prime));
for (int i = 2; i <= MAXN; i++) {
if (!prime[i]) prime[++prime[0]] = i;
for (int j = 1; j <= prime[0] && prime[j] <= MAXN / i; j++) {
... | ### Prompt
Construct a cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &u) {
u = 0;
char c = getchar();
long long flag = 0;
while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
while (c >= '0' && c <= '9')
u = (u << 3) + (u << 1) + (c ^ 48), c = getchar();
if (flag) u = -u;
}
template <cl... | ### Prompt
Create a solution in CPP for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int cases;
cin >> cases;
for (int tt = 0; tt < cases; tt++) {
long long n;
cin >> n;
int ok = 0;
long long ax, ay, az;
for (long long i = 2; i * i <= n && !ok; i++) {
if (n % i == 0) ... | ### Prompt
Create a solution in Cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
void add(long long int& a, long long int b) {
a += b;
while (a >= mod) a -= mod;
while (a < 0) a += mod;
}
void mul(long long int& a, long long int b) {
a *= b;
while (a >= mod) a -= mod;
while (a < 0) a += mod;
}
long long int binexp... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
inline int read() {
char c = getchar();
int x = 0, f = 1;
while (c < '0' || c > '9') {
if (c == '-') f = -1;
c = getchar();
}
while (c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
return x * f;
}
const int maxn = 1e6 + 10;
const... | ### Prompt
Create a solution in Cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
long long spf(long long n) {
if (n % 2 == 0) {
return 2;
}
while (n % 2 == 0) {
n /= 2;
}
for (long long i = 3; i * i <= n; i++) {
if (n % i == 0) {
return i;
}
}
return n;
}
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
... | ### Prompt
Please provide a Cpp coded solution to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
const long double INF = 1e18 + 7;
long long N = 1e6 * 5;
long double EPS = 1 / 1e18;
long long a[1005];
map<long long, long long> cnt;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
for (long long i = 0; i < t; i++)... | ### Prompt
Please create a solution in cpp to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
const int N = 1e5 + 7;
const int M = 1e6 + 7;
const int INF = 1e9 + 8;
int p[N];
int c[N];
int m;
void divide(int n) {
m = 0;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
p[++m] = i, c[m] = 0;
while... | ### Prompt
Please create a solution in CPP to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int a[N];
void solve() {
int n;
cin >> n;
set<int> s;
for (long long i = 2; i * i <= n; i++) {
if (n % i == 0 && s.find(i) == s.end()) {
n /= i;
s.insert(i);
break;
}
}
for (long long i = 2; i * i <= n; i++) {
... | ### Prompt
Please create a solution in CPP to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
#pragma 03
using namespace std;
vector<pair<long long, long long> > pfac;
long long binpow(long long x, long long y) {
if (x == 0) return 0;
if (y == 0) return 1;
long long res = binpow(x, y / 2);
if (y % 2 == 0)
return res * res;
else
return res * res * x;
}
signed main() {
... | ### Prompt
Create a solution in CPP for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
int n, a[105], m;
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
for (int i = 1; i <= n; i++) {
int s1 = 0, s2 = 0, s3 = 0;
m = a[i];
for (int j = 2; j * j <= m; j++) {
if (m % j == 0) {
if (s1 == 0)
s1 = j;
else
... | ### Prompt
Please provide a cpp coded solution to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long int n;
cin >> n;
long long int ans[3];
long long int count = 0;
for (long long int i = 2; i * i <= n; i++) {
if (n % i == 0) {
n = n / i;
ans[count] = i;
count++;
}
if (count == 3) {
break;
}
}
i... | ### Prompt
Please formulate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t, n, a, b, i, ra, rb, rc;
cin >> t;
while (t--) {
ra = rb = rc = 1;
cin >> a;
b = sqrt(a);
for (i = 2; i <= b + 1; i++) {
if (a % i == 0) {
a = a / i;
ra = i;
break;
}
}
b = sqrt(a... | ### Prompt
Your task is to create a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
int T;
int main(int argc, char const *argv[]) {
cin >> T;
for (int kase = 1; kase <= T; kase++) {
int n;
cin >> n;
map<int, int> mp;
int tmp = n;
int cnt = 3;
while (cnt) {
if (cnt == 1) {
mp[tmp] = 1;
break;
}
f... | ### Prompt
Your task is to create a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
int gcd(int r, int p) {
if (p == 0) return r;
return gcd(p, r % p);
}
struct Test {
int x, y, z;
};
long long int fact(long long int x) {
long long int p = (fact(x - 1) * x) % 1000000007;
return p;
}
void sieveOfEratosthenes(long long int N, long long int s[]) {
... | ### Prompt
Create a solution in CPP for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
void Doaa() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int main() {
Doaa();
int n, t, num1 = 0, count = 0;
cin >> t;
while (t--) {
count = 0;
cin >> n;
int x = n;
bool f = true;
for (int i = 2; i <= sqrt(n); i++) {
if (n % ... | ### Prompt
Create a solution in cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
const ll INF = 1e18 + 1;
void err(...) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a,... | ### Prompt
Construct a Cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
long long q, n;
long long ans1, ans2, ans3;
long long cnt, a[1000005];
signed main() {
cin >> q;
while (q--) {
cnt = 0;
cin >> n;
for (long long i = 2; i * i <= n; i++)
if (n % i == 0) {
a[++cnt] = i;
a[++cnt] = n / i;
}
if (c... | ### Prompt
Please formulate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int ans1, ans2, n, T;
inline int read() {
int x = 0;
int flag = 0;
char ch;
ch = getchar();
while (!isdigit(ch)) {
if (ch == '-') flag = 1;
ch = getchar();
}
while (isdigit(ch)) {
x = (x << 3) + (x << 1) + ch - 48;
ch = getchar();
}
if (fla... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
set<int> s;
int count = 0;
int a;
cin >> a;
for (int i = 2; i * i <= a; i++) {
if (a % i == 0) {
int u = a / i;
s.insert(i);
for (int j = i + 1; j * j <= u; j++) {
... | ### Prompt
Construct a CPP code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e8 + 1;
const long double PI = 3.141592653;
bool isp(int n) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) return 0;
}
return 1;
}
int main() {
int tc;
cin >> tc;
while (tc--) {
int n;
cin >> n;
if (isp(n)) {
cout << ... | ### Prompt
Generate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
;
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
if (n < 24) {
cout << "NO" << endl;
continue;
}
long long p = 0;
for (long long i = 2; i <= sqrt(n); i+... | ### Prompt
Create a solution in Cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
long long myCeil(long long num, long long divider) {
long long result = num / divider;
if ((result * divider) == num) return result;
return result + 1;
}
long long gcd(long long a, long long b) {
if (!b) return a;
return gcd(b, a % b);
}
bool isPrime(long long n) ... | ### Prompt
Create a solution in cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
long long myCeil(long long num, long long divider) {
long long result = num / divider;
if ((result * divider) == num) return result;
return result + 1;
}
long long gcd(long long a, long long b) {
if (!b) return a;
return gcd(b, a % b);
}
bool isPrime(long long n) ... | ### Prompt
Construct a Cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int tab[50000];
int main() {
int t;
int long long n, a, b, c, maxi;
scanf("%lld", &t);
while (t--) {
int s = 0;
int long long i = 2, j = 2, sq;
scanf("%lld", &n);
sq = sqrt(n);
while (n != 0 && i <= sq) {
if (n % i == 0) {
tab[s] = ... | ### Prompt
Create a solution in CPP for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
long long int a, b, c, n;
cin >> n;
int e = 0;
long long int d;
for (int j = 2; j <= (int)sqrt(n); j++) {
if (n % j == 0) {
e = 1;
d = n / j;
a = j;
b... | ### Prompt
Your task is to create a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test ca... |
#include <bits/stdc++.h>
using namespace std;
template <typename T>
void inpos(T &x) {
x = 0;
register T c = getchar();
while (((c < 48) || (c > 57)) && (c != '-')) c = getchar();
bool neg = 0;
if (c == '-') neg = 1;
for (; c < 48 || c > 57; c = getchar())
;
for (; c > 47 && c < 58; c = getchar()) x =... | ### Prompt
Develop a solution in cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
vector<int> primefactors(int n) {
vector<int> ans;
while (n % 2 == 0) {
ans.push_back(2);
n = n / 2;
}
for (int i = 3; i * i <= n; i += 2) {
while (n % i == 0) {
ans.push_back(i);
n = n / i;
}
}
if (n > 2) {
ans.push_back(n);
}
... | ### Prompt
Create a solution in cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
int a, b, c, d, t;
scanf("%d", &t);
while (t--) {
int flag = 0;
scanf("%d", &n);
a = 0;
b = 0;
for (int i = 2; i < sqrt(n); i++) {
if (n % i == 0) {
if (a == 0) {
a = i;
n /= i;
} els... | ### Prompt
Develop a solution in cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
int a = 2;
while (a * a <= n) {
if (n % a == 0) {
n /= a;
break;
}
++a;
}
int b = a + 1, c = -1;
while (b * b < n) {
if (n % b == 0) {
if (n / b != a) {
c = n / b;
cout << "YES" ... | ### Prompt
Please formulate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t;
cin >> t;
while (t--) {
long long int n;
cin >> n;
long long int k = n;
vector<long long int> b;
for (int i = 2; i < sqrt(k) + 1; i++) {
if (n % i == 0) {
b.push_back(i);
n /= i;
}
if ... | ### Prompt
Create a solution in cpp for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
template <class T>
using minheap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
void setmax(T& a, T b) {
a = max(a, b);
};
template <typename T>
void setmin(T& a, T b) {
a = min(a, b);
};
int getPow(int a, int b) {
int p = 1;
for (int i = 0; i < b... | ### Prompt
Please create a solution in CPP to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int N = 1000002;
const double PI = 4 * atan(1);
const double eps = 1e-7;
const long long oo = 1e18;
vector<pair<long long, long long> > v;
long long t;
long long n;
int main() {
ios::sync_with_stdio(0);
cin >> t;
while (t--) {
cin... | ### Prompt
Please provide a cpp coded solution to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t, n;
cin >> t;
for (int p = 0; p < t; p++) {
cin >> n;
vector<int> ans;
for (int i = 2; i <= sqrt(n); i++) {
if (ans.size() == 2) break;
if (n % i == 0) {
ans.push_back(i);
n /= i;
}
}
auto ... | ### Prompt
Construct a cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long p = 0;
long long n;
cin >> n;
long long a, b, c;
for (long long i = 2; i < sqrt(n); i++) {
if (n % i == 0) {
a = i;
p = 1;
break;
}
}
if (p == 0... | ### Prompt
Generate a Cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
T... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t;
cin >> t;
while (t--) {
long long int n, cp = 0;
cin >> n;
vector<long long int> v1;
long long int i;
for (i = 2; i <= sqrt(n); i++) {
if (n % i == 0 && n / i != i) {
v1.push_back(i);
cp++;
... | ### Prompt
In Cpp, your task is to solve the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input... |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n, i;
cin >> n;
vector<long long> v;
map<long long, long long> mp;
while (n % 2 == 0) {
v.push_back(2);
mp[2]++;
n = n / 2;
}
for (i = 3; i <= sqrt(n); i = i + 2)... | ### Prompt
Please provide a cpp coded solution to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
template <class T>
void printArray(vector<T> arr) {
for (T a : arr) cout << a << " ";
cout << '\n';
}
void printVerdict(bool verdict) { cout << (verdict ? "YES" : "NO") << '\n'; }
vector<long long> findPrime(long long n) {
vector<long long> ret;
for (int i = 2; i * ... | ### Prompt
Develop a solution in cpp to the problem described below:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
set<int> used;
for (int i = 2; i * i < n; i++) {
if (n % i == 0 && !used.count(i)) {
used.insert(i);
n /= i;
break;
}
}
for (int i = 2; i * i < n; ... | ### Prompt
Your challenge is to write a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent tes... |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
for (int tt = 0; tt < t; tt++) {
int n;
cin >> n;
set<int> used;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0 && !used.count(i)) {
used.insert(i);
... | ### Prompt
Create a solution in CPP for the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Input
... |
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
inline long long read() {
long long X = 0, w = 0;
char ch = 0;
while (!isdigit(ch)) {
w |= ch == '-';
ch = getchar();
}
while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
return w ? -X : X;
}
inline char pow... | ### Prompt
Please formulate a cpp solution to the following problem:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
... |
#include <bits/stdc++.h>
using namespace std;
const int ma1 = 3e5 + 5;
string no = "NO", yes = "YES";
const unsigned int MAX1 = 1000000007;
void f(int n) {
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
int d = n / i;
for (int j = i + 1; j < sqrt(d); j++) {
if (d % j == 0) {
... | ### Prompt
Construct a Cpp code solution to the problem outlined:
You are given one integer number n. Find three distinct integers a, b, c such that 2 β€ a, b, c and a β
b β
c = n or say that it is impossible to do it.
If there are several answers, you can print any.
You have to answer t independent test cases.
Inp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.