Help me in solving SUMARRAY problem

My issue

in editorial why this
if (k < 0 or k%2 == 1) cout << -1 << ‘\n’;
part of code is there ,i mean why k cannot be odd?

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	int t; cin >> t;
	while (t--) {
	    int n, k; cin >> n >> k;
	    vector<int> a(n, 1);
	    for (int i = 0; i < n; ++i) {
	        if (i >= n/2) ++a[i];
	        k -= a[i];
	    }
	    if (k < 0 or k%2 == 1) cout << -1 << '\n';
	    else {
	        for (int i = 0; i < n; ++i) {
	            int take = min(k, 99998);
	            k -= take;
	            a[i] += take;
	        }
	        if (k > 0) cout << -1 << '\n';
	        else {
	            for (int i = 0; i < n; ++i) cout << a[i] << ' ';
	            cout << '\n';
	        }
	    }
	}
	return 0;
}

Problem Link: SUMARRAY Problem - CodeChef