Submission #173339

#TimeUsernameProblemLanguageResultExecution timeMemory
173339LinusTorvaldsFanNice sequence (IZhO18_sequence)C++14
0 / 100
2 ms376 KiB
#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<<0<<"\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; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...