QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#421126#8726. Magic Showiee100 ✓61ms0kbC++176.2kb2024-05-25 13:54:262024-05-25 13:56:47

Judging History

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

  • [2024-05-25 13:56:47]
  • 管理员手动重测本题所有提交记录
  • 测评结果:100
  • 用时:61ms
  • 内存:0kb
  • [2024-05-25 13:54:27]
  • 评测
  • 测评结果:100
  • 用时:50ms
  • 内存:0kb
  • [2024-05-25 13:54:26]
  • 提交

Alice

#include"Alice.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
namespace A{
const ll mod=4096;
ll n,i,j,k,l,r,x,y,z,w,s,t,a[1100000],b[1100000],adj[5500][5500],c[1100000],d[1100000],h[1100000],e,m,perm[1100000];
vector<ll> v[1100000];
vector<pair<ll,ll>> u;
vector<pair<int,int>> p;
void link(ll x,ll y,ll z)
{
    ll i;
    for(i=y;i<=z;i++)
    {
        perm[i]=x;
        if(adj[x][i]==0)
        {
            adj[x][i]=1;
            adj[i][x]=1;
        }
    }
}
pair<ll,ll> f(ll x,ll y)
{
    //printf("%lld(%lld)\n",ll(x),y);
    c[x]=1;
    ll i,mn=100000,mx=0;
    pair<ll,ll> p;
    for(i=0;i<h[x];i++)
    {
        if(v[x][i]==y)
            continue;
        p=f(v[x][i],x);
        mn=min(mn,p.first);
        mx=max(mx,p.second);
    }
    if(h[x]<=1)
    {
        mn=min(mn,x);
        mx=max(mx,x);
    }
    return {mn,mx};
}
void Clear()
{
    ll i;
    for(i=1;i<=4991;i++)
    {
        v[i].clear();
        h[i]=0;
        b[i]=0;
        a[i]=0;
        c[i]=0;
        d[i]=0;
        perm[i]=0;
    }
    for(i=1;i<=4991;i++)
        for(j=1;j<=4991;j++)
    {
        adj[i][j]=0;
    }
}
vector<pair<int,int>> Alice()
{
    for(i=1;i<=4991;i++)
        adj[i][i]=1;
    k=setN(4991);
    i=1;
        while(k>0)
        {
           a[i]=k%mod;
           k/=mod;
           i++;
        }
        for(i=1;i<=31;i++)
        {
            x=i;
            j=1;
            while(x>0)
            {
                if(x&1)
                {
                    b[i]^=a[j];
                }
                x>>=1;
                j++;
            }
            b[i]++;
        }
        for(i=1;i<=31;i++)
        {
            if(i!=31)
            link(b[i],(i-1)*161+1,i*161);
            else
            {
                link(b[i],(i-1)*161+1,4991);
            }
        }
        n=4991;
        for(i=1;i<=n;i++)
        {
            if(c[i]==2)
                continue;
            x=i;
            y=0;
            while(1)
            {
                c[x]=1;
                y=x;
                x=perm[x];
                if(c[x]==2)
                    break;
                if(c[x]==1)
                {
                    if(x==y)
                        break;
                    adj[x][y]=0;
                    adj[y][x]=0;
                    break;
                }
            }
            x=i;
            while(1)
            {
                if(c[x]==2)
                    break;
                c[x]=2;
                x=perm[x];
            }
        }
        for(i=1;i<=n;i++)
        {
            c[i]=0;
        }
        for(i=1;i<=n;i++)
        {
            for(j=1;j<i;j++)
            {
                if(adj[i][j]==1)
                {
                    v[i].push_back(j);
                    v[j].push_back(i);
                    h[i]++;
                    h[j]++;
                    p.push_back({i,j});
                }
            }
        }
        for(i=1;i<=n;i++)
        {
            if(c[i]==0)
            {
                u.push_back(f(i,0));
            }
        }
        for(i=0;i<u.size()-1;i++)
        {
            x=u[i].first;
            y=u[i+1].second;
            v[x].push_back(y);
            v[y].push_back(x);
            h[x]++;
            h[y]++;
            p.push_back({x,y});
        }
    return p;
}
};
vector<pair<int,int>> Alice()
{
    return A::Alice();
}

Bob

#include"Bob.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
namespace B{
const ll mod=4096;
ll n,i,j,k,l,r,x,y,z,w,s,t,a[1100000],b[1100000],adj[5500][5500],c[1100000],d[1100000],h[1100000],e,m,perm[1100000];
vector<ll> v[1100000];
vector<pair<ll,ll>> u,p;
void link(ll x,ll y,ll z)
{
    ll i;
    for(i=y;i<=z;i++)
    {
        perm[i]=x;
        if(adj[x][i]==0)
        {
            adj[x][i]=1;
            adj[i][x]=1;
        }
    }
}
pair<ll,ll> f(ll x,ll y)
{
    //printf("%lld(%lld)\n",ll(x),y);
    c[x]=1;
    ll i,mn=100000,mx=0;
    pair<ll,ll> p;
    for(i=0;i<h[x];i++)
    {
        if(v[x][i]==y)
            continue;
        p=f(v[x][i],x);
        mn=min(mn,p.first);
        mx=max(mx,p.second);
    }
    if(h[x]<=1)
    {
        mn=min(mn,x);
        mx=max(mx,x);
    }
    return {mn,mx};
}
void Clear()
{
    ll i;
    for(i=1;i<=4991;i++)
    {
        v[i].clear();
        h[i]=0;
        b[i]=0;
        a[i]=0;
        c[i]=0;
        d[i]=0;
        perm[i]=0;
    }
    for(i=1;i<=4991;i++)
        for(j=1;j<=4991;j++)
    {
        adj[i][j]=0;
    }
}
ll Bob(vector<pair<int,int>> V)
{
   Clear();
    m=V.size();
    for(i=1;i<=m;i++)
    {
        x=V[i-1].first;
        y=V[i-1].second;
        v[x].push_back(y);
        v[y].push_back(x);
        h[x]++;
        h[y]++;
    }
    n=4991;
    for(e=1;e<=31;e++)
    {
        if(e!=31)
        {
            l=(e-1)*161+1;
            r=e*161;
        }
        else
        {
            l=(e-1)*161+1;
            r=4991;
        }
        for(i=1;i<=n;i++)
        {
            if(h[i]>=2)
            {
                //printf("(%lld)\n",i);
                s=0;
                for(j=0;j<h[i];j++)
                {
                    if(l<=v[i][j]&&r>=v[i][j])
                        s++;
                }
                if(s>=2)
                {
                    b[e]=i-1;
                    //printf("%lld %lld\n",e,i-1);
                    break;
                }
            }
            if(i==n)
            {
                b[e]=-1;
            }
        }
    }
    b[0]=0;
    d[1]=1;
    d[2]=2;
    d[4]=3;
    d[8]=4;
    d[16]=5;
    for(i=0;i<=31;i++)
    {
        for(j=0;j<=31;j++)
        {
            if((i|j)==j&&d[(j-i)]!=0)
            {
                if(b[i]!=-1&&b[j]!=-1)
                {
                    a[d[j-i]]=b[i]^b[j];
                }
            }
        }
    }
    s=0;
    for(i=5;i>=1;i--)
    {
        s=s*mod+a[i];
    }
    return s;
}
};
ll Bob(vector<pair<int,int>> V)
{
   return B::Bob(V);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 38ms = 30ms + 8ms

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

2
4991 3959
1 162
1 164
1 166
1 167
1 168
1 169
1 170
1 171
1 172
1 173
1 175
1 176
1 177
1 178
1 179
1 180
1 181
1 182
1 183
1 184
1 185
1 186
1 187
1 188
1 189
1 191
1 192
1 194
1 195
1 196
1 197
1 198
1 199
1 201
1 202
1 203
1 204
1 206
1 207
1 209
1 210
1 211
1 212
1 213
1 214
1 215
1 216
1 217
...

input:

2
4991 3959
1 162
1 164
1 166
1 167
1 168
1 169
1 170
1 171
1 172
1 173
1 175
1 176
1 177
1 178
1 179
1 180
1 181
1 182
1 183
1 184
1 185
1 186
1 187
1 188
1 189
1 191
1 192
1 194
1 195
1 196
1 197
1 198
1 199
1 201
1 202
1 203
1 204
1 206
1 207
1 209
1 210
1 211
1 212
1 213
1 214
1 215
1 216
1 217
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4005

Test #2:

score: 5
Accepted
time: 39ms = 28ms + 11ms

input:

1
459

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

2
4991 3959
1 162
1 164
1 166
1 167
1 168
1 169
1 170
1 171
1 172
1 173
1 175
1 176
1 177
1 178
1 179
1 180
1 181
1 182
1 183
1 184
1 185
1 186
1 187
1 188
1 189
1 191
1 192
1 194
1 195
1 196
1 197
1 198
1 199
1 201
1 202
1 203
1 204
1 206
1 207
1 209
1 210
1 211
1 212
1 213
1 214
1 215
1 216
1 217
...

input:

2
4991 3959
1 162
1 164
1 166
1 167
1 168
1 169
1 170
1 171
1 172
1 173
1 175
1 176
1 177
1 178
1 179
1 180
1 181
1 182
1 183
1 184
1 185
1 186
1 187
1 188
1 189
1 191
1 192
1 194
1 195
1 196
1 197
1 198
1 199
1 201
1 202
1 203
1 204
1 206
1 207
1 209
1 210
1 211
1 212
1 213
1 214
1 215
1 216
1 217
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
459

Test #3:

score: 5
Accepted
time: 34ms = 27ms + 7ms

input:

1
2495

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

2
4991 3959
1 162
1 164
1 166
1 167
1 168
1 169
1 170
1 171
1 172
1 173
1 175
1 176
1 177
1 178
1 179
1 180
1 181
1 182
1 183
1 184
1 185
1 186
1 187
1 188
1 189
1 191
1 192
1 194
1 195
1 196
1 197
1 198
1 199
1 201
1 202
1 203
1 204
1 206
1 207
1 209
1 210
1 211
1 212
1 213
1 214
1 215
1 216
1 217
...

input:

2
4991 3959
1 162
1 164
1 166
1 167
1 168
1 169
1 170
1 171
1 172
1 173
1 175
1 176
1 177
1 178
1 179
1 180
1 181
1 182
1 183
1 184
1 185
1 186
1 187
1 188
1 189
1 191
1 192
1 194
1 195
1 196
1 197
1 198
1 199
1 201
1 202
1 203
1 204
1 206
1 207
1 209
1 210
1 211
1 212
1 213
1 214
1 215
1 216
1 217
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
2495

Test #4:

score: 5
Accepted
time: 34ms = 27ms + 7ms

input:

3
1560

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1560

Test #5:

score: 5
Accepted
time: 47ms = 28ms + 19ms

input:

3
3594

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
3594

Test #6:

score: 5
Accepted
time: 38ms = 24ms + 14ms

input:

3
1750

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1750

Test #7:

score: 5
Accepted
time: 43ms = 31ms + 12ms

input:

5
4878

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
162 2
163 2
164 2
165 2
166 2
167 2
168 2
169 2
170 2
171 2
172 2
173 2
174 2
175 2
176 2
177 2
178 2
179 2
180 2
181 2
182 2
183 2
184 2
185 2
186 2
187 2
188 2
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
162 2
163 2
164 2
165 2
166 2
167 2
168 2
169 2
170 2
171 2
172 2
173 2
174 2
175 2
176 2
177 2
178 2
179 2
180 2
181 2
182 2
183 2
184 2
185 2
186 2
187 2
188 2
18...

output:

6
4991 3704
1 484
1 485
1 486
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 502
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 519
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 531
...

input:

6
4991 3704
1 484
1 485
1 486
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 502
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 519
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 531
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4878

Test #8:

score: 5
Accepted
time: 38ms = 27ms + 11ms

input:

5
1223

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1223

Test #9:

score: 5
Accepted
time: 32ms = 28ms + 4ms

input:

5
648

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
648

Test #10:

score: 5
Accepted
time: 34ms = 27ms + 7ms

input:

7
4475

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
162 2
163 2
164 2
165 2
166 2
167 2
168 2
169 2
170 2
171 2
172 2
173 2
174 2
175 2
176 2
177 2
178 2
179 2
180 2
181 2
182 2
183 2
184 2
185 2
186 2
187 2
188 2
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
162 2
163 2
164 2
165 2
166 2
167 2
168 2
169 2
170 2
171 2
172 2
173 2
174 2
175 2
176 2
177 2
178 2
179 2
180 2
181 2
182 2
183 2
184 2
185 2
186 2
187 2
188 2
18...

output:

8
4991 2496
2 162
2 163
2 164
2 165
2 166
2 167
2 168
2 169
2 170
2 171
2 172
2 173
2 174
2 175
2 176
2 177
2 178
2 179
2 180
2 181
2 182
2 184
2 185
2 186
2 187
2 188
2 189
2 190
2 191
2 192
2 193
2 194
2 195
2 196
2 197
2 198
2 200
2 201
2 202
2 203
2 204
2 205
2 206
2 207
2 208
2 209
2 210
2 211
...

input:

8
4991 2496
2 162
2 163
2 164
2 165
2 166
2 167
2 168
2 169
2 170
2 171
2 172
2 173
2 174
2 175
2 176
2 177
2 178
2 179
2 180
2 181
2 182
2 184
2 185
2 186
2 187
2 188
2 189
2 190
2 191
2 192
2 193
2 194
2 195
2 196
2 197
2 198
2 200
2 201
2 202
2 203
2 204
2 205
2 206
2 207
2 208
2 209
2 210
2 211
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4475

Test #11:

score: 5
Accepted
time: 27ms = 27ms + 0ms

input:

7
4240

output:

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

input:

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

output:

8
4991 2496
2 162
2 163
2 164
2 165
2 166
2 167
2 168
2 169
2 170
2 171
2 172
2 173
2 174
2 176
2 177
2 178
2 179
2 180
2 181
2 182
2 183
2 184
2 185
2 186
2 187
2 188
2 189
2 190
2 191
2 192
2 193
2 194
2 195
2 197
2 198
2 199
2 200
2 201
2 202
2 203
2 204
2 205
2 206
2 207
2 208
2 209
2 210
2 211
...

input:

8
4991 2496
2 162
2 163
2 164
2 165
2 166
2 167
2 168
2 169
2 170
2 171
2 172
2 173
2 174
2 176
2 177
2 178
2 179
2 180
2 181
2 182
2 183
2 184
2 185
2 186
2 187
2 188
2 189
2 190
2 191
2 192
2 193
2 194
2 195
2 197
2 198
2 199
2 200
2 201
2 202
2 203
2 204
2 205
2 206
2 207
2 208
2 209
2 210
2 211
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
4240

Test #12:

score: 5
Accepted
time: 40ms = 32ms + 8ms

input:

7
1291

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
162 1
163 1
164 1
165 1
166 1
167 1
168 1
169 1
170 1
171 1
172 1
173 1
174 1
175 1
176 1
177 1
178 1
179 1
180 1
181 1
182 1
183 1
184 1
185 1
186 1
187 1
188 1
18...

output:

8
4991 2496
2 1292
3 1292
4 1292
5 1292
6 1292
7 1292
8 1292
9 1292
10 1292
11 1292
12 1292
14 1292
15 1292
16 1292
18 1292
19 1292
20 1292
21 1292
22 1292
24 1292
25 1292
26 1292
27 1292
28 1292
30 1292
31 1292
32 1292
33 1292
34 1292
35 1292
36 1292
37 1292
38 1292
39 1292
40 1292
41 1292
42 1292
...

input:

8
4991 2496
2 1292
3 1292
4 1292
5 1292
6 1292
7 1292
8 1292
9 1292
10 1292
11 1292
12 1292
14 1292
15 1292
16 1292
18 1292
19 1292
20 1292
21 1292
22 1292
24 1292
25 1292
26 1292
27 1292
28 1292
30 1292
31 1292
32 1292
33 1292
34 1292
35 1292
36 1292
37 1292
38 1292
39 1292
40 1292
41 1292
42 1292
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
1291

Subtask #2:

score: 30
Accepted

Test #13:

score: 30
Accepted
time: 38ms = 27ms + 11ms

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
171 162
171 163
171 164
171 165
171 166
171 167
171 168
171 169
171 170
172 171
173 171
174 171
175 171
176 171
177 171
178 171
179 171
180 171
181 171
182 171
183 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
171 162
171 163
171 164
171 165
171 166
171 167
171 168
171 169
171 170
172 171
173 171
174 171
175 171
176 171
177 171
178 171
179 171
180 171
181 171
182 171
183 ...

output:

2
4991 4408
1 1128
1 1129
1 1130
1 1131
1 1132
1 1134
1 1135
1 1136
1 1137
1 1138
1 1139
1 1140
1 1141
1 1143
1 1144
1 1145
1 1146
1 1148
1 1149
1 1150
1 1151
1 1152
1 1153
1 1154
1 1155
1 1156
1 1157
1 1158
1 1159
1 1160
1 1161
1 1163
1 1164
1 1166
1 1167
1 1168
1 1169
1 1170
1 1171
1 1172
1 1173
1...

input:

2
4991 4408
1 1128
1 1129
1 1130
1 1131
1 1132
1 1134
1 1135
1 1136
1 1137
1 1138
1 1139
1 1140
1 1141
1 1143
1 1144
1 1145
1 1146
1 1148
1 1149
1 1150
1 1151
1 1152
1 1153
1 1154
1 1155
1 1156
1 1157
1 1158
1 1159
1 1160
1 1161
1 1163
1 1164
1 1166
1 1167
1 1168
1 1169
1 1170
1 1171
1 1172
1 1173
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
17476204

Test #14:

score: 30
Accepted
time: 30ms = 27ms + 3ms

input:

1
11926600

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

2
4991 4408
1 484
1 486
1 487
1 488
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 499
1 500
1 501
1 502
1 503
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 532
1 533
1 534
1 535
1 537
1 538
...

input:

2
4991 4408
1 484
1 486
1 487
1 488
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 499
1 500
1 501
1 502
1 503
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 532
1 533
1 534
1 535
1 537
1 538
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
11926600

Test #15:

score: 30
Accepted
time: 32ms = 28ms + 4ms

input:

1
16602378

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

2
4991 4450
1 484
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 518
1 519
1 520
1 521
1 523
1 524
1 525
1 526
1 527
1 529
1 530
1 531
1 532
1 533
1 534
1 535
1 536
1 537
...

input:

2
4991 4450
1 484
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 518
1 519
1 520
1 521
1 523
1 524
1 525
1 526
1 527
1 529
1 530
1 531
1 532
1 533
1 534
1 535
1 536
1 537
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
16602378

Test #16:

score: 30
Accepted
time: 35ms = 28ms + 7ms

input:

3
13129243

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

4
4991 2496
1 484
1 485
1 486
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 502
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 519
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 531
...

input:

4
4991 2496
1 484
1 485
1 486
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 502
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 519
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 531
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
13129243

Test #17:

score: 30
Accepted
time: 43ms = 32ms + 11ms

input:

3
7892141

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

4
4991 2496
1 484
1 485
1 486
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 502
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 519
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 531
...

input:

4
4991 2496
1 484
1 485
1 486
1 487
1 488
1 489
1 490
1 491
1 492
1 493
1 494
1 495
1 496
1 497
1 498
1 499
1 500
1 501
1 502
1 503
1 504
1 505
1 506
1 507
1 508
1 509
1 510
1 511
1 512
1 513
1 514
1 515
1 516
1 517
1 518
1 519
1 520
1 521
1 522
1 523
1 524
1 525
1 526
1 527
1 528
1 529
1 530
1 531
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
7892141

Test #18:

score: 30
Accepted
time: 42ms = 27ms + 15ms

input:

3
21314775

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 2
485 2
486 2
487 2
488 2
489 2
490 2
491 2
492 2
493 2
494 2
495 2
496 2
497 2
498 2
499 2
500 2
501 2
502 2
503 2
504 2
505 2
506 2
507 2
508 2
509 2
510 2
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 2
485 2
486 2
487 2
488 2
489 2
490 2
491 2
492 2
493 2
494 2
495 2
496 2
497 2
498 2
499 2
500 2
501 2
502 2
503 2
504 2
505 2
506 2
507 2
508 2
509 2
510 2
51...

output:

4
4991 2496
1 1128
1 1129
1 1130
1 1131
1 1132
1 1133
1 1134
1 1135
1 1136
1 1137
1 1138
1 1139
1 1140
1 1141
1 1142
1 1143
1 1144
1 1145
1 1146
1 1147
1 1148
1 1149
1 1150
1 1151
1 1152
1 1153
1 1154
1 1155
1 1156
1 1157
1 1158
1 1159
1 1160
1 1161
1 1162
1 1163
1 1164
1 1165
1 1166
1 1167
1 1168
1...

input:

4
4991 2496
1 1128
1 1129
1 1130
1 1131
1 1132
1 1133
1 1134
1 1135
1 1136
1 1137
1 1138
1 1139
1 1140
1 1141
1 1142
1 1143
1 1144
1 1145
1 1146
1 1147
1 1148
1 1149
1 1150
1 1151
1 1152
1 1153
1 1154
1 1155
1 1156
1 1157
1 1158
1 1159
1 1160
1 1161
1 1162
1 1163
1 1164
1 1165
1 1166
1 1167
1 1168
1...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
21314775

Test #19:

score: 30
Accepted
time: 43ms = 28ms + 15ms

input:

5
5559540

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
442 323
442 324
442 325
442 326
442 327
442 328
442 329
442 330
442 331
442 332
442 333
442 334
442 335
442 336
442 337
442 338
442 339
442 340
442 341
442 342
442 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
442 323
442 324
442 325
442 326
442 327
442 328
442 329
442 330
442 331
442 332
442 333
442 334
442 335
442 336
442 337
442 338
442 339
442 340
442 341
442 342
442 ...

output:

6
4991 2577
1 484
2 4991
3 1269
162 1358
163 1358
164 1358
165 1358
166 1358
167 1358
168 1358
169 1358
170 1358
171 1358
172 1358
173 1358
174 1358
175 1358
176 1358
177 1358
178 1358
179 1358
180 1358
181 1358
182 1358
183 1358
184 1358
185 1358
186 1358
187 1358
188 1358
189 1358
190 1358
191 135...

input:

6
4991 2577
1 484
2 4991
3 1269
162 1358
163 1358
164 1358
165 1358
166 1358
167 1358
168 1358
169 1358
170 1358
171 1358
172 1358
173 1358
174 1358
175 1358
176 1358
177 1358
178 1358
179 1358
180 1358
181 1358
182 1358
183 1358
184 1358
185 1358
186 1358
187 1358
188 1358
189 1358
190 1358
191 135...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5559540

Test #20:

score: 30
Accepted
time: 42ms = 31ms + 11ms

input:

5
9424319

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
9424319

Test #21:

score: 30
Accepted
time: 36ms = 28ms + 8ms

input:

5
10955780

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

6
4991 2577
1 484
2 4991
3 3077
162 2675
163 2675
164 2675
165 2675
166 2675
167 2675
168 2675
169 2675
170 2675
171 2675
172 2675
173 2675
174 2675
175 2675
176 2675
177 2675
178 2675
179 2675
180 2675
181 2675
182 2675
183 2675
184 2675
185 2675
186 2675
187 2675
188 2675
189 2675
190 2675
191 267...

input:

6
4991 2577
1 484
2 4991
3 3077
162 2675
163 2675
164 2675
165 2675
166 2675
167 2675
168 2675
169 2675
170 2675
171 2675
172 2675
173 2675
174 2675
175 2675
176 2675
177 2675
178 2675
179 2675
180 2675
181 2675
182 2675
183 2675
184 2675
185 2675
186 2675
187 2675
188 2675
189 2675
190 2675
191 267...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
10955780

Test #22:

score: 30
Accepted
time: 47ms = 27ms + 20ms

input:

7
19938721

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
484 2
485 2
486 2
487 2
488 2
489 2
490 2
491 2
492 2
493 2
494 2
495 2
496 2
497 2
498 2
499 2
500 2
501 2
502 2
503 2
504 2
505 2
506 2
507 2
508 2
509 2
510 2
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
484 2
485 2
486 2
487 2
488 2
489 2
490 2
491 2
492 2
493 2
494 2
495 2
496 2
497 2
498 2
499 2
500 2
501 2
502 2
503 2
504 2
505 2
506 2
507 2
508 2
509 2
510 2
51...

output:

8
4991 2496
2 484
2 485
2 486
2 487
2 488
2 489
2 491
2 492
2 493
2 494
2 495
2 496
2 497
2 498
2 499
2 500
2 501
2 502
2 504
2 505
2 506
2 507
2 508
2 509
2 510
2 511
2 512
2 513
2 514
2 515
2 516
2 517
2 518
2 519
2 522
2 523
2 524
2 525
2 526
2 527
2 528
2 529
2 530
2 531
2 532
2 533
2 534
2 535
...

input:

8
4991 2496
2 484
2 485
2 486
2 487
2 488
2 489
2 491
2 492
2 493
2 494
2 495
2 496
2 497
2 498
2 499
2 500
2 501
2 502
2 504
2 505
2 506
2 507
2 508
2 509
2 510
2 511
2 512
2 513
2 514
2 515
2 516
2 517
2 518
2 519
2 522
2 523
2 524
2 525
2 526
2 527
2 528
2 529
2 530
2 531
2 532
2 533
2 534
2 535
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
19938721

Test #23:

score: 30
Accepted
time: 40ms = 28ms + 12ms

input:

7
5129508

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
449 323
449 324
449 325
449 326
449 327
449 328
449 329
449 330
449 331
449 332
449 333
449 334
449 335
449 336
449 337
449 338
449 339
449 340
449 341
449 342
449 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
449 323
449 324
449 325
449 326
449 327
449 328
449 329
449 330
449 331
449 332
449 333
449 334
449 335
449 336
449 337
449 338
449 339
449 340
449 341
449 342
449 ...

output:

8
4991 2496
3 1317
4 1317
5 1317
6 1317
7 1317
9 1317
11 1317
12 1317
13 1317
14 1317
15 1317
16 1317
17 1317
18 1317
19 1317
20 1317
21 1317
22 1317
23 1317
24 1317
25 1317
26 1317
27 1317
28 1317
29 1317
30 1317
31 1317
32 1317
33 1317
34 1317
35 1317
36 1317
37 1317
38 1317
39 1317
40 1317
41 131...

input:

8
4991 2496
3 1317
4 1317
5 1317
6 1317
7 1317
9 1317
11 1317
12 1317
13 1317
14 1317
15 1317
16 1317
17 1317
18 1317
19 1317
20 1317
21 1317
22 1317
23 1317
24 1317
25 1317
26 1317
27 1317
28 1317
29 1317
30 1317
31 1317
32 1317
33 1317
34 1317
35 1317
36 1317
37 1317
38 1317
39 1317
40 1317
41 131...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
5129508

Test #24:

score: 30
Accepted
time: 30ms = 23ms + 7ms

input:

7
15332941

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
484 1
485 1
486 1
487 1
488 1
489 1
490 1
491 1
492 1
493 1
494 1
495 1
496 1
497 1
498 1
499 1
500 1
501 1
502 1
503 1
504 1
505 1
506 1
507 1
508 1
509 1
510 1
51...

output:

8
4991 2496
2 1614
3 1614
5 1614
6 1614
8 1614
9 1614
10 1614
11 1614
12 1614
13 1614
14 1614
15 1614
16 1614
17 1614
18 1614
19 1614
20 1614
22 1614
23 1614
24 1614
25 1614
26 1614
27 1614
28 1614
29 1614
30 1614
31 1614
32 1614
33 1614
34 1614
35 1614
36 1614
37 1614
38 1614
39 1614
41 1614
42 161...

input:

8
4991 2496
2 1614
3 1614
5 1614
6 1614
8 1614
9 1614
10 1614
11 1614
12 1614
13 1614
14 1614
15 1614
16 1614
17 1614
18 1614
19 1614
20 1614
22 1614
23 1614
24 1614
25 1614
26 1614
27 1614
28 1614
29 1614
30 1614
31 1614
32 1614
33 1614
34 1614
35 1614
36 1614
37 1614
38 1614
39 1614
41 1614
42 161...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
15332941

Subtask #3:

score: 65
Accepted

Test #25:

score: 65
Accepted
time: 40ms = 29ms + 11ms

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
806 805
807 805
808 805
809 805
810 805
811 805
812 805
813 805
814 805
815 805
816 805
817 805
818 805
819 805
820 805
821 805
822 805
823 805
824 805
825 805
826 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
806 805
807 805
808 805
809 805
810 805
811 805
812 805
813 805
814 805
815 805
816 805
817 805
818 805
819 805
820 805
821 805
822 805
823 805
824 805
825 805
826 ...

output:

2
4991 2656
1 1931
1 1932
3 1932
5 1932
7 1932
12 1932
13 1932
14 1932
15 1932
18 1932
19 1932
20 1932
21 1932
22 1932
23 1932
25 1932
26 1932
28 1932
30 1932
32 1932
33 1932
34 1932
35 1932
38 1932
40 1932
42 1932
53 1932
56 1932
57 4187
57 4188
57 4189
57 4191
57 4192
57 4193
57 4194
57 4196
57 41...

input:

2
4991 2656
1 1931
1 1932
3 1932
5 1932
7 1932
12 1932
13 1932
14 1932
15 1932
18 1932
19 1932
20 1932
21 1932
22 1932
23 1932
25 1932
26 1932
28 1932
30 1932
32 1932
33 1932
34 1932
35 1932
38 1932
40 1932
42 1932
53 1932
56 1932
57 4187
57 4188
57 4189
57 4191
57 4192
57 4193
57 4194
57 4196
57 41...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
355365355024496523

Test #26:

score: 65
Accepted
time: 35ms = 24ms + 11ms

input:

1
727827999106414164

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
806 164
807 164
808 164
809 164
810 164
811 164
812 164
813 164
814 164
815 164
816 164
817 164
818 164
819 164
820 164
821 164
822 164
823 164
824 164
825 164
826 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
806 164
807 164
808 164
809 164
810 164
811 164
812 164
813 164
814 164
815 164
816 164
817 164
818 164
819 164
820 164
821 164
822 164
823 164
824 164
825 164
826 ...

output:

2
4991 2656
2 1621
4 1621
6 1621
11 1621
12 1621
13 1621
14 1621
17 1621
18 1621
19 1621
20 1621
21 1621
22 1621
24 1621
25 1621
27 1621
29 1621
31 1621
32 1621
33 1621
34 1621
37 1621
39 1621
41 1621
52 1621
55 1621
57 1621
58 1621
59 1621
61 1621
62 1621
63 1621
67 1621
70 1621
71 1621
73 1621
74 ...

input:

2
4991 2656
2 1621
4 1621
6 1621
11 1621
12 1621
13 1621
14 1621
17 1621
18 1621
19 1621
20 1621
21 1621
22 1621
24 1621
25 1621
27 1621
29 1621
31 1621
32 1621
33 1621
34 1621
37 1621
39 1621
41 1621
52 1621
55 1621
57 1621
58 1621
59 1621
61 1621
62 1621
63 1621
67 1621
70 1621
71 1621
73 1621
74 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
727827999106414164

Test #27:

score: 65
Accepted
time: 28ms = 28ms + 0ms

input:

1
656410143989222955

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
645 633
646 633
647 633
648 633
649 633
650 633
651 633
652 633
653 633
654 633
655 633
656 633
657 633
658 633
659 633
660 633
661 633
662 633
663 633
664 633
665 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
645 633
646 633
647 633
648 633
649 633
650 633
651 633
652 633
653 633
654 633
655 633
656 633
657 633
658 633
659 633
660 633
661 633
662 633
663 633
664 633
665 ...

output:

2
4991 2656
1 3628
7 3628
9 3628
12 3628
17 3628
19 3628
20 3628
21 3628
23 3628
24 3628
26 3628
30 3628
33 3628
34 3628
36 3628
38 3628
39 3628
40 3628
41 3628
42 3628
43 3628
46 3628
47 3628
48 3628
49 3628
50 3628
51 3628
58 3628
60 2899
60 2901
60 2906
60 2910
60 2911
60 2912
60 2913
60 2914
60 ...

input:

2
4991 2656
1 3628
7 3628
9 3628
12 3628
17 3628
19 3628
20 3628
21 3628
23 3628
24 3628
26 3628
30 3628
33 3628
34 3628
36 3628
38 3628
39 3628
40 3628
41 3628
42 3628
43 3628
46 3628
47 3628
48 3628
49 3628
50 3628
51 3628
58 3628
60 2899
60 2901
60 2906
60 2910
60 2911
60 2912
60 2913
60 2914
60 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
656410143989222955

Test #28:

score: 65
Accepted
time: 30ms = 27ms + 3ms

input:

1
410366615149657534

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
804 484
804 485
804 486
804 487
804 488
804 489
804 490
804 491
804 492
804 493
804 494
804 495
804 496
804 497
804 498
804 499
804 500
804 501
804 502
804 503
804 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
804 484
804 485
804 486
804 487
804 488
804 489
804 490
804 491
804 492
804 493
804 494
804 495
804 496
804 497
804 498
804 499
804 500
804 501
804 502
804 503
804 ...

output:

2
4991 2656
3 3519
7 3519
11 3519
13 3519
15 3519
16 3519
18 3519
26 3519
28 3519
31 3519
33 3519
38 3519
40 3519
41 3519
43 3519
46 3519
47 3519
48 3519
50 3519
51 3519
52 3519
53 3519
55 3519
57 3519
58 1933
58 1935
58 1937
58 1939
58 1944
58 1945
58 1946
58 1947
58 1950
58 1951
58 1952
58 1953
58...

input:

2
4991 2656
3 3519
7 3519
11 3519
13 3519
15 3519
16 3519
18 3519
26 3519
28 3519
31 3519
33 3519
38 3519
40 3519
41 3519
43 3519
46 3519
47 3519
48 3519
50 3519
51 3519
52 3519
53 3519
55 3519
57 3519
58 1933
58 1935
58 1937
58 1939
58 1944
58 1945
58 1946
58 1947
58 1950
58 1951
58 1952
58 1953
58...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
410366615149657534

Test #29:

score: 65
Accepted
time: 47ms = 31ms + 16ms

input:

1
298090682780948428

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 50
163 50
164 50
165 50
166 50
167 50
168 50
169 50
170 50
171 50
172 50
173 50
174 50
175 50
176 50
177 50
178 50
179 50
180 50
181 50
182 50
183 50
184 50
185...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
4991
162 50
163 50
164 50
165 50
166 50
167 50
168 50
169 50
170 50
171 50
172 50
173 50
174 50
175 50
176 50
177 50
178 50
179 50
180 50
181 50
182 50
183 50
184 50
185...

output:

2
4991 2656
2 1997
3 1997
5 1997
6 1997
7 1997
11 1997
12 1997
14 1997
16 1997
17 1997
18 1997
22 1997
23 1997
24 1997
25 1997
28 1997
29 1997
30 1997
33 1997
34 1997
35 1997
37 1997
40 1997
41 1997
43 1997
46 1997
48 1997
50 163
50 173
50 175
50 177
50 178
50 179
50 181
50 182
50 183
50 185
50 186
...

input:

2
4991 2656
2 1997
3 1997
5 1997
6 1997
7 1997
11 1997
12 1997
14 1997
16 1997
17 1997
18 1997
22 1997
23 1997
24 1997
25 1997
28 1997
29 1997
30 1997
33 1997
34 1997
35 1997
37 1997
40 1997
41 1997
43 1997
46 1997
48 1997
50 163
50 173
50 175
50 177
50 178
50 179
50 181
50 182
50 183
50 185
50 186
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
298090682780948428

Test #30:

score: 65
Accepted
time: 36ms = 24ms + 12ms

input:

3
969441916331132577

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
522 323
522 324
522 325
522 326
522 327
522 328
522 329
522 330
522 331
522 332
522 333
522 334
522 335
522 336
522 337
522 338
522 339
522 340
522 341
522 342
522 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
522 323
522 324
522 325
522 326
522 327
522 328
522 329
522 330
522 331
522 332
522 333
522 334
522 335
522 336
522 337
522 338
522 339
522 340
522 341
522 342
522 ...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
969441916331132577

Test #31:

score: 65
Accepted
time: 39ms = 27ms + 12ms

input:

3
929489812741933634

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
806 611
807 611
808 611
809 611
810 611
811 611
812 611
813 611
814 611
815 611
816 611
817 611
818 611
819 611
820 611
821 611
822 611
823 611
824 611
825 611
826 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
806 611
807 611
808 611
809 611
810 611
811 611
812 611
813 611
814 611
815 611
816 611
817 611
818 611
819 611
820 611
821 611
822 611
823 611
824 611
825 611
826 ...

output:

4
4991 2496
1 4830
162 2576
162 3389
163 3389
164 3389
165 3389
166 3389
167 3389
168 3389
169 3389
170 3389
171 3389
172 3389
173 3389
174 3389
175 3389
176 3389
177 3389
178 3389
179 3389
180 3389
181 3389
182 3389
183 3389
184 3389
185 3389
186 3389
187 3389
188 3389
189 3389
190 3389
191 3389
19...

input:

4
4991 2496
1 4830
162 2576
162 3389
163 3389
164 3389
165 3389
166 3389
167 3389
168 3389
169 3389
170 3389
171 3389
172 3389
173 3389
174 3389
175 3389
176 3389
177 3389
178 3389
179 3389
180 3389
181 3389
182 3389
183 3389
184 3389
185 3389
186 3389
187 3389
188 3389
189 3389
190 3389
191 3389
19...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
929489812741933634

Test #32:

score: 65
Accepted
time: 39ms = 28ms + 11ms

input:

3
144032041325838295

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 228
485 228
486 228
487 228
488 228
489 228
490 228
491 228
492 228
493 228
494 228
495 228
496 228
497 228
498 228
499 228
500 228
501 228
502 228
503 228
504 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 228
485 228
486 228
487 228
488 228
489 228
490 228
491 228
492 228
493 228
494 228
495 228
496 228
497 228
498 228
499 228
500 228
501 228
502 228
503 228
504 ...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
144032041325838295

Test #33:

score: 65
Accepted
time: 50ms = 31ms + 19ms

input:

3
832110946250826180

output:

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

input:

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

output:

4
4991 2496
1 3542
98 453
98 4026
98 4027
98 4028
98 4029
98 4030
98 4031
98 4032
98 4033
98 4034
98 4035
98 4036
98 4037
98 4038
98 4039
98 4040
98 4041
98 4042
98 4043
98 4044
98 4045
98 4046
98 4047
98 4048
98 4049
98 4050
98 4051
98 4052
98 4053
98 4054
98 4055
98 4056
98 4057
98 4058
98 4059
98...

input:

4
4991 2496
1 3542
98 453
98 4026
98 4027
98 4028
98 4029
98 4030
98 4031
98 4032
98 4033
98 4034
98 4035
98 4036
98 4037
98 4038
98 4039
98 4040
98 4041
98 4042
98 4043
98 4044
98 4045
98 4046
98 4047
98 4048
98 4049
98 4050
98 4051
98 4052
98 4053
98 4054
98 4055
98 4056
98 4057
98 4058
98 4059
98...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
832110946250826180

Test #34:

score: 65
Accepted
time: 47ms = 28ms + 19ms

input:

3
85728715707691821

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 15
485 15
486 15
487 15
488 15
489 15
490 15
491 15
492 15
493 15
494 15
495 15
496 15
497 15
498 15
499 15
500 15
501 15
502 15
503 15
504 15
505 15
506 15
507...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
3
4991
484 15
485 15
486 15
487 15
488 15
489 15
490 15
491 15
492 15
493 15
494 15
495 15
496 15
497 15
498 15
499 15
500 15
501 15
502 15
503 15
504 15
505 15
506 15
507...

output:

4
4991 2496
1 814
1 4830
2 814
3 814
4 814
5 814
6 814
7 814
8 814
9 814
10 814
11 814
12 814
13 814
14 814
15 484
15 485
15 486
15 487
15 488
15 489
15 490
15 491
15 492
15 493
15 494
15 495
15 496
15 497
15 498
15 499
15 500
15 501
15 502
15 503
15 504
15 505
15 506
15 507
15 508
15 509
15 510
15 ...

input:

4
4991 2496
1 814
1 4830
2 814
3 814
4 814
5 814
6 814
7 814
8 814
9 814
10 814
11 814
12 814
13 814
14 814
15 484
15 485
15 486
15 487
15 488
15 489
15 490
15 491
15 492
15 493
15 494
15 495
15 496
15 497
15 498
15 499
15 500
15 501
15 502
15 503
15 504
15 505
15 506
15 507
15 508
15 509
15 510
15 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
85728715707691821

Test #35:

score: 65
Accepted
time: 31ms = 28ms + 3ms

input:

5
777434612360931036

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
967 564
968 564
969 564
970 564
971 564
972 564
973 564
974 564
975 564
976 564
977 564
978 564
979 564
980 564
981 564
982 564
983 564
984 564
985 564
986 564
987 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
967 564
968 564
969 564
970 564
971 564
972 564
973 564
974 564
975 564
976 564
977 564
978 564
979 564
980 564
981 564
982 564
983 564
984 564
985 564
986 564
987 ...

output:

6
4991 2576
1 4508
2 1757
11 1128
11 1129
11 1130
11 1131
11 1132
11 1133
11 1134
11 1135
11 1136
11 1137
11 1138
11 1139
11 1140
11 1141
11 1142
11 1143
11 1144
11 1145
11 1146
11 1147
11 1148
11 1149
11 1150
11 1151
11 1152
11 1153
11 1154
11 1155
11 1156
11 1157
11 1158
11 1159
11 1160
11 1161
11...

input:

6
4991 2576
1 4508
2 1757
11 1128
11 1129
11 1130
11 1131
11 1132
11 1133
11 1134
11 1135
11 1136
11 1137
11 1138
11 1139
11 1140
11 1141
11 1142
11 1143
11 1144
11 1145
11 1146
11 1147
11 1148
11 1149
11 1150
11 1151
11 1152
11 1153
11 1154
11 1155
11 1156
11 1157
11 1158
11 1159
11 1160
11 1161
11...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
777434612360931036

Test #36:

score: 65
Accepted
time: 47ms = 28ms + 19ms

input:

5
705262511549880222

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
728 323
728 324
728 325
728 326
728 327
728 328
728 329
728 330
728 331
728 332
728 333
728 334
728 335
728 336
728 337
728 338
728 339
728 340
728 341
728 342
728 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
728 323
728 324
728 325
728 326
728 327
728 328
728 329
728 330
728 331
728 332
728 333
728 334
728 335
728 336
728 337
728 338
728 339
728 340
728 341
728 342
728 ...

output:

6
4991 2575
1 4830
2 1951
66 3704
66 3705
66 3706
66 3707
66 3708
66 3709
66 3710
66 3711
66 3712
66 3713
66 3714
66 3715
66 3716
66 3717
66 3718
66 3719
66 3720
66 3721
66 3722
66 3723
66 3724
66 3725
66 3726
66 3727
66 3728
66 3729
66 3730
66 3731
66 3732
66 3733
66 3734
66 3735
66 3736
66 3737
66...

input:

6
4991 2575
1 4830
2 1951
66 3704
66 3705
66 3706
66 3707
66 3708
66 3709
66 3710
66 3711
66 3712
66 3713
66 3714
66 3715
66 3716
66 3717
66 3718
66 3719
66 3720
66 3721
66 3722
66 3723
66 3724
66 3725
66 3726
66 3727
66 3728
66 3729
66 3730
66 3731
66 3732
66 3733
66 3734
66 3735
66 3736
66 3737
66...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
705262511549880222

Test #37:

score: 65
Accepted
time: 35ms = 32ms + 3ms

input:

5
510318082834167951

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
967 930
968 930
969 930
970 930
971 930
972 930
973 930
974 930
975 930
976 930
977 930
978 930
979 930
980 930
981 930
982 930
983 930
984 930
985 930
986 930
987 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
967 930
968 930
969 930
970 930
971 930
972 930
973 930
974 930
975 930
976 930
977 930
978 930
979 930
980 930
981 930
982 930
983 930
984 930
985 930
986 930
987 ...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
510318082834167951

Test #38:

score: 65
Accepted
time: 40ms = 28ms + 12ms

input:

5
914858813253258744

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
944 645
944 646
944 647
944 648
944 649
944 650
944 651
944 652
944 653
944 654
944 655
944 656
944 657
944 658
944 659
944 660
944 661
944 662
944 663
944 664
944 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
944 645
944 646
944 647
944 648
944 649
944 650
944 651
944 652
944 653
944 654
944 655
944 656
944 657
944 658
944 659
944 660
944 661
944 662
944 663
944 664
944 ...

output:

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

input:

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

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
914858813253258744

Test #39:

score: 65
Accepted
time: 34ms = 27ms + 7ms

input:

5
659635316746638238

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
645 194
646 194
647 194
648 194
649 194
650 194
651 194
652 194
653 194
654 194
655 194
656 194
657 194
658 194
659 194
660 194
661 194
662 194
663 194
664 194
665 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
5
4991
645 194
646 194
647 194
648 194
649 194
650 194
651 194
652 194
653 194
654 194
655 194
656 194
657 194
658 194
659 194
660 194
661 194
662 194
663 194
664 194
665 ...

output:

6
4991 2575
1 4347
2 927
162 4038
163 4038
164 4038
165 4038
166 4038
167 4038
168 4038
169 4038
170 4038
171 4038
172 4038
173 4038
174 4038
175 4038
176 4038
177 4038
178 4038
179 4038
180 4038
181 4038
182 4038
183 4038
184 4038
185 4038
186 4038
187 4038
188 4038
189 4038
190 4038
191 4038
192 4...

input:

6
4991 2575
1 4347
2 927
162 4038
163 4038
164 4038
165 4038
166 4038
167 4038
168 4038
169 4038
170 4038
171 4038
172 4038
173 4038
174 4038
175 4038
176 4038
177 4038
178 4038
179 4038
180 4038
181 4038
182 4038
183 4038
184 4038
185 4038
186 4038
187 4038
188 4038
189 4038
190 4038
191 4038
192 4...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659635316746638238

Test #40:

score: 65
Accepted
time: 50ms = 31ms + 19ms

input:

7
858490260563149759

output:

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

input:

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

output:

8
4991 2496
3 960
5 960
7 960
11 960
14 960
16 960
17 960
18 960
20 960
21 960
24 960
25 960
30 960
32 960
33 960
35 960
36 960
38 960
39 960
42 960
43 960
45 960
46 960
48 960
50 960
52 960
53 960
56 960
58 960
59 960
60 960
61 4509
61 4510
61 4511
61 4513
61 4514
61 4516
61 4517
61 4521
61 4524
61...

input:

8
4991 2496
3 960
5 960
7 960
11 960
14 960
16 960
17 960
18 960
20 960
21 960
24 960
25 960
30 960
32 960
33 960
35 960
36 960
38 960
39 960
42 960
43 960
45 960
46 960
48 960
50 960
52 960
53 960
56 960
58 960
59 960
60 960
61 4509
61 4510
61 4511
61 4513
61 4514
61 4516
61 4517
61 4521
61 4524
61...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
858490260563149759

Test #41:

score: 65
Accepted
time: 43ms = 27ms + 16ms

input:

7
860058643727731209

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
806 462
807 462
808 462
809 462
810 462
811 462
812 462
813 462
814 462
815 462
816 462
817 462
818 462
819 462
820 462
821 462
822 462
823 462
824 462
825 462
826 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
806 462
807 462
808 462
809 462
810 462
811 462
812 462
813 462
814 462
815 462
816 462
817 462
818 462
819 462
820 462
821 462
822 462
823 462
824 462
825 462
826 ...

output:

8
4991 2496
2 2570
4 2570
5 2570
6 2570
8 2570
9 2570
10 2570
12 2570
14 2570
16 2570
17 2570
20 2570
21 2570
22 2570
24 2570
25 2570
28 2570
29 2570
30 2570
33 2570
34 2570
36 2570
42 2570
43 2570
44 3543
44 3544
44 3547
44 3549
44 3554
44 3555
44 3556
44 3558
44 3559
44 3560
44 3562
44 3563
44 356...

input:

8
4991 2496
2 2570
4 2570
5 2570
6 2570
8 2570
9 2570
10 2570
12 2570
14 2570
16 2570
17 2570
20 2570
21 2570
22 2570
24 2570
25 2570
28 2570
29 2570
30 2570
33 2570
34 2570
36 2570
42 2570
43 2570
44 3543
44 3544
44 3547
44 3549
44 3554
44 3555
44 3556
44 3558
44 3559
44 3560
44 3562
44 3563
44 356...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
860058643727731209

Test #42:

score: 65
Accepted
time: 61ms = 32ms + 29ms

input:

7
718861404514377808

output:

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

input:

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

output:

8
4991 2496
31 2094
31 2095
31 2097
31 2099
31 2101
31 2103
31 2104
31 2105
31 2106
31 2109
31 2110
31 2111
31 2113
31 2114
31 2115
31 2116
31 2120
31 2121
31 2122
31 2123
31 2126
31 2129
31 2131
31 2132
31 2133
31 2135
31 2137
31 2138
31 2141
31 2147
31 2150
31 2151
31 2152
31 2155
31 2156
31 2158
...

input:

8
4991 2496
31 2094
31 2095
31 2097
31 2099
31 2101
31 2103
31 2104
31 2105
31 2106
31 2109
31 2110
31 2111
31 2113
31 2114
31 2115
31 2116
31 2120
31 2121
31 2122
31 2123
31 2126
31 2129
31 2131
31 2132
31 2133
31 2135
31 2137
31 2138
31 2141
31 2147
31 2150
31 2151
31 2152
31 2155
31 2156
31 2158
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
718861404514377808

Test #43:

score: 65
Accepted
time: 36ms = 24ms + 12ms

input:

7
659192688464047828

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
499 484
499 485
499 486
499 487
499 488
499 489
499 490
499 491
499 492
499 493
499 494
499 495
499 496
499 497
499 498
500 499
501 499
502 499
503 499
504 499
505 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
7
4991
499 484
499 485
499 486
499 487
499 488
499 489
499 490
499 491
499 492
499 493
499 494
499 495
499 496
499 497
499 498
500 499
501 499
502 499
503 499
504 499
505 ...

output:

8
4991 2496
2 3797
7 3797
9 3797
10 3797
11 3797
12 3797
13 3797
14 3797
16 3797
17 1290
17 1291
17 1297
17 1299
17 1300
17 1301
17 1302
17 1303
17 1304
17 1306
17 1307
17 1309
17 1312
17 1313
17 1314
17 1315
17 1316
17 1317
17 1318
17 1319
17 1320
17 1322
17 1323
17 1327
17 1329
17 1330
17 1331
17 ...

input:

8
4991 2496
2 3797
7 3797
9 3797
10 3797
11 3797
12 3797
13 3797
14 3797
16 3797
17 1290
17 1291
17 1297
17 1299
17 1300
17 1301
17 1302
17 1303
17 1304
17 1306
17 1307
17 1309
17 1312
17 1313
17 1314
17 1315
17 1316
17 1317
17 1318
17 1319
17 1320
17 1322
17 1323
17 1327
17 1329
17 1330
17 1331
17 ...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
659192688464047828

Test #44:

score: 65
Accepted
time: 31ms = 28ms + 3ms

input:

7
685730986714800201

output:

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

input:

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

output:

8
4991 2496
32 2899
32 2901
32 2902
32 2903
32 2907
32 2909
32 2910
32 2911
32 2913
32 2914
32 2915
32 2916
32 2917
32 2918
32 2921
32 2923
32 2924
32 2926
32 2927
32 2928
32 2929
32 2930
32 2932
32 2933
32 2935
32 2937
32 2940
32 2941
32 2942
32 2944
32 2945
32 2946
32 2947
32 2952
32 2953
32 2954
...

input:

8
4991 2496
32 2899
32 2901
32 2902
32 2903
32 2907
32 2909
32 2910
32 2911
32 2913
32 2914
32 2915
32 2916
32 2917
32 2918
32 2921
32 2923
32 2924
32 2926
32 2927
32 2928
32 2929
32 2930
32 2932
32 2933
32 2935
32 2937
32 2940
32 2941
32 2942
32 2944
32 2945
32 2946
32 2947
32 2952
32 2953
32 2954
...

output:

08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e
685730986714800201