Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <algorithm>
- #include <vector>
- #include <map>
- #include <queue>
- #include <set>
- #include <stack>
- using namespace std;
- typedef long long ll;
- ll del(ll n)
- {
- ll sc = 0;
- for (int i = 1; i <= (int)sqrt(double(n)); i++)
- {
- if (n%i == 0)
- sc++;
- }
- return sc;
- }
- int main()
- {
- ll n, m, k;
- cin >> m >> n >> k;
- for (ll i = 1; i <= 10000; i++)
- {
- if(del(i)==n)
- if (del(i - k) == m)
- {
- cout << i;
- return 0;
- }
- }
- cout << 0;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment