Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int unsigned long long
- bool prost(int n) {
- if (n == 1) return false;
- for (int d = 2; d * d <= n; d++) {
- if (n % d == 0) return false;
- }
- return true;
- }
- signed main() {
- // freopen("input.txt", "r", stdin);
- int k = 0;
- for (int i = 2e6; k != 6; i++) {
- int d_count = 0, d_s = 0, d_p = 1, mx_prost = 0;
- for (int d = 1; d * d <= i; d++) {
- if (i % d == 0) {
- d_count++;
- if (prost(d)) mx_prost = max(mx_prost, d);
- d_s += d;
- d_p *= d;
- if (i / d != d) {
- d_count++;
- d_s += i / d;
- d_p *= i / d;
- if (prost(i / d)) mx_prost = max(mx_prost, i / d);
- }
- }
- }
- if (d_s % 2 == 1 && d_p % 2 == 1) {
- if (d_count > 30) {
- cout << i << " " << mx_prost << "\n";
- k++;
- }
- }
- // cout << d_count << " " << mx_prost << " " << d_s << " " << d_p << " ";
- // break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement