#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
for(;t;t--){
int n,m;
cin>>n>>m;
if(n==m){
cout<<n-1<<"\n";
for(int i=0;i<n-1;i++){
cout<<1<<" ";
}
cout<<"\n";
continue;
}
if(n%m==0){
cout<<n-1<<"\n";
for(int i=0;i<n-1;i++){
cout<<1<<" ";
}
cout<<"\n";
continue;
}
if(m%n==0){
cout<<m-1<<"\n";
for(int i=0;i<m-1;i++){
cout<<-1<<" ";
}
cout<<"\n";
continue;
}
if(n==2){
cout<<"3\n3 -4 2\n";
continue;
}
if(m==2){
cout<<"3\n-3 4 -2\n";
continue;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Ok |
2 |
Correct |
2 ms |
256 KB |
Ok |
3 |
Correct |
2 ms |
376 KB |
Ok |
4 |
Correct |
2 ms |
256 KB |
Ok |
5 |
Correct |
2 ms |
256 KB |
Ok |
6 |
Correct |
2 ms |
376 KB |
Ok |
7 |
Correct |
2 ms |
256 KB |
Ok |
8 |
Correct |
2 ms |
364 KB |
Ok |
9 |
Correct |
2 ms |
256 KB |
Ok |
10 |
Correct |
2 ms |
376 KB |
Ok |
11 |
Correct |
2 ms |
292 KB |
Ok |
12 |
Correct |
2 ms |
376 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Jury has the better answer : jans = 5, pans = 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Ok |
2 |
Correct |
2 ms |
256 KB |
Ok |
3 |
Incorrect |
2 ms |
256 KB |
Jury has the better answer : jans = 5, pans = 3 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Ok |
2 |
Correct |
2 ms |
256 KB |
Ok |
3 |
Correct |
2 ms |
376 KB |
Ok |
4 |
Correct |
2 ms |
256 KB |
Ok |
5 |
Correct |
2 ms |
256 KB |
Ok |
6 |
Correct |
2 ms |
376 KB |
Ok |
7 |
Correct |
2 ms |
256 KB |
Ok |
8 |
Correct |
2 ms |
364 KB |
Ok |
9 |
Correct |
2 ms |
256 KB |
Ok |
10 |
Correct |
2 ms |
376 KB |
Ok |
11 |
Correct |
2 ms |
292 KB |
Ok |
12 |
Correct |
2 ms |
376 KB |
Ok |
13 |
Correct |
2 ms |
256 KB |
Ok |
14 |
Correct |
2 ms |
256 KB |
Ok |
15 |
Incorrect |
2 ms |
256 KB |
Jury has the better answer : jans = 5, pans = 3 |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Ok |
2 |
Correct |
2 ms |
256 KB |
Ok |
3 |
Correct |
2 ms |
376 KB |
Ok |
4 |
Correct |
2 ms |
256 KB |
Ok |
5 |
Correct |
2 ms |
256 KB |
Ok |
6 |
Correct |
2 ms |
376 KB |
Ok |
7 |
Correct |
2 ms |
256 KB |
Ok |
8 |
Correct |
2 ms |
364 KB |
Ok |
9 |
Correct |
2 ms |
256 KB |
Ok |
10 |
Correct |
2 ms |
376 KB |
Ok |
11 |
Correct |
2 ms |
292 KB |
Ok |
12 |
Correct |
2 ms |
376 KB |
Ok |
13 |
Incorrect |
2 ms |
376 KB |
Jury has the better answer : jans = 5, pans = 3 |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Ok |
2 |
Correct |
2 ms |
256 KB |
Ok |
3 |
Correct |
2 ms |
376 KB |
Ok |
4 |
Correct |
2 ms |
256 KB |
Ok |
5 |
Correct |
2 ms |
256 KB |
Ok |
6 |
Correct |
2 ms |
376 KB |
Ok |
7 |
Correct |
2 ms |
256 KB |
Ok |
8 |
Correct |
2 ms |
364 KB |
Ok |
9 |
Correct |
2 ms |
256 KB |
Ok |
10 |
Correct |
2 ms |
376 KB |
Ok |
11 |
Correct |
2 ms |
292 KB |
Ok |
12 |
Correct |
2 ms |
376 KB |
Ok |
13 |
Incorrect |
2 ms |
376 KB |
Jury has the better answer : jans = 5, pans = 3 |
14 |
Halted |
0 ms |
0 KB |
- |