artemgf

Юный плиточник

Nov 18th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <conio.h>
  4. #include <string>
  5. #include <algorithm>
  6. #include <vector>
  7. #include <map>
  8. #include <queue>
  9. #include <set>
  10. #include <stack>
  11.  
  12. using namespace std;
  13.  
  14. typedef long long ll;
  15.  
  16. ll del(ll n)
  17. {
  18.     ll sc = 0;
  19.     for (int i = 1; i <= (int)sqrt(double(n)); i++)
  20.     {
  21.         if (n%i == 0)
  22.             sc++;
  23.     }
  24.     return sc;
  25. }
  26. int main()
  27. {
  28.     ll n, m, k;
  29.     cin >> m >> n >> k;
  30.     for (ll i = 1; i <= 10000; i++)
  31.     {
  32.         if(del(i)==n)
  33.             if (del(i - k) == m)
  34.             {
  35.                 cout << i;
  36.                 return 0;
  37.             }
  38.     }
  39.  
  40.     cout << 0;
  41.     _getch();
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment