-
Notifications
You must be signed in to change notification settings - Fork 0
/
B.cpp
40 lines (39 loc) · 790 Bytes
/
B.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<bits/stdc++.h>
#include<string>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
fastio;
long long t,n,m,i;
cin>>t;
while(t--)
{
cin>>n>>m;
if(m<n)
{
cout<<"NO"<<"\n";
continue;
}
if(n%2==1)
{
cout<<"YES"<<"\n";
for(i=0;i<n-1;i++)
cout<<1<<" ";
cout<<m-n+1<<"\n";
}
else
{
if((m-n+2)%2!=0)
{
cout<<"NO"<<"\n";
continue;
}
cout<<"YES"<<"\n";
for(i=0;i<n-2;i++)
cout<<1<<" ";
cout<<(m-n+2)/2<<" "<<(m-n+2)/2<<"\n";
}
}
return 0;
}