QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#99161#4883. Bayan Testingckiseki#AC ✓65ms5136kbC++201.8kb2023-04-21 13:38:062023-04-21 13:38:09

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-21 13:38:09]
  • 评测
  • 测评结果:AC
  • 用时:65ms
  • 内存:5136kb
  • [2023-04-21 13:38:06]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#ifdef CKISEKI
#define safe cerr << __PRETTY_FUNCTION__ << " line " << __LINE__ << " safe\n"
#define debug(a...) debug_(#a, a)
#define orange(a...) orange_(#a, a)
template <typename ...T>
void debug_(const char *s, T ...a) {
    cerr << "\e[1;32m(" << s << ") = (";
    int cnt = sizeof...(T);
    (..., (cerr << a << (--cnt ? ", " : ")\e[0m\n")));
}
template <typename I>
void orange_(const char * s, I L, I R) {
    cerr << "\e[1;32m[" << s << "] = [ ";
    for (int f = 0; L != R; ++L)
        cerr << (f++ ? ", " : "") << *L;
    cerr << " ]\e[0m\n";
}
#else
#define safe ((void)0)
#define debug(...) safe
#define orange(...) safe
#endif

void solve() {
    int N, M;
    cin >> N >> M;
    vector<pair<int,int>> seg;
    for (int i = 0; i < M * 2; i++) {
        int l, r;
        cin >> l >> r;

        // l = rand() % N + 1;
        // r = rand() % N + 1;
        // if (l > r) swap(l, r);

        seg.emplace_back(r - l + 1, -r);
    }

    sort(seg.begin(), seg.end(), greater<>());
    auto [k, pos] = seg[M - 1];

    if (k == 1) {
        cout << -1 << '\n';
        return;
    }

    pos = -pos;

    // vector<int> A(N + 1);
    for (int i = 1; i <= N; i++) {
        int a;
        if (i <= pos) {
            a = (pos - i) % (k - 1) + 1;
        } else {
            a = k - (i - pos - 1) % k;
        }

        cout << a << (i==N ? '\n' : ' ');
        // A[i] = a;
    }

//    int c = 0;
//    for (auto [len, _r]: seg) {
//        int r = -_r;
//        int l = r - len + 1;
//        debug(l, r);
//        int sz = set<int>(A.begin() + l, A.begin() + r + 1).size();
//        if (sz == len)
//            ++c;
//    }
//    assert (c == M);


}

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int T;
    cin >> T;
    while (T--)
        solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3384kb

input:

3
2 1
1 1
2 2
6 2
1 3
4 6
2 4
3 5
4 3
1 2
1 1
2 2
2 3
3 3
3 4

output:

-1
2 1 2 1 3 2
1 1 1 1

result:

ok ok (3 test cases)

Test #2:

score: 0
Accepted
time: 42ms
memory: 3460kb

input:

100000
2 1
1 1
2 2
2 1
2 2
1 2
2 1
1 2
2 2
2 1
1 2
2 2
2 1
2 2
1 2
2 1
2 2
1 1
2 1
1 1
2 2
2 1
1 2
2 2
2 1
2 2
1 1
2 1
2 2
1 2
2 1
2 2
1 1
2 1
2 2
1 2
2 1
2 2
1 2
2 1
2 2
1 1
2 1
2 2
1 1
2 1
1 2
2 2
2 1
2 2
1 2
2 1
2 2
1 2
2 1
2 2
1 2
2 1
1 1
2 2
2 1
2 2
1 2
2 1
1 1
2 2
2 1
1 1
2 2
2 1
2 2
1 2
2 1
2...

output:

-1
1 1
1 1
1 1
1 1
-1
-1
1 1
-1
1 1
-1
1 1
1 1
-1
-1
1 1
1 1
1 1
1 1
-1
1 1
-1
-1
1 1
-1
1 1
1 1
-1
-1
1 1
1 1
-1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
-1
1 1
1 1
1 1
1 1
1 1
1 1
-1
1 1
1 1
1 1
1 1
-1
1 1
-1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
-1
1 1
1 1
1 1
-1
-1
1 1
-1
1 1
1 1
-1
1 1
-1
1 1
1 1
-1
1 1
1 1
1 1
-...

result:

ok ok (100000 test cases)

Test #3:

score: 0
Accepted
time: 37ms
memory: 3460kb

input:

25000
10 5
4 10
1 4
9 9
2 9
5 8
1 8
1 5
5 5
4 9
6 6
11 5
9 11
4 7
2 2
2 5
8 10
3 11
2 4
4 8
3 10
4 6
5 2
1 3
4 4
1 5
5 5
6 3
4 6
3 3
1 5
3 6
1 1
1 3
7 3
4 4
3 5
1 6
3 4
2 3
1 2
7 3
3 4
1 5
6 7
2 6
3 5
2 3
5 2
5 5
4 5
2 3
1 1
10 5
3 6
4 5
3 3
6 9
2 5
9 10
5 6
5 7
1 4
8 9
11 5
1 10
2 11
6 9
2 6
6 6
8 ...

output:

1 4 3 2 1 5 4 3 2 1
1 3 2 1 3 2 1 4 3 2 1
1 2 1 3 2
1 2 1 3 2 1
1 1 2 1 2 1 2
1 2 1 2 1 3 2
1 1 1 1 1
1 2 1 2 1 2 1 3 2 1
2 1 3 2 1 4 3 2 1 4 3
2 1 2 1 2 1 3 2
1 4 3 2 1 5 4 3 2 1
3 2 1 4 3 2 1 5
2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1
4 3 2 1 5 4 3 2 1 6 5 4 3
2 1 2 1 2 1
2 1 3 2 1 3 2 1 4 3
1 1 2 1 2 1 ...

result:

ok ok (25000 test cases)

Test #4:

score: 0
Accepted
time: 40ms
memory: 3500kb

input:

10000
22 11
2 5
6 9
11 22
10 18
15 19
6 19
6 15
8 13
2 13
8 18
13 17
10 12
3 11
11 18
12 17
13 18
7 8
17 18
11 15
5 15
5 20
18 19
23 11
10 21
1 10
4 21
15 21
12 21
2 14
7 15
2 6
6 15
2 22
1 21
12 13
2 10
11 19
4 22
10 10
7 12
5 17
11 22
22 22
3 12
5 9
18 9
4 12
12 12
4 18
1 13
8 10
3 4
7 15
2 12
17 ...

output:

3 2 1 5 4 3 2 1 5 4 3 2 1 6 5 4 3 2 1 6 5 4
6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3
4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1
5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 8 7 6
2 1 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3
3 2 1 5 4 3 2 1 6 5 4 3 2 1 6 5 4
6 5 4 3 2 1 7 6 5 4 3 2 1 8 7 6 5 4 3
...

result:

ok ok (10000 test cases)

Test #5:

score: 0
Accepted
time: 26ms
memory: 3408kb

input:

5000
36 18
9 14
2 17
8 32
3 32
15 24
14 29
9 20
24 27
22 36
4 9
24 28
16 34
5 33
31 35
13 33
2 32
5 31
22 29
25 31
26 31
7 7
11 11
7 15
2 4
2 3
21 34
26 35
6 20
1 10
2 35
7 24
1 27
1 18
9 13
4 34
10 11
56 28
24 29
22 37
41 43
36 56
25 45
26 54
3 28
14 29
11 18
1 6
7 50
5 27
3 3
41 46
38 38
47 52
6 1...

output:

9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9
12 11 10 9 8 7 6 5 4 3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15
5 4 3 2 1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 ...

result:

ok ok (5000 test cases)

Test #6:

score: 0
Accepted
time: 39ms
memory: 3464kb

input:

4000
55 27
30 37
26 41
46 51
44 49
4 24
1 13
7 13
10 36
44 48
7 16
41 51
13 29
24 47
12 20
4 26
16 43
15 45
7 22
40 44
32 43
5 26
27 27
28 41
8 49
13 47
7 42
26 51
11 23
9 32
33 42
33 34
4 12
3 9
28 36
2 32
8 39
31 43
35 55
21 37
20 33
37 39
7 37
7 23
46 55
29 36
32 38
12 52
37 46
24 32
2 17
1 36
26...

output:

7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 14 13 12 11 10 9 8 7
11 10 9 8 7 6 5 4 3 2 1 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 20 19
14 13 12 11 10 9 8 7 6 5 4 3 2 1 23 22 21 20 1...

result:

ok ok (4000 test cases)

Test #7:

score: 0
Accepted
time: 42ms
memory: 3488kb

input:

3000
65 32
38 46
59 65
18 19
50 54
15 20
31 35
38 61
12 65
17 36
17 23
19 57
58 60
1 54
14 47
52 60
9 46
38 53
34 49
16 60
6 40
47 51
33 45
2 35
8 11
14 15
16 30
11 61
21 40
30 30
15 50
23 34
27 38
21 28
36 37
4 51
47 53
26 37
15 52
41 52
56 65
1 32
60 61
62 65
25 33
36 45
1 7
38 43
55 62
2 42
10 25...

output:

1 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6
1 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8...

result:

ok ok (3000 test cases)

Test #8:

score: 0
Accepted
time: 37ms
memory: 3352kb

input:

2000
96 48
62 74
45 59
40 76
15 46
3 82
31 48
31 94
66 91
77 96
53 80
9 65
3 4
5 78
28 34
7 55
23 51
4 61
4 57
36 86
59 68
89 94
47 67
53 74
48 60
53 91
39 95
18 60
50 88
7 75
87 90
8 44
22 63
58 85
12 68
37 90
3 26
18 50
86 94
62 88
50 54
59 61
91 93
17 32
63 80
40 44
5 95
45 91
49 91
36 53
30 36
4...

output:

23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14
5 4 3 2 1 27 26 25 24 23 22 21 20 19 18...

result:

ok ok (2000 test cases)

Test #9:

score: 0
Accepted
time: 42ms
memory: 3408kb

input:

1500
147 73
5 92
4 46
113 113
14 113
54 126
17 36
83 94
99 110
55 69
24 97
20 82
43 91
131 137
22 115
96 97
3 83
51 96
73 123
40 71
79 137
25 135
49 60
4 44
74 124
114 141
39 115
9 48
83 112
11 46
80 139
37 125
8 59
43 136
122 124
111 115
85 131
35 89
75 129
16 19
27 77
82 118
19 137
17 109
82 101
3...

output:

28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 ...

result:

ok ok (1500 test cases)

Test #10:

score: 0
Accepted
time: 34ms
memory: 3380kb

input:

1000
188 94
142 175
49 149
53 186
33 144
128 167
81 123
40 95
7 134
82 157
95 95
167 178
5 34
42 52
68 71
118 157
108 114
7 33
95 144
126 165
79 126
49 68
3 39
30 63
100 182
11 18
66 72
99 109
5 8
39 52
13 188
83 101
107 118
58 165
34 176
41 94
61 74
8 159
157 165
21 45
3 137
131 183
90 165
83 100
7...

output:

27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 ...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 46ms
memory: 3508kb

input:

500
392 196
1 389
69 348
155 217
305 339
211 303
73 145
14 245
2 11
41 78
80 279
92 390
313 355
29 164
189 284
52 381
67 150
220 242
281 352
276 389
26 352
164 346
107 125
292 357
97 312
100 335
85 241
83 173
136 299
170 335
30 84
36 329
143 298
13 139
268 309
281 384
116 293
103 116
120 284
209 305...

output:

98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 128 127 126 125...

result:

ok ok (500 test cases)

Test #12:

score: 0
Accepted
time: 42ms
memory: 3456kb

input:

41902
4 1
1 4
1 1
2 1
1 2
2 2
4 2
2 2
1 4
3 3
1 3
3 2
1 2
2 2
1 1
3 3
3 1
3 3
1 2
3 1
1 1
2 2
2 1
1 1
2 2
3 1
1 1
1 2
2 1
2 2
1 1
5 7
5 5
1 1
3 5
1 2
2 3
2 2
4 5
2 4
1 5
2 5
3 4
3 3
4 4
1 3
5 5
2 4
4 4
1 3
3 3
3 4
2 5
1 1
2 2
1 2
5 5
5 4
3 5
5 5
2 5
2 2
1 3
2 3
1 5
4 4
3 2
1 3
1 1
2 2
1 2
4 3
1 4
3 ...

output:

1 3 2 1
1 1
1 2 1 3
-1
1 1 2
-1
-1
1 1 2
-1
1 1 1 2 1
1 1 1 1 2
1 2 1 2 1
1 1 2
1 1 2 1
1 1 2 1 2
2 1 2 1 3
1 1
1 1
1 1
1 1 1 2 1
1 1 1
2 1 2 1
-1
1 1 2
1 1 2 1 2
1 1 2 1 2
1 1 1
1 1
2 1 2 1 3
1 1 1
-1
1 1 1
1 1 1 1 2
1 1 1 2 1
1 1 1 2 1
1 1 1
2 1 2 1
-1
1 1 2
-1
1 1 2 1
1 1 1 2 1
1 1
1 1 1 2
1 3 2 ...

result:

ok ok (41902 test cases)

Test #13:

score: 0
Accepted
time: 33ms
memory: 3404kb

input:

15702
9 7
1 4
3 6
4 4
4 5
7 8
1 1
4 9
5 7
1 8
3 4
5 6
6 6
7 9
1 7
7 13
4 5
1 7
2 5
6 7
1 4
1 3
4 4
1 1
1 2
2 4
5 6
4 7
3 6
2 7
2 2
3 7
5 7
3 3
6 6
2 6
3 4
4 6
5 5
1 5
1 6
2 3
4 2
3 4
2 2
2 3
2 4
8 14
5 7
1 6
4 6
1 3
8 8
1 1
5 8
2 6
3 3
3 7
2 2
6 6
6 7
4 8
6 8
4 5
3 8
1 2
5 6
3 5
5 5
4 7
1 5
7 7
2 4
...

output:

1 2 1 2 1 2 1 2 1
2 1 2 1 2 1 3
1 1 1 2
2 1 2 1 2 1 3 2
1 1 1 1 1 2 1 2
1 1 1
2 1 2 1 2 1 3
1 2 1 2 1 3 2 1 3
2 1 2 1 3 2 1 3 2 1
1 1 1 2 1 2
2 1 2 1 2 1 3 2
1 1 1
2 1 4 3 2 1 4 3 2 1
1 2 1 2 1 3 2
2 1 2 1 2 1 3 2
1 2 1 3 2 1 3
1 1 1
2 1 2 1 2 1 2 1
1 1 1 1 2 1
1 1 1 2 1
2 1 2 1 2 1
2 1 2 1
1 1 1 2
...

result:

ok ok (15702 test cases)

Test #14:

score: 0
Accepted
time: 36ms
memory: 3432kb

input:

4960
9 20
1 3
1 7
1 2
2 3
8 8
2 4
7 8
9 9
6 8
3 4
3 9
6 6
2 5
5 9
3 7
7 9
4 5
4 7
2 6
4 9
4 8
3 3
5 8
8 9
1 4
5 6
3 8
1 5
2 8
3 5
1 8
1 1
2 2
5 5
6 7
7 7
1 6
4 4
5 7
6 9
3 2
1 3
2 2
3 3
1 1
11 16
4 11
9 10
3 4
2 10
4 9
6 7
3 7
6 10
1 7
7 11
7 7
1 6
1 9
10 11
5 9
4 7
8 10
3 6
5 5
1 10
6 11
3 10
5 7
7...

output:

1 2 1 2 1 3 2 1 3
-1
3 2 1 3 2 1 4 3 2 1 4
2 1 3 2 1 3 2 1 3 2 1
2 1 3 2 1 3 2 1 4 3
1 1 1 1 1
3 2 1 3 2 1
1 2 1 3 2 1 3
1 4 3 2 1 5 4 3 2 1
3 2 1 3 2 1 4 3 2 1 4 3
6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 7 6
1 2 1 2 1 3 2 1
-1
5 4 3 2 1 5 4 3 2 1 6 5 4 3 2 1 6
1 1 1 2
1 8 7 6 5 4 3 2 1 9 8 7 6
1 2 1 3 ...

result:

ok ok (4960 test cases)

Test #15:

score: 0
Accepted
time: 35ms
memory: 3384kb

input:

871
32 256
28 31
18 22
1 15
2 13
9 12
8 11
9 16
2 6
8 20
19 23
10 32
1 29
6 7
11 17
4 24
17 17
14 20
2 23
13 14
7 21
3 30
4 7
19 20
4 10
15 24
4 12
16 23
3 11
3 28
3 19
8 18
8 8
9 17
5 24
6 15
22 30
26 26
5 27
13 13
5 12
20 20
7 12
4 23
10 21
5 11
27 30
18 26
10 20
15 17
14 24
4 25
14 19
8 23
2 12
1...

output:

1 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8
1 1 1
3 2 1 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 9 8
2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1
8 7 6 5 4 3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5
3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 14 13 12 1...

result:

ok ok (871 test cases)

Test #16:

score: 0
Accepted
time: 35ms
memory: 3464kb

input:

929
28 52
13 25
1 21
9 25
1 7
4 28
11 12
9 10
7 23
7 24
4 18
20 21
16 18
21 26
19 22
24 27
22 28
7 27
19 19
9 14
6 14
13 15
4 20
27 27
23 26
23 24
10 13
9 23
5 5
3 26
4 9
18 23
11 23
5 26
8 22
8 17
10 17
2 3
2 23
17 20
4 25
5 24
9 13
22 24
12 20
3 8
21 23
7 25
10 27
22 23
13 20
2 15
6 8
8 8
3 28
11 ...

output:

6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 9 8 7
4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3 2 1
5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 7
4 3 2 1 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 11
4 3 2 1 11 10 9 8...

result:

ok ok (929 test cases)

Test #17:

score: 0
Accepted
time: 36ms
memory: 3428kb

input:

934
34 156
7 22
17 27
3 20
8 8
28 29
11 23
24 29
6 20
12 30
10 10
10 24
2 23
4 21
15 23
8 27
5 14
20 21
17 28
4 18
14 27
8 31
8 30
21 31
24 26
10 16
3 11
9 23
4 27
21 33
2 18
8 10
1 32
5 23
22 24
27 32
26 29
7 28
16 31
4 23
6 22
5 20
26 32
9 18
1 8
14 22
3 29
12 23
25 33
9 31
12 29
7 7
25 32
2 19
16...

output:

7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5
2 1 3 2 1 3 2 1 4 3 2
3 2 1 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 18 17 16 15 14 13 12 11
5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2
2 1 6 5 4 3 2 1 6 5 4 3 ...

result:

ok ok (934 test cases)

Test #18:

score: 0
Accepted
time: 25ms
memory: 3512kb

input:

216
78 478
13 77
47 50
6 66
66 73
5 14
35 45
3 57
16 43
39 40
44 52
48 52
72 72
45 71
50 66
16 50
24 45
40 76
53 74
25 28
28 66
41 58
9 56
13 44
6 21
26 77
3 25
3 50
53 58
15 68
3 48
38 61
33 65
5 39
43 73
8 78
30 41
57 62
41 46
20 33
31 45
18 27
14 58
63 64
47 57
29 70
1 51
27 61
36 58
25 46
5 65
7...

output:

8 7 6 5 4 3 2 1 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 23 22 21
21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13...

result:

ok ok (216 test cases)

Test #19:

score: 0
Accepted
time: 36ms
memory: 3544kb

input:

243
10 19
3 7
1 6
4 10
4 8
5 8
1 9
2 5
3 9
3 3
1 5
5 10
2 10
3 4
3 6
5 9
2 2
2 6
4 7
6 6
4 9
7 7
3 5
7 9
3 8
5 5
6 8
2 9
1 7
4 5
7 8
7 10
1 8
9 9
2 8
2 7
1 2
3 10
8 8
87 218
19 76
44 64
22 42
29 51
12 46
15 17
65 68
8 37
32 42
13 83
21 51
18 86
8 41
21 36
34 82
5 78
52 74
29 56
12 76
52 63
20 67
66 ...

output:

1 4 3 2 1 4 3 2 1 5
13 12 11 10 9 8 7 6 5 4 3 2 1 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7
4 3 2 1 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1...

result:

ok ok (243 test cases)

Test #20:

score: 0
Accepted
time: 21ms
memory: 3484kb

input:

207
49 111
29 35
17 17
6 31
3 30
38 41
22 30
8 41
5 20
6 16
31 34
24 36
11 19
16 38
7 35
30 35
14 36
13 30
14 45
30 42
23 38
1 6
6 42
36 46
15 47
30 47
8 45
22 48
42 46
2 31
6 12
24 49
4 42
2 10
29 30
14 18
6 27
30 48
36 36
8 47
12 41
4 43
1 22
18 23
6 26
25 41
4 27
7 32
9 20
35 48
11 38
11 39
7 48
...

output:

3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13
2 1 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 12 11 10 9 8 7 6 5 4 3
5 4 3 2 1 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10
11 10 9 8 7...

result:

ok ok (207 test cases)

Test #21:

score: 0
Accepted
time: 29ms
memory: 3524kb

input:

66
164 5146
112 153
31 50
121 160
112 149
34 101
46 59
46 118
71 151
42 157
99 153
9 11
58 83
34 89
5 155
102 153
56 157
83 104
83 87
7 77
43 137
40 152
36 47
65 104
43 110
4 68
56 134
11 130
130 159
1 108
44 158
16 78
68 91
12 135
35 120
41 146
85 152
95 120
106 132
27 119
16 88
46 111
17 138
30 82...

output:

29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 ...

result:

ok ok (66 test cases)

Test #22:

score: 0
Accepted
time: 33ms
memory: 3648kb

input:

26
259 10209
140 162
33 206
18 209
102 147
159 256
138 143
117 257
19 217
70 247
81 215
74 171
24 76
56 167
63 79
146 202
183 203
1 119
95 131
192 194
181 205
39 235
118 158
184 204
116 130
102 214
94 183
36 170
73 120
13 16
17 76
37 96
65 86
72 109
36 249
6 210
25 41
71 91
18 149
66 110
186 222
27 ...

output:

19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 76 75 74 73 72 71 70 69 68 67 66 ...

result:

ok ok (26 test cases)

Test #23:

score: 0
Accepted
time: 36ms
memory: 3840kb

input:

15
110 874
86 90
38 53
36 71
95 108
13 95
24 38
6 57
9 32
48 71
60 87
36 99
79 84
3 40
1 18
25 98
72 102
26 43
56 98
5 15
13 27
17 25
22 27
58 64
85 89
58 88
5 11
2 34
62 69
109 109
49 99
28 39
4 49
20 105
43 53
25 45
25 96
1 22
40 57
1 103
34 42
39 97
23 69
49 65
30 81
14 27
41 86
17 78
58 100
83 8...

