Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #define ULL unsigned long long int
- using namespace std;
- ifstream f("b2.in");
- ofstream g("b2.out");
- ULL n,nr;
- int main()
- {
- f>>n;
- bool ok=false;
- for(int x=1;x<=62;++x)
- {
- for(int y=0;y<x;++y)
- {
- nr=(1ULL<<x)+(1ULL<<y);
- if(nr<=n)
- g<<(1LL<<y)+(1LL<<x)<<' ';
- else
- {
- ok=true;
- break;
- }
- }
- if(ok)
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement