#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
#define tlll tuple<ll,ll,ll>
const int big = 1e8;
void solve(){
int n,m;
cin>>n>>m;
int sign = -1;
if(m>n){
sign = 1;
swap(n,m);
}
if(n%2 == 0){
cout<<n-1<<'\n';
for(int i = 1;i<n;i++)cout<<(i&1?big*sign:-(big+1)*sign)<<' ';
cout<<'\n';
}
else{
cout<<n<<'\n';
for(int i = 1;i<=n;i++)cout<<(i&1?big*sign:-(big+1)*sign)<<' ';
cout<<'\n';
}
return;
}
int main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int t;cin>>t;
while(t--)solve();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
there is incorrect sequence |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Ok |
2 |
Correct |
0 ms |
348 KB |
Ok |
3 |
Correct |
1 ms |
504 KB |
Ok |
4 |
Correct |
0 ms |
348 KB |
Ok |
5 |
Correct |
1 ms |
348 KB |
Ok |
6 |
Correct |
1 ms |
456 KB |
Ok |
7 |
Correct |
6 ms |
1116 KB |
Ok |
8 |
Correct |
3 ms |
856 KB |
Ok |
9 |
Correct |
6 ms |
1372 KB |
Ok |
10 |
Correct |
4 ms |
856 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
there is incorrect sequence |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Jury has the better answer : jans = 5, pans = 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
there is incorrect sequence |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
there is incorrect sequence |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
there is incorrect sequence |
2 |
Halted |
0 ms |
0 KB |
- |