QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#56058#4883. Bayan Testingtriple__a#AC ✓164ms51540kbC++2.3kb2022-10-16 18:22:492022-10-16 18:22:52

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-16 18:22:52]
  • 评测
  • 测评结果:AC
  • 用时:164ms
  • 内存:51540kb
  • [2022-10-16 18:22:49]
  • 提交

answer

// #pragma comment(linker, "/STACK:102400000,102400000")
#pragma GCC optimize("O3")
#pragma GCC optimize("O2")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
// #pragma GCC optimize("trapv")
#include<bits/stdc++.h>
// #include <bits/extc++.h>
#define int long long
#define double long double
// #define i128 long long
// #define double long double
using namespace std;
 
#define rep(i,n) for (int i=0;i<(int)(n);++i)
#define rep1(i,n) for (int i=1;i<=(int)(n);++i)
#define range(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define F first
#define S second
 
typedef long long ll;
typedef unsigned long long ull;
// typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;


int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
// const int mod[]={998244353,(int)1e9+7};
const int mod=998244353;
const int base[]={12321,32123};
const double EPS=8e-6;
// const double pi=acos(-1);
const int INF=1e12;
const int N=1500007;
mt19937 rng(1235);
const int B=500;

int l[N], r[N],p[N];
int ans[N];
vi lst[N];
signed main(){
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout.precision(15);
  int _;
  cin>>_;
  while (_--){
    int n,m;
    cin>>n>>m;
    rep(i,2*m) cin>>l[i]>>r[i], l[i]--;
    int sum=0;
    rep(i,2*m) {
        if (r[i]==l[i]+1) sum++;
    }
    if (sum>m){
        cout<<"-1\n";
        continue;
    }
    rep(i,2*m) p[i]=i;
    sort(p,p+2*m,[&](int u,int v){return (r[u]-l[u]<r[v]-l[v])||(r[u]-l[u]==r[v]-l[v]&&l[u]<l[v]);});
    rep(i,n+2) lst[i].clear();
    rep(i,m) lst[l[p[i]]].pb(1);
    rep(i,m) lst[r[p[i]]].pb(~l[p[i]]);
    map<int,int> nw;
    stack<int> rem;
    for (int i=0;i<n+3;++i) rem.push(i);
    int L=0;
    for (int i=0;i<n;++i){
        for (auto c:lst[i]){
            if (c>0) nw[i]++;
            else {
                nw[~c]--;
                if (!nw[~c]) nw.erase(~c);
            }
        }
        int ret;
        if (!sz(nw)) ret=i;
        else ret=nw.begin()->F;
        for (;L<ret;L++) rem.push(ans[L]);
        ans[i]=rem.top(), rem.pop();
    }
    rep(i,n) cout<<ans[i]+2<<" ";
    cout<<"\n";
  }
  return 0;
}
/*
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
*/

详细

Test #1:

score: 100
Accepted
time: 19ms
memory: 38740kb

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
10 9 8 10 10 10 
8 8 8 8 

result:

ok ok (3 test cases)

Test #2:

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

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
6 6 
6 6 
6 6 
6 6 
-1
-1
6 6 
-1
6 6 
-1
6 6 
6 6 
-1
-1
6 6 
6 6 
6 6 
6 6 
-1
6 6 
-1
-1
6 6 
-1
6 6 
6 6 
-1
-1
6 6 
6 6 
-1
6 6 
6 6 
6 6 
6 6 
6 6 
6 6 
6 6 
6 6 
-1
6 6 
6 6 
6 6 
6 6 
6 6 
6 6 
-1
6 6 
6 6 
6 6 
6 6 
-1
6 6 
-1
6 6 
6 6 
6 6 
6 6 
6 6 
6 6 
6 6 
-1
6 6 
6 6 
6 6 
-1
-1
6 ...

result:

ok ok (100000 test cases)

Test #3:

score: 0
Accepted
time: 51ms
memory: 38760kb

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:

14 13 12 11 11 12 13 14 14 14 
15 15 14 13 14 15 15 15 14 13 15 
9 9 9 9 9 
10 9 8 8 8 8 
11 10 11 11 11 11 11 
11 11 10 11 11 11 10 
9 9 9 9 9 
14 14 14 14 13 14 14 14 13 14 
15 15 14 13 12 12 13 14 15 14 13 
12 11 10 10 10 10 11 10 
14 13 12 11 10 10 11 11 11 10 
12 11 12 10 9 12 11 11 
21 20 20 2...

result:

ok ok (25000 test cases)

Test #4:

score: 0
Accepted
time: 60ms
memory: 38876kb

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:

26 26 25 24 23 23 24 25 26 24 23 22 21 24 26 23 25 24 21 21 21 21 
27 26 25 24 23 22 21 20 19 18 22 23 24 25 26 18 19 20 21 25 24 24 24 
22 22 22 21 21 21 22 20 19 18 17 16 17 18 19 17 16 20 
26 25 24 26 26 24 25 23 22 21 23 25 24 26 24 25 23 21 22 22 22 22 
32 31 30 30 30 30 30 31 32 29 28 27 29 32...

result:

ok ok (10000 test cases)

Test #5:

score: 0
Accepted
time: 63ms
memory: 38920kb

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:

40 39 38 37 36 35 34 33 32 31 35 36 37 38 39 38 37 36 35 31 32 33 34 40 32 31 35 36 37 40 34 32 33 38 39 39 
60 59 58 57 56 55 60 54 53 52 51 50 49 48 47 57 58 56 59 60 60 60 60 59 56 58 57 47 48 49 47 57 49 48 58 56 59 60 58 48 49 57 47 50 51 60 59 56 52 49 47 57 48 58 53 53 
50 49 48 47 46 45 44 4...

result:

ok ok (5000 test cases)

Test #6:

score: 0
Accepted
time: 62ms
memory: 38916kb

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:

59 58 57 56 55 54 53 52 51 50 49 48 47 54 55 56 50 51 52 53 57 58 59 52 51 50 56 55 54 47 48 49 46 51 52 59 58 57 53 47 54 55 56 59 52 51 47 53 57 58 46 52 59 56 55 
55 54 53 54 54 54 53 55 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 54 46 47 48 49 50 51 52 55 40 41 42 43 44 45 49 50 48 52 51 47...

result:

ok ok (4000 test cases)

Test #7:

score: 0
Accepted
time: 100ms
memory: 38740kb

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:

69 68 67 66 65 64 63 66 67 68 69 62 62 62 69 68 67 66 62 63 68 69 64 63 62 66 67 65 69 68 61 60 59 58 62 63 64 66 62 58 59 60 61 68 69 64 64 69 68 61 60 59 58 68 60 61 69 64 62 66 68 58 60 59 63 
74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 70 71 72 73 74 58 59 60 61 62 63 64 65...

result:

ok ok (3000 test cases)

Test #8:

score: 0
Accepted
time: 72ms
memory: 38940kb

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:

100 99 98 97 96 100 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 92 93 94 95 100 96 97 98 85 86 92 73 74 75 76 77 78 79 80 96 100 95 94 93 85 98 97 76 75 74 77 73 92 86 81 82 83 78 94 95 100 96 80 79 84 87 88 89 90 91 99 76 97 98 85 93 73 77 74 92 75 82 88 87 84 79 80 
108 10...

result:

ok ok (2000 test cases)

Test #9:

score: 0
Accepted
time: 67ms
memory: 38892kb

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:

151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 149 150 151 115 114 113 112 111 110 109 144 145 135 134 136 137 138 139 140 141 142 143 146 147 148 108 107 126 127 128 129 117 118 119 120 144 109 110 111 ...

result:

ok ok (1500 test cases)

Test #10:

score: 0
Accepted
time: 72ms
memory: 38784kb

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:

192 192 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 187 188 186 189 190 191 192 155 154 153 152 151 150 149 148 147 146 145 171 172 173 174 175 176 165 166 167 168 169 170 177 178 179 180 181 182 ...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 76ms
memory: 38892kb

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:

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 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 385 386 387 388 389 390 391 392 393 394 395 ...

result:

ok ok (500 test cases)

Test #12:

score: 0
Accepted
time: 56ms
memory: 38692kb

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:

8 8 8 8 
6 6 
8 8 8 8 
-1
7 7 7 
-1
-1
7 7 7 
-1
9 8 9 9 9 
9 9 9 9 9 
9 9 8 8 8 
7 7 7 
8 7 7 7 
9 8 9 8 8 
9 9 8 9 9 
6 6 
6 6 
6 6 
9 8 9 9 9 
7 7 7 
8 8 8 8 
-1
7 6 6 
9 9 9 9 9 
9 8 9 9 9 
7 7 7 
6 6 
9 9 9 9 9 
7 7 7 
-1
7 7 7 
9 9 9 9 9 
9 8 9 9 9 
9 8 9 9 9 
7 7 7 
8 8 8 8 
-1
7 7 7 
-1
8 7 ...

result:

ok ok (41902 test cases)

Test #13:

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

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:

13 13 13 12 13 12 12 13 13 
11 10 9 10 9 10 9 
8 8 7 7 
12 11 10 12 10 12 10 10 
12 12 11 11 11 11 11 11 
7 7 7 
11 10 9 10 9 10 9 
13 12 12 12 12 12 12 12 12 
14 13 12 14 12 13 12 14 12 14 
10 10 9 10 9 9 
12 11 10 10 10 10 11 11 
7 7 7 
14 13 14 13 12 11 12 13 14 14 
11 11 11 11 10 10 10 
12 11 12...

result:

ok ok (15702 test cases)

Test #14:

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

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:

13 12 11 13 12 13 12 13 12 
-1
15 14 13 12 14 15 12 15 12 14 12 
15 14 13 15 14 15 15 14 13 15 15 
14 13 12 12 13 14 14 14 14 14 
9 9 9 9 9 
10 9 9 9 9 9 
11 10 9 9 10 10 9 
14 13 12 11 10 10 10 11 11 11 
16 15 14 13 16 15 14 14 15 16 14 14 
24 23 22 21 20 19 18 22 21 23 20 19 18 22 21 20 23 19 18 2...

result:

ok ok (4960 test cases)

Test #15:

score: 0
Accepted
time: 67ms
memory: 38860kb

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:

36 35 34 33 32 31 30 29 28 27 36 35 34 33 32 31 30 29 28 27 36 35 33 32 31 30 29 28 27 36 35 33 
7 7 7 
35 34 33 32 31 30 29 28 27 35 34 33 32 31 30 29 27 28 35 34 33 31 30 32 29 27 28 34 33 31 30 
24 23 22 21 20 19 24 23 22 21 20 19 24 23 22 21 20 19 24 23 
37 37 37 37 37 37 37 37 37 37 37 37 37 37...

result:

ok ok (871 test cases)

Test #16:

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

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:

32 31 30 29 28 27 26 31 32 29 28 30 25 24 26 27 23 29 32 28 27 26 24 25 30 32 29 27 
54 54 54 54 53 52 51 50 49 48 47 49 50 51 52 53 54 46 46 46 54 53 46 52 51 50 49 47 52 52 52 47 49 50 51 46 53 54 47 46 51 51 51 46 47 54 53 53 54 47 
22 21 20 19 18 17 16 18 19 20 21 18 16 19 17 21 16 19 
41 40 39 ...

result:

ok ok (929 test cases)

Test #17:

score: 0
Accepted
time: 62ms
memory: 38784kb

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:

38 37 36 35 34 33 32 31 30 29 38 28 35 36 34 37 32 33 30 29 38 31 36 34 33 32 37 35 30 31 36 38 29 33 
15 14 13 12 15 13 12 15 13 12 15 
49 49 49 49 49 49 49 49 49 48 47 46 45 44 43 42 41 40 39 38 37 36 47 48 49 35 34 33 36 37 38 39 40 41 42 43 48 36 33 34 35 39 38 37 49 
37 36 35 34 33 32 31 30 29 ...

result:

ok ok (934 test cases)

Test #18:

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

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:

82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 81 82 80 77 76 74 75 78 72 71 73 69 68 70 66 67 79 64 62 63 65 60 81 80 77 82 61 74 76 75 72 78 68 70 69 73 66 67 64 63 62 79 65 80 81 60 82 77 74 61 76 75 68 70 78 
100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 7...

result:

ok ok (216 test cases)

Test #19:

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

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:

14 13 14 12 11 13 14 12 13 11 
91 90 89 88 87 86 85 91 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 89 85 86 87 88 90 84 78 79 80 81 82 83 74 75 76 77 69 70 67 65 66 68 89 71 72 85 73 90 88 87 80 79 78 84 86 74 83 82 77 76 69 65 67 70 75 73 85 72 71 89 68 66 78 79 80 87 88 77 
60 59 5...

result:

ok ok (243 test cases)

Test #20:

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

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:

53 52 51 50 49 48 47 46 45 44 43 52 53 42 41 40 39 50 49 46 43 52 44 45 47 42 53 48 41 40 51 49 50 39 44 52 42 41 48 53 47 45 40 43 49 39 50 51 50 
49 48 47 46 45 49 48 44 43 42 46 47 45 44 48 49 41 40 45 47 46 42 43 39 48 47 45 40 41 49 39 43 42 46 41 40 45 43 39 49 41 46 46 46 46 
39 38 37 36 35 3...

result:

ok ok (207 test cases)

Test #21:

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

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:

168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 166 167 168 164 165 162 163 161 159 160 158 157 156 155 154 153 152 151 150 149 147 148 145 146 143 144 ...

result:

ok ok (66 test cases)

Test #22:

score: 0
Accepted
time: 51ms
memory: 39884kb

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:

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 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 ...

result:

ok ok (26 test cases)

Test #23:

score: 0
Accepted
time: 64ms
memory: 40696kb

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:

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 114 88 87 86 85 84 83 82 81 111 112 108 109 105 106 107 110 113 104 102 101 100 96 97 98 99 103 95 94 90 89 91 92 88 114 87 84 85 86 112 111 81 108 109 82 83 106 110 113 107 105 101 102 100 96 104 103 95 99 ...

result:

ok ok (15 test cases)

Test #24:

score: 0
Accepted
time: 62ms
memory: 40464kb

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:

220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 220 218 219 158 157 215 216 217 213 214 210 209 211 ...

result:

ok ok (13 test cases)

Test #25:

score: 0
Accepted
time: 161ms
memory: 51220kb

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:

200004 200004 200004 200004 200004 200003 200002 200001 200000 199999 199998 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966...

result:

ok ok (1 test case)

Test #26:

score: 0
Accepted
time: 164ms
memory: 51488kb

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:

199925 199925 199925 199924 199923 199922 199921 199920 199919 199918 199917 199916 199915 199914 199913 199912 199911 199910 199909 199908 199907 199906 199905 199904 199903 199902 199901 199900 199899 199898 199897 199896 199895 199894 199893 199892 199891 199890 199889 199888 199887 199886 199885...

result:

ok ok (1 test case)

Test #27:

score: 0
Accepted
time: 142ms
memory: 51392kb

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:

199911 199911 199910 199909 199908 199907 199906 199905 199904 199903 199902 199901 199900 199899 199898 199897 199896 199895 199894 199893 199892 199891 199890 199889 199888 199887 199886 199885 199884 199883 199882 199881 199880 199879 199878 199877 199876 199875 199874 199873 199872 199871 199870...

result:

ok ok (1 test case)

Test #28:

score: 0
Accepted
time: 141ms
memory: 51052kb

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:

199191 199191 199191 199190 199189 199188 199187 199186 199185 199184 199183 199182 199181 199180 199179 199178 199177 199176 199175 199174 199173 199172 199171 199170 199169 199168 199167 199166 199165 199164 199163 199162 199161 199160 199159 199158 199157 199156 199155 199154 199153 199152 199151...

result:

ok ok (1 test case)

Test #29:

score: 0
Accepted
time: 161ms
memory: 51332kb

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:

199406 199405 199404 199403 199402 199401 199400 199399 199398 199397 199396 199395 199394 199393 199392 199391 199390 199389 199388 199387 199386 199385 199384 199383 199382 199381 199380 199379 199378 199377 199376 199375 199374 199373 199372 199371 199370 199369 199368 199367 199366 199365 199364...

result:

ok ok (1 test case)

Test #30:

score: 0
Accepted
time: 130ms
memory: 51368kb

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:

199608 199607 199606 199605 199604 199603 199602 199601 199600 199599 199598 199597 199596 199595 199594 199593 199592 199591 199590 199589 199588 199587 199586 199585 199584 199583 199582 199581 199580 199579 199578 199577 199576 199575 199574 199573 199572 199571 199570 199569 199568 199567 199566...

result:

ok ok (1 test case)

Test #31:

score: 0
Accepted
time: 133ms
memory: 51328kb

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:

199493 199492 199491 199490 199489 199488 199487 199486 199485 199484 199483 199482 199481 199480 199479 199478 199477 199476 199475 199474 199473 199472 199471 199470 199469 199468 199467 199466 199465 199464 199463 199462 199461 199460 199459 199458 199457 199456 199455 199454 199453 199452 199451...

result:

ok ok (1 test case)

Test #32:

score: 0
Accepted
time: 143ms
memory: 51388kb

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:

199709 199709 199709 199708 199707 199706 199705 199704 199703 199702 199701 199700 199699 199698 199697 199696 199695 199694 199693 199692 199691 199690 199689 199688 199687 199686 199685 199684 199683 199682 199681 199680 199679 199678 199677 199676 199675 199674 199673 199672 199671 199670 199669...

result:

ok ok (1 test case)

Test #33:

score: 0
Accepted
time: 143ms
memory: 51376kb

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:

199356 199356 199355 199354 199353 199352 199351 199350 199349 199348 199347 199346 199345 199344 199343 199342 199341 199340 199339 199338 199337 199336 199335 199334 199333 199332 199331 199330 199329 199328 199327 199326 199325 199324 199323 199322 199321 199320 199319 199318 199317 199316 199315...

result:

ok ok (1 test case)

Test #34:

score: 0
Accepted
time: 144ms
memory: 51540kb

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:

199342 199341 199340 199339 199338 199337 199336 199335 199334 199333 199332 199331 199330 199329 199328 199327 199326 199325 199324 199323 199322 199321 199320 199319 199318 199317 199316 199315 199314 199313 199312 199311 199310 199309 199308 199307 199306 199305 199304 199303 199302 199301 199300...

result:

ok ok (1 test case)

Test #35:

score: 0
Accepted
time: 147ms
memory: 51480kb

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:

199443 199442 199441 199440 199439 199438 199437 199436 199435 199434 199433 199432 199431 199430 199429 199428 199427 199426 199425 199424 199423 199422 199421 199420 199419 199418 199417 199416 199415 199414 199413 199412 199411 199410 199409 199408 199407 199406 199405 199404 199403 199402 199401...

result:

ok ok (1 test case)

Test #36:

score: 0
Accepted
time: 124ms
memory: 46008kb

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:

99798 99797 99796 99795 99794 99793 99792 99791 99790 99789 99788 99787 99786 99785 99784 99783 99782 99781 99780 99779 99778 99777 99776 99775 99774 99773 99772 99771 99770 99769 99768 99767 99766 99765 99764 99763 99762 99761 99760 99759 99758 99757 99756 99755 99754 99753 99752 99751 99750 99749 ...

result:

ok ok (2 test cases)

Test #37:

score: 0
Accepted
time: 120ms
memory: 43844kb

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:

66383 66382 66381 66380 66379 66378 66377 66376 66375 66374 66373 66372 66371 66370 66369 66368 66367 66366 66365 66364 66363 66362 66361 66360 66359 66358 66357 66356 66355 66354 66353 66352 66351 66350 66349 66348 66347 66346 66345 66344 66343 66342 66341 66340 66339 66338 66337 66336 66335 66334 ...

result:

ok ok (3 test cases)

Test #38:

score: 0
Accepted
time: 122ms
memory: 42060kb

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:

39518 39517 39516 39515 39514 39513 39512 39511 39510 39509 39508 39507 39506 39505 39504 39503 39502 39501 39500 39499 39498 39497 39496 39495 39494 39493 39492 39491 39490 39489 39488 39487 39486 39485 39484 39483 39482 39481 39480 39479 39478 39477 39476 39475 39474 39473 39472 39471 39470 39469 ...

result:

ok ok (5 test cases)

Test #39:

score: 0
Accepted
time: 108ms
memory: 40564kb

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:

20102 20101 20100 20099 20098 20097 20096 20095 20094 20093 20092 20091 20090 20089 20088 20087 20086 20085 20084 20083 20082 20081 20080 20079 20078 20077 20076 20075 20074 20073 20072 20071 20070 20069 20068 20067 20066 20065 20064 20063 20062 20061 20060 20059 20058 20057 20056 20055 20054 20053 ...

result:

ok ok (10 test cases)

Test #40:

score: 0
Accepted
time: 93ms
memory: 39804kb

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:

10040 10039 10038 10037 10036 10035 10034 10033 10032 10031 10030 10029 10028 10027 10026 10025 10024 10023 10022 10021 10020 10019 10018 10017 10016 10015 10014 10013 10012 10011 10010 10009 10008 10007 10006 10005 10004 10003 10002 10001 10000 9999 9998 9997 9996 9995 9994 9993 9992 9991 9990 9989...

result:

ok ok (20 test cases)

Test #41:

score: 0
Accepted
time: 92ms
memory: 39248kb

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:

4029 4028 4027 4026 4025 4024 4023 4022 4021 4020 4019 4018 4017 4016 4015 4014 4013 4012 4011 4010 4009 4008 4007 4006 4005 4004 4003 4002 4001 4000 3999 3998 3997 3996 3995 3994 3993 3992 3991 3990 3989 3988 3987 3986 3985 3984 3983 3982 3981 3980 3979 3978 3977 3976 3975 3974 3973 3972 3971 3970 ...

result:

ok ok (50 test cases)

Test #42:

score: 0
Accepted
time: 86ms
memory: 38960kb

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:

1984 1983 1982 1981 1980 1979 1978 1977 1976 1975 1974 1973 1972 1971 1970 1969 1968 1967 1966 1965 1964 1963 1962 1961 1960 1959 1958 1957 1956 1955 1954 1953 1952 1951 1950 1949 1948 1947 1946 1945 1944 1943 1942 1941 1940 1939 1938 1937 1936 1935 1934 1933 1932 1931 1930 1929 1928 1927 1926 1925 ...

result:

ok ok (100 test cases)

Test #43:

score: 0
Accepted
time: 86ms
memory: 38944kb

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:

992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924 923 922 921 920 919 918 ...

result:

ok ok (200 test cases)

Test #44:

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

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
29 29 29 28 27 26 26 26 26 27 28 29 25 28 27 27 27 27 27 28 25 29 26 26 26 
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 
-1
29 28 27 29 26 26 26 26 26 26 26 26 26 26 26 26 29 27 27 27 27 27 27 27 2...

result:

ok ok (5599 test cases)

Test #45:

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

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
56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 
59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 58 57 56 55 54 53 52 51 50 50 50 50 50 50 50...

result:

ok ok (3304 test cases)

Test #46:

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

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
93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 
-1
312 312 312 312 312 312...

result:

ok ok (781 test cases)

Test #47:

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

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:

94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 94 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 94 94 94 94 94 
278 278 278 278 278 278 278 2...

result:

ok ok (735 test cases)

Test #48:

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

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:

144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 144 ...

result:

ok ok (777 test cases)

Test #49:

score: 0
Accepted
time: 54ms
memory: 38860kb

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:

889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 889 888 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 887 ...

result:

ok ok (385 test cases)

Test #50:

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

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:

71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 71 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 
-1
-1
4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 4855 48...

result:

ok ok (77 test cases)

Test #51:

score: 0
Accepted
time: 69ms
memory: 39644kb

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
5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 5047 50...

result:

ok ok (42 test cases)

Test #52:

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

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
7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 7359 73...

result:

ok ok (8 test cases)