Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. int main() {
  5. int x;
  6. cin >> x;
  7. int s = 0;
  8. vector <int> ans(100);
  9. vector <int> del(16);
  10. int n = 16;
  11. int j = 1;
  12. int a[17];
  13. a[0] = 1;
  14. //a[5] = 18;
  15. while(n < 100000) {
  16. //del.push_back(1);
  17. for(int i = 1; i <= n; ++i) {
  18. if(n%i == 0) {
  19. del.push_back(i);
  20. }
  21. }
  22. if(del.size() == 16) {
  23. if(del[8] - del[7] == x && del[5] == 18) {
  24. ans.push_back(n);
  25. cout << n;
  26. }
  27. }
  28. for (int i = 0; i < del.size(); ++i) {
  29. cout << del[i] << " ";
  30. }
  31. cout << endl;
  32. del.clear();
  33. n++;
  34. //cout << 1;
  35. }
  36. cout << endl;
  37. if (ans.size() == 0) {
  38. cout << 0;
  39. return 0;
  40. }
  41. else {
  42.  
  43. for(int i = 0; i < ans.size(); ++i) {
  44. s+= ans[i];
  45. }
  46. }
  47. cout << s;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement