//16:25
#include<iostream>
#include<cstdio>

using namespace std;
int n,m,k;
int a[2005];
int ans[2000005],cnt;
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	int sum=0;
	for(int i=1;i<=k;++i) ans[i]=1;
	cnt=k;
	sum=k;
	a[n+1]+=k;

	for(int i=2;i<=n+m;++i)
	{
		sum-=a[i];
		if(!sum)
		{
			ans[++cnt]=i-1;
			++a[i-1+n];
			++sum;
		}
		for(int j=sum+1;j<=k;++j)
		{
			ans[++cnt]=i;
			++a[i+n];
			++sum;
		}
	}
	sum-=a[n+m+1];
	if(!sum) ans[++cnt]=n+m;
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;++i)
	{
		printf("%d ",ans[i]);
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(a) (int)a.size()

typedef long long ll;

const int N = (int)1e5 + 4;
const int K = 26;
const int inf = (int)1e9 + 7;

struct rest {
    int t, n;
    rest() {}
    rest(int t, int n) : t(t), n(n) {}
    bool operator <(const rest& a) const {
        if (t == a.t) {
            return n < a.n;
        } else {
            return t < a.t;
        }
    }
};

struct work {
    int t, n, k;
    work() {}
    work(int t, int n, int k) : t(t), n(n), k(k) {}
};

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    vector<int> ans;
    set<rest> q;
    vector<work> a(k);
    for (int i = 0; i < k; ++i) {
        a[i] = work(0, i, 0);
        ans.push_back(1);
    }
    a[0].k = 1;
    int s = n - 1;
    for (int i = 1; i < 3 * (n + m); ++i) {
        if (s == i) {
            bool f = 0;
            for (int j = 0; j < sz(a); ++j) {
                if (a[j].t + n - 1 > i) {
                    s = a[j].t + n - 1;
                    f = 1;
                    break;
                }
            }
            if (f) {
                continue;
            }
            set<rest> :: iterator it = (sz(q) == 0 ? q.end() : q.begin());
            if (sz(q) > 0 && it->t + m <= i) {
                a.push_back(work(i, it->n, 1));
                q.erase(it);
            } else {
                a.push_back(work(i, sz(ans), 1));
                ans.push_back(i + 1);
            }
            s = i + n - 1;
        }
        int d = 0;
        for (int j = 0; j < sz(a); ++j) {
            if (i - a[j].t < n) {
                ++d;
            }
        }
        for (int j = 0; j < sz(a); ++j) {
            if (i - a[j].t == n) {
                rest p = rest(i, a[j].n);
                if (d < k) {
                    set<rest> :: iterator it = (sz(q) == 0 ? q.end() : q.begin());
                    ++d;
                    if (sz(q) > 0 && it->t + m <= i) {
                        a[j] = work(i, it->n, 0);
                        q.erase(it);
                    } else {
                        a[j] = work(i, sz(ans), 0);
                        ans.push_back(i + 1);
                    }
                }
                q.insert(p);
            }
        }
    }
    printf("%d\n", sz(ans));
    for (int i = 0; i < sz(ans); ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(a) (int)a.size()

typedef long long ll;

const int N = (int)1e5 + 4;
const int K = 26;
const int inf = (int)1e9 + 7;

struct rest {
    int t, n;
    rest() {}
    rest(int t, int n) : t(t), n(n) {}
    bool operator <(const rest& a) const {
        if (t == a.t) {
            return n < a.n;
        } else {
            return t < a.t;
        }
    }
};

struct work {
    int t, n, k;
    work() {}
    work(int t, int n, int k) : t(t), n(n), k(k) {}
};

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    vector<int> ans;
    set<rest> q;
    vector<work> a(k);
    for (int i = 0; i < k; ++i) {
        a[i] = work(0, i, 0);
        ans.push_back(1);
    }
    set<rest> :: iterator it = q.end();
    a[0].k = 1;
    int s = n - 1;
    for (int i = 1; i < 3 * (n + m); ++i) {
        if (s == i) {
            int x = -1;
            for (int j = 0; j < k; ++j) {
                if (a[j].k != 1 && (x == -1 || a[x].t > a[j].t)) {
                    x = j;
                }
            }
            set<rest> :: iterator it = (sz(q) == 0 ? q.end() : q.begin());
            if (sz(q) > 0 && it->t + m <= i) {
                rest p = rest(i + (k == 1), a[x + (k == 1)].n);
                a[x + (k == 1)] = work(i, it->n, 1);
                q.erase(it);
                q.insert(rest(p.t, p.n));
            } else {
                q.insert(rest(i + (k == 1), a[x + (k == 1)].n));
                a[x + (k == 1)] = work(i, sz(ans), 1);
                ans.push_back(i + 1);
            }
            s = i + n - 1;
        }
        for (int j = 0; j < k; ++j) {
            if (i - a[j].t == n) {
                set<rest> :: iterator it = (sz(q) == 0 ? q.end() : q.begin());
                if (sz(q) > 0 && it->t + m <= i) {
                    rest p = rest(i, a[j].n);
                    a[j] = work(i, it->n, 0);
                    q.erase(it);
                    q.insert(p);
                } else {
                    q.insert(rest(i, a[j].n));
                    a[j] = work(i, sz(ans), 0);
                    ans.push_back(i + 1);
                }
            }
        }
    }
    printf("%d\n", sz(ans));
    for (int i = 0; i < sz(ans); ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(a) (int)a.size()

typedef long long ll;

const int N = (int)1e5 + 4;
const int K = 26;
const int inf = (int)1e9 + 7;

struct rest {
    int t, n;
    rest() {}
    rest(int t, int n) : t(t), n(n) {}
    bool operator <(const rest& a) const {
        if (t == a.t) {
            return n < a.n;
        } else {
            return t < a.t;
        }
    }
};

struct work {
    int t, n, k;
    work() {}
    work(int t, int n, int k) : t(t), n(n), k(k) {}
};

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    vector<int> ans;
    set<rest> q;
    vector<work> a(k);
    for (int i = 0; i < k; ++i) {
        a[i] = work(0, i, 0);
        ans.push_back(1);
    }
    a[0].k = 1;
    for (int i = 1; i < 3 * (n + m); ++i) {
        int x = -1;
        bool f = 0;
        for (int j = 0; j < k; ++j) {
            if (a[j].k == 1 && i - a[j].t == n - 1) {
                f = 1;
            }
        }
        if (f) {
            for (int j = 0; j < k; ++j) {
                if (a[j].k != 1 && (x == -1 || a[x].t > a[j].t)) {
                    x = j;
                }
            }
            set<rest> :: iterator it = (sz(q) == 0 ? q.end() : q.begin());
            if (sz(q) > 0 && it->t + m <= i) {
                work p = a[x];
                p.t = i;
                a[x] = work(i, it->n, 1);
                q.erase(it);
                q.insert(rest(p.t, p.n));
            } else {
                q.insert(rest(i, a[x].n));
                a[x] = work(i, sz(ans), 1);
                ans.push_back(i + 1);
            }
        }
        for (int j = 0; j < k; ++j) {
            if (i - a[j].t == n) {
                set<rest> :: iterator it = (sz(q) == 0 ? q.end() : q.begin());
                if (sz(q) > 0 && it->t + m <= i) {
                    work p = a[j];
                    p.t = i;
                    a[j] = work(i, it->n, 0);
                    q.erase(it);
                    q.insert(rest(p.t, p.n));
                } else {
                    q.insert(rest(i, a[j].n));
                    a[j] = work(i, sz(ans), 0);
                    ans.push_back(i + 1);
                }
            }
        }
    }
    printf("%d\n", sz(ans));
    for (int i = 0; i < sz(ans); ++i) {
        printf("%d ", ans[i]);
    }
    return 0;
}


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

int n,m,k;
int ans[2000],siz;
int main()
{
	while(~scanf("%d%d%d",&n,&m,&k))
	{
		siz=0;
		for(int i=0;i<k;++i) ans[siz++]=1;
		ans[siz++]=n;
		for(int i=0;i<k-1;++i)
			ans[siz++]=n+1;
		if(2*n<=1+m+n)
		{
			//printf("k=%d\n",k);
			if(k==1) ans[siz++]=2*n-1;
			else ans[siz++]=2*n;
		}
		printf("%d\n",siz);
		for(int i=0;i<siz;++i)
			printf("%d%c",ans[i],i==siz-1?'\n':' ');
	}
	return 0;
}


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

int n,m,k;
int ans[2000],siz;
int main()
{
	while(~scanf("%d%d%d",&n,&m,&k))
	{
		siz=0;
		for(int i=0;i<k;++i) ans[siz++]=1;
		ans[siz++]=n;
		for(int i=0;i<k-1;++i)
			ans[siz++]=n+1;
		if((k==1&&2*n-1<m+n+1)||(k>1&&2*n<1+m+n))
		{
			//printf("k=%d\n",k);
			if(k==1) ans[siz++]=2*n-1;
			else ans[siz++]=2*n;
		}
		printf("%d\n",siz);
		for(int i=0;i<siz;++i)
			printf("%d%c",ans[i],i==siz-1?'\n':' ');
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
int n,m,k;
vector<int> ans;
int main()
{
    cin >> n >> m >> k;
    for(int i=0;i<k;i++) ans.push_back(1);
    int d = n;
    while(1)
    {
        if(d >= m + n) break;
        ans.push_back(d); d++;
        if(d >= 1 + m + n) break;
        for(int i=0;i<k-1;i++)
            ans.push_back(d);
        d = d + n - 2;
    }
    cout << ans.size() << endl;
    for(int i=0;i<ans.size();i++) cout << ans[i] << " ";
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int n,m,k;
int day[2000000];
vector<int> ans;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m >> k;
    for(int i=0;i<k;i++) ans.push_back(1);
    for(int i=1;i<=n;i++) day[i] = k;
    int pt = n;
    //int c = 10;
    while(pt < 1 + m + n)
    {
        if(day[pt] < k)
        {
            int rem = k - day[pt];
            for(int i=0;i<rem;i++) ans.push_back(pt);
            for(int i = pt;i < pt + n;i++) day[i] += rem;
           // pt = pt + 1;
            //continue;
        }
        if(day[pt + 1] == 0)
        {
            //cout << "HIHIT\n";
            ans.push_back(pt);
            for(int i=pt;i< pt + n;i++) day[i]++;
            //pt = pt + 1;
            //continue;
        }
        pt = pt + 1;
    }
    /*for(int i=1;i<=1 + m + n;i++)
    {
        cout << "day: " << i << "  " << day[i] << endl;
    }*/
    cout << ans.size() << endl;
    for(int i=0;i<ans.size();i++) cout << ans[i] << " ";
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int n,m,k;
int day[2006];
vector<int> ans;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m >> k;
    for(int i=0;i<k;i++) ans.push_back(1);
    for(int i=1;i<=n;i++) day[i] = k;
    int pt = n;
    //int c = 10;
    while(pt < 1 + m + n)
    {
        if(day[pt] < k)
        {
            int rem = k - day[pt];
            for(int i=0;i<rem;i++) ans.push_back(pt);
            for(int i = pt;i < pt + n;i++) day[i] += rem;
           // pt = pt + 1;
            //continue;
        }
        if(day[pt + 1] == 0)
        {
            //cout << "HIHIT\n";
            ans.push_back(pt);
            for(int i=pt;i< pt + n;i++) day[i]++;
            //pt = pt + 1;
            //continue;
        }
        pt = pt + 1;
    }
    /*for(int i=1;i<=1 + m + n;i++)
    {
        cout << "day: " << i << "  " << day[i] << endl;
    }*/
    cout << ans.size() << endl;
    for(int i=0;i<ans.size();i++) cout << ans[i] << " ";
    cout << endl;
    return 0;
}


#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> v;
int n,m,k,a[10005]={0},i,j;
bool b[10005]={0};
cin>>n>>m>>k;
b[1]=1;
for(i=1;i<=n+m;i++)
{
while(a[i]<k || b[i+1]==0)
{
v.push_back(i);
for(j=i;j<=i+n-1;j++)
{
a[j]++;
a[j+n+m]++;
b[j]=1;
}
}
}
cout<<v.size()<<endl;
for(i=0;i<v.size();i++) cout<<v[i]<<" ";
return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<iterator>
#include<cmath>
#include<string>
#include<sstream>
#include<cstring>
#include<ctype.h>
#include<iomanip>
#include<functional>
#include<bitset>
#include<stdio.h>
#include<fstream>
#include<stdlib.h>
#include<math.h>
#include<ctime>
#include<string>
#include<cstdio>
#include<locale>
#include<codecvt>
using namespace std;
#define lop(i,a,n) for(ll i=a;i<n;++i)
#define loop(i,n,a)for(ll i=n-1;i>=a;--i)
#define R_(s)      freopen(s, "r", stdin)
#define W_(s)      freopen(s, "w", stdout)
#define R_W        R_("input.txt"),W_("output.txt")
#define ll         long long
#define ld         long double
#define ii         pair<ll,ll>
#define vii        vector<ii>
#define vi         vector<int>
#define vll        vector<ll>
#define vs         vector<string>
#define vvii       vector<vector<ii>>
#define vvi        vector<vector<int>>
#define vvll       vector<vector<ll>>
#define sz(v)      (ll)v.size()
#define all(v)     v.begin(),v.end()
#define sc(n)      scanf("%d",&n)
#define scl(n)     scanf("%lld",&n)
#define pr1(n)     printf("%d\n",n)
#define pr2(n)     printf("%d " ,n)
#define pr4(n)     printf("%lld\n",n)
#define pr3(n)     cout<<fixed<<setprecision(2)<<n<<endl
#define endl       "\n"
#define PI         2*acos(0.0)
#define DFS_GRAY  -1
#define DFS_WHITE  0
#define DFS_BLACK  1
#define oo  1e9
#define OO  1e18
#define EPS pow(10,-9)
int dr[] = { 1, 0, -1, 0, -1, -1, 1, 1 };
int dc[] = { 0, -1, 0, 1, -1, 1, -1, 1 };
const int MAX = 500 + 7;
const int MOD = 1e9 + 7;
int main()
{
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

typedef long long ll;
typedef int int_type;
typedef pair<int_type, int_type> pii;
typedef vector<int_type> vi;
typedef vector<vi> vii;

const int MAXN = 10010;
int v[MAXN+20];

int main() {
	int n,m,k;
	RRR(n,m,k);
	vi ans;
	// DBG(k);
	FOR(i,1,MAXN) {
		// DBG(v[i]);
		if(v[i] < k) {
			int inser = k - v[i];
			FOR0(j,inser) ans.pb(i);
			int j = i;
			while(j<MAXN) {
				// DBG(inserx);
				for(int aux=0; aux<n && j<MAXN; ++aux, ++j) v[j]+=inser;
				j += m;
			}
		}
		else if(i < MAXN-1 && !v[i+1]) {
			int inser = 1;
			FOR0(j,inser) ans.pb(i);
			int j = i;
			while(j<MAXN) {
				for(int aux=0; aux<n && j<MAXN; ++aux, ++j) v[j]+=inser;
				j += m;
			}
		}
	}
	printf("%d\n",ans.size());
	TRAV(it,ans) {
		if(it != ans.begin()) printf(" ");
		printf("%d", *it);
	}
	printf("\n");
}


#include <bits/stdc++.h>

using namespace std;
#define DEBUG_ON 1

#define INF 0x3f3f3f3f
#define NSYNC ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=a; i<(b); ++i)
#define FOR0(i,b) for(int i=0; i<(b); ++i)
#define TRAV(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define RTRAV(it,c) for(__typeof((c).rbegin()) it=(c).rbegin(); it!=(c).rend(); ++it)
#define DBG(x) if(DEBUG_ON) cout << #x << " == " << x << endl
#define DBGP(x) if(DEBUG_ON) cout << "(" << (x).first << ", " << (x).second << ")" << endl
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define R(x) scanf(" %d",&(x))
#define RR(x,y) scanf(" %d %d",&(x), &(y))
#define RRR(x,y,z) scanf(" %d %d %d",&(x), &(y),&(z))
#define CLR(v) memset(v, 0, sizeof(v))
#define SET(v) memset(v, -1, sizeof(v))

typedef long long ll;
typedef int int_type;
typedef pair<int_type, int_type> pii;
typedef vector<int_type> vi;
typedef vector<vi> vii;

const int MAXN = 10010;
int v[MAXN+20];

int main() {
	int n,m,k;
	RRR(n,m,k);
    vi ans;
    vi cnt(3 * (n + m), 0);
    for (int i = 0; i < n + m; i++)
    {
        while (cnt[i] < k)
        {
            ans.pb(i);
            for (int t = 0; t < n; t++)
                cnt[i + t]++;
        }

        if (cnt[i + 1] == 0)
        {
            ans.pb(i);
            for (int t = 0; t < n; t++)
                cnt[i + t]++;
        }
    }

    printf("%d\n", ans.size());
    for (int i = 0; i < (int)ans.size(); i++)
    {
        if (i > 0) printf(" ");
        printf("%d", ans[i] + 1);
    }}


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

int hires[2048];
int main(){
	int N,M,K;cin>>N>>M>>K;
	int total = K;
	hires[0] = K;
	if(K != 1){
		for(int i=N-1;i<N+M;i += N){
			hires[i] = 1;
			if(i+1<N+M) hires[i+1] = K-1;
			total += hires[i]+hires[i+1];
		}
	}else{
		for(int i=N-1;i<N+M;i += N-1){
			hires[i] = 1;
			total += hires[i];
		}
	}
	cout<<total<<endl;
	for(int i=0;i<N+M;i++) for(int j=0;j<hires[i];j++) cout<<i+1<<" ";
	cout<<endl;
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <string>
#include <cstring>
#include <ctime>
#include <cassert>
#include <queue>
#include <stack>
#include <bitset>
#include <bits/stdc++.h>
#define  ll long long int
#define  ld long double
#define  ss string
#define  M 1000000007
#define p pair<ll,ll>
#define F first
#define S second
#define  pb push_back
const int MAXN = 200001;
const int inf = 0x3f3f3f3f;
using namespace std;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define REV(i,a,b) for(int i=a-1;i>=b;i--)
#define rev(i,n) REV(i,n,0)
#define k(x) (x*x);

int main()
{
    ll n,m,k;
    cin>>n>>m>>k;
    ll hires[2048];
    hires[0]=k;
    ll total=k;

    if(k!=1)
    {
        for(ll i=n-1;i<n+m;i+=n)
        {
            hires[i]=1;
            if(i+1<n+m)hires[i+1]=k-1;
            total+=hires[i]+hires[i+1];
        }
    }
    else
    {
        for(ll i=n-1;i<n+m;i+=n-1)
        {
            hires[i]=1;
            total+=hires[i];
        }
    }

   cout<<total<<endl;
   rep(i,n+m)rep(j,hires[i])cout<<i+1<<" ";

    return 0;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else if ( n == 2 && m == 1 && k == 1 )
		G<<"3\n1 2 3\n";
	else if ( n == 2 && m == 2 && k >= 2 )
	{
		G<<2*k+1<<'\n';
		for (int i=1;i<=k;++i) G<<1<<' ';
		G<<2<<' ';
		for (int i=2;i<=k;++i) G<<3<<' ';
		G<<4<<' ';
	}
	else
		if ( n == m || ( m+1 == n && k == 1 ) )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<=k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else if ( n == 2 && m == 1 && k == 1 )
		G<<"3\n1 2 3\n";
	else if ( n == 2 && m == 2 && k >= 2 )
	{
		G<<2*k+1<<'\n';
		for (int i=1;i<=k;++i) G<<1<<' ';
		G<<2<<' '<<3<<' ';
		for (int i=2;i<=k;++i) G<<4<<' ';
	}
	else
		if ( n == m || ( m+1 == n && k == 1 ) )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<=k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else
		if ( n == m || ( m+1 == n && k == 1 ) )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<=k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else
		if ( n == m )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<2<<' ';
			for (int i=2;i<k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else
		if ( n == m )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else
		if ( n == m )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<=k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else if ( n == 2 && m == 1 && k == 1 )
		G<<"3\n1 2 3\n";
	else
		if ( n == m || ( m+1 == n && k == 1 ) )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<=k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else
		if ( n == m )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<2<<' ';
			for (int i=1;i<=k;++i) G<<n+1<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <iomanip>
#include <numeric>
#include <map>
#include <set>
#include <algorithm>
#include <vector>
#include <cstring>
#include <sstream>
#include <queue>
#include <bitset>
#include <cmath>
using namespace std;

#define F cin
#define G cout

const int K = 25;
const int N = 100005;
const int M = 1000000007;

int n,m,k;

int main()
{
	ios::sync_with_stdio(0);
	#ifndef ONLINE_JUDGE
		ifstream F("p.in");
	#endif

	F>>n>>m>>k;
	if ( n == 2 && m == 2 && k == 1 )
		G<<"4\n1 2 3 4\n";
	else if ( n == 2 && m == 1 && k == 1 )
		G<<"3\n1 2 3\n";
	else if ( n == 2 && m == 2 && k == 2 )
		G<<"5\n1 1 2 3 4\n";
	else
		if ( n == m || ( m+1 == n && k == 1 ) )
		{
			G<<2*k+1<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<3<<' ';
			for (int i=2;i<=k;++i) G<<n+1<<' ';
			G<<n+2<<' ';
			G<<'\n';
		}
		else
		{
			G<<2*k<<'\n';
			for (int i=1;i<=k;++i) G<<1<<' ';
			G<<n<<' ';
			for (int i=1;i<k;++i) G<<n+1<<' ';
			G<<'\n';
		}
}


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

int main(){
	int N,M,K;
	cin>>N>>M>>K;
	if(N == M){
		cout<<2*K+1<<endl;
		for(int i=0;i<K;i++) cout<<1<<" ";
		cout<<N<<" ";
		for(int i=0;i<K-1;i++) cout<<N+1<<" ";
		cout<<N+2<<endl;
	}else{
		cout<<2*K<<endl;
		for(int i=0;i<K;i++) cout<<1<<" ";
		cout<<N<<" ";
		for(int i=0;i<K-1;i++) cout<<N+1<<" ";
		cout<<endl;
	}
	return 0;
}


// https://codeforces.com/problemset/problem/950/D

#include <bits/stdc++.h>
using namespace std;
#define cerr if(false) cerr
#define watch(x) cerr << (#x) << " is " << (x) << endl;
#define endl '\n'
#define ld long double
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define sz(a) (int)a.size()
#define all(x) (x).begin(), (x).end()

void solve() {

}

const int maxn = 1050;
int n, m, k;

int a[2*maxn], d[2*maxn];

signed main() {
    ios::sync_with_stdio(0);
    cin.sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> m >> k;

    int cur = 0;
    vector<int> ans;
    for(int i = 1; i <= n+m; i++) {
        if(cur < k) {
            int h = k-cur;

            cerr << "adding " << h << " on" << i << endl;
            d[i] += h;
            d[i+n-1] -= h;
            // ans += h;

            for(int j = 1; j <= h; j++) {
                ans.emplace_back(i);
            }
        }

        cur += d[i];

        cerr << i << " " << cur << endl;

        if(!cur) {
            cerr << "extra on " << i << endl;
            cur++;
            d[i+n-1]--;
            ans.emplace_back(i);
        }
    }

    // cout << ans << endl;
    cout << sz(ans) << endl;
    for(int x: ans) {
        cout << x << " ";
    }
    cout << endl;
}

/*

observation: we only have to calculate up to n+m because it just loops over and over

in that same vein, we only have to deal with "adding" things

simulate difference array

*/

// Did you read the bounds?
// Did you make typos?
// Are there edge cases (N=1?)
// Are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
// Integer overflow?
// DS reset properly between test cases?
// Is using long longs causing TLE?
// Are you using floating points?


// https://codeforces.com/problemset/problem/950/D

#include <bits/stdc++.h>
using namespace std;
#define cerr if(false) cerr
#define watch(x) cerr << (#x) << " is " << (x) << endl;
#define endl '\n'
#define ld long double
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define sz(a) (int)a.size()
#define all(x) (x).begin(), (x).end()

void solve() {

}

const int maxn = 1050;
int n, m, k;

int a[2*maxn], d[2*maxn];

signed main() {
    ios::sync_with_stdio(0);
    cin.sync_with_stdio(0);
    cin.tie(0);

    cin >> n >> m >> k;

    int cur = 0;
    vector<int> ans;
    for(int i = 1; i <= n+m; i++) {
        if(cur < k) {
            int h = k-cur;

            cerr << "adding " << h << " on" << i << endl;
            d[i] += h;
            d[i+n-1] -= h;
            // ans += h;

            for(int j = 1; j <= h; j++) {
                ans.emplace_back(i);
            }
        }

        cur += d[i];

        cerr << i << " " << cur << endl;

        if(!cur and i != n+m) {
            cerr << "extra on " << i << endl;
            cur++;
            d[i+n-1]--;
            ans.emplace_back(i);
        }
    }

    // cout << ans << endl;
    cout << sz(ans) << endl;
    for(int x: ans) {
        cout << x << " ";
    }
    cout << endl;
}

/*

observation: we only have to calculate up to n+m because it just loops over and over

in that same vein, we only have to deal with "adding" things

simulate difference array

*/

// Did you read the bounds?
// Did you make typos?
// Are there edge cases (N=1?)
// Are array sizes proper (scaled by proper constant, for example 2* for koosaga tree)
// Integer overflow?
// DS reset properly between test cases?
// Is using long longs causing TLE?
// Are you using floating points?


#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <stack>
#include <map>
#include <math.h>
#include <numeric>
#include <list>
#include <queue>
#include <string>
#include <vector>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
using namespace std;

int main(){
    int n=6,m=5,k=1;
    cin >> n >> m >> k;
    vector<int> days(n+m+1, 0);
    int result = 0;
    vector<int> add;
    int p = n+m;
    for(int i = 0; i < p; i++){
        int need = 0;
        if (days[i] < k) {
            need = k - days[i];
        } else if (i + 1 < days.size() && days[i+1] == 0){
            need = 1;
        }
        for(int j = 0; j < n && (j + i) < days.size(); j++){
            days[i+j] += need;
        }
        result += need;
        for(int j = 0; j < need; j++){
            add.push_back(i+1);
        }
    }
    cout << result << endl;
    for(int i : add){
        cout << i << " ";
    }

}


#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <stack>
#include <map>
#include <math.h>
#include <numeric>
#include <list>
#include <queue>
#include <string>
#include <vector>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
using namespace std;

int main(){
    int n=3,m=3,k=1;
    cin >> n >> m >> k;
    vector<int> days(n+m, 0);
    int result = 0;
    vector<int> add;
    for(int i = 0; i < days.size(); i++){
        int need = 0;
        if (days[i] < k) {
            need = k - days[i];

        } else if (i + 1 < days.size() && days[i+1] == 0){
            need = 1;
        }
        for(int j = 0; j < n && (j + j) < days.size(); j++){
            days[i+j] += need;
        }
        result += need;
        for(int j = 0; j < need; j++){
            add.push_back(i+1);
        }
    }
    cout << result << endl;
    for(int i : add){
        cout << i << " ";
    }

}


#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
#include <stack>
#include <map>
#include <math.h>
#include <numeric>
#include <list>
#include <queue>
#include <string>
#include <vector>
#include <set>
#include <sstream>
#include <cstdio>
#include <cstring>
using namespace std;

int main(){
    int n=3,m=3,k=1;
    cin >> n >> m >> k;
    vector<int> days(n+m, 0);
    int result = 0;
    vector<int> add;
    for(int i = 0; i < days.size(); i++){
        int need = 0;
        if (days[i] < k) {
            need = k - days[i];
        } else if (i + 1 < days.size() && days[i+1] == 0){
            need = 1;
        }
        for(int j = 0; j < n && (j + i) < days.size(); j++){
            days[i+j] += need;
        }
        result += need;
        for(int j = 0; j < need; j++){
            add.push_back(i+1);
        }
    }
    cout << result << endl;
    for(int i : add){
        cout << i << " ";
    }

}


#include <iostream>
#include <vector>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
int main(int argc, char** argv) {
	vector<int>ans;
	int n,m,k;
	cin>>n>>m>>k;
	if(k!=1)
	{
	rep(i,1,k)ans.pb(1);
	int t=n+1;
	while(t<=n+m+1)
	{
		ans.pb(t-1);
		if(t!=n+m+1&&t-1+n<n+m+1)
		rep(i,1,k-1)ans.pb(t);
		else if(t-1+n>=n+m+1&&t!=n+m+1)
		rep(i,1,k-1)ans.pb(t);
		t+=n;
	}
	}
	else
	{
		ans.pb(1);
		int t=n;
		while(t+n-1<n+m+1)
		{
			ans.pb(t);
			t+=n-1;
		}
		ans.pb(t);
	}
	cout<<ans.size()<<endl;
	rep(i,0,ans.size()-1)printf("%d ",ans[i]);

	return 0;
}//hello


/*
ID: varunra2
LANG: C++
TASK: hiringstaff
*/
#pragma region Headers, define, typedef
#include<bits/stdc++.h>

using namespace std;
#ifdef DEBUG
#include <debug.h>
#endif

#define EPS 1e-9
#define IN(A, B, C) assert(B <= A && A <= C)
#define INF (int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))
#define MOD 1000000007
#define MP make_pair
#define PB push_back
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define x first
#define y second

const double PI = acos(-1.0);
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef map<int, int> MPII;
typedef multiset<int> MSETI;
typedef set<int> SETI;
typedef set<string> SETS;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef vector<string> VS;

#ifdef DEBUG
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

// util functions

#pragma endregion

int main(int argc, char const *argv[]) {
#ifndef ONLINE_JUDGE
  freopen("hiringstaff.in", "r", stdin);
  freopen("hiringstaff.out", "w", stdout);
#endif
  cin.sync_with_stdio(0); cin.tie(0);

  int n, m, k;
  cin >> n >> m >> k;
  VI ret;
  VI cnt(3*(n + m), 0);

  for(int i = 0; i < n + m; i++) {
    while(cnt[i] < k) {
      ret.PB(i);
      for(int j = 0; j < n; j++) {
          cnt[i + j]++;
      }
    }
    if(cnt[i + 1] == 0) {
      ret.PB(i);
      for(int j = 0; j < n; j++) {
        cnt[i + j]++;
      }
    }
  }

  cout << ret.size() << endl;

  for(int i = 0; i < ret.size(); i++) {
    cout << ret[i] + 1 << " ";
  }
  cout << endl;

  return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		vector<int> vec;
		int tmp = 1;
		for (int i = 0; i < k; i++)	vec.push_back(tmp);
		tmp += (n - 1);
		while (tmp < n + m){
			vec.push_back(tmp);
			if ((n + m) % (tmp + 1) == 0) break;
			for (int i = 0; i < k - 1; i++){
				vec.push_back(tmp + 1);
			}
			tmp += (n - 1);
		}
		cout << vec.size() << endl;
		for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		vector<int> vec;
		int tmp = 1, last;
		for (int i = 0; i < k; i++)	vec.push_back(tmp);
		last = tmp;
		tmp += (n - 1);
		while (tmp < n + m){
			if (tmp == vec[vec.size() - 1]) break;
			vec.push_back(tmp);
			last = tmp;
			if ((n + m) % (tmp + 1) == 0) break;
			for (int i = 0; i < k - 1; i++){
				vec.push_back(tmp + 1);
				last = tmp + 1;
			}
			tmp += (n - 1);
		}
		if (m + 1 >= last) vec.push_back(last + n - 1);
		cout << vec.size() << endl;
		for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		vector<int> vec;
		int tmp = 1, last;
		for (int i = 0; i < k; i++)	vec.push_back(tmp);
		last = tmp;
		tmp += (n - 1);
		while (tmp < n + m){
			if (tmp == vec[vec.size() - 1]) break;
			vec.push_back(tmp);
			last = tmp;
			for (int i = 0; i < k - 1; i++){
				vec.push_back(tmp + 1);
				last = tmp + 1;
			}
			if (m + 1 <= tmp + 1) break;
			tmp += (n - 1);
		}
		if (m + 1 >= last) vec.push_back(last + n - 1);
		cout << vec.size() << endl;
		for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		vector<int> vec;
		int tmp = 1, last;
		for (int i = 0; i < k; i++)	vec.push_back(tmp);
		last = tmp;
		tmp += (n - 1);
		while (tmp < n + m){
			vec.push_back(tmp);
			last = tmp;
			if ((n + m) % (tmp + 1) == 0) break;
			for (int i = 0; i < k - 1; i++) {
				vec.push_back(tmp + 1);
				last = tmp + 1;
			}
			tmp += (n - 1);
		}
		if (m + 1 >= last) vec.push_back(last + n - 1);
		cout << vec.size() << endl;
		for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		vector<int> vec;
		int tmp = 1;
		for (int i = 0; i < k; i++)	vec.push_back(tmp);
		tmp += (n - 1);
		while (tmp < n + m){
			vec.push_back(tmp);
			for (int i = 0; i < min(k - 1, n + m - tmp - 1); i++){
				vec.push_back(tmp + 1);
			}
			tmp += (n - 1);
		}
		cout << vec.size() << endl;
		for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		cout << (1 + (ceil)(m*1.0 / (n - 1)))*k << endl;
		int tmp = 1;
		for (int i = 0; i < k; i++){
			cout << tmp << " ";
		}
		tmp += (n - 1);
		while (tmp < n + m){
			cout << tmp << " ";
			for (int i = 0; i < k - 1; i++){
				cout << tmp + 1 << " ";
			}
			tmp += (n - 1);
		}
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
	int n, m, k;
	while (cin >> n >> m >> k){
		vector<int> vec;
		int tmp = 1, last;
		for (int i = 0; i < k; i++)	vec.push_back(tmp);
		last = tmp;
		tmp += (n - 1);
		while (tmp < n + m){
			if (tmp == vec[vec.size() - 1]) break;
			vec.push_back(tmp);
			last = tmp;
			for (int i = 0; i < k - 1; i++){
				vec.push_back(tmp + 1);
				last = tmp + 1;
			}
			if (m + 1 <= last) break;
			tmp += (n - 1);
		}
		if (m + 1 >= last) vec.push_back(last + n - 1);
		cout << vec.size() << endl;
		for (int i = 0; i < vec.size(); i++) cout << vec[i] << " ";
		cout << endl;
	}
}


//16:25
#include<iostream>
#include<cstdio>

using namespace std;
int n,m,k;
int a[2005];
int ans[2000005],cnt;
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	int sum=0;
	for(int i=1;i<=k;++i) ans[i]=1;
	cnt=k;
	sum=k;
	a[n+1]+=k;

	for(int i=2;i<=n+m;++i)
	{
		sum-=a[i];
		if(!sum)
		{
			ans[++cnt]=i-1;
			++a[i-1+n];
			++sum;
		}
		for(int j=sum+1;j<=k;++j)
		{
			ans[++cnt]=i;
			++a[i+n];
			++sum;
		}
	}
	sum-=a[n+m+1];
	if(!sum) ans[++cnt]=n+m;
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;++i)
	{
		printf("%d ",ans[i]);
	}
	return 0;
}//hello


#include<cstring>
#include<cstdio>
#include<algorithm>
#include<vector>
#define pb push_back
using namespace std;

const int N = 1010;
int n;
vector<int>g[N];

int Solve(int now, int l, int r) {
  //printf("solve %d %d %d\n", now, l, r);
  int res = 0;
  int x = 0, y = 0;
  for (int i = 1; i < (int)g[now].size(); ++i) {
    int cntl = 0, cntr = 0;
    while (x < (int)g[l].size() && g[l][x] < g[now][i - 1])
      ++x;
    while (y < (int)g[r].size() && g[r][y] < g[now][i - 1])
      ++y;
    while (x < (int)g[l].size() && g[l][x] < g[now][i])
      ++x, ++cntl;
    while (y < (int)g[r].size() && g[r][y] < g[now][i])
      ++y, ++cntr;
    res += (cntl != cntr);
    //if (cntl != cntr) printf("qwq %d\n", i);
  }
  //printf("%d %d\n", now, res);
  return res;
}

int main(void) {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int n0;
    scanf("%d", &n0);
    while (n0--) {
      int x;
      scanf("%d", &x);
      g[i].pb(x);
    }
    sort(g[i].begin(), g[i].end());
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    int l = (i == 1) ? n : i - 1;
    int r = (i == n) ? 1 : i + 1;
    ans += Solve(i, l, r);
  }
  printf("%d\n", ans);

  return 0;
}


#include<cstring>
#include<cstdio>
#include<algorithm>
#include<queue>
#define mp make_pair
#define pb push_back
using namespace std;

int n, m, k;
vector<int>ans;
queue<pair<int, int> >q;

int main(void) {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; ++i)
    q.push(mp(1, n)), ans.pb(1);
  int date = 1;
  while (date <= m + n) {
    int x = q.front().second;
    if (x > m + n) break;
    while (!q.empty() && q.front().second <= x)
      q.pop();
    if (q.empty()) {
      ans.pb(x);
      q.push(mp(x, x + n - 1));
    }
    date = x + 1;
    if (date > m + n) break;
    int tmp = k - (int)q.size();
    while (tmp--) {
      ans.pb(date);
      q.push(mp(date, date + n - 1));
    }
  }
  printf("%d\n", (int)ans.size());
  for (int i = 0; i < (int)ans.size(); ++i)
    printf("%d ", ans[i]);

  return 0;
}


/*
 *    Author: Vladislav Belov
 */
#include <bits/stdc++.h>
using namespace std; typedef long long ll; typedef long double ld; void solutionC();
int main()
{
    ios_base::sync_with_stdio(false);
#ifdef HOME
    freopen("C.in", "rt", stdin); clock_t start = clock();
#endif
    solutionC();
#ifdef HOME
    cerr.precision(3); cerr << endl << "Time: " << fixed << double( clock() - start ) / double(CLOCKS_PER_SEC) << endl;
#endif
    return EXIT_SUCCESS;
}

#define int ll

#define N 2048
int n, m, k, t[N], f[N];

void solve()
{
    memset(t, 0, sizeof(int) * N);
    vector<int> ans;
    for (int i = 0; i < n + m; ++i)
        f[i] = n + m + 3;
    for (int i = 0; i < k; ++i)
    {
        ans.push_back(0);
        for (int j = 0; j < n; ++j)
        {
            ++t[j];
            f[j] = 0;
        }
    }
    for (int i = n; i < n + m; ++i)
    {
        if (f[i] >= i)
        {
            ans.push_back(i - 1);
            for (int j = i - 1; j < i - 1 + n; ++j)
            {
                ++t[j];
                f[j] = i - 1;
            }
        }
        while (t[i] < k)
        {
            ans.push_back(i);
            for (int j = i; j < i + n; ++j)
            {
                ++t[j];
                f[j] = i - 1;
            }
            ++t[i];
        }
    }
    if (f[n + m] >= n + m)
        ans.push_back(n + m - 1);
    cout << ans.size() << endl;
    for (int i: ans)
        cout << i + 1 << " ";
    cout << endl;
}

void solutionC()
{
    for (;cin >> n >> m >> k;)
    {
        solve();
        cerr << endl;
    }
}


/*
 *    Author: Vladislav Belov
 */
#include <bits/stdc++.h>
using namespace std; typedef long long ll; typedef long double ld; void solutionC();
int main()
{
    ios_base::sync_with_stdio(false);
#ifdef HOME
    freopen("C.in", "rt", stdin); clock_t start = clock();
#endif
    solutionC();
#ifdef HOME
    cerr.precision(3); cerr << endl << "Time: " << fixed << double( clock() - start ) / double(CLOCKS_PER_SEC) << endl;
#endif
    return EXIT_SUCCESS;
}

#define int ll

#define N 2048
int n, m, k;

void solve()
{
    vector<int> ans;
    queue<int> q;
    for (int i = 0; i < k; ++i)
    {
        ans.push_back(0);
        q.push(0);
    }
    for (int i = n; i < n + m; ++i)
    {
        while (!q.empty() && i - q.front() >= n)
            q.pop();
        if (q.empty())
        {
            ans.push_back(i - 1);
            q.push(i - 1);
        }
        while (q.size() < k)
        {
            ans.push_back(i);
            q.push(i);
        }
    }
    if (q.empty())
        ans.push_back(n + m - 1);
    cout << ans.size() << endl;
    for (int i: ans)
        cout << i + 1 << " ";
    cout << endl;
}

void solutionC()
{
    for (;cin >> n >> m >> k;)
    {
        solve();
        cerr << endl;
    }
}


/*
 *    Author: Vladislav Belov
 */
#include <bits/stdc++.h>
using namespace std; typedef long long ll; typedef long double ld; void solutionC();
int main()
{
    ios_base::sync_with_stdio(false);
#ifdef HOME
    freopen("C.in", "rt", stdin); clock_t start = clock();
#endif
    solutionC();
#ifdef HOME
    cerr.precision(3); cerr << endl << "Time: " << fixed << double( clock() - start ) / double(CLOCKS_PER_SEC) << endl;
#endif
    return EXIT_SUCCESS;
}

#define int ll

#define N 2048
int n, m, k, t[N], f[N];

void solve()
{
    memset(t, 0, sizeof(int) * N);
    vector<int> ans;
    for (int i = 0; i <= n + m; ++i)
        f[i] = n + m + 3;
    for (int i = 0; i < k; ++i)
    {
        ans.push_back(0);
        for (int j = 0; j < n; ++j)
        {
            ++t[j];
            f[j] = 0;
        }
    }
    for (int i = n; i < n + m; ++i)
    {
        if (f[i] >= i)
        {
            ans.push_back(i - 1);
            for (int j = i - 1; j < i - 1 + n; ++j)
            {
                ++t[j];
                f[j] = i - 1;
            }
        }
        while (t[i] < k)
        {
            ans.push_back(i);
            for (int j = i; j < i + n; ++j)
            {
                ++t[j];
                f[j] = i - 1;
            }
        }
    }
    if (f[n + m] >= n + m)
        ans.push_back(n + m - 1);
    cout << ans.size() << endl;
    for (int i: ans)
        cout << i + 1 << " ";
    cout << endl;
}

void solutionC()
{
    for (;cin >> n >> m >> k;)
    {
        solve();
        cerr << endl;
    }
}


/*
 *    Author: Vladislav Belov
 */
#include <bits/stdc++.h>
using namespace std; typedef long long ll; typedef long double ld; void solutionC();
int main()
{
    ios_base::sync_with_stdio(false);
#ifdef HOME
    freopen("C.in", "rt", stdin); clock_t start = clock();
#endif
    solutionC();
#ifdef HOME
    cerr.precision(3); cerr << endl << "Time: " << fixed << double( clock() - start ) / double(CLOCKS_PER_SEC) << endl;
#endif
    return EXIT_SUCCESS;
}

#define int ll

#define N 2048
int n, m, k, t[N], f[N];

void solve()
{
    memset(t, 0, sizeof(int) * N);
    vector<int> ans;
    for (int i = 0; i <= n + m; ++i)
        f[i] = n + m + 3;
    for (int i = 0; i < k; ++i)
    {
        ans.push_back(0);
        for (int j = 0; j < n; ++j)
        {
            ++t[j];
            f[j] = 0;
        }
    }
    for (int i = n; i < n + m; ++i)
    {
        if (f[i] >= i)
        {
            ans.push_back(i - 1);
            for (int j = i - 1; j < i - 1 + n; ++j)
            {
                ++t[j];
                f[j] = i - 1;
            }
        }
        while (t[i] < k)
        {
            ans.push_back(i);
            for (int j = i; j < i + n; ++j)
            {
                ++t[j];
                f[j] = i - 1;
            }
            ++t[i];
        }
    }
    if (f[n + m] >= n + m)
        ans.push_back(n + m - 1);
    cout << ans.size() << endl;
    for (int i: ans)
        cout << i + 1 << " ";
    cout << endl;
}

void solutionC()
{
    for (;cin >> n >> m >> k;)
    {
        solve();
        cerr << endl;
    }
}


/*
 *    Author: Vladislav Belov
 */
#include <bits/stdc++.h>
using namespace std; typedef long long ll; typedef long double ld; void solutionC();
int main()
{
    ios_base::sync_with_stdio(false);
#ifdef HOME
    freopen("C.in", "rt", stdin); clock_t start = clock();
#endif
    solutionC();
#ifdef HOME
    cerr.precision(3); cerr << endl << "Time: " << fixed << double( clock() - start ) / double(CLOCKS_PER_SEC) << endl;
#endif
    return EXIT_SUCCESS;
}

#define int ll

#define N 2048
int n, m, k;

void solve()
{
    vector<int> ans;
    queue<int> q;
    for (int i = 0; i < k; ++i)
    {
        ans.push_back(0);
        q.push(0);
    }
    for (int i = n; i < n + m; ++i)
    {
        while (!q.empty() && i - q.front() >= n)
            q.pop();
        if (q.empty())
        {
            ans.push_back(i - 1);
            q.push(i - 1);
        }
        while (q.size() < k)
        {
            ans.push_back(i);
            q.push(i);
        }
    }
    while (!q.empty() && n + m - q.front() >= n)
        q.pop();
    if (q.empty())
        ans.push_back(n + m - 1);
    cout << ans.size() << endl;
    for (int i: ans)
        cout << i + 1 << " ";
    cout << endl;
}

void solutionC()
{
    for (;cin >> n >> m >> k;)
    {
        solve();
        cerr << endl;
    }
}


#include <bits/stdc++.h>
#define MAX 1000000007
#define pb push_back
#define mp make_pair
#define FOR(n) for(i=0;i<n;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define reps(i,a,b) for(i=a;i<=b;i++)
#define swap(a,b) T=a,a=b,b=T
#define ll long long int
#define ff first.first
#define ss first.second
#define pii pair< ll,ll >
#define piii pair< pii,ll >
#define que queue<int>
#define s(t) scanf("%I64d",&t)
#define p(t) printf("%I64d\n",t)
using namespace std;

int main()
{
    ll i,j,k,l,t,T,f,p,ans,cnt,par,ele,r1,r2,tmp,m,n;
    s(n);
    s(m);
    s(k);
    cnt=k;
    if(m<n){
        cnt+=k;
    }
    else{
        cnt+=k+1;
    }
    if(m==n) cnt+=(k==1);
    if(m==n-1 && k==1){
        cnt+=1;
    }
    p(cnt);
    FOR(k) printf("1 ");
    printf("%I64d ",n);
    FOR(k-1) printf("%I64d ",n+1);
    if(m==n || (m==n-1 && k==1)){
       printf("%I64d ",2*n-(k==1));
    }
    if(m==2 && n==2 &&k==1) printf("%I64d ",2*n);

    return 0;
}


#include <iostream>
using namespace std;
int main()
{

	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	int t;cin>>t;
	while(t--)
	{
		int n,k;
		cin>>n>>k;
		uint64_t ans=n-(k-1)*(k-1);
		ans&1 && ans>0 ?cout<<"YES"<<endl:cout<<"NO"<<endl;
	}

	return 0;
}


#include<iostream>
using namespace std;
typedef long long ll;
int main()
{
//    freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
    int t;cin>>t;
    while(t--)
    {
        ll n,k;cin>>n>>k;
        //cout<<sizeof(ll)<<endl;
        ll rem=n-k*k;
        if(rem==0 || rem%2==0 )
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
           int t;cin>>t;
           while(t--)
           {
                      long n,k;cin>>n>>k;
                      if(n%2==0 &&k%2!=0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else if(n%2!=0 &&k%2==0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else{
                                 if(n>=k*k){
                                            cout<<"YES"<<endl;
                                 }
                                 else{
                                            cout<<"NO"<<endl;
                                 }
                      }
           }
}


#include <iostream>
#define ll long long
using namespace std;
void merge()
{

}

int main()
{
  // freopen("output.txt","w",stdout);
  // freopen("input.txt","r",stdin);
  int t;cin>>t;
  while(t--)
  {
    ll n,k;cin>>n>>k;
    ll total=n;ll j=1;
  for(int i=0;i<k;i++){
    total=total-j;
    j+=2;

  }
  if(total%2!=0)
     cout<<"NO"<<endl;
  else
    cout<<"YES"<<endl;

  }

}


#include <iostream>
#define ll long long
using namespace std;
int main()
{
  // freopen("output.txt","w",stdout);
  // freopen("input.txt","r",stdin);
  int t;cin>>t;
  while(t--)
  {
    ll n,k;cin>>n>>k;
    ll total=n;ll j=1;
  for(int i=0;i<k;i++){
    total=total-j;
    if(total<0){
      cout<<"NO"<<endl;
      return 0;
    }
    j+=2;

  }
  if(total>0)
  {
    if(total%2==0)
       cout<<"YES"<<endl;
    else
       cout<<"NO"<<endl;
  }
  else
    cout<<"NO"<<endl;

  }

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve(){
           ll n,k;cin>>n>>k;ll steps=1;
           ll i=1;ll sum=0;
           while(steps<k){
                      sum+=i;
                      i+=2;steps++;
           }
           if((n-sum)%2!=0 && (n-sum >i)){
                      cout<<"YES"<<endl;
           }
           else{
                      cout<<"NO"<<endl;
           }
}
int main(){
	       int n;cin>>n;
	       while(n--)
            solve();
}


#include<iostream>
#define ll long long
using namespace std;
int main()
{
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  int t;cin>>t;
  while(t--)
  {
    ll n,k;cin>>n>>k;
    ll i=1;
    ll moves=1;
    ll sum=(k-1)*(k-1);
    if((n-sum)%2!=0 && (n-sum)>0)
       cout<<"YES"<<endl;
    else
      cout<<"NO"<<endl;
  }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;cin>>t;
    while(t--)
    {
        int n,k;cin>>n>>k;
        if(n%2==0)
        {
            if(k%2!=0)
            {
                cout<<"NO"<<endl;
                break;
            }
            else{
                if(n>=(k*k))
                {
                    cout<<"YES"<<endl;
                }
                else{
                    cout<<"NO"<<endl;
                }
            }
        }
        else if(n%2!=0){
            if(k%2==0)
            {
                cout<<"NO"<<endl;
                break;
            }
            else{
                if(n>=(k*k))
                {
                    cout<<"YES"<<endl;
                }
                else{
                    cout<<"NO"<<endl;
                }
            }

        }
        else{

        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;cin>>t;
    while(t--)
    {
        int n,k;cin>>n>>k;
        if(n%2==0)
        {
            if(k%2!=0)
            {
                cout<<"NO"<<endl;
                break;
            }
            else{
                if(n>=(k*k))
                {
                    cout<<"YES"<<endl;
                }
                else{
                    cout<<"NO"<<endl;
                }
            }
        }
        else if(n%2!=0){
            if(k%2==0)
            {
                cout<<"NO"<<endl;
                break;
            }
            else{
                if((n>=(k*k))
                {
                    cout<<"YES"<<endl;
                }
                else{
                    cout<<"NO"<<endl;
                }
            }

        }
        else{

        }
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
           int t;cin>>t;
           while(t--)
           {
                      long n,k;cin>>n>>k;
                      if(n%2==0 && k%2!=0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else if(n%2!=0 && k%2==0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else{
                                 if(n<k*k)
                                 {
                                            cout<<"NO"<<endl;
                                 }
                                else{

                                           cout<<"YES"<<endl;
                                }
                      }

           }

}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve(){
           ll n,k;cin>>n>>k;ll steps=1;
           ll i=1;ll sum=0;
           while(steps<k){
                      sum+=i;
                      i+=2;steps++;
           }
           if((n-sum)%2!=0){
                      cout<<"YES"<<endl;
           }
           else{
                      cout<<"NO"<<endl;
           }
}
int main(){
	       int n;cin>>n;
	       while(n--)
            solve();
}


#include<bits/stdc++.h>
using namespace std
int main()
{
           int t;cin>>t;
           while(t--)
           {
                      int n,k;cin>>n>>k;
                      if(n%2==0 && k%2!=0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else if(n%2!=0 && k%2==0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else{
                                 if(n<k*k)
                                 {
                                            cout<<"NO"<<endl;
                                 }
                                 else{
                                            cout<<"YES"<<endl;
                                 }
                      }

           }

}


#include<iostream>
using namespace std;
typedef long long ll;
int main()
{
//    freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
    int t;cin>>t;
    while(t--)
    {
        ll n,k;cin>>n>>k;
        //cout<<sizeof(ll)<<endl;
        ll rem=n-k*k;
        if((rem>0 || rem==0) && rem%2==0)
            cout<<"YES"<<endl;
        else
            cout<<"NO"<<endl;

    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
           int t;cin>>t;
           while(t--)
           {
                      int n,k;cin>>n>>k;
                      if(n%2==0 && k%2!=0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else if(n%2!=0 && k%2==0)
                      {
                                 cout<<"NO"<<endl;
                      }
                      else{
                                 if(n<k*k)
                                 {
                                            cout<<"NO"<<endl;
                                 }
                                 else{
                                            cout<<"YES"<<endl;
                                 }
                      }

           }

}


#include <iostream>
#define ll long long
using namespace std;

int main()
{
  freopen("output.txt","w",stdout);
  freopen("input.txt","r",stdin);
  int t;cin>>t;
  while(t--)
  {
    ll n,k;cin>>n>>k;
    ll total=n;ll j=1;
  for(int i=0;i<k;i++){
    total=total-j;
    j+=2;

  }
  if(total>0)
  {
    if(total%2==0)
       cout<<"YES"<<endl;
    else
       cout<<"NO"<<endl;
  }
  else
    cout<<"NO"<<endl;

  }

}


#include <iostream>
#define ll long long
using namespace std;

int main()
{
  // freopen("output.txt","w",stdout);
  // freopen("input.txt","r",stdin);
  int t;cin>>t;
  while(t--)
  {
    ll n,k;cin>>n>>k;
    ll total=n;ll j=1;
  for(int i=0;i<k;i++){
    total=total-j;
    j+=2;

  }
  if(total>0)
  {
    if(total%2==0)
       cout<<"YES"<<endl;
    else
       cout<<"NO"<<endl;
  }
  else
    cout<<"NO"<<endl;

  }

}


#include<iostream>
#define ll long long
using namespace std;
int main()
{

    int t;cin>>t;
    while(t--)
    {
        ll n,k;cin>>n>>k;
        ll rem=n-(k-1)*(k-1);
        if( rem%2==0)
        {
            if(rem>0)
             cout<<"NO"<<endl;
            else
                cout<<"NO"<<endl;
        }
        else
            cout<<"YES"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;cin>>t;
    while(t--)
    {
        int n,k;cin>>n>>k;
        if(n%2==0)
        {
            if(k%2!=0)
            {
                cout<<"NO"<<endl;
                break;
            }
            else{
                if((n-k)/2>=(k*k))
                {
                    cout<<"YES"<<endl;
                }
                else{
                    cout<<"NO"<<endl;
                }
            }
        }
        else if(n%2!=0){
            if(k%2==0)
            {
                cout<<"NO"<<endl;
                break;
            }
            else{
                if((n-k)/2>(k*k))
                {
                    cout<<"YES"<<endl;
                }
                else{
                    cout<<"NO"<<endl;
                }
            }

        }
        else{

        }
    }
}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;

		if(n / k >= k)
		{
			cout << "YES\n";
			continue;
		}

		 else cout << "NO\n";
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;

		if(n / k >= k && n % k == 0)
		{
			cout << "YES\n";
			continue;
		}

		 else cout << "NO\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if(k > 3 && k == 1 || k < n)   cout << "NO\n";
	    else	if(n % k  == 0 && )	cout << "YES\n";
		else	cout << "NO\n";
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;
		n = n / k;
		if(n * k == x)
		{
			cout << "YES\n";
			continue;
		}

		 else cout << "NO\n";
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;
		n = n / k;
		if(n * k == x && x - k >= 2)
		{
			cout << "YES\n";
			continue;
		}

		 else cout << "NO\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if(k > 3 && k == 1 || k >= n)   cout << "NO\n";
	    else	if(n % k  == 0 && k <= n - k)	cout << "YES\n";
		else	cout << "NO\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if(k > 3 && k == 1)   cout << "NO\n";
	    else	if(n % k  == 0)	cout << "YES\n";
		else	cout << "NO\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if(n % k  &&(n - k ) % 2 )
			cout << "NO\n";
		else
			cout << "YES\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if(k > 3 && k == 1 || k >= n)   cout << "NO\n";
	    else	if(n % k  == 0 && k < n)	cout << "YES\n";
		else	cout << "NO\n";
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;
		if(n == 3 && k =1 ){
		    cout  << "YES\n";
		    continue;
		}
		if(n & 1 && !(k & 1) || !(n & 1) && (k & 1))
		{
			cout << "NO\n";
			continue;
		}

		 else cout << "YES\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if ((n % 2 == 0 && k % 2 == 0 && n %k == 0)|| (n % 2 != 0 && k % 2 != 0 && n % k == 0))
	//	if((n - k ) % 2 == 0)
			cout << "YES\n";
		else
			cout << "NO\n";
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;
		if (n & 1 && k == 1) {
			cout << "YES\n";
			continue;
		}
		if(n % k))
		{
			cout << "NO\n";
			continue;
		}

		 else cout << "YES\n";
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;
		if(n == 3 && k == 1 ){
		    cout  << "YES\n";
		    continue;
		}
		if(n & 1 && !(k & 1) || !(n & 1) && (k & 1))
		{
			cout << "NO\n";
			continue;
		}

		 else cout << "YES\n";
	}

}


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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("in", "r", stdin);
	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		cout << ((n >= k * k && !(n - k & 1)) ? "YES\n" : "NO\n");
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		if (n == 3 && k == 1) {
			cout << "YES\n";
			continue;
		}
		if (k % 2)
			cout << "NO\n";
		else cout << "YES\n";
	}

}


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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("in", "r", stdin);
	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		cout << ((n < k * k || (n - k & 1)) ? "NO\n" : "YES\n");
	}

}


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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	//freopen("in", "r", stdin);
	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		cout << ((n >= (ll)k * k && !((n - k) & 1)) ? "YES\n" : "NO\n");
	}

}


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

int main() {

	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		int x = n;
		if (n & 1 && k == 1) {
			cout << "YES\n";
			continue;
		}
		if(n % k)
		{
			cout << "NO\n";
			continue;
		}

		 else cout << "YES\n";
	}

}


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

int main() {
	int x;
	cin >> x;
	while (x--) {
		int n, k;
		cin >> n >> k;
		if(k > 3 && k == 1)   cout << "NO\n";
	    else	if(n % k  == 0 && k <= n - k)	cout << "YES\n";
		else	cout << "NO\n";
	}

}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000+10;
const int M = 1e7+10;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int sum[M];
int l;
void Init()
{
    sum[0] = 0;
    l = 1;
    for ( int i=1; i; i+=2 )
    {
        sum[l] = sum[l-1]+i;
        if ( sum[l] >= M ) break;
        l++;
    }
}

int main()
{
    Init();
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {
            if ( k>l ) cout << "NO" << endl;
            else if ( sum[k]<=x ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
        else cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1000+10;
const int M = 50002;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int main()
{
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {
            if ( k<=x ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000+10;
const int M = 1e7+10;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int sum[M];
int l;
void Init()
{
    sum[0] = 0;
    l = 1;
    for ( int i=1; i; i+=2 )
    {
        sum[l] = sum[l-1]+i;
        l++;
        if ( sum[l] >= M ) break;
    }
}

int main()
{
    Init();
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {
            //cout << sum[k] << " " << x << endl;
            if ( sum[k]<=x ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
        else cout << "NO" << endl;

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000+10;
const int M = 1e7+10;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int sum[M];
int l;
void Init()
{
    sum[0] = 0;
    l = 1;
    for ( int i=1; i; i+=2 )
    {
        sum[l] = sum[l-1]+i;
        l++;
        if ( sum[l] >= M ) break;
    }
}

int main()
{
    Init();
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {
            if ( k>l ) cout << "NO" << endl;
            else if ( sum[k]<=x ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
        else cout << "NO" << endl;

    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1000+10;
const int M = 50002;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int main()
{
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {
            if ( k<=x ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
        else cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(x) cout << #x << ": " << x << endl
#define debugs  cout<<"ssssss"<<endl
#define debugx  cout<<"xxxxxx"<<endl
#define __count(x) __builtin_popcount(x)
//返回二进制下有多少个1  int范围 后加l是 unsigned long 加ll是 unsigned long long
#define __ctz(x) __builtin_ctz(x)           //返回二进制下末尾有几个零
#define __ffs(x) __builtin_ffs(x)           //返回二进制下最后一个1的位置，从1开始
#define __max_elenment *max_element		   //返回一个数组的最大值,参数是数组的起始位置和结束位置
#define __min_elenment *min_element

using namespace std;
int t;
int n,k;
int main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>k;
        int sum=0;
        if(n&1)
        {
            if(k==3||k==1)
                {cout<<"YES"<<endl;continue;}
            else
                {cout<<"NO"<<endl;continue;}
        }
        else {
                if(n==2)
                {
                    puts("NO");
                    continue;
                }
           if(k==2&&n!=2)
           {
               puts("YES");
               continue;
           }
           int len=0;
           for(int i=1;i<n;i+=2)
           {
               sum+=i;
               len++;
               if(sum>n)
               {
                   break;
               }
           }
           len-=1;
           if(k>len||len&1)
           {
               puts("NO");
           }
           else {
            puts("YES");
           }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000+10;
const int M = 50002;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int main()
{
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {
            int s = x/2 + (x&1);
            if ( k<=s ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
        else cout << "NO" << endl;

    }
    return 0;
}


#include <bits/stdc++.h>

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(x) cout << #x << ": " << x << endl
#define debugs  cout<<"ssssss"<<endl
#define debugx  cout<<"xxxxxx"<<endl
#define __count(x) __builtin_popcount(x)
//返回二进制下有多少个1  int范围 后加l是 unsigned long 加ll是 unsigned long long
#define __ctz(x) __builtin_ctz(x)           //返回二进制下末尾有几个零
#define __ffs(x) __builtin_ffs(x)           //返回二进制下最后一个1的位置，从1开始
#define __max_elenment *max_element		   //返回一个数组的最大值,参数是数组的起始位置和结束位置
#define __min_elenment *min_element

using namespace std;
int t;
int n,k;
int main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>k;
        int sum=0;
        if(n&1)
        {
            if(k==3||k==1)
                cout<<"YES"<<endl;
            else
                cout<<"NO"<<endl;
        }
        else {
                if(n==2)
                {
                    puts("NO");
                }
           if(k==2&&n!=2)
           {
               puts("YES");
           }
           int len=0;
           for(int i=1;i<n;i+=2)
           {
               sum+=i;
               len++;
               if(sum>n)
               {
                   break;
               }
           }
           len-=1;
           if(k>len)
           {
               puts("NO");
           }
           else {
            puts("YES");
           }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(x) cout << #x << ": " << x << endl
#define debugs  cout<<"ssssss"<<endl
#define debugx  cout<<"xxxxxx"<<endl
#define __count(x) __builtin_popcount(x)
//返回二进制下有多少个1  int范围 后加l是 unsigned long 加ll是 unsigned long long
#define __ctz(x) __builtin_ctz(x)           //返回二进制下末尾有几个零
#define __ffs(x) __builtin_ffs(x)           //返回二进制下最后一个1的位置，从1开始
#define __max_elenment *max_element		   //返回一个数组的最大值,参数是数组的起始位置和结束位置
#define __min_elenment *min_element

using namespace std;
long long t,n,k;

int main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>k;
        if(n<k*k*1ll)  {
            puts("NO");
            continue;
        }
        if(n&1)
        {
            if(k%2==0)
                puts("NO");
            else {
                puts("YES");
            }
        }
        else {

            if(k%2==0)
               puts("YES");
            else {
                puts("NO");
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(x) cout << #x << ": " << x << endl
#define debugs  cout<<"ssssss"<<endl
#define debugx  cout<<"xxxxxx"<<endl
#define __count(x) __builtin_popcount(x)
//返回二进制下有多少个1  int范围 后加l是 unsigned long 加ll是 unsigned long long
#define __ctz(x) __builtin_ctz(x)           //返回二进制下末尾有几个零
#define __ffs(x) __builtin_ffs(x)           //返回二进制下最后一个1的位置，从1开始
#define __max_elenment *max_element		   //返回一个数组的最大值,参数是数组的起始位置和结束位置
#define __min_elenment *min_element

using namespace std;
int t,n,k;

int main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>k;
        if(n<k*k)  {
            puts("NO");
            continue;
        }
        if(n&1)
        {
            if(k%2==0)
                puts("NO");
            else {
                puts("YES");
            }
        }
        else {

            if(k%2==0)
               puts("YES");
            else {
                puts("NO");
            }
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 2000+10;
const int M = 1e7+10;
const int INF = 0x7fffffff;
const int mod = 1e9+7;

int sum[M];
int l;
void Init()
{
    sum[0] = l = 0;
    for ( int i=1; i; i+=2 )
    {
        sum[l] = sum[l-1]+i;
        l++;
        if ( sum[l] >= M ) break;
    }
}
int main()
{
    Init();
    int T;
    cin >> T;
    while ( T-- )
    {
        int x, k;
        cin >> x >> k;
        if ( ( (x&1) && (k&1) ) || ( !(x&1) && !(k&1) ) )
        {

            if ( sum[k]<=x ) cout << "YES" << endl;
            else  cout << "NO" << endl;
        }
        else cout << "NO" << endl;

    }
    return 0;
}


/***
*  author  :_shamim
*  created : 09.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;
		for(i=0,j=1;i<k-1;i++,j+=2){
			x -= j;
		}
		if(x%2==0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin>>t;

	while(t--){
		ll N,k,count =0;

		cin>>N>>k;
		for(i=1;count!=k-1;i+=2){
			N -= i;
			count++;
		}
		if(N%2!=0 && N>0){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}

	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		//cout<<temp<<endl;

		else if(k*k<=x && x%2== k%2){
			cout<<"YES"<<endl;
		}

		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin>>t;

	while(t--){
		ll N,k,count =0,bad_dibo;

		cin>>N>>k;
		if(N%2==0 && k%2!=0){
			cout<<"NO"<<endl;
		}
		else{
			for(i=1;count<k-1;i+=2){
				N -= i;
				count++;
			}
			if(N%2!=0 && N>0 && N!=0){
				cout<<"YES"<<endl;
			}

			else{
				cout<<"NO"<<endl;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;

	cin>>t;
	while(t--){
		ll N,k,count=0;

		cin>>N>>k;
		for(i=1;count<=k-1;i+=2){
			N-=i;
			count++;
		}
		if(N%2!=0 || (N%2!=0 && k==1) || count<k){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;

	cin>>t;
	while(t--){
		ll N,k,count=0;

		cin>>N>>k;
		for(i=1;count<=k-1;i+=2){
			N-=i;
			count++;
		}
		if(N%2!=0 || (N%2!=0 && k==1)){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		//cout<<temp<<endl;
		if(x<=k){
			cout<<"NO"<<endl;
		}
		else if(k*k>x){
			cout<<"NO"<<endl;
		}
		else if(x%2==0 && k%2!=0){
			cout<<"NO"<<endl;
		}
		else if(temp %2 ==0 || temp<0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;

	cin>>t;
	while(t--){
		ll N,k,count=0;

		cin>>N>>k;
		if(N%2==0 && k%2==0 && k<N){
			cout<<"YES"<<endl;
		}
		else{
			count<<"No"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		//cout<<temp<<endl;

		if(k*k<=x && x%2== k%2){
			cout<<"YES"<<endl;
		}

		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin>>t;

	while(t--){
		ll N,k,count =0,bad_dibo;

		cin>>N>>k;
		if(N%2!=0 && k==1){
			cout<<"YES"<<endl;
		}
		else if(k==1 && N%2==0){
			cout<<"NO"<<endl;
		}
		else if(N%2==0 && k%2!=0){
			cout<<"NO"<<endl;
		}
		else{
			for(i=1;count<k-1;i+=2){
				N -= i;
				count++;
			}
			if(N%2!=0 && N>0 && N!=0){
				cout<<"YES"<<endl;
			}

			else{
				cout<<"NO"<<endl;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;

	cin>>t;
	while(t--){
		ll N,k,count=0;

		cin>>N>>k;
		for(i=1;i<=N,count<=k-1;i+=2){
			N-=i;
			count++;
		}
		if(N<=0||N%2!=0 || (N%2!=0 && k==1) || count<k){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin>>t;

	while(t--){
		ll N,k,count =0;

		cin>>N>>k;
		for(i=1;count<k-1;i+=2){
			N -= i;
			count++;
		}
		if(N%2!=0 && N>0){
			cout<<"YES"<<endl;
		}

		else{
			cout<<"NO"<<endl;
		}

	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;

	cin>>t;
	while(t--){
		ll N,k,count=0;

		cin>>N>>k;
		if(k==1||N%2==0 && k%2==0 && k<N){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		//cout<<temp<<endl;
		if(x<=k){
			cout<<"NO"<<endl;
		}
		else if(x<=0){
			cout<<"NO"<<endl;
		}
		else if(x%2==0 && k%2!=0){
			cout<<"NO"<<endl;
		}
		else if(temp %2 ==0 || temp<0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		if(x<=k){
			cout<<"NO"<<endl;
		}
		else if(temp %2 ==0 || temp<=0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin>>t;

	while(t--){
		ll N,k,count =0,bad_dibo;

		cin>>N>>k;
		if(N%2==0 && k%2!=0){
			cout<<"NO"<<endl;
		}
		else{
			for(i=1;count<k-1;i+=2){
				N -= i;
				count++;
			}
			if(N%2!=0 && N>0){
				cout<<"YES"<<endl;
			}

			else{
				cout<<"NO"<<endl;
			}
		}
	}
	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		if(temp %2 ==0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <bits/stdc++.h>
#include <bitset>
#include <set>
#include <stdio.h>

#define loop(i,n)   for(i=0;i<n;i++)
#define ll long long
#define MAX 1000000007

ll i,j,k,cnt,sum;

using namespace std;

//Code Starts Here//
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;

	cin>>t;
	while(t--){
		ll N,k,count=0;

		cin>>N>>k;
		for(i=1;i<=N,count<=k-1;i+=2){
			N-=i;
			count++;
		}
		if(N%2!=0 || (N%2!=0 && k==1) || count<k){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		if(x<=k){
			cout<<"NO"<<endl;
		}
		else if(temp %2 ==0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		if(k*k<=x && x%2== k%2){
			cout<<"YES"<<endl;
		}

		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 09.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;
		temp = x;
		for(i=0,j=1;i<k-1;i++,j+=2){
			temp -= j;
		}
		if(k == 1 && x == 1){
			cout<<"YES"<<endl;
		}
		else if(k<=x){
			cout<<"NO"<<endl;
		}
		else if(temp%2==1){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}

	return 0;
}


/***
*  author  :_shamim
*  created : 06.05.2020
*
***/

#include <iostream>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <list>
#include <set>
#include <queue>
#include <iterator>
#include <bitset>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#define ll             long long
#define _              ios_base::sync_with_stdio(0);cin.tie(0);
#define loop           for(i=0;i<n;i++)
#define pb             push_back
#define tc()           int t;cin>>t;while(t--)
#define MAX            10000000

using namespace std;

ll i,j,temp;

int main()
{_

	tc(){
		ll x,k;
		cin>>x>>k;

		temp = x;

		for(j=0,i=1;j<k-1;j++,i+=2){
			temp -= i;
		}
		cout<<temp<<endl;
		if(x<=k){
			cout<<"NO"<<endl;
		}
		else if(x<=0){
			cout<<"NO"<<endl;
		}
		else if(x%2==0 && k%2!=0){
			cout<<"NO"<<endl;
		}
		else if(temp %2 ==0 || temp<0){
			cout<<"NO"<<endl;
		}
		else{
			cout<<"YES"<<endl;
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int t;
    cin>>t;
    while(t--)
    {
        long long int n,k;
      cin>>n>>k;
       if(n%2!=0&&k>1)
        cout<<"NO"<<endl;
        else if(n%2!=0&&k==1)
        cout<<"YES";
      else if(n%k==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int t;
    cin>>t;
    while(t--)
    { long long int sum=0,a;
        long long int n,k;
        cin>>n>>k;
       for(long long i=1;i<=k;i++)
       {

           a=2*i-1;
           sum=sum+a;
       }if(sum==n)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
        a=0;
        sum=0;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int t;
    cin>>t;
    while(t--)
    {
        long long int n,k;
        cin>>n>>k;
        if(n%k==0)
        cout"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
}


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

int main() {
int t;
cin>>t;
while(t--)
{
    int n,k;
    cin>>n>>k;
    if(n%2==0)
    {
        if(k%2==0)
        {
            if(n>=(k*k))
            cout<<"YES"<<'\n';
        }
            else
            cout<<"NO"<<'\n';

    }
    else
    {
            if(k%2!=0)
            {
                if(n>=(k*k))
                cout<<"YES"<<'\n';
            }
            else
            cout<<"NO"<<'\n';

    }

}
}


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

int main()
 {
ll t;
cin>>t;
while(t--)
{
    ll n,k;
    cin>>n>>k;
    if(n%2==0)
    {
        if(k%2==0)
        {
            if(n>=pow(2,k))
            cout<<"YES"<<'\n';
        }
            else
            cout<<"NO"<<'\n';

    }
    else
    {
            if(k%2!=0)
            {
                if(n>=(k*k))
                cout<<"YES"<<'\n';
            }
            else
            cout<<"NO"<<'\n';

    }

}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int t;
    cin>>t;
    while(t--)
    {
        long long int n,k;
      cin>>n>>k;
       if(n%2!=0&&k>1)
        cout<<"NO"<<endl;
      else if(n%k==0)
        cout<<"YES"<<endl;

        else
        cout<<"NO"<<endl;
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int t;
    cin>>t;
    while(t--)
    {
        long long int n,k;
        cin>>n>>k;
        if(n%k==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }
}


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

int main() {
ll t;
cin>>t;
while(t--)
{
    ll n,k;
    cin>>n>>k;
    if(n%2==0)
    {
        if(k%2==0)
        {
            if(n>=(k*k))
            cout<<"YES"<<'\n';
        }
            else
            cout<<"NO"<<'\n';

    }
    else
    {
            if(k%2!=0)
            {
                if(n>=(k*k))
                cout<<"YES"<<'\n';
            }
            else
            cout<<"NO"<<'\n';

    }

}
}


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

int main() {
ll t;
cin>>t;
while(t--)
{
    ll n,k;
    cin>>n>>k;
    if(n%2==0)
    {
        if(k%2==0)
        {
            if(n>=(k*k))
            cout<<"YES"<<'\n';
            else
            cout<<"NO"<<'\n';
        }
            else
            cout<<"NO"<<'\n';

    }
    else
    {
            if(k%2!=0)
            {
                if(n>=(k*k))
                cout<<"YES"<<'\n';
                else
            cout<<"NO"<<'\n';
            }
            else
            cout<<"NO"<<'\n';

    }

}
}


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

int main() {
ll t;
cin>>t;
while(t--)
{
    ll n,k;
    cin>>n>>k;
    if(n%2==0)
    {
        if(k%2==0)
        {
            if(n>=(pow(2,k))
            cout<<"YES"<<'\n';
            else
            cout<<"NO"<<'\n';
        }
            else
            cout<<"NO"<<'\n';

    }
    else
    {
            if(k%2!=0)
            {
                if(n>=(k*k))
                cout<<"YES"<<'\n';
                else
            cout<<"NO"<<'\n';
            }
            else
            cout<<"NO"<<'\n';

    }

}
}


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

int main() {
ll t;
cin>>t;
while(t--)
{
    ll n,k;
    cin>>n>>k;
    if(n%2==0)
    {
        if(k%2==0)
        {
            if(n>=(pow(2,k)))
            cout<<"YES"<<'\n';
            else
            cout<<"NO"<<'\n';
        }
            else
            cout<<"NO"<<'\n';

    }
    else
    {
            if(k%2!=0)
            {
                if(n>=(k*k))
                cout<<"YES"<<'\n';
                else
            cout<<"NO"<<'\n';
            }
            else
            cout<<"NO"<<'\n';

    }

}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int t;
    cin>>t;
    while(t--)
    {
        long long int n,k;
      cin>>n>>k;
      if(n%2!=0&&k==1)
        cout<<"YES"<<endl;
      else if(n%2!=0&&k>1)
        cout<<"NO"<<endl;
      else if(n%k==0)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl;
    }

}


#include <iostream>
using namespace std;

int main() {
    int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0){
            cout<<"yes"<<endl;
        }else if(n%2!=0&&k%2!=0){
            cout<<"yes"<<endl;
        }else{
            cout<<"no"<<endl;
        }

    }return 0;
}


#include <iostream>
using namespace std;

int main() {
    int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0&&n>=k^2){
            cout<<"YES"<<endl;
        }else if(n%2!=0&&k%2!=0&&n>=k^2){
            cout<<"yes"<<endl;
        }else if(n==1&&k==1){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }

    }return 0;
}


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

int main() {
    long long int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0&&n>=k*k){
            cout<<"YES"<<endl;
        }else if(n%2!=0&&k%2!=0&&n>=k*k){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
        return 0;
    }


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

int main() {
    long long int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0&&n>=k*k){
            cout<<"YES"<<endl;
        }else if(n%2!=0&&k%2!=0&&n>=k*k){
            cout<<"YES"<<endl;
        }else if(n==k==1){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
        return 0;
    }


#include <iostream>
using namespace std;

int main() {
    long long int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0&&n>=k*k){
            cout<<"YES"<<endl;
        }else if(n%2!=0&&k%2!=0&&n>=k*k){
            cout<<"YES"<<endl;
        }else if(n==k==1){
            cout<<"YES"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }
    }
        return 0;
    }


#include <iostream>
using namespace std;

int main() {
    int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0&&n>=k^2){
            cout<<"YES"<<endl;
        }else if(n%2!=0&&k%2!=0&&n>=k^2){
            cout<<"yes"<<endl;
        }
        else{
            cout<<"NO"<<endl;
        }

    }return 0;
}


#include <iostream>
using namespace std;

int main() {
    int t, n,k;
    cin>>t;
    for(int i=0;i<t;i++){
        cin>>n>>k;
        if(n%2==0&&k%2==0&&n>k){
            cout<<"yes"<<endl;
        }else if(n%2!=0&&k%2!=0&&n>k){
            cout<<"yes"<<endl;
        }else if(n==1&&k==1){
            cout<<"yes"<<endl;
        }
        else{
            cout<<"no"<<endl;
        }

    }return 0;
}