Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <set>
- #include <string>
- #include <algorithm>
- using namespace std;
- using ll = long long;
- void cv(vector <int> v){
- for (auto x: v) cout<<x<<' ';
- cout<<'\n';
- }
- vector <int> ans;
- ll S(int n, int a1){
- //cout<<"(a1 + n - 1 ) * n = "<<(a1 + n - 1 ) * n<<'\n';
- //cout<<"a1= "<<a1<<" n= "<<n<<'\n';
- return (a1 + n - 1 ) * n;
- }
- void al(ll N){
- int odd, evn;
- if (N % 2 == 0){
- odd = N-1;
- evn = N - 2;
- }else{
- odd = N - 2;
- evn = N - 1;
- }
- evn /= 2;
- odd = odd / 2 + 1;
- ll Sodd, Sevn;
- Sodd = S(odd,1);
- Sevn = S(evn,2);
- ll res = N - Sodd + Sevn;
- if (res == 67){
- ans.push_back(N);
- }
- }
- int main()
- {
- for (ll i=1;i<1e8;++i){
- //cout<<"i = "<<i<<'\n';
- al(i);
- }
- for (auto g: ans){
- cout<<g<<'\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement