QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#674222#8726. Magic ShowPhysics212303100 ✓1ms1908kbC++171.7kb2024-10-25 14:36:262024-10-25 14:36:29

Judging History

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

  • [2024-10-25 14:36:29]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:1908kb
  • [2024-10-25 14:36:26]
  • 提交

Alice

#include "Alice.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=5000;
mt19937 g(time(0)),g2(20090219);
inline vector<int> gen(){
  vector<int> p(N);
  iota(p.begin(),p.end(),0);
  shuffle(p.begin(),p.end(),g2);
  return p;
}
vector<pii> Alice(){
  ll X=setN(N);
  vector<pii> e;
  int B=131;
  if(X<=N){
    for(int i=1;i<=N;i++)
      if(X!=i)e.emplace_back(X,i);
    return e;
  }
  vector<int> v;
  while(X)v.emplace_back(X%B),X/=B;
  for(int i=3001;i<=5000;i++)
    e.emplace_back(i,v.size()<<3^(i/61<<2)^(i%61));
  for(int i=501,c=0;i<=3000;i++,c%=v.size())
    e.emplace_back(i,v[c++]<<1^(i%200)^(i/200));
  for(int i=2;i<=500;i++)
    e.emplace_back(i,g()%(i-1)+1);
  auto p=gen();
  for(auto &[x,y]:e)
    assert(x>=y),x=p[x-1]+1,y=p[y-1]+1;
  shuffle(e.begin(),e.end(),g);
  return e;
}

Bob

#include "Bob.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int N=5000;
mt19937 g2(20090219);
inline vector<int> gen(){
  vector<int> p(N),a(N);
  iota(p.begin(),p.end(),0);
  shuffle(p.begin(),p.end(),g2);
  for(int i=0;i<N;i++)
    a[p[i]]=i;
  return a;
}
ll Bob(vector<pii> e){
  int B=131,E=-1;
  vector<int> X(N+1,-1),C(N+1);
  auto p=gen();
  for(auto &[x,y]:e){
    C[x]++,C[y]++;
    x=p[x-1]+1,y=p[y-1]+1;
    if(x>y)swap(x,y);
    if(y>3000)E=(x^(y%61)^(y/61<<2))>>3;
    else if(y>500)X[y-501]=(x^(y%200)^(y/200))>>1;
  }
  for(int i=1;i<=N;i++)
    if(C[i]==e.size())return i;
  assert(~B&&~E);
  vector<int> v(E);
  for(int i=501;i<=3000;i++)
    if(~X[i-501])v[(i-501)%E]=X[i-501];
  ll c=0,s=1;
  for(int i=0;i<E;i++,s*=B)
    c+=s*v[i];
  return c;
}

详细

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1880kb,1896kb

input:

1
4005

output:

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

input:

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

output:

2
5000 3602
1 4005
3 4005
4 4005
5 4005
7 4005
8 4005
9 4005
11 4005
12 4005
13 4005
14 4005
15 4005
16 4005
17 4005
18 4005
21 4005
22 4005
23 4005
24 4005
27 4005
29 4005
30 4005
31 4005
32 4005
33 4005
34 4005
35 4005
36 4005
37 4005
38 4005
39 4005
40 4005
42 4005
43 4005
44 4005
46 4005
47 4005...

input:

2
5000 3602
1 4005
3 4005
4 4005
5 4005
7 4005
8 4005
9 4005
11 4005
12 4005
13 4005
14 4005
15 4005
16 4005
17 4005
18 4005
21 4005
22 4005
23 4005
24 4005
27 4005
29 4005
30 4005
31 4005
32 4005
33 4005
34 4005
35 4005
36 4005
37 4005
38 4005
39 4005
40 4005
42 4005
43 4005
44 4005
46 4005
47 4005...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1892kb

input:

1
459

output:

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

input:

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

output:

2
5000 3602
1 459
3 459
4 459
5 459
7 459
8 459
9 459
11 459
12 459
13 459
14 459
15 459
16 459
17 459
18 459
21 459
22 459
23 459
24 459
27 459
29 459
30 459
31 459
32 459
33 459
34 459
35 459
36 459
37 459
38 459
39 459
40 459
42 459
43 459
44 459
46 459
47 459
48 459
49 459
50 459
51 459
53 459
5...

input:

2
5000 3602
1 459
3 459
4 459
5 459
7 459
8 459
9 459
11 459
12 459
13 459
14 459
15 459
16 459
17 459
18 459
21 459
22 459
23 459
24 459
27 459
29 459
30 459
31 459
32 459
33 459
34 459
35 459
36 459
37 459
38 459
39 459
40 459
42 459
43 459
44 459
46 459
47 459
48 459
49 459
50 459
51 459
53 459
5...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1896kb

input:

1
2495

output:

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

input:

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

output:

2
5000 3602
1 2495
3 2495
4 2495
5 2495
7 2495
8 2495
9 2495
11 2495
12 2495
13 2495
14 2495
15 2495
16 2495
17 2495
18 2495
21 2495
22 2495
23 2495
24 2495
27 2495
29 2495
30 2495
31 2495
32 2495
33 2495
34 2495
35 2495
36 2495
37 2495
38 2495
39 2495
40 2495
42 2495
43 2495
44 2495
46 2495
47 2495...

input:

2
5000 3602
1 2495
3 2495
4 2495
5 2495
7 2495
8 2495
9 2495
11 2495
12 2495
13 2495
14 2495
15 2495
16 2495
17 2495
18 2495
21 2495
22 2495
23 2495
24 2495
27 2495
29 2495
30 2495
31 2495
32 2495
33 2495
34 2495
35 2495
36 2495
37 2495
38 2495
39 2495
40 2495
42 2495
43 2495
44 2495
46 2495
47 2495...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1892kb

input:

3
1560

output:

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

input:

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

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1892kb

input:

3
3594

output:

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

input:

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

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1880kb,1900kb

input:

3
1750

output:

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

input:

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

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1880kb,1900kb

input:

5
4878

output:

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

input:

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

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1892kb

input:

5
1223

output:

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

input:

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

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 1ms = 0ms + 1ms
memory: 1876kb,1900kb

input:

5
648

output:

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

input:

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

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

7
4475

output:

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

input:

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

output:

8
5000 2500
1 4475
2 4475
4 4475
8 4475
9 4475
11 4475
13 4475
14 4475
15 4475
17 4475
18 4475
23 4475
26 4475
27 4475
28 4475
29 4475
30 4475
31 4475
32 4475
34 4475
38 4475
39 4475
40 4475
41 4475
43 4475
44 4475
45 4475
49 4475
50 4475
51 4475
52 4475
56 4475
60 4475
63 4475
68 4475
73 4475
75 44...

input:

8
5000 2500
1 4475
2 4475
4 4475
8 4475
9 4475
11 4475
13 4475
14 4475
15 4475
17 4475
18 4475
23 4475
26 4475
27 4475
28 4475
29 4475
30 4475
31 4475
32 4475
34 4475
38 4475
39 4475
40 4475
41 4475
43 4475
44 4475
45 4475
49 4475
50 4475
51 4475
52 4475
56 4475
60 4475
63 4475
68 4475
73 4475
75 44...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

7
4240

output:

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

input:

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

output:

8
5000 2500
1 4240
2 4240
4 4240
8 4240
9 4240
11 4240
13 4240
14 4240
15 4240
17 4240
18 4240
23 4240
26 4240
27 4240
28 4240
29 4240
30 4240
31 4240
32 4240
34 4240
38 4240
39 4240
40 4240
41 4240
43 4240
44 4240
45 4240
49 4240
50 4240
51 4240
52 4240
56 4240
60 4240
63 4240
68 4240
73 4240
75 42...

input:

8
5000 2500
1 4240
2 4240
4 4240
8 4240
9 4240
11 4240
13 4240
14 4240
15 4240
17 4240
18 4240
23 4240
26 4240
27 4240
28 4240
29 4240
30 4240
31 4240
32 4240
34 4240
38 4240
39 4240
40 4240
41 4240
43 4240
44 4240
45 4240
49 4240
50 4240
51 4240
52 4240
56 4240
60 4240
63 4240
68 4240
73 4240
75 42...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

7
1291

output:

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

input:

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

output:

8
5000 2500
1 1291
2 1291
4 1291
8 1291
9 1291
11 1291
13 1291
14 1291
15 1291
17 1291
18 1291
23 1291
26 1291
27 1291
28 1291
29 1291
30 1291
31 1291
32 1291
34 1291
38 1291
39 1291
40 1291
41 1291
43 1291
44 1291
45 1291
49 1291
50 1291
51 1291
52 1291
56 1291
60 1291
63 1291
68 1291
73 1291
75 12...

input:

8
5000 2500
1 1291
2 1291
4 1291
8 1291
9 1291
11 1291
13 1291
14 1291
15 1291
17 1291
18 1291
23 1291
26 1291
27 1291
28 1291
29 1291
30 1291
31 1291
32 1291
34 1291
38 1291
39 1291
40 1291
41 1291
43 1291
44 1291
45 1291
49 1291
50 1291
51 1291
52 1291
56 1291
60 1291
63 1291
68 1291
73 1291
75 12...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1904kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 2119
1489 2802
4222 1820
4221 1337
1758 941
142 2975
1204 4179
2517 1296
1301 689
2363 899
2591 2499
3147 4189
3053 2482
2048 2627
2166 1028
4377 3067
3383 335...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 2119
1489 2802
4222 1820
4221 1337
1758 941
142 2975
1204 4179
2517 1296
1301 689
2363 899
2591 2499
3147 4189
3053 2482
2048 2627
2166 1028
4377 3067
3383 335...

output:

2
5000 3602
1 1138
1 1150
1 2047
1 2150
1 3274
1 3479
1 3827
1 4281
3 4497
4 1163
5 4179
6 1249
7 2630
9 775
10 255
12 3406
13 875
14 1028
15 3453
17 1848
18 1296
19 3960
21 4321
22 4205
23 2482
24 4612
25 1214
26 1644
27 4625
28 4184
29 2573
30 1503
31 3311
32 941
34 3318
35 250
35 301
35 1350
35 1...

input:

2
5000 3602
1 1138
1 1150
1 2047
1 2150
1 3274
1 3479
1 3827
1 4281
3 4497
4 1163
5 4179
6 1249
7 2630
9 775
10 255
12 3406
13 875
14 1028
15 3453
17 1848
18 1296
19 3960
21 4321
22 4205
23 2482
24 4612
25 1214
26 1644
27 4625
28 4184
29 2573
30 1503
31 3311
32 941
34 3318
35 250
35 301
35 1350
35 1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1908kb

input:

1
11926600

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 2119
1489 2802
4222 1304
4221 1337
1758 3304
142 2975
1204 4179
2517 1296
1301 3832
2363 3578
2591 4418
3147 4189
3053 3058
2048 2627
2166 3718
4377 3067
3383 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 2119
1489 2802
4222 1304
4221 1337
1758 3304
142 2975
1204 4179
2517 1296
1301 3832
2363 3578
2591 4418
3147 4189
3053 3058
2048 2627
2166 3718
4377 3067
3383 ...

output:

2
5000 3602
1 915
1 959
1 1425
1 2967
1 3391
1 4179
3 1982
4 4344
5 3655
6 1249
7 1416
9 775
10 255
12 3406
13 1862
14 1028
15 1477
17 1848
18 946
19 753
21 168
21 2823
21 2913
21 4321
22 4205
23 2583
24 4308
25 1214
26 1644
27 4994
28 1152
29 1494
30 942
31 3311
32 3304
34 1304
35 205
35 228
35 250...

input:

2
5000 3602
1 915
1 959
1 1425
1 2967
1 3391
1 4179
3 1982
4 4344
5 3655
6 1249
7 1416
9 775
10 255
12 3406
13 1862
14 1028
15 1477
17 1848
18 946
19 753
21 168
21 2823
21 2913
21 4321
22 4205
23 2583
24 4308
25 1214
26 1644
27 4994
28 1152
29 1494
30 942
31 3311
32 3304
34 1304
35 205
35 228
35 250...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1904kb

input:

1
16602378

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 2119
1489 2802
4222 1820
4221 1337
1758 4199
142 2975
1204 4179
2517 1296
1301 689
2363 3453
2591 2091
3147 4189
3053 2482
2048 2627
2166 1427
4377 3067
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 2119
1489 2802
4222 1820
4221 1337
1758 4199
142 2975
1204 4179
2517 1296
1301 689
2363 3453
2591 2091
3147 4189
3053 2482
2048 2627
2166 1427
4377 3067
3383 3...

output:

2
5000 3602
1 315
1 1382
1 1979
1 3125
1 3479
1 3688
1 3769
1 4281
3 4497
4 987
5 4080
6 1249
7 2620
9 775
10 255
12 3406
13 3100
14 1028
15 2533
17 1848
18 4152
19 3960
21 4321
22 4205
23 1264
24 3578
25 1214
26 1644
27 45
28 3513
29 2482
30 4204
31 3311
32 4199
34 2621
35 250
35 301
35 1350
35 192...

input:

2
5000 3602
1 315
1 1382
1 1979
1 3125
1 3479
1 3688
1 3769
1 4281
3 4497
4 987
5 4080
6 1249
7 2620
9 775
10 255
12 3406
13 3100
14 1028
15 2533
17 1848
18 4152
19 3960
21 4321
22 4205
23 1264
24 3578
25 1214
26 1644
27 45
28 3513
29 2482
30 4204
31 3311
32 4199
34 2621
35 250
35 301
35 1350
35 192...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

3
13129243

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 2119
1489 2802
4222 1304
4221 1337
1758 4408
142 2975
1204 4179
2517 1296
1301 3832
2363 2482
2591 1176
3147 4189
3053 3058
2048 2627
2166 1673
4377 3067
3383 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 2119
1489 2802
4222 1304
4221 1337
1758 4408
142 2975
1204 4179
2517 1296
1301 3832
2363 2482
2591 1176
3147 4189
3053 3058
2048 2627
2166 1673
4377 3067
3383 ...

output:

4
5000 2500
1 404
1 760
1 959
1 1425
1 2967
1 3211
1 3294
1 4862
1 4897
2 1644
3 1982
5 111
7 4636
11 2554
13 3366
15 2824
16 1204
17 1848
18 2760
19 753
20 753
21 423
21 2285
21 3370
21 4321
24 2811
25 1214
26 1644
27 4279
28 3318
29 3453
30 2413
34 4184
38 1214
39 3716
41 3367
42 3101
47 114
49 29...

input:

4
5000 2500
1 404
1 760
1 959
1 1425
1 2967
1 3211
1 3294
1 4862
1 4897
2 1644
3 1982
5 111
7 4636
11 2554
13 3366
15 2824
16 1204
17 1848
18 2760
19 753
20 753
21 423
21 2285
21 3370
21 4321
24 2811
25 1214
26 1644
27 4279
28 3318
29 3453
30 2413
34 4184
38 1214
39 3716
41 3367
42 3101
47 114
49 29...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

3
7892141

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 2119
1489 2802
4222 4667
4221 1337
1758 2160
142 2975
1204 4179
2517 1296
1301 2630
2363 4497
2591 434
3147 4189
3053 4625
2048 2627
2166 3961
4377 3067
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 2119
1489 2802
4222 4667
4221 1337
1758 2160
142 2975
1204 4179
2517 1296
1301 2630
2363 4497
2591 434
3147 4189
3053 4625
2048 2627
2166 3961
4377 3067
3383 3...

output:

4
5000 2500
1 659
1 690
1 1603
1 2508
1 3833
1 4074
1 4436
1 4664
1 4880
2 1644
3 4989
4 1340
5 2382
7 4359
16 1176
17 1848
19 1695
20 2002
21 423
21 2285
21 3370
21 4321
21 4886
23 117
25 1214
26 1644
27 4870
30 4188
32 2160
38 1214
39 3716
40 570
41 3659
49 3367
50 4388
52 2630
53 4102
54 3296
56 ...

input:

4
5000 2500
1 659
1 690
1 1603
1 2508
1 3833
1 4074
1 4436
1 4664
1 4880
2 1644
3 4989
4 1340
5 2382
7 4359
16 1176
17 1848
19 1695
20 2002
21 423
21 2285
21 3370
21 4321
21 4886
23 117
25 1214
26 1644
27 4870
30 4188
32 2160
38 1214
39 3716
40 570
41 3659
49 3367
50 4388
52 2630
53 4102
54 3296
56 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1884kb

input:

3
21314775

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 2119
1489 2802
4222 1152
4221 1337
1758 1925
142 2975
1204 4179
2517 1296
1301 2620
2363 1401
2591 2044
3147 4189
3053 45
2048 2627
2166 2413
4377 3067
3383 33...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 2119
1489 2802
4222 1152
4221 1337
1758 1925
142 2975
1204 4179
2517 1296
1301 2620
2363 1401
2591 2044
3147 4189
3053 45
2048 2627
2166 2413
4377 3067
3383 33...

output:

4
5000 2500
1 100
1 492
1 1592
1 1691
1 1998
1 2038
1 2152
1 2238
1 2530
1 2912
1 3037
1 4185
2 1644
3 3664
13 2239
15 554
16 4152
17 1848
18 987
19 4593
20 3320
21 423
21 2285
21 3370
21 4321
23 4958
25 1214
26 1644
27 1982
28 4533
29 4368
30 1673
32 1925
34 2418
38 1214
39 3716
40 2022
41 1623
42 ...

input:

4
5000 2500
1 100
1 492
1 1592
1 1691
1 1998
1 2038
1 2152
1 2238
1 2530
1 2912
1 3037
1 4185
2 1644
3 3664
13 2239
15 554
16 4152
17 1848
18 987
19 4593
20 3320
21 423
21 2285
21 3370
21 4321
23 4958
25 1214
26 1644
27 1982
28 4533
29 4368
30 1673
32 1925
34 2418
38 1214
39 3716
40 2022
41 1623
42 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

5
5559540

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 2119
1489 2802
4222 2935
4221 1337
1758 4886
142 2975
1204 4179
2517 1296
1301 3513
2363 1477
2591 1573
3147 4189
3053 1401
2048 2627
2166 2406
4377 3067
3383 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 2119
1489 2802
4222 2935
4221 1337
1758 4886
142 2975
1204 4179
2517 1296
1301 3513
2363 1477
2591 1573
3147 4189
3053 1401
2048 2627
2166 2406
4377 3067
3383 ...

output:

6
5000 2503
1 4598
2 1644
3 4188
5 4019
10 255
11 1652
12 3406
16 713
17 1848
18 3960
19 4140
21 4886
28 532
31 3311
32 4886
33 4108
34 3364
35 55
35 250
35 301
35 1012
35 1350
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 3510
35 4076
35 4351
36 3009
40 3367
43 941
44 3311
45 6...

input:

6
5000 2503
1 4598
2 1644
3 4188
5 4019
10 255
11 1652
12 3406
16 713
17 1848
18 3960
19 4140
21 4886
28 532
31 3311
32 4886
33 4108
34 3364
35 55
35 250
35 301
35 1012
35 1350
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 3510
35 4076
35 4351
36 3009
40 3367
43 941
44 3311
45 6...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

5
9424319

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 2119
1489 2802
4222 1217
4221 1337
1758 1296
142 2975
1204 4179
2517 1296
1301 4193
2363 4667
2591 2077
3147 4189
3053 1424
2048 2627
2166 532
4377 3067
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 2119
1489 2802
4222 1217
4221 1337
1758 1296
142 2975
1204 4179
2517 1296
1301 4193
2363 4667
2591 2077
3147 4189
3053 1424
2048 2627
2166 532
4377 3067
3383 3...

output:

6
5000 2501
1 486
1 1008
1 1315
1 1367
1 1529
1 1852
1 2080
1 2532
1 2550
1 3093
1 3227
1 4107
5 4199
6 1249
7 4279
8 1506
9 775
11 1382
14 1028
15 1494
18 1925
20 2017
21 423
21 2285
21 3370
21 4321
22 4205
23 2658
24 1846
25 1214
26 1644
27 4636
30 1846
32 1296
35 2684
37 628
38 1214
39 3716
40 36...

input:

6
5000 2501
1 486
1 1008
1 1315
1 1367
1 1529
1 1852
1 2080
1 2532
1 2550
1 3093
1 3227
1 4107
5 4199
6 1249
7 4279
8 1506
9 775
11 1382
14 1028
15 1494
18 1925
20 2017
21 423
21 2285
21 3370
21 4321
22 4205
23 2658
24 1846
25 1214
26 1644
27 4636
30 1846
32 1296
35 2684
37 628
38 1214
39 3716
40 36...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1884kb

input:

5
10955780

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 2119
1489 2802
4222 1217
4221 1337
1758 2973
142 2975
1204 4179
2517 1296
1301 4193
2363 4308
2591 2022
3147 4189
3053 1424
2048 2627
2166 838
4377 3067
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 2119
1489 2802
4222 1217
4221 1337
1758 2973
142 2975
1204 4179
2517 1296
1301 4193
2363 4308
2591 2022
3147 4189
3053 1424
2048 2627
2166 838
4377 3067
3383 3...

output:

6
5000 2502
1 1485
5 1410
6 1249
8 1506
9 775
11 1382
13 111
14 1028
15 4184
16 775
18 3687
20 2687
21 423
21 2285
21 3370
21 4321
22 4205
24 4279
25 1214
26 1644
27 1477
35 2684
37 628
38 1214
39 3716
41 1862
45 4685
46 2553
47 1862
50 2958
54 3296
57 775
58 146
59 2540
61 670
63 399
64 1695
66 440...

input:

6
5000 2502
1 1485
5 1410
6 1249
8 1506
9 775
11 1382
13 111
14 1028
15 4184
16 775
18 3687
20 2687
21 423
21 2285
21 3370
21 4321
22 4205
24 4279
25 1214
26 1644
27 1477
35 2684
37 628
38 1214
39 3716
41 1862
45 4685
46 2553
47 1862
50 2958
54 3296
57 775
58 146
59 2540
61 670
63 399
64 1695
66 440...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 1ms = 1ms + 0ms
memory: 1884kb,1892kb

input:

7
19938721

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
1015 2119
1489 2802
4222 508
4221 1337
1758 2357
142 2975
1204 4179
2517 1296
1301 1737
2363 2891
2591 1862
3147 4189
3053 2228
2048 2627
2166 1494
4377 3067
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
1015 2119
1489 2802
4222 508
4221 1337
1758 2357
142 2975
1204 4179
2517 1296
1301 1737
2363 2891
2591 1862
3147 4189
3053 2228
2048 2627
2166 1494
4377 3067
3383 3...

output:

8
5000 2500
2 1644
3 1494
6 1249
10 255
12 3406
14 1028
15 1846
16 4031
17 1848
18 4593
24 1494
25 1214
26 1644
31 3311
35 55
35 250
35 301
35 385
35 798
35 1012
35 1350
35 1621
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 4076
35 4351
36 3009
37 628
38 1214
39 3716
40 4992
43 ...

input:

8
5000 2500
2 1644
3 1494
6 1249
10 255
12 3406
14 1028
15 1846
16 4031
17 1848
18 4593
24 1494
25 1214
26 1644
31 3311
35 55
35 250
35 301
35 385
35 798
35 1012
35 1350
35 1621
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 4076
35 4351
36 3009
37 628
38 1214
39 3716
40 4992
43 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

7
5129508

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
1015 2119
1489 2802
4222 2935
4221 1337
1758 3175
142 2975
1204 4179
2517 1296
1301 3513
2363 482
2591 236
3147 4189
3053 1401
2048 2627
2166 4439
4377 3067
3383 33...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
1015 2119
1489 2802
4222 2935
4221 1337
1758 3175
142 2975
1204 4179
2517 1296
1301 3513
2363 482
2591 236
3147 4189
3053 1401
2048 2627
2166 4439
4377 3067
3383 33...

output:

8
5000 2500
2 1644
6 1249
8 1506
9 775
10 255
13 4152
15 3058
17 1848
18 4317
23 4368
25 1214
26 1644
27 918
29 298
30 287
31 3311
32 3175
34 3058
35 55
35 250
35 301
35 1012
35 1350
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 4076
35 4351
36 3009
37 628
38 1214
39 3716
42 236...

input:

8
5000 2500
2 1644
6 1249
8 1506
9 775
10 255
13 4152
15 3058
17 1848
18 4317
23 4368
25 1214
26 1644
27 918
29 298
30 287
31 3311
32 3175
34 3058
35 55
35 250
35 301
35 1012
35 1350
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 4076
35 4351
36 3009
37 628
38 1214
39 3716
42 236...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1884kb

input:

7
15332941

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
1015 2119
1489 2802
4222 4612
4221 1337
1758 3352
142 2975
1204 4179
2517 1296
1301 2965
2363 4497
2591 410
3147 4189
3053 1477
2048 2627
2166 1503
4377 3067
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
1015 2119
1489 2802
4222 4612
4221 1337
1758 3352
142 2975
1204 4179
2517 1296
1301 2965
2363 4497
2591 410
3147 4189
3053 1477
2048 2627
2166 1503
4377 3067
3383 3...

