diff --git a/Codechef-2021/SEPT21C/Prefix_Sums.cpp b/Codechef-2021/SEPT21C/Prefix_Sums.cpp new file mode 100644 index 0000000..46f4905 --- /dev/null +++ b/Codechef-2021/SEPT21C/Prefix_Sums.cpp @@ -0,0 +1,55 @@ +#pragma GCC optimize ("trapv") +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; +#define pb push_back +#define all(v) v.begin(),v.end() +#define rep(i,n,v) for(i=n;iv;i--) +#define ff first +#define ss second +#define pp pair +#define ll long long +#define ld long double +#define endl "\n" + +const ll mod=1e9+7; +void solve() +{ +ll n, a=0,b=0,m=1, c=-1,k=0, i=0, j=0, l=1e9+5; +string s,p, q; + cin>>n; + a=(n*(n+1))/2; + if(n%2 || a%2) cout<<"NO"<v,vec; + rep(i,1,n+1){ + if(i<=(n/4) || i>n-n/4) v.pb(i); + else vec.pb(i); + } + rep(i,0,v.size()) cout<>t; +while(t--) +{ +solve(); +} +return 0; +} \ No newline at end of file