output:

26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 ...

result:

ok ok (15 test cases)

Test #24:

score: 0
Accepted
time: 43ms
memory: 3908kb

input:

13
216 4476
108 125
45 173
117 126
95 127
157 199
128 167
119 216
53 93
67 214
38 58
19 25
14 135
114 171
29 48
4 143
43 199
22 74
98 211
31 106
106 140
26 204
14 199
158 167
65 186
123 152
80 203
182 216
78 139
47 176
162 204
11 95
83 197
58 69
138 184
1 59
186 191
105 173
48 97
35 109
45 64
124 13...

output:

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 63 62 61 60 59 58 57 56 55 54 53 52 ...

result:

ok ok (13 test cases)

Test #25:

score: 0
Accepted
time: 65ms
memory: 5136kb

input:

1
200000 100000
5435 51605
65565 190063
140607 193643
31380 45537
3961 55383
25625 38764
27570 135633
35840 167150
126881 193680
19261 139009
110761 185612
25060 168287
23579 129939
31514 88726
127835 171458
48657 82850
19153 176202
117009 136283
38162 106216
70625 130422
56502 121622
86260 142727
3...

output:

14578 14577 14576 14575 14574 14573 14572 14571 14570 14569 14568 14567 14566 14565 14564 14563 14562 14561 14560 14559 14558 14557 14556 14555 14554 14553 14552 14551 14550 14549 14548 14547 14546 14545 14544 14543 14542 14541 14540 14539 14538 14537 14536 14535 14534 14533 14532 14531 14530 14529 ...

result:

ok ok (1 test case)

Test #26:

score: 0
Accepted
time: 59ms
memory: 5036kb

input:

1
199921 99985
103056 143610
165590 191047
63600 63838
123160 188419
104260 147276
112410 185579
2700 179127
78472 164457
114801 145423
191999 196291
90822 177869
51896 145573
74782 131827
160438 167805
52443 141624
146562 158836
70400 119165
115232 127784
24895 47913
128942 175540
40145 41946
93417...

output:

2747 2746 2745 2744 2743 2742 2741 2740 2739 2738 2737 2736 2735 2734 2733 2732 2731 2730 2729 2728 2727 2726 2725 2724 2723 2722 2721 2720 2719 2718 2717 2716 2715 2714 2713 2712 2711 2710 2709 2708 2707 2706 2705 2704 2703 2702 2701 2700 2699 2698 2697 2696 2695 2694 2693 2692 2691 2690 2689 2688 ...

result:

ok ok (1 test case)

Test #27:

score: 0
Accepted
time: 49ms
memory: 5076kb

input:

1
199907 99603
84324 152188
68856 157591
918 87087
86133 120796
44517 106591
79065 142117
75031 153216
194825 196384
67470 114247
19127 140381
51212 197585
132561 171506
59403 177050
137553 195682
135941 146610
45358 57782
2628 161890
71022 189271
34370 86323
19542 108262
38970 59100
116781 122224
1...

output:

44039 44038 44037 44036 44035 44034 44033 44032 44031 44030 44029 44028 44027 44026 44025 44024 44023 44022 44021 44020 44019 44018 44017 44016 44015 44014 44013 44012 44011 44010 44009 44008 44007 44006 44005 44004 44003 44002 44001 44000 43999 43998 43997 43996 43995 43994 43993 43992 43991 43990 ...

result:

ok ok (1 test case)

Test #28:

score: 0
Accepted
time: 55ms
memory: 5092kb

input:

1
199187 99820
148565 160009
140518 171681
75059 140113
40970 117651
46813 120478
41658 177438
126700 183863
89947 152361
35812 121754
129088 186431
98884 159523
43327 99423
58054 151417
125288 173885
6257 78052
132171 180569
103064 111103
103720 117210
12343 66848
30679 96271
89720 162883
28897 191...

output:

13675 13674 13673 13672 13671 13670 13669 13668 13667 13666 13665 13664 13663 13662 13661 13660 13659 13658 13657 13656 13655 13654 13653 13652 13651 13650 13649 13648 13647 13646 13645 13644 13643 13642 13641 13640 13639 13638 13637 13636 13635 13634 13633 13632 13631 13630 13629 13628 13627 13626 ...

result:

ok ok (1 test case)

Test #29:

score: 0
Accepted
time: 44ms
memory: 5032kb

input:

1
199402 99528
59883 73211
154329 197322
106362 122643
148179 186347
5919 101638
181550 189040
30498 86234
18736 98684
5528 113409
55716 187444
18658 125497
51054 165466
21111 86450
6115 67650
22324 149626
73894 129025
11036 170928
84030 147342
183697 192954
96225 165374
165196 169809
40552 58094
47...

output:

45754 45753 45752 45751 45750 45749 45748 45747 45746 45745 45744 45743 45742 45741 45740 45739 45738 45737 45736 45735 45734 45733 45732 45731 45730 45729 45728 45727 45726 45725 45724 45723 45722 45721 45720 45719 45718 45717 45716 45715 45714 45713 45712 45711 45710 45709 45708 45707 45706 45705 ...

result:

ok ok (1 test case)

Test #30:

score: 0
Accepted
time: 52ms
memory: 5096kb

input:

1
199604 99546
176159 191086
138429 181944
67569 198623
35297 177657
22993 62162
68546 193414
100380 161830
112597 133247
114577 121122
80178 84189
17707 42100
211 56675
18930 116076
170214 176911
88756 115840
85121 93430
1538 194211
5297 194826
12331 139371
98205 110997
3333 56340
11700 96402
45656...

output:

37387 37386 37385 37384 37383 37382 37381 37380 37379 37378 37377 37376 37375 37374 37373 37372 37371 37370 37369 37368 37367 37366 37365 37364 37363 37362 37361 37360 37359 37358 37357 37356 37355 37354 37353 37352 37351 37350 37349 37348 37347 37346 37345 37344 37343 37342 37341 37340 37339 37338 ...

result:

ok ok (1 test case)

Test #31:

score: 0
Accepted
time: 52ms
memory: 5084kb

input:

1
199489 99617
23664 52627
108617 138959
4229 100223
176064 196597
143559 163730
103535 151443
53554 196500
105472 158006
154506 190393
6693 54536
26379 105288
121437 171819
105401 197780
38110 152169
129376 134448
193185 199074
42992 61557
8706 29384
296 109525
55956 97934
40004 43964
88870 178390
...

output:

35097 35096 35095 35094 35093 35092 35091 35090 35089 35088 35087 35086 35085 35084 35083 35082 35081 35080 35079 35078 35077 35076 35075 35074 35073 35072 35071 35070 35069 35068 35067 35066 35065 35064 35063 35062 35061 35060 35059 35058 35057 35056 35055 35054 35053 35052 35051 35050 35049 35048 ...

result:

ok ok (1 test case)

Test #32:

score: 0
Accepted
time: 58ms
memory: 5104kb

input:

1
199705 99899
113902 138967
68937 86292
147460 190982
79047 160599
98906 168949
42987 184473
62758 124862
4375 43060
26883 73218
110548 143921
37414 51392
94630 101673
87850 122341
153060 187310
3981 89322
76857 177304
41266 79671
11196 188361
59146 125009
93905 191774
33636 74651
114150 156609
141...

output:

15715 15714 15713 15712 15711 15710 15709 15708 15707 15706 15705 15704 15703 15702 15701 15700 15699 15698 15697 15696 15695 15694 15693 15692 15691 15690 15689 15688 15687 15686 15685 15684 15683 15682 15681 15680 15679 15678 15677 15676 15675 15674 15673 15672 15671 15670 15669 15668 15667 15666 ...

result:

ok ok (1 test case)

Test #33:

score: 0
Accepted
time: 45ms
memory: 5100kb

input:

1
199352 99733
37917 173133
73254 154287
2180 130392
53939 184382
95721 125269
18990 93274
175898 182797
24516 148454
164014 182201
56926 133290
39103 102519
77598 126847
35976 105611
101372 185172
24212 41991
28068 62504
44141 145704
38850 144703
5078 190440
37230 88435
90584 149922
601 191977
7793...

output:

31872 31871 31870 31869 31868 31867 31866 31865 31864 31863 31862 31861 31860 31859 31858 31857 31856 31855 31854 31853 31852 31851 31850 31849 31848 31847 31846 31845 31844 31843 31842 31841 31840 31839 31838 31837 31836 31835 31834 31833 31832 31831 31830 31829 31828 31827 31826 31825 31824 31823 ...

result:

ok ok (1 test case)

Test #34:

score: 0
Accepted
time: 58ms
memory: 5076kb

input:

1
199338 99971
17165 87851
23818 121851
4100 166900
91756 190077
78693 113537
14532 180577
11424 48656
40803 117414
32918 34131
122396 186203
134844 185967
79253 153593
116943 178384
7639 9185
132251 134894
88424 118015
168090 177027
187304 198306
49999 50358
97318 159339
16055 130932
145439 171551
...

output:

8819 8818 8817 8816 8815 8814 8813 8812 8811 8810 8809 8808 8807 8806 8805 8804 8803 8802 8801 8800 8799 8798 8797 8796 8795 8794 8793 8792 8791 8790 8789 8788 8787 8786 8785 8784 8783 8782 8781 8780 8779 8778 8777 8776 8775 8774 8773 8772 8771 8770 8769 8768 8767 8766 8765 8764 8763 8762 8761 8760 ...

result:

ok ok (1 test case)

Test #35:

score: 0
Accepted
time: 53ms
memory: 5100kb

input:

1
199439 99823
81809 140926
23811 147090
191848 197185
132851 198467
66372 148259
64416 183635
74793 174015
75536 109314
28933 41402
69571 183777
125547 157788
23864 130276
66590 149298
85462 129801
122032 128546
18807 166479
155391 195550
31785 66555
133607 186674
2581 56107
60668 187154
80341 1213...

output:

44247 44246 44245 44244 44243 44242 44241 44240 44239 44238 44237 44236 44235 44234 44233 44232 44231 44230 44229 44228 44227 44226 44225 44224 44223 44222 44221 44220 44219 44218 44217 44216 44215 44214 44213 44212 44211 44210 44209 44208 44207 44206 44205 44204 44203 44202 44201 44200 44199 44198 ...

result:

ok ok (1 test case)

Test #36:

score: 0
Accepted
time: 55ms
memory: 4952kb

input:

2
99794 49897
8477 62498
65109 96477
42995 72444
28517 55936
67876 87225
20851 53210
53382 82592
40295 71977
27761 47307
37822 82660
19497 42096
3437 26217
31268 47871
85339 98140
64736 97501
20135 40750
3912 44208
22007 33971
31186 63013
18250 43277
39789 56149
56163 62346
54231 92269
88417 90929
5...

output:

16062 16061 16060 16059 16058 16057 16056 16055 16054 16053 16052 16051 16050 16049 16048 16047 16046 16045 16044 16043 16042 16041 16040 16039 16038 16037 16036 16035 16034 16033 16032 16031 16030 16029 16028 16027 16026 16025 16024 16023 16022 16021 16020 16019 16018 16017 16016 16015 16014 16013 ...

result:

ok ok (2 test cases)

