Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool fdp(int n) {
- int div = 0;
- for (int i = 2; i * i <= n; i++) {
- if (!(n % i)) {
- if (++div > 4) return false;
- while (!(n % i)) n /= i;
- }
- }
- if (n) ++div;
- return div == 4;
- }
- signed main() {
- ios::sync_with_stdio(0);
- cin.tie(0); cout.tie(0);
- int i = 2, s;
- while (i++) {
- if (fdp(i)) {
- if (++s == 4) {
- cout << i - 3;
- return 0;
- }
- }
- else s = 0;
- }
- }
Advertisement