output:

8
5000 2500
2 1644
3 2406
5 3380
6 1249
8 1506
9 775
10 255
14 1028
16 1176
17 1848
18 713
20 399
23 45
24 508
25 1214
26 1644
27 1264
29 628
30 1028
31 3311
32 3352
34 4937
35 55
35 250
35 301
35 1012
35 1350
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 4076
35 4351
36 3009
37...

input:

8
5000 2500
2 1644
3 2406
5 3380
6 1249
8 1506
9 775
10 255
14 1028
16 1176
17 1848
18 713
20 399
23 45
24 508
25 1214
26 1644
27 1264
29 628
30 1028
31 3311
32 3352
34 4937
35 55
35 250
35 301
35 1012
35 1350
35 1927
35 2168
35 2178
35 2419
35 2471
35 2572
35 2982
35 3195
35 4076
35 4351
36 3009
37...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1904kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 4279
4221 2540
1758 4992
142 2975
1204 4179
2517 1296
1301 2824
2363 2553
2591 409
3147 4189
3053 1709
2048 482
2166 689
4377 2754
3383 4317...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 4279
4221 2540
1758 4992
142 2975
1204 4179
2517 1296
1301 2824
2363 2553
2591 409
3147 4189
3053 1709
2048 482
2166 689
4377 2754
3383 4317...

output:

2
5000 3602
1 410
1 813
1 1054
1 1584
1 2219
1 2444
1 2528
1 3610
1 3794
1 3824
1 4392
3 3103
4 4344
5 2382
6 1320
7 4204
9 2017
10 3033
12 337
13 4199
14 3790
15 4636
17 1018
18 2017
19 1340
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 117
24 482
...

input:

2
5000 3602
1 410
1 813
1 1054
1 1584
1 2219
1 2444
1 2528
1 3610
1 3794
1 3824
1 4392
3 3103
4 4344
5 2382
6 1320
7 4204
9 2017
10 3033
12 337
13 4199
14 3790
15 4636
17 1018
18 2017
19 1340
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 117
24 482
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1904kb

input:

1
727827999106414164

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 3058
4221 2540
1758 210
142 2975
1204 4179
2517 1296
1301 554
2363 2630
2591 2958
3147 4189
3053 4989
2048 482
2166 2573
4377 2754
3383 4317...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 3058
4221 2540
1758 210
142 2975
1204 4179
2517 1296
1301 554
2363 2630
2591 2958
3147 4189
3053 4989
2048 482
2166 2573
4377 2754
3383 4317...

output:

2
5000 3602
1 99
1 1421
1 1925
1 2500
1 2947
1 4107
3 1494
4 4593
5 2239
6 1320
7 1820
9 2017
10 3033
12 337
13 4317
14 3790
15 4667
17 1018
18 3251
19 399
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 4184
24 4848
25 811
26 2663
27 2965
28 4102
29 ...

input:

2
5000 3602
1 99
1 1421
1 1925
1 2500
1 2947
1 4107
3 1494
4 4593
5 2239
6 1320
7 1820
9 2017
10 3033
12 337
13 4317
14 3790
15 4667
17 1018
18 3251
19 399
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 4184
24 4848
25 811
26 2663
27 2965
28 4102
29 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1900kb

input:

1
656410143989222955

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 4102
4221 2540
1758 875
142 2975
1204 4179
2517 1296
1301 2573
2363 1047
2591 4786
3147 4189
3053 3033
2048 482
2166 554
4377 2754
3383 4317...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 4102
4221 2540
1758 875
142 2975
1204 4179
2517 1296
1301 2573
2363 1047
2591 4786
3147 4189
3053 3033
2048 482
2166 554
4377 2754
3383 4317...

output:

2
5000 3602
1 18
1 416
1 443
1 539
1 987
1 1064
1 1609
1 1913
1 2102
1 2465
1 4737
3 4497
4 2684
5 3772
6 1320
7 3578
9 2017
10 3033
12 337
13 3147
14 3790
15 2517
17 1018
19 3380
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 255
24 628
25 811
26 26...

input:

2
5000 3602
1 18
1 416
1 443
1 539
1 987
1 1064
1 1609
1 1913
1 2102
1 2465
1 4737
3 4497
4 2684
5 3772
6 1320
7 3578
9 2017
10 3033
12 337
13 3147
14 3790
15 2517
17 1018
19 3380
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 255
24 628
25 811
26 26...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1904kb

input:

1
410366615149657534

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 2674
4221 2540
1758 2687
142 2975
1204 4179
2517 1296
1301 4870
2363 1152
2591 399
3147 4189
3053 3318
2048 482
2166 3345
4377 2754
3383 431...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 2674
4221 2540
1758 2687
142 2975
1204 4179
2517 1296
1301 4870
2363 1152
2591 399
3147 4189
3053 3318
2048 482
2166 3345
4377 2754
3383 431...

output:

2
5000 3602
1 923
1 1054
1 1366
1 1713
1 2501
1 2578
3 3103
4 4080
5 352
6 1320
7 628
9 2017
10 3033
12 337
13 4373
14 3790
15 4636
17 1018
18 3366
19 3673
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 3318
24 1820
25 811
26 2663
27 3318
28 918
29 9...

input:

2
5000 3602
1 923
1 1054
1 1366
1 1713
1 2501
1 2578
3 3103
4 4080
5 352
6 1320
7 628
9 2017
10 3033
12 337
13 4373
14 3790
15 4636
17 1018
18 3366
19 3673
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 3318
24 1820
25 811
26 2663
27 3318
28 918
29 9...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1904kb

input:

1
298090682780948428

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 1344
4221 2540
1758 4179
142 2975
1204 4179
2517 1296
1301 2658
2363 1264
2591 3313
3147 4189
3053 3664
2048 482
2166 2504
4377 2754
3383 43...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1015 503
1489 1695
4222 1344
4221 2540
1758 4179
142 2975
1204 4179
2517 1296
1301 2658
2363 1264
2591 3313
3147 4189
3053 3664
2048 482
2166 2504
4377 2754
3383 43...

output:

2
5000 3602
1 32
1 65
1 484
1 690
1 1176
1 1745
1 2388
1 2530
1 3496
1 4689
3 4989
4 4140
5 427
6 1320
7 298
9 2017
10 3033
12 337
13 4753
14 3790
15 508
17 1018
18 4940
19 3224
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 1152
24 1820
25 811
26 26...

input:

2
5000 3602
1 32
1 65
1 484
1 690
1 1176
1 1745
1 2388
1 2530
1 3496
1 4689
3 4989
4 4140
5 427
6 1320
7 298
9 2017
10 3033
12 337
13 4753
14 3790
15 508
17 1018
18 4940
19 3224
21 681
21 737
21 1065
21 1321
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3837
22 1701
23 1152
24 1820
25 811
26 26...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

3
969441916331132577

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 4958
4221 2540
1758 1652
142 2975
1204 4179
2517 1296
1301 4636
2363 618
2591 4199
3147 4189
3053 2620
2048 482
2166 1095
4377 2754
3383 431...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 4958
4221 2540
1758 1652
142 2975
1204 4179
2517 1296
1301 4636
2363 618
2591 4199
3147 4189
3053 2620
2048 482
2166 1095
4377 2754
3383 431...

output:

4
5000 2500
1 416
1 765
1 1064
1 1110
1 1813
1 2807
1 3080
1 3286
1 3479
1 4176
1 4669
3 4279
5 410
6 1320
12 337
13 2554
17 1018
18 3620
20 1557
23 287
24 628
27 2620
29 2487
30 838
31 4994
32 2091
35 1383
35 3510
35 3674
39 2285
40 4598
44 4994
45 165
45 508
45 638
45 1784
45 2002
45 2554
45 2819
...

input:

4
5000 2500
1 416
1 765
1 1064
1 1110
1 1813
1 2807
1 3080
1 3286
1 3479
1 4176
1 4669
3 4279
5 410
6 1320
12 337
13 2554
17 1018
18 3620
20 1557
23 287
24 628
27 2620
29 2487
30 838
31 4994
32 2091
35 1383
35 3510
35 3674
39 2285
40 4598
44 4994
45 165
45 508
45 638
45 1784
45 2002
45 2554
45 2819
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

3
929489812741933634

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 1095
4221 2540
1758 2973
142 2975
1204 4179
2517 1296
1301 1820
2363 2504
2591 4593
3147 4189
3053 4361
2048 482
2166 3578
4377 2754
3383 43...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 1095
4221 2540
1758 2973
142 2975
1204 4179
2517 1296
1301 1820
2363 2504
2591 4593
3147 4189
3053 4361
2048 482
2166 3578
4377 2754
3383 43...

output:

4
5000 2500
1 49
1 219
1 901
1 2154
1 2881
4 4539
6 1320
7 554
11 2044
13 1651
16 775
19 3620
20 3175
24 4439
30 4671
32 1410
34 3308
35 1383
35 3674
39 2285
40 3673
42 2674
45 508
45 854
45 1564
45 2002
45 2441
45 2554
45 2996
45 3124
45 3443
45 3706
45 4035
47 3100
50 4466
52 2517
53 4757
54 3373
...

input:

4
5000 2500
1 49
1 219
1 901
1 2154
1 2881
4 4539
6 1320
7 554
11 2044
13 1651
16 775
19 3620
20 3175
24 4439
30 4671
32 1410
34 3308
35 1383
35 3674
39 2285
40 3673
42 2674
45 508
45 854
45 1564
45 2002
45 2441
45 2554
45 2996
45 3124
45 3443
45 3706
45 4035
47 3100
50 4466
52 2517
53 4757
54 3373
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1888kb

input:

3
144032041325838295

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 2533
4221 2540
1758 4598
142 2975
1204 4179
2517 1296
1301 4671
2363 255
2591 941
3147 4189
3053 2418
2048 482
2166 1152
4377 2754
3383 4317...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 2533
4221 2540
1758 4598
142 2975
1204 4179
2517 1296
1301 4671
2363 255
2591 941
3147 4189
3053 2418
2048 482
2166 1152
4377 2754
3383 4317...

output:

4
5000 2500
1 20
1 189
1 398
1 1193
1 1627
1 1942
1 2611
1 3024
1 3601
1 4080
1 4838
1 4980
3 4958
4 2022
5 3482
11 4539
13 4462
15 2487
18 4373
19 3100
23 3664
24 689
27 3578
29 2504
30 1820
32 2499
35 1383
35 3674
39 2285
40 114
42 2827
47 3620
49 1573
53 1424
54 3373
55 2583
56 3103
59 1337
60 37...

input:

4
5000 2500
1 20
1 189
1 398
1 1193
1 1627
1 1942
1 2611
1 3024
1 3601
1 4080
1 4838
1 4980
3 4958
4 2022
5 3482
11 4539
13 4462
15 2487
18 4373
19 3100
23 3664
24 689
27 3578
29 2504
30 1820
32 2499
35 1383
35 3674
39 2285
40 114
42 2827
47 3620
49 1573
53 1424
54 3373
55 2583
56 3103
59 1337
60 37...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

3
832110946250826180

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 554
4221 2540
1758 2357
142 2975
1204 4179
2517 1296
1301 4499
2363 2533
2591 2077
3147 4189
3053 2677
2048 482
2166 3103
4377 2754
3383 431...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 503
1489 1695
4222 554
4221 2540
1758 2357
142 2975
1204 4179
2517 1296
1301 4499
2363 2533
2591 2077
3147 4189
3053 2677
2048 482
2166 3103
4377 2754
3383 431...

output:

4
5000 2500
1 492
1 651
1 1008
1 1502
1 2497
1 3032
1 3482
1 4425
3 3664
4 3687
6 1320
8 127
11 4992
12 337
15 2935
16 4514
17 1018
19 358
30 1090
32 1296
35 1383
35 3674
39 2285
40 4189
42 1427
45 53
45 182
45 228
45 508
45 1254
45 1895
45 1920
45 2002
45 2554
45 4035
45 4741
47 4388
48 4381
49 344...

input:

4
5000 2500
1 492
1 651
1 1008
1 1502
1 2497
1 3032
1 3482
1 4425
3 3664
4 3687
6 1320
8 127
11 4992
12 337
15 2935
16 4514
17 1018
19 358
30 1090
32 1296
35 1383
35 3674
39 2285
40 4189
42 1427
45 53
45 182
45 228
45 508
45 1254
45 1895
45 1920
45 2002
45 2554
45 4035
45 4741
47 4388
48 4381
49 344...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1884kb

input:

3
85728715707691821

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 1654
1489 3960
4222 3223
4221 1353
1758 1713
142 2975
1204 4179
2517 1296
1301 4670
2363 3086
2591 2044
3147 4189
3053 918
2048 1701
2166 2546
4377 4597
3383 3...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
5000
1015 1654
1489 3960
4222 3223
4221 1353
1758 1713
142 2975
1204 4179
2517 1296
1301 4670
2363 3086
2591 2044
3147 4189
3053 918
2048 1701
2166 2546
4377 4597
3383 3...

output:

4
5000 2500
1 19
1 1476
1 2038
1 2530
1 3319
1 3412
1 4118
1 4189
2 4768
4 541
5 1382
9 4753
13 219
15 554
16 2357
18 4189
20 427
26 4768
28 4612
30 4937
31 2583
32 1925
34 2487
35 789
35 3484
35 4687
39 1955
40 2022
42 3690
44 2583
45 62
45 508
45 1521
45 1579
45 2002
45 2262
45 2428
45 2554
45 274...

input:

4
5000 2500
1 19
1 1476
1 2038
1 2530
1 3319
1 3412
1 4118
1 4189
2 4768
4 541
5 1382
9 4753
13 219
15 554
16 2357
18 4189
20 427
26 4768
28 4612
30 4937
31 2583
32 1925
34 2487
35 789
35 3484
35 4687
39 1955
40 2022
42 3690
44 2583
45 62
45 508
45 1521
45 1579
45 2002
45 2262
45 2428
45 2554
45 274...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1884kb

input:

5
777434612360931036

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 503
1489 1695
4222 4533
4221 2540
1758 1232
142 2975
1204 4179
2517 1296
1301 618
2363 117
2591 4581
3147 4189
3053 255
2048 482
2166 407
4377 2754
3383 4317
2...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 503
1489 1695
4222 4533
4221 2540
1758 1232
142 2975
1204 4179
2517 1296
1301 618
2363 117
2591 4581
3147 4189
3053 255
2048 482
2166 407
4377 2754
3383 4317
2...

output:

6
5000 2551
1 783
1 1274
1 1591
1 3164
1 3165
1 3401
1 3773
1 3789
1 3810
1 4584
1 4923
2 2663
3 1494
4 2382
8 127
9 2017
11 2592
13 1382
16 352
19 3147
20 775
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2285
21 2731
21 3268
21 3370
21 3520
21 3788
21 3837
21 406...

input:

6
5000 2551
1 783
1 1274
1 1591
1 3164
1 3165
1 3401
1 3773
1 3789
1 3810
1 4584
1 4923
2 2663
3 1494
4 2382
8 127
9 2017
11 2592
13 1382
16 352
19 3147
20 775
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2285
21 2731
21 3268
21 3370
21 3520
21 3788
21 3837
21 406...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1888kb

input:

5
705262511549880222

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 503
1489 1695
4222 3033
4221 2540
1758 4381
142 2975
1204 4179
2517 1296
1301 1427
2363 1737
2591 2592
3147 4189
3053 3345
2048 482
2166 4848
4377 2754
3383 43...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
1015 503
1489 1695
4222 3033
4221 2540
1758 4381
142 2975
1204 4179
2517 1296
1301 1427
2363 1737
2591 2592
3147 4189
3053 3345
2048 482
2166 4848
4377 2754
3383 43...

output:

6
5000 2611
1 1378
1 1412
1 2054
1 3030
1 4775
2 2663
3 1494
5 2684
8 127
9 2017
16 4753
19 1485
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2285
21 2731
21 3268
21 3370
21 3520
21 3788
21 3837
21 4061
22 1701
24 2366
25 811
28 4102
29 4497
30 2494
31 4994
32 377...

input:

6
5000 2611
1 1378
1 1412
1 2054
1 3030
1 4775
2 2663
3 1494
5 2684
8 127
9 2017
16 4753
19 1485
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2285
21 2731
21 3268
21 3370
21 3520
21 3788
21 3837
21 4061
22 1701
24 2366
25 811
28 4102
29 4497
30 2494
31 4994
32 377...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1884kb

input:

5
510318082834167951

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
3758 3428
3197 3313
1381 2935
3611 987
1710 2002
1549 260
2859 1559
161 287
3257 3311
2315 2484
3761 2658
2681 3578
3931 1652
1215 707
2025 4772
3086 2620
3704 1313...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
3758 3428
3197 3313
1381 2935
3611 987
1710 2002
1549 260
2859 1559
161 287
3257 3311
2315 2484
3761 2658
2681 3578
3931 1652
1215 707
2025 4772
3086 2620
3704 1313...

output:

6
5000 2533
1 3482
2 2663
3 1982
4 3380
7 98
9 2017
10 3033
14 3790
15 4848
16 4539
19 410
20 1651
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 3033
29 117
30 4193
31 4994
32 1296
35 1383
35 3508
35 3674
36 2...

input:

6
5000 2533
1 3482
2 2663
3 1982
4 3380
7 98
9 2017
10 3033
14 3790
15 4848
16 4539
19 410
20 1651
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 3033
29 117
30 4193
31 4994
32 1296
35 1383
35 3508
35 3674
36 2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1884kb

input:

5
914858813253258744

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
3758 3428
3197 3313
1381 2811
3611 746
1710 1176
1549 3251
2859 1559
161 1401
3257 3311
2315 2484
3761 612
2681 4205
3931 381
1215 707
2025 4772
3086 2620
3704 1313...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
3758 3428
3197 3313
1381 2811
3611 746
1710 1176
1549 3251
2859 1559
161 1401
3257 3311
2315 2484
3761 612
2681 4205
3931 381
1215 707
2025 4772
3086 2620
3704 1313...

output:

6
5000 2505
1 1573
2 2663
3 1090
9 2017
10 3033
11 2357
14 3790
16 1862
18 3366
19 713
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
23 117
24 1028
30 1701
31 4994
34 3664
35 1383
35 3508
35 3674
36 2213
40 3673
...

input:

6
5000 2505
1 1573
2 2663
3 1090
9 2017
10 3033
11 2357
14 3790
16 1862
18 3366
19 713
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
23 117
24 1028
30 1701
31 4994
34 3664
35 1383
35 3508
35 3674
36 2213
40 3673
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 1ms = 1ms + 0ms
memory: 1876kb,1888kb

input:

5
659635316746638238

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
3758 3428
3197 3313
1381 2494
3611 236
1710 746
1549 434
2859 1559
161 287
3257 3311
2315 2484
3761 2630
2681 1759
3931 3175
1215 707
2025 4772
3086 2620
3704 1313
...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
5000
3758 3428
3197 3313
1381 2494
3611 236
1710 746
1549 434
2859 1559
161 287
3257 3311
2315 2484
3761 2630
2681 1759
3931 3175
1215 707
2025 4772
3086 2620
3704 1313
...

output:

6
5000 2533
1 2002
2 2663
7 3364
9 2017
10 3033
14 3790
15 2517
16 4539
19 541
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 3033
28 3167
30 3664
31 4994
32 3380
35 1383
35 3508
35 3674
36 2213
42 3058
43 2077...

input:

6
5000 2533
1 2002
2 2663
7 3364
9 2017
10 3033
14 3790
15 2517
16 4539
19 541
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 3033
28 3167
30 3664
31 4994
32 3380
35 1383
35 3508
35 3674
36 2213
42 3058
43 2077...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

7
858490260563149759

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 4848
3611 358
1710 2592
1549 427
2859 1559
161 3058
3257 3311
2315 2484
3761 2811
2681 1304
3931 1862
1215 707
2025 4772
3086 2620
3704 131...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 4848
3611 358
1710 2592
1549 427
2859 1559
161 3058
3257 3311
2315 2484
3761 2811
2681 1304
3931 1862
1215 707
2025 4772
3086 2620
3704 131...

output:

8
5000 2500
1 232
1 492
1 499
1 1502
1 2516
1 3125
1 3672
1 3925
1 4072
1 4131
1 4778
2 2663
3 3664
4 4466
5 4080
6 1320
8 127
11 1925
12 337
17 1018
19 2592
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 2827
...

input:

8
5000 2500
1 232
1 492
1 499
1 1502
1 2516
1 3125
1 3672
1 3925
1 4072
1 4131
1 4778
2 2663
3 3664
4 4466
5 4080
6 1320
8 127
11 1925
12 337
17 1018
19 2592
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 2827
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1884kb

input:

7
860058643727731209

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 4848
3611 2239
1710 2592
1549 4886
2859 1559
161 2630
3257 3311
2315 2484
3761 2494
2681 2553
3931 1119
1215 707
2025 4772
3086 2620
3704 1...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 4848
3611 2239
1710 2592
1549 4886
2859 1559
161 2630
3257 3311
2315 2484
3761 2494
2681 2553
3931 1119
1215 707
2025 4772
3086 2620
3704 1...

output:

8
5000 2500
2 2663
3 3664
6 1320
10 3033
11 1163
12 337
13 434
14 3790
15 2935
16 1176
17 1018
18 3147
19 4466
20 4019
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
23 3364
24 1938
25 811
26 2663
30 1217
31 4994
...

input:

8
5000 2500
2 2663
3 3664
6 1320
10 3033
11 1163
12 337
13 434
14 3790
15 2935
16 1176
17 1018
18 3147
19 4466
20 4019
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
23 3364
24 1938
25 811
26 2663
30 1217
31 4994
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1876kb,1888kb

input:

7
718861404514377808

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 4636
3611 1232
1710 3175
1549 1163
2859 1559
161 2573
3257 3311
2315 2484
3761 2504
2681 532
3931 3772
1215 707
2025 4772
3086 2620
3704 13...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 4636
3611 1232
1710 3175
1549 1163
2859 1559
161 2573
3257 3311
2315 2484
3761 2504
2681 532
3931 3772
1215 707
2025 4772
3086 2620
3704 13...

output:

8
5000 2500
2 2663
3 1494
6 1320
7 3832
8 127
9 2017
12 337
17 1018
19 1573
20 2022
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
23 4204
25 811
26 2663
28 4102
29 3103
30 2553
31 4994
32 4408
34 1477
37 1673
38 811
39 2...

input:

8
5000 2500
2 2663
3 1494
6 1320
7 3832
8 127
9 2017
12 337
17 1018
19 1573
20 2022
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
23 4204
25 811
26 2663
28 4102
29 3103
30 2553
31 4994
32 4408
34 1477
37 1673
38 811
39 2...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1880kb,1888kb

input:

7
659192688464047828

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 2494
3611 4344
1710 746
1549 4539
2859 1559
161 2674
3257 3311
2315 2484
3761 3513
2681 1424
3931 4886
1215 707
2025 4772
3086 2620
3704 13...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 2494
3611 4344
1710 746
1549 4539
2859 1559
161 2674
3257 3311
2315 2484
3761 3513
2681 1424
3931 4886
1215 707
2025 4772
3086 2620
3704 13...

output:

8
5000 2500
2 2663
3 4497
6 1320
7 1759
11 4179
12 337
17 1018
19 4080
20 434
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 2627
25 811
26 2663
27 4757
28 3167
30 2487
31 4994
32 3380
38 811
39 2285
40 3251
41...

input:

8
5000 2500
2 2663
3 4497
6 1320
7 1759
11 4179
12 337
17 1018
19 4080
20 434
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
24 2627
25 811
26 2663
27 4757
28 3167
30 2487
31 4994
32 3380
38 811
39 2285
40 3251
41...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1884kb,1884kb

input:

7
685730986714800201

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 2494
3611 2592
1710 746
1549 1119
2859 1559
161 1028
3257 3311
2315 2484
3761 4848
2681 1401
3931 1695
1215 707
2025 4772
3086 2620
3704 13...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
5000
3758 3428
3197 3313
1381 2494
3611 2592
1710 746
1549 1119
2859 1559
161 1028
3257 3311
2315 2484
3761 4848
2681 1401
3931 1695
1215 707
2025 4772
3086 2620
3704 13...

output:

8
5000 2500
2 2663
3 4497
4 4344
6 1320
7 4636
11 4685
12 337
13 1340
15 2517
17 1018
19 1176
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
25 811
26 2663
27 482
28 3167
31 4994
32 3487
34 4533
38 811
39 2285
40 ...

input:

8
5000 2500
2 2663
3 4497
4 4344
6 1320
7 4636
11 4685
12 337
13 1340
15 2517
17 1018
19 1176
21 681
21 737
21 1065
21 1321
21 1343
21 1556
21 1608
21 1630
21 1830
21 2253
21 2731
21 3268
21 3520
21 3788
21 3837
21 4061
22 1701
25 811
26 2663
27 482
28 3167
31 4994
32 3487
34 4533
38 811
39 2285
40 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201