QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#302097#370. CityXttttr100 ✓152ms9948kbC++141.6kb2024-01-10 16:13:242024-01-10 16:13:25

Judging History

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

  • [2024-01-10 16:13:25]
  • 评测
  • 测评结果:100
  • 用时:152ms
  • 内存:9948kb
  • [2024-01-10 16:13:24]
  • 提交

Encoder

#include<bits/stdc++.h>
#include "Encoder.h"
#define ll long long
using namespace std;
namespace encode{
    const int M=250052;
    const double q=0.027;
    int n,cnt,ver[M<<1],nxt[M<<1],h[M],cntdfn,dfn[M],siz[M];
    int f[M];
    inline void init(){
        f[0]=1;
        for(int i=1;i<512;i++)f[i]=min(1<<20,(int)max(1.0,q*f[i-1])+f[i-1]);
    }
    inline void add_edge(int x,int y){cnt++;ver[cnt]=y;nxt[cnt]=h[x];h[x]=cnt;}
    inline void dfs(int x){
        dfn[x]=++cntdfn;
        siz[x]=1;
        for(int i=h[x];i;i=nxt[i]){
            int y=ver[i];
            if(!dfn[y]){
                dfs(y);
                siz[x]+=siz[y];
            }
        }
        int p=lower_bound(f,f+512,siz[x])-f;
        siz[x]=f[p];
        cntdfn=dfn[x]+siz[x]-1;
        Code(x,(long long)512ll*dfn[x]+p);
    }
}
void Encode(int N,int A[],int B[]){
    using namespace encode;
    n=N;
    init();
    for(int i=0;i<n-1;i++){
        add_edge(A[i],B[i]),add_edge(B[i],A[i]);
    }
    dfs(0);
}

Device

#include<bits/stdc++.h>
#include "Device.h"
using namespace std;
namespace device{
    const int M=250052;
    const double q=0.027;
    int f[M];
    inline void init(){
        f[0]=1;
        for(int i=1;i<512;i++)f[i]=min(1<<20,(int)max(1.0,q*f[i-1])+f[i-1]);
    }
}
void InitDevice(){
    using namespace device;
    init();
}
int Answer(long long S,long long T){
    using namespace device;
    long long dfns=S>>9,sizs=f[S&511ll],dfnt=T>>9,sizt=f[T&511ll];
    if(dfnt<dfns&&dfns<dfnt+sizt)return 0;
    if(dfns<dfnt&&dfnt<dfns+sizs)return 1;
    return 2;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 8
Accepted

Test #1:

score: 8
Accepted
time: 2ms
memory: 7772kb

input:

10 45
0 5
0 2
4 3
6 4
0 6
2 8
6 9
2 1
5 7
5 0
0 2
8 0
0 7
0 6
1 0
4 0
0 3
0 9
5 2
5 8
7 5
5 6
1 5
4 5
5 3
9 5
8 2
7 2
2 6
2 1
2 4
3 2
2 9
7 8
6 8
8 1
8 4
3 8
9 8
6 7
1 7
4 7
3 7
9 7
1 6
6 4
6 3
6 9
4 1
1 3
9 1
3 4
9 4
9 3

output:

521 3584 3074 2560 2049 4609 1027 5120 4096 1536 

input:

Interaction has been finished!

output:

0
1
0
1
1
0
0
1
1
2
2
0
2
2
2
2
2
0
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
2
2
2
0
2
2
5120

result:

ok 

Test #2:

score: 8
Accepted
time: 0ms
memory: 5808kb

input:

10 45
6 2
0 7
6 9
7 6
0 8
5 4
8 1
7 3
0 5
7 0
0 5
8 0
0 3
6 0
0 1
0 9
4 0
0 2
5 7
8 7
7 3
6 7
7 1
7 9
4 7
7 2
5 8
5 3
5 6
1 5
9 5
4 5
2 5
8 3
6 8
1 8
9 8
8 4
2 8
3 6
3 1
9 3
4 3
2 3
6 1
9 6
4 6
2 6
1 9
1 4
2 1
4 9
9 2
4 2

output:

521 2560 5120 3584 1536 1025 4098 3076 2049 4608 

input:

Interaction has been finished!

output:

0
1
0
1
0
1
1
0
1
2
2
1
0
2
1
2
1
2
2
2
2
2
0
2
2
2
0
2
2
2
2
2
2
2
2
2
0
2
0
2
2
2
2
2
2
5120

result:

ok 

Test #3:

score: 8
Accepted
time: 0ms
memory: 7852kb

input:

10 45
0 9
0 7
7 3
6 2
6 1
9 8
6 4
7 5
3 6
7 0
9 0
3 0
0 6
4 0
1 0
8 0
0 2
0 5
9 7
7 3
7 6
7 4
1 7
8 7
2 7
7 5
9 3
9 6
4 9
1 9
8 9
9 2
5 9
3 6
4 3
1 3
3 8
2 3
5 3
4 6
6 1
8 6
2 6
6 5
4 1
4 8
4 2
5 4
8 1
1 2
1 5
2 8
5 8
2 5

output:

521 3584 4096 2052 3072 1536 2563 1030 5120 4609 

input:

Interaction has been finished!

output:

0
0
0
1
0
0
0
1
1
2
1
1
1
0
2
0
1
2
2
2
2
0
2
2
1
0
0
2
0
2
0
1
2
0
2
2
2
2
2
2
2
2
2
2
2
5120

result:

ok 

Test #4:

score: 8
Accepted
time: 2ms
memory: 7780kb

input:

10 45
3 8
9 6
7 4
7 5
7 9
5 2
0 3
3 1
0 7
7 0
3 0
0 9
6 0
1 0
8 0
0 5
0 2
4 0
7 3
9 7
7 6
1 7
7 8
7 5
2 7
7 4
9 3
6 3
1 3
8 3
5 3
3 2
4 3
9 6
9 1
8 9
5 9
2 9
9 4
1 6
6 8
6 5
2 6
4 6
1 8
5 1
1 2
1 4
8 5
2 8
8 4
5 2
4 5
2 4

output:

521 4608 3072 4098 3584 2561 2048 1029 5120 1537 

input:

Interaction has been finished!

output:

0
0
1
0
0
0
1
1
0
2
0
1
2
2
1
0
1
2
2
0
0
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
5120

result:

ok 

Test #5:

score: 8
Accepted
time: 2ms
memory: 7780kb

input:

10 45
8 7
6 8
7 0
2 5
9 0
4 5
1 9
3 9
5 7
7 0
0 9
0 5
0 8
3 0
0 1
2 0
4 0
0 6
7 9
7 5
8 7
7 3
1 7
2 7
7 4
6 7
5 9
9 8
3 9
1 9
2 9
9 4
9 6
5 8
5 3
1 5
2 5
5 4
5 6
3 8
1 8
2 8
8 4
6 8
3 1
2 3
4 3
6 3
2 1
1 4
6 1
4 2
6 2
4 6

output:

521 2048 4096 1536 3584 3074 5120 2565 4609 1026 

input:

Interaction has been finished!

output:

0
1
1
1
0
1
0
0
1
2
1
0
2
2
0
1
0
2
2
0
0
2
2
2
2
2
2
0
1
2
2
2
2
2
0
2
2
2
2
2
2
2
2
2
2
5120

result:

ok 

Test #6:

score: 8
Accepted
time: 2ms
memory: 7896kb

input:

9 36
3 6
4 3
6 8
4 2
3 1
0 7
0 4
7 5
7 0
5 0
0 4
0 3
2 0
1 0
6 0
0 8
7 5
4 7
3 7
2 7
1 7
6 7
8 7
5 4
5 3
5 2
5 1
6 5
8 5
3 4
4 2
4 1
4 6
8 4
2 3
3 1
6 3
8 3
1 2
2 6
2 8
1 6
8 1
6 8

output:

520 2560 1536 2051 1029 4608 3073 4097 3584 

input:

Interaction has been finished!

output:

0
0
1
1
0
0
0
1
1
2
2
2
2
2
2
2
2
2
2
2
2
0
1
1
1
0
2
1
0
0
2
2
2
2
2
1
4608

result:

points 1.0

Test #7:

score: 8
Accepted
time: 2ms
memory: 7768kb

input:

10 45
0 5
4 7
4 2
0 4
1 6
0 1
1 8
0 9
9 3
0 1
4 0
2 0
0 8
0 6
0 9
5 0
3 0
7 0
1 4
1 2
8 1
1 6
1 9
5 1
1 3
7 1
2 4
4 8
4 6
9 4
4 5
3 4
4 7
2 8
2 6
9 2
5 2
2 3
7 2
6 8
8 9
8 5
3 8
8 7
9 6
6 5
6 3
6 7
9 5
3 9
9 7
3 5
5 7
3 7

output:

521 2050 4096 1536 3586 5120 3072 4608 2560 1025 

input:

Interaction has been finished!

output:

1
0
0
1
1
1
0
0
0
2
2
0
1
2
2
2
2
0
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
0
2
2
2
2
5120

result:

ok 

Test #8:

score: 8
Accepted
time: 2ms
memory: 7776kb

input:

5 10
4 1
0 4
0 2
2 3
0 4
2 0
1 0
3 0
2 4
4 1
4 3
1 2
2 3
1 3

output:

516 2560 1025 1536 2049 

input:

Interaction has been finished!

output:

1
0
0
0
2
1
2
2
1
2
2560

result:

points 1.0

Test #9:

score: 8
Accepted
time: 2ms
memory: 7888kb

input:

7 21
4 1
2 5
0 6
0 4
0 2
5 3
0 4
1 0
0 6
0 2
0 5
3 0
4 1
6 4
2 4
4 5
4 3
6 1
1 2
1 5
1 3
2 6
5 6
3 6
2 5
2 3
5 3

output:

518 3072 1026 2048 2561 1537 3584 

input:

Interaction has been finished!

output:

1
0
1
1
1
0
1
2
2
2
2
2
2
2
2
2
2
2
1
1
1
3584

result:

points 1.0

Test #10:

score: 8
Accepted
time: 0ms
memory: 7772kb

input:

8 28
7 2
2 1
0 3
2 4
7 5
0 7
0 6
0 3
0 6
0 7
0 2
5 0
0 4
0 1
6 3
7 3
2 3
5 3
4 3
1 3
7 6
2 6
6 5
4 6
6 1
7 2
7 5
4 7
1 7
5 2
2 4
1 2
4 5
5 1
4 1

output:

519 3584 2562 4096 3072 2048 1024 1540 

input:

Interaction has been finished!

output:

1
1
1
1
0
1
1
2
2
2
2
2
2
2
2
2
2
2
1
1
0
0
2
1
0
2
2
2
4096

result:

points 1.0

Test #11:

score: 8
Accepted
time: 0ms
memory: 7776kb

input:

6 15
0 3
1 4
1 5
4 2
0 1
1 0
0 5
4 0
0 3
0 2
1 5
4 1
1 3
2 1
5 4
3 5
5 2
3 4
2 4
3 2

output:

517 1027 2560 3072 2049 1536 

input:

Interaction has been finished!

output:

0
1
0
1
1
1
0
2
0
2
2
2
2
0
2
3072

result:

points 1.0

Test #12:

score: 8
Accepted
time: 2ms
memory: 7768kb

input:

4 6
0 2
2 3
0 1
0 1
0 2
0 3
2 1
3 1
3 2

output:

515 1024 1537 2048 

input:

Interaction has been finished!

output:

1
1
1
2
2
0
2048

result:

points 1.0

Subtask #2:

score: 92
Accepted

Test #13:

score: 92
Accepted
time: 66ms
memory: 7780kb

input:

700 244650
407 643
680 336
573 208
466 455
159 648
575 549
50 567
251 211
211 481
530 513
136 334
112 492
175 396
643 483
265 132
20 160
174 550
251 90
99 236
579 374
670 613
495 379
251 170
652 61
495 467
27 317
202 484
420 592
542 354
565 650
35 88
216 681
277 219
299 171
220 647
418 433
434 660
2...

output:

680 121345 74752 264192 31233 177154 17921 110592 137216 6144 60418 119296 225280 348161 30208 71169 187904 37377 37888 281088 138755 202262 237568 176128 141824 162304 297984 350722 358400 10752 277505 61952 32770 64512 39937 183321 248320 295936 129024 350208 107526 220160 264704 190977 27137 3061...

input:

Interaction has been finished!

output:

0
0
0
0
1
0
1
1
1
1
0
0
1
0
1
1
1
0
1
1
1
1
0
1
1
0
1
0
0
1
1
1
0
1
1
1
1
1
1
0
1
0
0
0
0
1
1
0
0
1
1
0
1
1
0
0
0
1
1
0
0
1
0
0
1
0
0
0
1
1
1
1
0
1
0
1
1
1
0
1
1
1
1
0
0
0
1
1
0
0
1
0
1
1
0
1
0
0
1
0
0
1
1
0
1
1
1
1
0
1
1
1
1
1
1
0
1
1
0
0
1
0
0
1
0
1
0
0
0
1
0
0
1
0
1
1
1
1
1
0
1
0
0
0
1
0
0
0
0
1
...

result:

points 1.0

Test #14:

score: 92
Accepted
time: 56ms
memory: 7772kb

input:

699 243951
59 192
191 301
270 524
135 496
647 573
174 262
662 43
371 50
655 434
123 242
209 46
612 646
11 533
156 443
322 462
329 558
417 383
283 263
615 504
29 520
391 135
546 535
54 264
382 651
541 427
536 456
295 169
645 303
494 21
282 179
329 490
191 67
697 55
226 276
32 160
226 482
392 56
144 1...

output:

680 162816 69121 181248 218112 282625 230912 185858 182274 203265 95235 13990 324096 321026 154112 139778 98816 102912 63488 323585 119308 313344 77824 344577 260609 331776 337923 150019 75776 334851 287232 106501 254470 263176 226306 18944 307718 51712 60929 45569 299008 123392 332296 38400 122880 ...

input:

Interaction has been finished!

output:

1
0
1
1
1
1
0
1
0
0
0
0
1
0
0
1
0
1
0
0
0
1
0
1
1
1
1
0
0
1
1
1
0
0
1
1
1
0
0
1
0
1
1
1
0
0
0
0
1
0
0
0
1
0
1
1
0
0
0
0
0
1
1
0
0
0
1
0
1
1
0
1
1
1
0
0
0
0
1
0
1
0
1
1
0
1
0
0
1
1
1
0
1
0
0
1
1
0
1
1
0
1
1
0
1
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
1
1
0
0
0
1
1
0
1
1
1
1
0
1
0
1
0
0
1
1
1
0
0
1
1
0
0
1
0
0
...

result:

points 1.0

Test #15:

score: 92
Accepted
time: 56ms
memory: 7852kb

input:

700 244650
32 619
369 483
58 148
484 103
190 630
589 659
90 204
515 464
215 254
688 658
454 3
286 582
158 246
90 164
648 13
602 240
237 8
36 620
31 558
515 560
302 39
373 418
288 388
50 516
26 514
190 467
190 439
600 35
258 421
148 214
251 111
50 62
10 530
624 466
666 637
666 692
285 650
137 686
280...

output:

680 265728 114176 133120 298526 27654 65024 199680 340481 299521 246806 343558 36864 125440 257537 236544 259584 196608 241160 336908 297984 219649 85505 174080 17408 244224 285185 91136 348160 276993 121344 166418 169985 3587 112640 128001 225796 57856 331776 316419 35863 279552 148992 179723 50691...

input:

Interaction has been finished!

output:

1
1
0
1
1
1
0
0
0
0
1
1
0
0
1
1
1
1
0
1
1
1
1
1
0
1
0
1
0
1
1
0
1
1
1
1
1
0
1
1
1
0
0
0
0
0
1
1
1
1
1
0
0
1
1
1
1
0
0
1
1
1
0
0
1
1
1
0
1
0
1
0
1
1
0
0
1
1
0
1
1
1
1
1
0
1
0
1
0
0
0
1
1
0
1
1
0
1
0
0
1
0
1
0
1
0
1
1
0
0
0
0
0
1
0
1
1
1
0
0
0
1
0
0
0
1
1
1
1
1
1
0
0
1
0
0
0
1
1
1
0
0
0
0
1
1
0
0
0
1
...

result:

points 1.0

Test #16:

score: 92
Accepted
time: 56ms
memory: 7764kb

input:

700 244650
230 624
291 145
565 474
12 535
152 335
438 692
136 13
199 155
255 47
546 152
293 254
427 131
71 388
31 231
124 522
503 23
320 545
322 480
674 535
247 415
301 163
226 63
560 367
361 103
391 149
483 661
262 632
337 79
45 59
182 489
526 425
275 369
256 598
42 487
125 63
661 23
181 152
366 29...

output:

680 205824 12288 14854 205312 86528 246784 264192 309250 346654 193024 151558 30726 347654 105474 199230 136219 273422 307206 269830 84998 48640 13314 281118 65026 55810 158734 72192 188416 141824 333312 165888 10766 93696 337410 103426 32256 214528 116750 49154 242688 253446 215040 223758 119298 27...

input:

Interaction has been finished!

output:

1
0
1
1
0
1
1
0
1
0
0
1
0
1
1
1
0
1
0
1
0
0
1
0
1
1
0
1
0
1
0
1
0
0
1
0
0
0
1
0
1
1
1
0
0
1
0
0
0
0
1
0
0
1
1
1
0
0
0
1
0
0
0
0
1
1
1
0
1
0
0
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
0
1
0
0
0
0
0
1
0
1
1
1
0
1
1
0
0
1
0
0
0
1
1
1
1
1
0
1
1
1
0
0
1
1
0
0
0
1
0
0
1
0
1
1
1
0
1
0
0
1
0
1
0
1
...

result:

points 1.0

Test #17:

score: 92
Accepted
time: 112ms
memory: 9880kb

input:

250000 250000
98377 99261
85304 211210
196850 193036
80796 130416
3160 72100
145991 142897
200915 46448
218676 213491
89680 96159
73896 8598
61659 226081
22401 122629
228272 20662
17177 215756
118511 136128
95692 43162
78229 30135
134970 150179
163578 188576
213241 99059
203107 94390
139934 51361
18...

output:

905 31539202 1029121 75484672 37000704 106554368 134233600 23004672 33043457 30040064 93203456 18348544 17574401 23027712 108104192 111657984 72925186 138208768 11497985 700418 16384513 122776065 123216384 110819328 42895873 81607168 116912131 28696576 46195712 108028929 22387713 59108864 136102400 ...

input:

Interaction has been finished!

output:

2
2
1
1
2
0
0
0
2
1
2
0
2
0
2
0
1
0
0
2
1
2
2
0
2
0
0
2
2
2
1
2
2
2
2
1
1
2
2
1
1
2
0
1
1
0
0
2
2
1
0
1
0
2
2
1
1
2
0
1
2
2
2
0
2
0
1
1
1
1
2
2
0
0
2
2
2
2
2
0
2
2
2
2
1
2
2
2
1
2
1
0
2
0
0
0
0
1
2
1
2
1
1
1
1
0
0
0
2
2
0
2
1
2
2
2
2
2
2
0
1
2
2
2
0
2
2
1
0
2
1
2
2
2
0
1
0
1
1
2
1
2
2
0
0
2
1
2
2
1
...

result:

points 1.0

Test #18:

score: 92
Accepted
time: 120ms
memory: 9824kb

input:

250000 250000
58662 187031
88005 38197
22682 178770
111851 15764
207630 198631
64191 185171
168598 129456
142337 237430
215849 182270
211116 93208
20 204879
130122 42963
11672 121189
75991 33257
87185 128123
33289 2936
144056 47212
140138 18041
2913 20891
194901 213077
39452 3187
187440 25628
73551 ...

output:

905 16726017 67412992 104905216 139330048 64066048 39076362 8952324 46950400 62876160 21843458 125306883 10724865 57285636 63882242 64701494 59807744 120386560 78013956 103546889 134167558 12378112 80945153 68383232 83923456 128690180 40207873 67941890 120399362 14251521 134048258 3968000 105043969 ...

input:

Interaction has been finished!

output:

1
0
2
1
2
2
2
0
1
2
1
2
0
0
1
1
0
2
2
2
1
2
1
1
2
1
2
0
2
1
1
2
1
2
2
2
0
0
1
1
2
1
2
2
2
2
2
1
0
1
0
2
2
1
2
0
1
0
2
1
1
2
0
0
1
1
1
2
1
0
1
2
0
2
2
2
0
2
0
0
2
2
1
1
1
0
2
0
0
2
2
1
1
0
1
0
2
0
0
1
2
2
2
2
2
2
0
2
2
1
1
2
0
1
2
2
1
0
2
2
1
0
2
2
2
1
1
2
2
0
1
1
2
2
1
2
1
2
1
2
2
2
2
1
1
0
0
2
0
0
...

result:

points 1.0

Test #19:

score: 92
Accepted
time: 110ms
memory: 9904kb

input:

250000 250000
212557 2865
205598 91456
106547 166169
2385 60328
54909 26698
82002 112166
121929 240217
123410 133417
93989 61456
92642 225604
49143 8681
1263 131585
214794 141276
12589 67655
51160 187118
83743 12235
86483 172453
29872 111146
249757 78807
216189 2378
57530 180918
106038 234952
16366 ...

output:

904 39623168 117399049 35403783 76691456 16569346 122553344 42999808 89393154 108797952 127787520 52495872 17046529 6856773 36008448 116282375 127522825 39185414 7248384 97502720 101036544 70151168 46039040 68172288 77313024 116271620 109351428 92271617 9210368 19546112 18656256 123170816 4085248 33...

input:

Interaction has been finished!

output:

1
1
2
1
2
2
2
0
0
2
1
1
2
2
2
0
0
2
1
1
0
0
0
2
0
1
1
2
2
2
1
2
0
1
2
1
2
1
1
0
2
2
2
2
2
0
2
1
1
2
2
1
2
0
1
2
1
2
1
1
2
2
2
0
0
2
2
1
2
2
1
2
1
2
2
0
1
2
2
2
0
0
0
2
2
0
0
2
2
2
2
2
2
1
2
0
2
1
2
2
2
1
2
0
2
0
1
1
2
0
1
2
2
0
2
2
2
2
1
0
0
2
1
1
2
2
2
0
0
2
0
1
1
2
2
2
0
0
1
2
0
0
1
1
2
2
2
2
1
1
...

result:

points 1.0

Test #20:

score: 92
Accepted
time: 128ms
memory: 9820kb

input:

250000 250000
108989 180679
6618 123314
146792 97095
101695 18624
109138 21259
130176 235020
131970 224224
32023 110376
126943 90247
7024 8229
55250 106561
44259 206501
157785 107293
88446 38793
62937 119441
158397 243678
83221 104131
184687 105512
101778 195126
76695 8559
31678 182822
58730 237755
...

output:

908 46118400 6769666 125365250 147151488 731138 130166272 93172736 115369984 42073600 60767232 40384000 71651840 145083904 136139776 147114496 131675198 139695104 126350848 98698246 113992192 21444608 103941632 12808704 140039168 51807232 75053570 57674758 84269056 95068166 30533632 55304704 1053327...

input:

Interaction has been finished!

output:

0
2
2
2
0
1
2
0
2
2
1
0
1
1
2
2
0
0
2
1
2
2
1
2
1
0
2
2
2
2
2
2
2
1
2
2
1
2
0
0
2
2
0
2
2
2
2
0
1
0
1
2
2
2
0
2
0
2
0
2
2
2
2
0
1
2
2
0
2
0
2
2
2
0
2
1
2
2
2
0
0
2
2
2
2
0
1
2
0
1
0
2
1
2
2
2
2
2
0
2
2
2
1
2
2
1
2
0
2
1
0
1
2
2
1
1
2
2
1
2
2
2
2
0
1
1
0
2
2
2
2
1
2
2
1
2
2
2
2
2
1
2
0
2
2
2
1
1
2
1
...

result:

points 1.0

Test #21:

score: 92
Accepted
time: 126ms
memory: 9808kb

input:

250000 250000
128536 214028
128536 203182
145589 67326
128536 148506
128536 118881
128536 221940
128536 82743
128536 76287
128536 207959
128536 126237
128536 33353
143121 245162
128536 140279
128536 149583
128536 146645
119187 41695
128536 122057
128536 1126
128536 97289
239043 83867
17254 163707
12...

output:

915 29562368 11702784 66753024 94326272 40326656 73424896 125319680 40825856 35251200 78248960 98179072 114896896 69388800 54409728 58744832 96194560 58119680 32370688 112688640 32090112 59504128 41178112 45233152 100465664 116718080 61361152 70812672 32238592 16983552 23008256 42189824 66022912 277...

input:

Interaction has been finished!

output:

1
1
2
1
1
2
1
2
2
0
2
2
0
2
2
2
0
1
2
1
2
2
2
2
2
1
2
1
1
0
1
0
1
2
2
0
2
0
2
1
2
2
1
2
0
1
2
0
2
2
2
2
2
2
2
2
0
1
2
1
2
1
2
0
2
0
1
1
2
1
2
2
0
2
0
0
1
1
0
2
2
2
2
2
0
1
1
2
2
1
2
2
1
1
2
1
0
2
2
2
2
2
1
2
0
0
0
2
0
2
2
2
2
0
2
2
1
1
1
2
0
2
2
1
2
0
0
2
0
0
0
1
2
1
2
2
0
0
2
0
1
0
1
1
0
2
2
2
0
2
...

result:

points 1.0

Test #22:

score: 92
Accepted
time: 130ms
memory: 9820kb

input:

250000 250000
198759 59913
198759 106050
198759 138903
198759 182095
198759 99282
198759 26662
198759 143423
198759 119590
198759 110285
198759 106764
198759 187588
198759 232194
198759 183411
198759 74226
198759 26210
198759 37134
198759 20394
198759 175287
198759 190555
198759 165099
198759 54430
...

output:

918 10550784 112752128 123957248 96352256 46170624 25668608 48875008 9133056 48263168 123889664 90999808 46197248 79347712 47950848 120259584 117399040 81425920 59010560 5535232 116454400 25230848 29429760 114519040 109636096 28178432 75406848 99187712 86127616 94956544 21476864 8095232 48188928 241...

input:

Interaction has been finished!

output:

1
0
2
0
0
2
0
2
2
1
2
1
2
1
2
0
2
0
2
2
1
0
0
2
2
0
0
2
2
1
1
2
0
2
1
0
0
2
2
0
1
1
2
2
2
1
1
2
1
2
1
0
1
2
0
2
2
2
2
2
1
1
2
0
0
2
2
1
0
2
2
2
2
2
1
0
0
0
0
1
2
0
1
2
2
2
2
2
0
2
2
2
1
2
0
2
0
0
0
2
2
2
1
2
1
1
1
2
0
2
2
0
1
1
0
1
1
1
2
1
1
2
2
2
0
2
2
2
2
2
2
2
0
2
2
2
2
1
0
2
2
2
2
1
0
2
0
1
0
1
...

result:

points 1.0

Test #23:

score: 92
Accepted
time: 128ms
memory: 9948kb

input:

250000 250000
184772 157900
184772 132155
184772 166876
184772 64405
184772 137509
184772 4522
184772 200709
184772 35336
184772 206423
184772 164177
184772 75085
184772 43926
184772 203078
184772 111955
184772 143339
184772 48472
184772 203381
184772 124891
184772 53181
184772 233575
184772 191324
...

output:

918 110437376 32808448 55684096 41948672 26866176 97275904 115614208 127443456 71303680 120988160 14709248 79291904 67077632 6418432 3523072 42418176 92561920 91999232 50917376 29991936 69317120 66500608 81675264 82347520 127694336 35527680 88591360 114891776 53764096 78941696 125566976 72586240 270...

input:

Interaction has been finished!

output:

0
0
1
2
2
2
1
2
2
1
2
1
2
2
0
2
2
0
2
0
0
2
2
2
1
2
1
1
0
1
1
0
0
2
2
0
2
2
2
1
1
0
2
0
1
2
0
2
2
1
1
0
2
0
1
0
2
1
1
2
0
0
2
2
2
0
2
2
2
2
1
2
2
2
1
1
0
1
2
1
1
0
0
1
1
0
2
0
2
2
1
2
0
0
2
2
1
2
2
1
2
2
2
1
0
2
1
0
2
2
1
2
0
1
2
2
1
0
2
0
1
0
1
0
0
0
2
1
0
1
1
2
2
0
2
2
1
2
2
2
1
2
2
2
2
2
0
0
1
2
...

result:

points 1.0

Test #24:

score: 92
Accepted
time: 122ms
memory: 9816kb

input:

250000 250000
230824 15636
230824 208607
230824 150840
230824 175213
230824 27372
230824 196695
230824 235943
230824 201709
230824 37092
230824 220813
230824 77183
230824 86286
230824 239581
230824 119137
230824 63155
230824 10112
230824 180498
230824 15837
230824 147783
230824 244036
230824 176382
...

output:

918 123689472 65996800 9801728 77240320 46395904 65871872 55133696 30081024 98790400 52209152 43665920 82444288 120816640 11176448 27649024 114541568 96098304 69537792 126529536 44630528 37975552 11245568 104066048 76775424 32104960 85401088 63226368 101347840 30220800 25640960 3570176 15999488 7656...

input:

Interaction has been finished!

output:

2
2
2
2
1
0
2
1
2
2
2
0
2
2
1
0
2
0
1
1
2
2
1
2
1
2
0
2
1
2
1
2
1
2
1
2
2
0
2
0
2
1
2
1
2
2
0
0
2
2
2
1
0
2
0
2
0
0
0
2
1
2
2
0
0
1
2
1
0
1
1
0
0
2
2
1
2
1
1
2
1
2
1
0
2
1
1
2
2
0
2
0
0
2
0
0
2
2
1
2
2
1
0
0
2
0
2
1
1
1
2
2
2
2
1
2
2
2
0
2
1
2
0
0
1
1
1
1
1
1
2
1
0
1
2
2
0
2
0
0
0
2
2
1
2
2
2
0
2
2
...

result:

points 1.0

Test #25:

score: 92
Accepted
time: 120ms
memory: 9884kb

input:

250000 250000
58738 89012
241722 74087
241722 58508
241722 195367
117601 155982
210156 8731
241722 133766
26861 91965
241722 172806
241722 205939
147422 190803
122741 188023
34509 198117
241722 237277
236733 191382
235687 182460
218974 217284
213346 156152
241722 134502
241722 28571
241722 31231
117...

output:

910 120700972 73262592 66917376 118600192 91879936 50365952 52390400 8697345 32809984 65708544 60151808 56858112 134550016 93440512 48514560 71449600 16743964 47425536 162161152 22419456 62266368 31815172 1415169 84113408 4675584 1099776 114644995 133970456 38201856 89010176 110304840 29560832 94723...

input:

Interaction has been finished!

output:

2
2
0
0
2
2
1
1
2
2
1
2
2
2
1
0
1
0
1
2
0
2
2
0
2
1
2
2
2
2
0
2
2
2
2
2
1
0
1
1
2
2
0
1
2
2
2
2
1
2
2
0
1
2
1
1
1
2
0
1
1
2
2
0
2
1
2
2
2
2
2
0
1
2
2
2
2
0
0
0
1
2
2
0
2
2
0
0
0
1
1
0
0
2
0
2
2
0
2
2
2
2
1
2
1
1
2
1
0
2
0
1
1
2
2
1
1
2
1
1
2
0
1
1
0
2
0
2
1
0
2
2
0
2
0
2
2
2
2
0
2
1
0
0
1
2
2
2
2
2
...

result:

points 1.0

Test #26:

score: 92
Accepted
time: 120ms
memory: 9820kb

input:

250000 250000
26495 54804
17692 109008
175459 12105
214482 13746
240824 131046
65255 113217
55284 75717
149186 198846
77755 108551
161766 100260
200089 208052
79927 67803
166414 91318
49019 16638
50859 113603
112174 66033
82811 201503
95187 31323
55284 191032
168776 146425
55284 243899
55284 109360
...

output:

907 29820418 83268096 105986050 49028096 2984962 78075393 43284480 60596736 84112395 10333696 26079744 10899457 123665412 30807057 72156673 47247872 147810304 75326985 139490825 32249344 96417295 82664448 78403072 115708928 32582146 140272128 54727680 116342272 2819584 77448825 117249536 32694274 13...

input:

Interaction has been finished!

output:

1
2
1
2
1
2
2
1
1
1
2
1
2
1
0
0
1
2
2
2
1
0
2
1
1
2
2
2
2
0
2
2
2
2
2
2
0
2
0
2
2
2
2
1
0
2
2
2
2
2
0
2
0
0
1
0
2
0
0
2
1
2
0
2
0
2
0
0
2
0
2
2
1
2
0
2
2
1
1
1
2
0
0
1
2
2
1
2
2
0
1
2
2
2
2
2
1
2
2
2
0
2
2
2
0
0
1
1
2
2
2
0
2
1
0
2
1
2
1
0
1
2
2
2
0
0
1
2
0
2
2
2
1
2
1
2
2
0
2
0
0
2
2
2
2
1
2
0
0
0
...

result:

points 1.0

Test #27:

score: 92
Accepted
time: 64ms
memory: 7776kb

input:

700 244650
275 683
22 179
393 371
237 435
143 394
557 333
541 230
98 280
585 410
289 526
96 82
594 616
228 632
579 661
608 432
442 562
653 561
39 439
401 676
444 681
509 178
94 106
281 608
83 133
71 443
336 396
547 221
133 254
230 498
161 29
492 669
340 312
347 97
191 342
501 573
487 409
611 670
180...

output:

681 11776 207879 3072 69120 38404 191488 283648 256000 281600 19459 252416 47105 48130 176128 51712 249856 31744 365574 296448 197122 175106 99334 243200 121348 6144 101888 79363 178688 263170 355345 41988 4096 302594 208385 63488 54272 327216 153600 12350 37888 364032 204291 331776 266240 140288 71...

input:

Interaction has been finished!

output:

1
1
1
1
1
1
1
1
1
0
1
0
0
0
1
1
1
1
1
1
0
1
0
0
1
0
1
1
0
0
0
0
0
0
0
0
0
1
1
0
0
1
0
0
1
0
0
0
0
1
1
0
0
0
0
1
1
0
1
1
1
0
0
1
0
1
0
0
0
0
1
1
1
1
0
0
0
1
0
0
0
0
1
0
0
1
0
0
0
0
0
1
1
1
0
1
1
1
1
0
0
0
1
0
1
1
0
1
1
1
1
1
1
0
1
0
1
1
1
0
0
0
0
1
0
1
1
1
1
1
1
1
1
0
0
0
1
1
0
1
1
0
1
1
1
0
1
0
0
1
...

result:

points 1.0

Test #28:

score: 92
Accepted
time: 54ms
memory: 7772kb

input:

700 244650
196 541
32 593
557 166
621 105
508 313
485 554
19 348
240 259
569 527
632 184
512 470
648 185
337 22
508 353
216 471
184 608
435 326
515 458
21 521
295 239
209 258
385 364
46 171
76 672
133 219
188 260
41 691
237 575
425 67
314 136
386 281
12 197
560 230
343 568
445 618
537 146
118 628
24...

output:

681 246784 243712 30327 176640 328704 370176 5121 91657 369665 254976 345093 199683 33794 282624 172032 288256 8707 239616 237570 111617 297474 178176 67072 196096 148480 59909 303104 184329 178688 31745 280064 281109 89088 60419 333825 325635 198144 16896 118272 314894 59410 12288 19968 96769 18125...

input:

Interaction has been finished!

output:

0
1
1
1
1
0
1
0
1
1
0
1
1
0
1
0
0
1
0
0
0
0
0
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
1
1
1
1
0
0
0
0
1
0
0
0
1
1
1
1
1
1
0
1
0
1
0
0
1
1
0
1
1
0
1
0
0
0
0
1
0
1
0
0
0
1
0
0
0
1
1
0
0
1
0
1
0
1
1
1
1
0
1
1
0
1
1
0
0
1
0
0
1
1
1
1
0
0
1
0
1
0
1
0
0
1
0
1
0
0
1
0
0
0
1
0
1
0
0
0
1
1
1
0
0
1
0
1
1
1
0
1
0
1
1
1
...

result:

points 1.0

Test #29:

score: 92
Accepted
time: 64ms
memory: 7756kb

input:

700 244650
592 352
634 56
500 199
138 39
242 322
130 457
673 471
9 518
342 498
30 580
199 675
341 437
10 42
623 556
9 595
571 363
680 303
638 685
628 334
219 488
6 501
284 18
511 520
607 102
437 618
234 667
561 224
299 291
386 607
584 171
140 166
679 285
559 393
570 546
64 81
361 110
510 117
519 467...

output:

680 204801 175622 340008 102912 312832 355332 130087 124417 61462 284674 169984 89089 267776 329741 31744 263168 64512 68608 75264 37381 157696 278528 53760 13829 328192 57856 171009 181250 4611 197130 5633 128512 46595 282624 156160 254466 101380 9313 14849 119297 44035 285696 318464 67075 94721 51...

input:

Interaction has been finished!

output:

1
1
1
0
0
1
0
1
1
1
1
0
0
0
1
0
0
1
1
0
1
0
0
1
0
1
1
1
1
1
0
0
1
1
1
1
0
0
0
1
1
1
0
1
0
0
1
0
1
1
1
1
1
1
0
0
0
0
0
1
1
0
1
1
1
0
0
1
1
1
1
1
1
0
1
0
0
1
0
0
0
0
0
1
1
0
1
1
1
0
1
1
0
1
1
0
1
1
1
1
0
0
0
1
1
1
1
1
1
0
1
1
0
1
0
1
1
0
1
1
1
1
1
0
0
1
1
1
0
1
0
0
1
0
1
1
1
0
1
0
0
1
0
0
1
1
0
0
0
0
...

result:

points 1.0

Test #30:

score: 92
Accepted
time: 152ms
memory: 9808kb

input:

250000 250000
110488 29915
32503 19122
163234 216779
32503 244838
32503 56235
40340 188891
32503 63368
32503 62093
32503 21241
156372 239088
86337 206334
32503 107656
186415 11721
32503 19412
1401 170501
238830 1975
32503 2536
32503 92576
146518 16823
50563 21743
32503 103708
70942 36214
52807 18384...

output:

917 50559488 125106688 31065088 62543361 58339329 69675009 66021888 61256705 105918977 37592576 42311680 106429953 89393664 2719745 106295809 123824129 11993088 107134465 1357825 75648512 88729601 119525888 61995008 118212608 56676353 5271040 83576833 62488065 49710592 47556097 4093953 58726913 4771...

input:

Interaction has been finished!

output:

1
0
2
0
0
2
0
2
2
2
2
0
2
2
1
2
2
2
2
0
2
2
2
2
0
1
2
2
2
2
2
2
2
2
2
2
2
1
1
2
1
2
1
2
1
2
2
1
1
0
1
2
2
0
0
2
2
1
2
2
2
1
2
1
2
0
0
1
2
2
2
0
2
2
0
2
1
0
2
0
1
1
2
2
1
2
2
2
2
0
2
2
2
2
0
0
1
0
1
0
1
0
1
1
1
1
0
2
2
2
0
2
2
2
0
1
2
1
2
0
2
2
2
2
2
1
1
0
2
1
1
1
0
1
1
2
1
2
2
2
2
0
1
1
0
0
2
2
1
2
...

result:

points 1.0

Test #31:

score: 92
Accepted
time: 96ms
memory: 9836kb

input:

250000 250000
56463 84241
17929 232104
78818 231179
7763 119812
78818 216137
78324 54969
78818 53079
195671 35431
112104 106560
39189 167309
78818 155903
113437 200963
78818 237821
123567 124204
78818 147909
78818 187029
78818 186742
78818 118534
100212 204834
148444 245654
61970 65024
25750 71621
7...

output:

917 65041408 17119232 21770241 123122688 72990720 1771009 120676353 33878017 49642496 94032896 37810176 96303104 117434880 111862784 49480192 35641856 32590848 81697792 48050177 22206464 60346368 91468288 101449216 24995328 82906112 75435009 28337152 31959552 44355584 21388800 72067585 86097921 3339...

input:

Interaction has been finished!

output:

2
2
1
1
0
2
1
1
0
1
1
2
2
1
2
2
1
2
0
1
2
0
1
2
2
2
0
2
2
2
2
1
0
2
2
1
2
0
2
2
0
2
2
1
2
1
2
0
2
1
0
2
2
0
1
2
0
2
1
2
1
0
0
0
0
2
2
2
0
2
0
0
2
0
2
2
2
2
2
2
2
0
2
0
2
0
2
0
0
1
2
2
1
2
0
2
2
2
0
0
1
1
1
1
2
2
2
2
2
2
1
0
2
1
2
2
2
2
2
0
2
1
0
1
2
1
2
2
2
1
2
1
2
2
0
2
0
2
2
2
1
1
2
1
2
2
2
0
2
1
...

result:

points 1.0

Test #32:

score: 92
Accepted
time: 118ms
memory: 9884kb

input:

250000 250000
246615 82684
47274 30232
139970 60613
210652 81239
179019 172038
41407 219436
132076 211714
29055 38907
49098 236568
48167 185138
47274 170520
47274 574
87166 134649
18240 198023
47274 32445
28748 188954
177984 156977
227404 152029
95667 40783
47274 237786
47274 57531
47274 110575
4727...

output:

917 95564800 19085824 79296512 2437633 79395329 47216640 24204800 118301696 87865344 22509569 51187201 15606784 17954304 22449664 13977089 45645313 56747008 21930497 66613760 79006209 59339264 24775169 93379073 23967744 112286208 2446849 120248321 68261889 111826945 50849792 93869568 106813441 99224...

input:

Interaction has been finished!

output:

2
2
2
0
0
0
0
0
1
1
2
2
2
0
0
2
2
2
2
2
2
1
1
2
2
1
2
0
0
2
2
2
2
2
2
1
2
0
1
1
0
1
0
2
0
1
2
2
0
0
1
2
0
2
2
2
2
0
2
0
2
2
0
0
2
1
2
2
0
2
2
1
2
2
0
2
2
2
2
1
2
2
2
0
0
0
2
2
0
1
0
1
2
2
1
1
1
2
2
2
2
1
1
0
1
0
1
0
1
0
0
0
2
2
2
2
0
0
0
1
2
0
0
0
2
0
1
2
1
0
2
1
2
2
2
0
1
2
2
0
2
0
2
1
0
1
2
0
2
1
...

result:

points 1.0

Test #33:

score: 92
Accepted
time: 128ms
memory: 9808kb

input:

250000 250000
169779 129784
65198 110053
158373 24761
66653 10729
75121 98520
225514 227184
130625 47045
145713 42773
75121 130333
75121 2813
75121 240810
75121 90074
222329 218563
59360 201210
81564 72860
236207 96937
79551 226435
14469 249307
222141 72356
88298 101110
75121 208318
75121 105396
484...

output:

915 101250562 72567296 73997312 92133376 14258691 58220032 3721216 103074307 43477504 31499776 1132032 73904640 43793921 54041600 37887488 23641601 121486848 56588800 41361920 7342592 34145792 64893440 19127296 113925632 41443329 17138688 30941185 19471873 86369792 21906944 13919747 23666689 7813990...

input:

Interaction has been finished!

output:

1
1
0
2
1
2
1
1
1
0
2
1
2
2
1
0
2
1
2
2
0
2
1
1
2
2
1
0
2
0
1
0
2
1
2
2
2
2
2
2
0
0
2
2
0
2
1
0
2
2
1
2
2
2
0
2
0
2
2
0
2
1
1
2
1
0
1
2
2
2
2
2
2
0
0
0
0
1
2
0
2
1
1
1
1
0
0
2
2
2
2
1
2
0
2
2
1
2
0
0
2
1
2
1
0
0
2
0
0
2
1
2
2
2
0
2
0
2
0
2
2
2
1
2
0
1
0
2
2
2
0
0
1
1
0
1
2
0
2
1
1
2
0
1
2
2
2
2
2
2
...

result:

points 1.0

Test #34:

score: 92
Accepted
time: 120ms
memory: 9804kb

input:

250000 250000
41598 211819
178057 8902
41598 25261
159032 170814
178057 51128
108989 52376
178057 120123
33050 191946
162642 212013
41598 26096
127315 209050
182576 43473
178057 120314
41598 46174
140237 131578
166787 88256
178057 208477
228075 235006
2102 72773
11150 206322
179976 14367
181499 7399...

output:

916 61484033 60838402 43591680 77649408 100862465 73014274 39052288 90767362 90114562 4260865 121095682 93336065 123936768 37581313 72034817 70861824 124961794 67332610 99492353 64553986 103140353 56002049 87631361 8209409 121096704 8461313 1546753 26824193 104832514 107604480 48091649 43514880 2508...

input:

Interaction has been finished!

output:

2
2
2
2
0
2
2
2
1
2
1
2
0
2
2
0
0
1
1
0
2
2
0
2
0
0
2
2
2
2
0
0
2
0
1
0
1
2
2
2
2
0
2
1
2
2
2
0
2
1
2
1
1
1
2
0
0
0
1
0
1
1
2
1
2
1
2
2
0
2
2
2
1
2
2
2
2
1
2
2
2
2
1
2
1
1
2
0
2
1
2
2
2
2
0
0
2
1
0
0
2
1
1
2
1
0
2
0
2
2
2
2
1
1
2
0
2
2
1
0
2
1
2
2
0
1
1
2
2
2
1
2
2
0
2
2
1
1
2
0
1
2
1
2
1
2
0
2
0
0
...

result:

points 1.0

Test #35:

score: 92
Accepted
time: 116ms
memory: 9816kb

input:

250000 250000
163081 132781
63469 11856
30855 50874
182965 210480
165909 208529
182965 69949
19082 85721
145102 24549
63469 98663
63469 230902
182965 247893
91712 244743
182965 246142
63469 92012
51907 109391
111901 86904
63469 12300
104476 112270
35238 54337
52549 37141
182965 87396
130391 140516
6...

output:

916 3420162 71356928 94470145 47733762 52510208 35316738 24069121 128195585 75547136 44696576 12306433 121200129 83964416 33162241 61537794 127131137 21810176 21564930 111119872 113160192 39671809 39617024 68102658 118062593 29984257 24564224 64380930 13292545 10616322 57017346 15467010 2341890 2571...

input:

Interaction has been finished!

output:

2
0
0
0
2
1
0
1
2
2
1
1
1
0
2
0
1
0
2
2
1
0
2
0
2
1
1
2
0
0
0
0
2
0
1
1
1
2
1
0
2
0
1
2
0
2
2
0
1
2
2
1
2
2
2
2
0
0
1
1
2
2
2
0
2
1
1
1
0
2
0
2
0
0
2
0
2
2
1
2
2
0
0
2
1
2
0
2
1
2
0
1
2
2
1
2
2
2
2
1
2
2
2
2
0
1
0
1
2
1
2
0
2
0
2
1
2
2
2
1
2
0
2
1
0
0
0
1
2
2
2
2
2
2
2
0
2
0
2
2
1
2
2
1
2
2
2
0
2
2
...

result:

points 1.0

Test #36:

score: 92
Accepted
time: 108ms
memory: 9936kb

input:

250000 250000
209695 203761
124115 27828
226002 88019
177206 117980
53014 34658
79947 249040
192420 90387
105823 50440
227710 118147
68838 70284
192420 168744
28455 61505
2311 93146
192420 12190
103505 37947
211324 154894
212740 208321
132041 90447
48111 234924
192420 180290
192420 120196
104200 491...

output:

915 44058624 89440771 40225793 21378048 76138498 27718656 7911424 30891008 114752003 23970816 69401088 16873985 19365888 121197570 23300096 5966337 109666819 72577536 96166403 102557185 102163458 125448707 63895553 120054786 101770242 65342465 3383810 37597696 70668802 10929664 72898560 76130818 647...

input:

Interaction has been finished!

output:

2
0
0
2
2
1
0
1
0
2
2
0
0
2
2
2
0
1
2
1
1
2
2
2
2
0
2
1
2
2
0
1
2
0
2
2
1
2
2
1
2
0
2
0
1
0
1
2
2
2
1
1
1
0
0
2
2
2
2
2
0
0
1
1
2
0
2
2
2
2
2
2
2
2
2
0
2
0
2
2
1
2
2
2
2
2
2
2
1
0
1
2
2
2
1
2
0
1
2
0
1
2
2
1
0
2
1
2
1
0
1
0
2
1
2
0
2
0
2
0
2
0
1
0
1
2
2
2
0
0
1
2
1
2
2
2
1
1
2
2
2
1
0
2
1
0
0
1
2
2
...

result:

points 1.0

Test #37:

score: 92
Accepted
time: 102ms
memory: 7776kb

input:

250000 250000
26171 185351
39348 11884
58623 154119
29392 210049
225461 13141
210462 239794
89337 158657
64038 226543
225461 165057
155662 236975
199438 169618
2656 123195
89755 217180
108157 40495
78088 16550
225461 101981
182908 74529
88887 167252
234346 52597
86586 112414
225461 73242
234252 2080...

output:

915 45004291 101954049 119775746 31929346 95012354 92571136 100524544 33052675 100333058 47259650 118203904 2713088 117943808 26173444 15644675 7743488 65403906 96759808 82200064 52333057 86373376 314368 33022466 87581185 39515648 85837824 7561728 84224000 47531008 27813888 114895873 16060928 480916...

input:

Interaction has been finished!

output:

2
2
1
2
1
1
2
1
1
2
1
0
0
2
1
0
1
2
0
2
2
0
0
1
2
2
2
0
0
2
2
2
0
1
2
2
1
1
0
2
0
2
2
1
1
2
1
2
1
1
2
1
2
2
1
2
0
1
2
1
1
0
2
2
2
2
2
0
2
1
2
2
1
0
2
2
0
0
1
2
0
2
1
2
0
2
2
0
1
0
1
2
2
2
2
1
2
0
2
2
0
1
1
2
1
2
2
2
2
2
1
0
0
1
0
0
2
1
0
2
2
2
2
0
2
0
0
2
2
1
0
0
0
0
2
2
1
2
2
2
2
2
0
2
1
2
2
2
1
0
...

result:

points 1.0

Test #38:

score: 92
Accepted
time: 120ms
memory: 9820kb

input:

250000 250000
110575 244888
185589 68626
9376 216813
144676 137788
100619 78212
211391 66989
35209 243254
20195 144006
196216 87366
185399 121645
194646 130354
54752 290
224640 85825
25675 41656
146244 90139
28927 68073
132399 6516
77706 91331
84625 151745
9376 84716
242992 193078
238102 220734
2181...

output:

914 64586752 126323201 128743937 55808 108808707 75343873 37875712 60843520 118916098 26125313 40843264 96414210 53385216 31075329 78194178 11680256 23876098 105230338 48766976 70296579 97777668 8157189 5872132 130096128 30542849 31706113 34314753 88315908 80860672 64583169 122599426 47843328 791705...

input:

Interaction has been finished!

output:

2
2
2
2
2
2
2
2
1
2
2
1
0
1
2
1
2
1
1
2
2
0
0
1
0
2
2
2
0
2
2
2
1
1
2
2
0
2
2
2
2
1
2
2
1
1
2
1
0
2
2
2
1
2
2
2
2
2
1
0
2
2
0
1
1
0
1
1
2
2
2
0
1
2
1
1
0
0
1
2
1
0
0
2
0
2
2
2
2
2
1
0
2
2
2
2
2
1
2
2
1
1
2
2
1
2
2
1
0
2
2
0
2
0
1
2
2
1
2
2
2
0
1
1
1
2
2
2
2
0
2
2
1
1
2
0
0
0
2
2
1
1
2
2
0
2
1
1
2
2
...

result:

points 1.0

Test #39:

score: 92
Accepted
time: 152ms
memory: 9824kb

input:

250000 250000
243362 29519
185329 174397
40158 169929
115163 94741
41201 214325
91993 61762
227404 228662
200708 3028
176550 161431
243362 183064
202244 84426
231033 143840
220682 231042
144308 210950
33871 71003
179193 137456
124230 121297
199243 15562
9791 220563
92161 54686
127414 130262
127103 2...

output:

912 51431424 80791552 62377985 50884608 125473283 122381313 115741190 498182 15796742 73499137 106017797 123118595 89714176 73719299 58683905 45708289 8702470 63088128 7369218 117087745 17507840 52997633 96076288 72640003 35079685 95536644 85913601 7865856 96581635 41723394 87742468 1092102 12655514...

input:

Interaction has been finished!

output:

2
2
2
2
0
1
0
1
1
2
1
0
2
2
1
2
2
2
0
1
2
2
0
0
2
2
0
2
1
0
2
0
1
1
2
1
1
2
1
0
1
2
0
2
2
0
1
1
2
0
2
0
2
2
1
2
2
2
2
1
2
0
2
2
2
2
0
2
0
1
1
0
2
2
0
0
2
2
2
2
2
0
2
2
1
1
1
1
2
0
2
0
2
2
2
2
0
2
2
2
2
1
2
2
2
2
0
0
2
2
2
2
1
0
1
0
2
1
0
2
1
2
2
1
1
0
2
2
1
2
1
1
2
0
2
2
0
0
2
2
1
2
1
1
0
2
0
2
2
2
...

result:

points 1.0