이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define ld long double
#define sqr(x) (x) * (x)
using namespace std;
using namespace __gnu_pbds;
int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // LOCAL
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for(int ii = 0; ii < t; ++ii)
    {
        int n, m;
        cin >> n >> m;
        if (max(n, m) % min(n, m) == 0)
        {
            cout << max(n, m) - 1 << '\n';
            if (n < m)
                for(int i = 0; i < max(n, m) - 1; ++i)
                    cout << -1 << ' ';
            else
                for(int i = 0; i < max(n, m) - 1; ++i)
                    cout << 1 << ' ';
            cout << '\n';
        }
        else
        {
            cout << max(n, m) << '\n';
            if (n < m)
                for(int i = 0; i < max(n, m); ++i)
                    if (i % 2 == 0)
                        cout << 2000 << ' ';
                    else
                        cout << -2001 << '\n';
            else
                for(int i = 0; i < max(n, m); ++i)
                    if (i % 2 == 0)
                        cout << -2000 << ' ';
                    else
                        cout << 2001 << '\n';
            cout << '\n';
        }
    }
    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... |