#include <bits/stdc++.h>
#define pb push_back
#define sz(v) (int)v.size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define x first
#define y second
#define int long long
#define nl "\n"
using namespace std;
typedef long long ll;
typedef pair<long long, long long> pll;
typedef pair <ll, ll> pii;
const int N = (int)5e4 + 7;
const int M = (int)7e6 + 7;
const ll MOD = (ll)1e9 + 7;
const int inf = (int)1e9 + 7;
const ll INF = (ll)3e18 + 7;
pii dir[] = {{-1, -1}, {1, 1}, {-1, 1}, {1, -1}};
int n, m;
void solve() {
cin >> n >> m;
cout << max(n, m) - 1 << nl;
if(n > m) {
for(int i = 1; i < n; ++i) cout << "1 ";
} else {
for(int i = 1; i < m; ++i) cout << "-1 ";
}
cout << nl;
}
signed main() {
ios_base::sync_with_stdio(NULL);
cin.tie(0);
cout.tie(0);
int test = 1;
cin >> test;
for(int i = 1; i <= test; ++i) {
//cout << "Case " << i << ": ";
solve();
}
return 0;
}
/*
3
3 1
2 3
1 1
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Ok |
2 |
Correct |
0 ms |
204 KB |
Ok |
3 |
Correct |
0 ms |
204 KB |
Ok |
4 |
Correct |
0 ms |
312 KB |
Ok |
5 |
Correct |
0 ms |
204 KB |
Ok |
6 |
Correct |
0 ms |
204 KB |
Ok |
7 |
Correct |
0 ms |
204 KB |
Ok |
8 |
Correct |
0 ms |
204 KB |
Ok |
9 |
Correct |
1 ms |
308 KB |
Ok |
10 |
Correct |
0 ms |
312 KB |
Ok |
11 |
Correct |
1 ms |
204 KB |
Ok |
12 |
Correct |
1 ms |
308 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Jury has the better answer : jans = 3, pans = 2 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Jury has the better answer : jans = 3, pans = 2 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Jury has the better answer : jans = 3, pans = 2 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Ok |
2 |
Correct |
0 ms |
204 KB |
Ok |
3 |
Correct |
0 ms |
204 KB |
Ok |
4 |
Correct |
0 ms |
312 KB |
Ok |
5 |
Correct |
0 ms |
204 KB |
Ok |
6 |
Correct |
0 ms |
204 KB |
Ok |
7 |
Correct |
0 ms |
204 KB |
Ok |
8 |
Correct |
0 ms |
204 KB |
Ok |
9 |
Correct |
1 ms |
308 KB |
Ok |
10 |
Correct |
0 ms |
312 KB |
Ok |
11 |
Correct |
1 ms |
204 KB |
Ok |
12 |
Correct |
1 ms |
308 KB |
Ok |
13 |
Incorrect |
0 ms |
204 KB |
Jury has the better answer : jans = 3, pans = 2 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Ok |
2 |
Correct |
0 ms |
204 KB |
Ok |
3 |
Correct |
0 ms |
204 KB |
Ok |
4 |
Correct |
0 ms |
312 KB |
Ok |
5 |
Correct |
0 ms |
204 KB |
Ok |
6 |
Correct |
0 ms |
204 KB |
Ok |
7 |
Correct |
0 ms |
204 KB |
Ok |
8 |
Correct |
0 ms |
204 KB |
Ok |
9 |
Correct |
1 ms |
308 KB |
Ok |
10 |
Correct |
0 ms |
312 KB |
Ok |
11 |
Correct |
1 ms |
204 KB |
Ok |
12 |
Correct |
1 ms |
308 KB |
Ok |
13 |
Incorrect |
0 ms |
204 KB |
Jury has the better answer : jans = 3, pans = 2 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Ok |
2 |
Correct |
0 ms |
204 KB |
Ok |
3 |
Correct |
0 ms |
204 KB |
Ok |
4 |
Correct |
0 ms |
312 KB |
Ok |
5 |
Correct |
0 ms |
204 KB |
Ok |
6 |
Correct |
0 ms |
204 KB |
Ok |
7 |
Correct |
0 ms |
204 KB |
Ok |
8 |
Correct |
0 ms |
204 KB |
Ok |
9 |
Correct |
1 ms |
308 KB |
Ok |
10 |
Correct |
0 ms |
312 KB |
Ok |
11 |
Correct |
1 ms |
204 KB |
Ok |
12 |
Correct |
1 ms |
308 KB |
Ok |
13 |
Incorrect |
0 ms |
204 KB |
Jury has the better answer : jans = 3, pans = 2 |
14 |
Halted |
0 ms |
0 KB |
- |