Test #37:

score: 0
Accepted
time: 49ms
memory: 4652kb

input:

3
66379 33189
5835 24165
19013 36047
30577 60062
11987 54246
38178 42807
22994 43449
28778 34300
30361 52843
28455 48046
900 6313
46437 47397
49432 55850
12602 41914
15221 65055
19672 20399
10357 64969
42367 62359
35447 61268
12946 47406
27260 40030
8484 15954
19705 39317
47257 47284
5051 57992
4915...

output:

10182 10181 10180 10179 10178 10177 10176 10175 10174 10173 10172 10171 10170 10169 10168 10167 10166 10165 10164 10163 10162 10161 10160 10159 10158 10157 10156 10155 10154 10153 10152 10151 10150 10149 10148 10147 10146 10145 10144 10143 10142 10141 10140 10139 10138 10137 10136 10135 10134 10133 ...

result:

ok ok (3 test cases)

Test #38:

score: 0
Accepted
time: 48ms
memory: 3856kb

input:

5
39514 19757
20458 28522
9917 17067
12908 15800
2845 4335
1704 33971
6247 7629
8075 18756
5525 37316
3627 27109
19324 33336
37991 38073
1914 16272
5429 14867
14743 28082
15639 17009
21773 31519
14282 23955
22555 33113
285 34627
23239 34179
6626 18400
7685 12193
23764 26880
10510 18607
8649 16792
27...

output:

9513 9512 9511 9510 9509 9508 9507 9506 9505 9504 9503 9502 9501 9500 9499 9498 9497 9496 9495 9494 9493 9492 9491 9490 9489 9488 9487 9486 9485 9484 9483 9482 9481 9480 9479 9478 9477 9476 9475 9474 9473 9472 9471 9470 9469 9468 9467 9466 9465 9464 9463 9462 9461 9460 9459 9458 9457 9456 9455 9454 ...

result:

ok ok (5 test cases)

Test #39:

score: 0
Accepted
time: 47ms
memory: 3588kb

input:

10
20098 10049
1332 9929
8348 16079
808 19476
577 19504
3976 17301
4195 15617
800 15096
1019 17128
13858 15961
1881 14465
278 4823
27 10577
18474 18645
6748 9234
4185 4551
8192 16755
2268 5542
4444 10026
13412 18514
2812 9565
15843 16720
13137 18526
1693 9391
8464 14783
1660 10294
8725 16273
2247 14...

output:

5041 5040 5039 5038 5037 5036 5035 5034 5033 5032 5031 5030 5029 5028 5027 5026 5025 5024 5023 5022 5021 5020 5019 5018 5017 5016 5015 5014 5013 5012 5011 5010 5009 5008 5007 5006 5005 5004 5003 5002 5001 5000 4999 4998 4997 4996 4995 4994 4993 4992 4991 4990 4989 4988 4987 4986 4985 4984 4983 4982 ...

result:

ok ok (10 test cases)

Test #40:

score: 0
Accepted
time: 55ms
memory: 3564kb

input:

20
10036 5018
9524 9978
881 7972
5874 9777
497 3608
1863 2806
4961 7511
4658 7600
3147 5840
5094 6027
5128 7282
160 6636
3363 7901
2537 9233
5573 5935
1301 9675
1826 5759
7871 9773
2156 3439
785 9043
4659 4795
2645 7779
1214 9464
4806 10015
3945 7258
3803 6147
1117 5744
4040 8735
4625 8249
2209 6769...

output:

442 441 440 439 438 437 436 435 434 433 432 431 430 429 428 427 426 425 424 423 422 421 420 419 418 417 416 415 414 413 412 411 410 409 408 407 406 405 404 403 402 401 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382 381 380 379 378 377 376 375 374 373 372 371 370 369 368 ...

result:

ok ok (20 test cases)

Test #41:

score: 0
Accepted
time: 45ms
memory: 3600kb

input:

50
4025 2012
1477 1545
503 648
387 3828
1927 3525
256 461
3276 3977
649 798
1698 1983
3 1101
2051 2223
3760 3828
3030 3686
2700 3054
575 1587
1010 2434
213 2977
46 3639
1193 3022
2649 3233
772 2064
901 3288
1319 2699
877 1348
2408 3698
192 545
214 3568
3809 4013
1188 1829
1994 3697
1930 2736
1511 35...

output:

330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 ...

result:

ok ok (50 test cases)

Test #42:

score: 0
Accepted
time: 41ms
memory: 3468kb

input:

100
1980 990
985 1741
981 1754
531 1058
995 1488
375 1042
26 874
1031 1659
667 1619
1673 1898
974 1830
116 1044
11 926
272 1267
516 784
717 824
107 1978
437 981
1148 1351
298 708
1226 1293
1268 1932
945 1571
1002 1229
70 1066
511 1868
584 1221
1504 1812
1158 1796
562 774
587 1026
1773 1926
426 595
3...

output:

119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 2...

result:

ok ok (100 test cases)

Test #43:

score: 0
Accepted
time: 48ms
memory: 3448kb

input:

200
988 494
682 908
368 485
227 596
311 808
354 763
354 953
664 848
674 734
730 897
76 733
366 968
313 666
311 700
132 567
268 766
180 806
622 712
442 966
1 664
709 739
291 943
672 906
230 290
200 934
40 84
534 675
147 701
425 656
638 795
955 973
267 900
254 747
463 737
234 742
600 805
57 606
65 562...

output:

36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 2...

result:

ok ok (200 test cases)

Test #44:

score: 0
Accepted
time: 39ms
memory: 3424kb

input:

5599
27 22
20 20
1 7
12 20
19 19
24 24
10 10
26 26
13 13
3 3
7 7
15 15
2 13
25 25
4 4
12 21
5 18
22 27
12 16
27 27
23 23
11 11
8 8
8 21
4 6
12 12
1 1
6 16
5 22
14 14
2 2
17 17
6 6
2 24
21 21
16 16
17 24
9 9
1 27
5 7
22 22
21 26
12 27
18 18
5 5
36 3
15 15
9 9
30 30
11 11
14 14
31 31
25 11
17 25
3 8
1...

output:

-1
-1
5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1
-1
2 1 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1
-1
-1
-1
-1
3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 5
5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2...

result:

ok ok (5599 test cases)

Test #45:

score: 0
Accepted
time: 27ms
memory: 3416kb

input:

3304
72 15
38 71
34 52
5 54
26 26
49 49
30 66
66 66
9 9
60 60
1 39
64 64
42 49
19 67
61 61
65 65
13 13
54 54
4 4
42 42
68 68
12 12
27 56
64 65
61 71
37 37
70 70
57 57
23 48
1 50
40 40
52 10
46 46
45 45
12 21
18 18
16 16
37 44
15 15
3 37
39 39
4 31
26 26
40 40
22 22
26 30
41 50
2 50
8 18
11 11
5 20
6...

output:

-1
2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4
11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 16 15 14 13 12 11 10 9 8 7 6 5 4 3
4 3 2 1 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 ...

result:

ok ok (3304 test cases)

Test #46:

score: 0
Accepted
time: 32ms
memory: 3496kb

input:

781
150 60
4 130
28 91
57 97
1 150
8 24
24 126
94 94
37 65
134 134
107 107
79 147
68 68
97 97
50 50
21 104
136 136
81 81
74 137
114 114
53 53
16 16
105 132
112 112
9 24
109 109
15 15
101 101
132 132
115 115
81 93
73 75
26 132
71 133
12 12
75 75
1 47
4 4
93 93
99 99
54 103
54 54
102 150
35 136
91 91
...

output:

-1
-1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2
-1
1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2...

result:

ok ok (781 test cases)

Test #47:

score: 0
Accepted
time: 38ms
memory: 3448kb

input:

735
90 62
39 76
56 77
9 9
11 57
3 72
55 89
36 50
24 63
19 34
27 64
19 19
46 48
43 43
61 61
7 87
77 77
63 63
21 75
22 44
4 4
23 32
25 25
47 47
68 89
2 24
53 53
6 6
1 38
49 89
73 73
50 50
71 74
88 88
84 84
22 22
78 78
36 63
38 90
26 48
35 57
23 34
23 63
21 73
70 70
2 2
46 46
72 72
83 83
60 60
18 18
30...

output:

2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ...

result:

ok ok (735 test cases)

Test #48:

score: 0
Accepted
time: 40ms
memory: 3516kb

input:

777
140 5
55 104
89 118
41 41
89 120
103 120
15 15
118 128
8 8
91 91
100 100
311 190
197 197
259 259
61 283
243 243
230 230
184 207
160 160
157 173
55 55
307 307
31 31
68 68
72 72
92 246
6 6
15 255
281 281
231 231
279 279
77 77
52 52
211 211
129 129
80 80
184 213
131 182
70 70
248 248
38 111
180 180...

output:

8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 10 9 8 7 6 5 4 3 2 1 11 10 9 8 7 6 5 4 3 2 1 11
4 3 2...

result:

ok ok (777 test cases)

Test #49:

score: 0
Accepted
time: 28ms
memory: 3420kb

input:

385
885 358
589 589
399 767
363 363
295 683
134 134
395 395
404 411
658 658
56 880
384 384
419 747
186 186
41 41
277 277
137 137
349 349
467 467
35 304
638 817
274 274
724 724
153 710
214 317
186 450
60 60
104 153
475 475
93 823
257 401
593 825
176 869
649 818
557 557
34 34
530 814
79 79
395 639
216...

output:

4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 1 7 6 5 4 3 2 ...

result:

ok ok (385 test cases)

Test #50:

score: 0
Accepted
time: 41ms
memory: 3548kb

input:

77
67 49
16 16
54 54
45 45
23 23
11 46
49 49
9 52
63 63
2 11
11 38
39 39
14 49
26 32
1 1
14 37
9 28
29 29
46 46
34 38
10 50
3 53
20 20
16 64
8 8
53 53
12 36
36 41
46 47
23 63
46 61
34 46
32 32
30 33
57 57
7 23
57 65
20 26
66 66
47 49
25 25
43 54
37 37
28 31
58 58
15 28
51 51
9 43
17 17
25 45
1 51
12...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1
-1
-1
11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 7 6 5 4 3 2 1 13 12 11 10 9 8 ...

result:

ok ok (77 test cases)

Test #51:

score: 0
Accepted
time: 40ms
memory: 3536kb

input:

42
4196 2994
2492 2492
390 2511
1498 2024
2164 2164
2161 3537
421 421
1680 1680
2484 2484
830 830
714 714
468 468
3662 3662
3181 3181
2192 3103
2433 2433
2284 2284
1074 3167
1431 2085
149 1169
3311 3625
3537 3642
303 375
3440 3440
2304 2304
3169 3169
1408 1654
1298 3334
590 3149
1181 2797
3244 3244
...

output:

-1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

result:

ok ok (42 test cases)

Test #52:

score: 0
Accepted
time: 22ms
memory: 4332kb

input:

8
41132 33063
5727 6723
16545 18518
7000 23858
21316 34695
4680 13234
1682 18038
9800 23791
39338 39338
16193 16193
1219 11844
10294 25003
718 11746
23967 31763
19416 19416
15762 29909
29565 37798
27394 27394
16073 16073
5862 5862
14541 14541
10027 24193
215 367
19677 19677
998 24535
9587 9587
11322...

output:

-1
2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4...

result:

ok ok (8 test cases)