Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool f(int x, int p)
- {
- if (p > 3)
- return false;
- if (x >= 34 && p == 3)
- return true;
- if (f(x + 1, p + 1) == true && f(x + 2, p + 1) == true && f(x + 3, p + 1) == true && f(x * 2, p + 1) == true)
- return true;
- }
- int main()
- {
- for (int S = 0; S < 33; S++)
- if (f(S, 1))
- cout << S << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement