Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int p, k;
- cin >> p >> k;
- int najmnogu_deliteli = -200000000;
- int vtor_i = 0;
- for(int i = p; i <= k; i++)
- {
- int deliteli = 0;
- for(int j = 1; j <= sqrt(i); j++)
- {
- if(i % j == 0)
- {
- deliteli++;
- if(j != i / j)
- {
- deliteli++;
- }
- }
- }
- if(deliteli > najmnogu_deliteli)
- {
- najmnogu_deliteli = deliteli;
- vtor_i = i;
- }
- }
- cout << vtor_i << " " << najmnogu_deliteli << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement