이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,tes,t,n,m,zx;
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>tes;
for(t=1; t<=tes; t++){
cin>>n>>m;
if(n<m){
swap(n,m);
zx=-1;
}else{
zx=1;
}
if(n%m==0){
cout<<n-1<<endl;
if(n!=1){
for(b=1; b<n; b++){
cout<<zx<<" ";
}
cout<<endl;
}
}else{
cout<<n<<endl;
for(b=1; b<=n; b++){
if(b%2==0) cout<<zx*1000000<<" "; else cout<<-zx*999999<<" ";
}
cout<<endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |