QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#136195#2415. Firetrucks Are RedNightW0lf#AC ✓201ms76324kbC++141.7kb2023-08-07 15:59:312023-08-07 15:59:56

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-07 15:59:56]
  • 评测
  • 测评结果:AC
  • 用时:201ms
  • 内存:76324kb
  • [2023-08-07 15:59:31]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define endl '\n'
struct RES{
    int p,q,r;
};
vector<RES> res;
const int N = 400005;
vector<int> adj[N];
vector<int> ids[N];

int vis[N];
int parent[N];
int decompress[N];
int n;
void dfs(int u){
    vis[u] = 1;
    for(auto v:adj[u]){
        if( vis[v] ) continue;
        parent[v] = u;
        if( v <=n ) {
            res.push_back({parent[u],v,decompress[u-n]});
        }
        dfs(v);
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    
    cin>>n;
    set<int> st;
    for(int i=1;i<=n;i++){
        int t;
        cin>>t;
        for(int j=0;j<t;j++){
            int a;
            cin>>a;
            st.insert(a);
            ids[i].push_back(a);
        }
    }
    map<int,int> compress;
    int id = 1;
    for(auto s:st){
        compress[s] = id;
        decompress[id] = s;
        id++;
    }
    /*for(int i=1;i<=2*n;i++){
        cout<<i<<endl;
        for(auto v:adj[i]) cout<<v<<" ";
        cout<<endl;
    }*/
    for(int i=1;i<=n;i++){
        for(auto v:ids[i]){
            int j = compress[v];
            adj[i].push_back(j+n);
            adj[j+n].push_back(i);
        }
    }
   /* for(int i=1;i<=2*n;i++){
        cout<<i<<endl;
        for(auto v:adj[i]) cout<<v<<" ";
        cout<<endl;
    }*/

    dfs(1);
    //cout<<res.size()<<endl;
    if( res.size() != n-1 ){
        cout<<"impossible\n";
        return 0;
    }
    for(auto r:res) cout<<r.p<<" "<<r.q<<" "<<r.r<<endl;
    
}

/*
6
2 17 10
1 5
2 10 22
3 17 22 9
2 17 8
3 9 22 16
*/
/*
6
2 17 10
2 5 10
2 10 22
3 17 22 9
2 17 8
3 9 22 16
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 28340kb

input:

2
1 144272510
1 144272510

output:

1 2 144272510

result:

ok 

Test #2:

score: 0
Accepted
time: 6ms
memory: 27232kb

input:

2
3 926756583 60721576 911666163
1 926756583

output:

1 2 926756583

result:

ok 

Test #3:

score: 0
Accepted
time: 6ms
memory: 27324kb

input:

10
2 853832590 668835602
1 668835602
1 384974576
2 274281999 796487719
3 668835602 384974576 853832590
3 274281999 796487719 668835602
4 668835602 274281999 853832590 384974576
2 796487719 274281999
1 384974576
1 274281999

output:

1 5 853832590
5 2 668835602
5 6 668835602
6 4 274281999
4 8 796487719
6 7 274281999
7 3 384974576
7 9 384974576
6 10 274281999

result:

ok 

Test #4:

score: 0
Accepted
time: 1ms
memory: 28140kb

input:

100
2 342937749 285101060
2 579015745 292807338
3 456017432 101157443 285101060
1 280913935
2 859297027 444536025
2 504931657 783643441
2 456017432 360328443
2 655033009 977719989
2 23503993 86510939
1 280913935
3 882566438 400677901 280913935
4 285101060 711696014 782637467 655033009
1 504931657
1 ...

output:

impossible

result:

ok 

Test #5:

score: 0
Accepted
time: 2ms
memory: 28400kb

input:

20
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1

output:

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

result:

ok 

Test #6:

score: 0
Accepted
time: 105ms
memory: 76324kb

input:

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

output:

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

result:

ok 

Test #7:

score: 0
Accepted
time: 1ms
memory: 27276kb

input:

6
2 17 10
1 5
2 10 22
3 17 22 9
2 17 8
3 9 22 16

output:

impossible

result:

ok 

Test #8:

score: 0
Accepted
time: 1ms
memory: 26784kb

input:

6
2 17 10
2 5 10
2 10 22
3 17 22 9
2 17 8
3 9 22 16

output:

1 4 17
4 3 22
3 2 10
4 6 22
1 5 17

result:

ok 

Test #9:

score: 0
Accepted
time: 184ms
memory: 54036kb

input:

2
100135 50111079 636408060 792100042 5331285 336232714 372531348 162635402 202613385 334090836 434578373 974884818 991177868 34904916 852254962 932427235 990037224 28539707 529294723 999535479 92353517 160063080 301178333 783582003 898654302 448001960 798608014 499842001 640408898 149094210 9433621...

output:

1 2 792100042

result:

ok 

Test #10:

score: 0
Accepted
time: 186ms
memory: 54160kb

input:

2
100205 402692425 947048076 726644125 19396699 862992483 245024640 740973675 980569112 910684526 801789052 557001194 245807612 61789671 812894241 226721911 929071642 127202795 669601395 762104667 274761931 736916240 633593859 295582544 557936950 541234480 853475793 409017481 571982228 320919975 148...

output:

1 2 947048076

result:

ok 

Test #11:

score: 0
Accepted
time: 1ms
memory: 27740kb

input:

1000
1 170570389
1 876309004
1 270859704
1 681063235
3 388428750 214660301 173343388
2 230530420 459123744
2 425028352 430985812
2 888134465 613326043
3 937167878 531627138 892379916
1 66423869
1 427424009
1 86523514
3 353975089 939671730 250542715
1 297337445
1 681192098
3 581503268 664754894 49731...

output:

impossible

result:

ok 

Test #12:

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

input:

1000
196 353335732 409189874 700840930 330445933 481862392 520871605 16334747 286519743 757135435 336218173 371759648 246353297 587875214 775977271 277408406 445423784 897302904 144984294 159136901 239018567 120141137 815375811 768250891 370067413 169973067 147431809 135776656 669999566 368541780 47...

output:

1 9 353335732
9 10 848544944
10 2 543934154
2 12 973897049
12 3 85492826
3 5 524800603
5 14 716498469
14 16 548658040
16 8 714064301
8 4 236174915
4 18 510965165
18 26 290858846
26 15 215474563
15 6 282515939
6 13 183296006
13 21 478946154
21 20 534273032
20 7 962668189
7 32 461201450
32 27 14986026...

result:

ok 

Test #13:

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

input:

1000
189 828192941 685817733 678017774 41116968 572481375 371245577 332259182 647183053 54592220 490654862 280198999 816286534 67217910 266490029 183296111 881325755 423521527 199040467 773986454 126627449 878841975 158056460 708000087 942344906 982273186 148549394 807148449 36561902 75342254 466857...

output:

1 33 828192941
33 27 191854797
27 10 792945044
10 74 743178841
74 43 978355153
43 56 851472598
56 96 948743590
96 2 125067388
2 64 526375929
64 42 286711184
42 35 941407607
35 118 359666275
118 67 536181808
67 78 475048230
78 51 38748973
51 38 914917887
38 77 956610034
77 7 437181716
7 54 978805343
...

result:

ok 

Test #14:

score: 0
Accepted
time: 201ms
memory: 58048kb

input:

200000
1 338399905
1 776534810
1 145642942
1 204041132
1 903206281
1 97213556
1 623800194
1 274470932
1 462713477
1 427531118
1 161862854
1 601371719
1 852865573
1 843902403
1 255426727
1 621765222
1 171216106
1 786755429
1 779543103
1 912736055
1 692014287
1 942045680
1 770693979
1 898055070
1 2407...

output:

impossible

result:

ok 

Test #15:

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

input:

200000
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485738844
1 485...

output:

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

result:

ok 

Test #16:

score: 0
Accepted
time: 71ms
memory: 40256kb

input:

100000
4 66986508 25672697 741308508 398643872
4 810714430 462971176 784903561 135133396
2 341884150 214808229
1 994562898
2 914628988 214354925
4 65267068 652634200 116594039 329964803
1 854894070
3 542040307 780705654 222928058
2 11661309 901308589
1 659980722
3 468105719 928529221 222066733
2 245...

output:

1 173 66986508
173 205 955288458
173 663 955288458
663 514 506357491
663 833 506357491
833 1164 174317862
1164 1499 696097406
1499 591 353356820
591 767 731686592
767 1262 174104706
1262 258 71058421
258 1228 334864484
1228 153 631827747
153 1675 175752068
153 2710 175752068
153 3800 175752068
3800 ...

result:

ok 

Test #17:

score: 0
Accepted
time: 178ms
memory: 57904kb

input:

66666
2 117465641 402715707
1 341083455
3 796958965 710301355 746905126
2 163268728 402102113
4 84769750 669732542 277812555 545765863
3 671164754 815075092 771856917
4 25145580 417136497 804678582 122185977
2 158857856 778998238
5 562047347 598388755 863583758 326100092 736225275
3 515335420 622477...

output:

impossible

result:

ok 

Test #18:

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

input:

66666
4 167619805 562085576 20222422 415275945
1 511659696
2 224047708 571170368
3 120215750 94035264 97028106
5 276938180 521048020 802135121 911006466 705678159
4 252107501 453206228 740527965 914645729
3 400916347 283609115 668954016
3 35760649 532141113 616088838
1 248512755
4 298227773 22976291...

output:

impossible

result:

ok 

Test #19:

score: 0
Accepted
time: 101ms
memory: 42892kb

input:

66666
3 505166193 93395939 794797228
3 547883844 731355206 518083062
2 15213032 934919980
2 879180481 615561017
3 31298049 778588758 913384358
2 622135901 96045329
2 575635537 725226152
3 371764320 541399775 739118591
6 231117007 172771060 677274540 384078219 784517111 743815130
2 285841853 98779078...

output:

1 7986 505166193
7986 3769 237238339
3769 8003 246125721
8003 9652 700232898
9652 3253 811809671
3253 2452 767351240
2452 5134 46831832
5134 11930 661824285
11930 13007 233578782
13007 11637 362349450
11637 4204 495017622
4204 956 910662623
956 1590 430251764
1590 1300 3263188
1300 1795 79672667
179...

result:

ok 

Test #20:

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

input:

66666
4 749237116 132626332 124653400 339740401
5 902503400 337405919 65585420 185910494 837432922
3 291170815 632807307 121977500
4 751040039 296835194 206735974 984844966
3 111334746 262468099 785973792
2 205568802 86034642
3 309871088 609050508 660559706
4 517816127 592885374 401382439 973321939
...

output:

1 339 749237116
1 1421 749237116
1421 2229 814315424
2229 284 424392983
284 66 166705866
284 615 166705866
615 436 654563440
436 57 905394365
57 93 613786469
93 861 792014923
861 941 478714687
941 43 991871976
43 98 784102004
98 850 906443930
850 30 331227526
30 17 316033257
17 236 896095082
236 126...

result:

ok 

Test #21:

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

input:

66666
6 515669354 687383080 707128932 726182260 74279860 801435741
3 54358921 332000472 900808766
4 520645316 241523225 22184995 183316997
1 802646452
3 54358921 726182260 373470557
1 87900645
3 977149212 80562651 211060053
3 572446680 600105575 412500581
1 679788096
2 118549454 617308388
3 34239371...

output:

1 15 515669354
15 155 439884484
155 41 984115761
155 121 984115761
121 38 571533905
38 42 756150324
42 83 266899756
83 27 734906210
27 170 268620365
170 18 402469589
18 84 707128932
84 152 840097143
152 7 211060053
7 53 977149212
53 181 508750764
181 176 687383080
181 236 687383080
236 62 173355699
...

result:

ok 

Test #22:

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

input:

66666
5 710205641 257157154 674511470 131872120 212536025
5 525613093 131872120 481922738 257157154 194631666
1 359230746
3 525613093 212536025 257157154
3 359230746 257157154 710205641
5 481922738 359230746 525613093 257157154 194631666
3 359230746 212536025 525613093
2 131872120 525613093
2 257157...

output:

1 5 710205641
5 3 359230746
5 6 359230746
6 2 481922738
2 4 525613093
4 7 212536025
4 9 212536025
9 16 257157154
16 10 530465699
10 13 674511470
10 14 674511470
14 8 131872120
14 15 131872120
14 17 131872120
14 22 131872120
14 27 131872120
27 24 194631666
27 49 194631666
27 54 194631666
27 59 194631...

result:

ok 

Test #23:

score: 0
Accepted
time: 176ms
memory: 55984kb

input:

50000
6 327676685 79137275 172885291 41826002 513900407 200386950
2 911586845 528189521
3 14558835 606854109 974795538
5 599278628 990072740 612558639 555435869 17559339
8 194313587 750835784 207940884 465375971 258158238 850965099 731439619 687176816
4 617462223 279393256 937673983 8864693
1 399356...

output:

impossible

result:

ok 

Test #24:

score: 0
Accepted
time: 156ms
memory: 53984kb

input:

50000
4 512682157 894833087 462054922 672207899
3 186079333 215371999 978545964
3 390642511 761179740 222727271
5 905506567 523166275 986970964 429848502 337309069
3 708115126 258594335 348461019
3 79395475 301162131 232119367
4 84645608 968578204 387392630 283880191
5 614472420 16828810 519408494 7...

output:

impossible

result:

ok 

Test #25:

score: 0
Accepted
time: 148ms
memory: 49684kb

input:

50000
7 459024596 704635913 923032689 888506127 355421029 816452434 533927184
4 11507956 754991312 655898369 362125251
5 402589851 499809379 319301087 625834427 897561803
6 750964819 437600356 724161830 160741809 381715968 170156679
1 783186878
3 258915852 395478803 373821424
1 55849302
5 92474652 8...

output:

impossible

result:

ok 

Test #26:

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

input:

50000
4 201187612 187117236 629403624 963202955
4 877506290 666252315 647721243 814417071
7 713202719 878716501 590716451 996553674 800640977 506610029 556291142
7 622849656 10540298 732705521 1437031 745954200 855866887 752624529
5 705212263 315649312 502466883 138595442 163565734
2 404721597 89829...

output:

1 6677 201187612
6677 468 332959455
468 5571 921621051
5571 5988 829207079
5988 2054 21736421
2054 135 541020064
135 3378 557557888
3378 3807 584873864
3807 281 847544251
281 1331 963110302
1331 4214 861115119
4214 835 4078611
835 3532 324685924
3532 6715 118943631
6715 1286 1375510
1286 4476 704741...

result:

ok 

Test #27:

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

input:

50000
8 641325023 789626607 492294335 504104914 686670938 629318609 3405465 937984260
3 483183626 330148255 304702304
4 35452084 394430004 574991316 273067480
4 292742571 330148255 355025841 858928228
2 871443606 47618503
8 810711155 457566975 952329071 180610816 887126652 533154325 123937219 111135...

output:

1 600 641325023
600 1496 373801658
1496 543 524871096
543 974 445277486
974 883 19259326
883 697 629797838
697 1332 869261943
1332 1311 511052027
1311 9 48937582
9 364 106497919
364 2008 425471768
2008 69 43673935
69 2512 32406171
2512 627 254345643
627 2298 130282314
2298 52 226080641
52 338 210704...

result:

ok 

Test #28:

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

input:

50000
2 164209258 104050975
2 527540136 473925754
2 731917343 212682687
2 100496618 473925754
5 304267884 696839751 797559398 363923049 229489591
5 907542871 141034869 992839470 35711814 348169471
2 816640729 124117860
6 530886688 842539091 731917343 582060567 813613886 141034869
2 879556072 8166407...

output:

1 39 164209258
39 3 731917343
3 70 212682687
70 5 696839751
5 14 304267884
14 68 737907641
68 15 394060430
15 16 278501790
16 58 181863651
58 18 350974654
18 76 179668822
76 36 546362951
36 30 212521036
30 22 208408438
22 40 502253807
40 19 272632306
19 50 960762591
50 20 30247675
20 97 793655801
97...

result:

ok 

Test #29:

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

input:

50000
6 999625659 905741186 404760190 905644043 995131580 16469317
5 404760190 825156184 327224558 935989460 229829890
3 905644043 995131580 905741186
3 404760190 935989460 229829890
5 905644043 905741186 327224558 825156184 935989460
1 327224558
7 229829890 404760190 16469317 905741186 327224558 99...

output:

1 7 999625659
7 2 229829890
2 4 404760190
4 5 935989460
5 3 905644043
3 11 995131580
11 6 327224558
11 8 327224558
8 10 825156184
10 13 16469317
10 14 16469317
14 12 905741186
14 15 905741186
14 17 905741186
14 22 905741186
14 23 905741186
14 25 905741186
14 26 905741186
14 29 905741186
14 34 905741...

result:

ok 

Test #30:

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

input:

50000
4 708119118 220287425 802397886 217703977
5 220287425 802397886 217703977 708119118 973596356
4 220287425 802397886 973596356 217703977
3 802397886 217703977 220287425
4 973596356 217703977 220287425 802397886
5 708119118 802397886 973596356 217703977 220287425
5 802397886 973596356 217703977 ...

output:

1 2 708119118
2 3 220287425
3 4 802397886
4 5 217703977
5 6 973596356
5 7 973596356
5 10 973596356
5 11 973596356
5 12 973596356
5 13 973596356
5 14 973596356
5 15 973596356
5 16 973596356
5 17 973596356
5 18 973596356
5 19 973596356
5 20 973596356
5 21 973596356
5 22 973596356
5 24 973596356
5 25 9...

result:

ok 

Test #31:

score: 0
Accepted
time: 168ms
memory: 75396kb

input:

100000
1 696318585
2 696318585 515269277
2 515269277 753089815
2 753089815 297661051
2 297661051 307064222
2 307064222 210886233
2 210886233 79402165
2 79402165 70189682
2 70189682 273165062
2 273165062 885039674
2 885039674 579352176
2 579352176 357627595
2 357627595 271562978
2 271562978 399834305...

output:

1 2 696318585
2 3 515269277
3 4 753089815
4 5 297661051
5 6 307064222
6 7 210886233
7 8 79402165
8 9 70189682
9 10 273165062
10 11 885039674
11 12 579352176
12 13 357627595
13 14 271562978
14 15 399834305
15 16 895663703
16 17 874955517
17 18 432612410
18 19 196854212
19 20 266114901
20 21 976763022...

result:

ok 

Test #32:

score: 0
Accepted
time: 96ms
memory: 72076kb

input:

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

output:

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

result:

ok 

Test #33:

score: 0
Accepted
time: 94ms
memory: 56888kb

input:

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

output:

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

result:

ok 

Test #34:

score: 0
Accepted
time: 115ms
memory: 74556kb

input:

100001
1 100000
2 99999 100000
2 99998 99999
2 99997 99998
2 99996 99997
2 99995 99996
2 99994 99995
2 99993 99994
2 99992 99993
2 99991 99992
2 99990 99991
2 99989 99990
2 99988 99989
2 99987 99988
2 99986 99987
2 99985 99986
2 99984 99985
2 99983 99984
2 99982 99983
2 99981 99982
2 99980 99981
2 9...

output:

1 2 100000
2 3 99999
3 4 99998
4 5 99997
5 6 99996
6 7 99995
7 8 99994
8 9 99993
9 10 99992
10 11 99991
11 12 99990
12 13 99989
13 14 99988
14 15 99987
15 16 99986
16 17 99985
17 18 99984
18 19 99983
19 20 99982
20 21 99981
21 22 99980
22 23 99979
23 24 99978
24 25 99977
25 26 99976
26 27 99975
27 2...

result:

ok 

Test #35:

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

input:

100001
1 57767
1 15315
1 981
1 11880
1 76313
1 4577
1 88023
1 90844
1 11001
1 12900
1 46482
1 31039
1 2284
1 4038
1 2076
1 45362
1 84976
1 81694
1 63471
1 80716
1 60758
1 19471
1 11965
1 23998
1 93508
1 14996
1 1916
1 65940
1 63799
1 32745
1 8462
1 87458
1 70921
1 61066
1 8987
1 78835
1 88490
1 1165...

output:

1 91472 57767
91472 29061 1
91472 96221 2
91472 46511 3
91472 4103 4
91472 43279 5
91472 91413 6
91472 75271 7
91472 34532 8
91472 45315 9
91472 14236 10
91472 88945 11
91472 99284 12
91472 31956 13
91472 63166 14
91472 95275 15
91472 64147 16
91472 7511 17
91472 89928 18
91472 43861 19
91472 88510 ...

result:

ok 

Test #36:

score: 0
Accepted
time: 110ms
memory: 60116kb

input:

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

output:

impossible

result:

ok 

Test #37:

score: 0
Accepted
time: 102ms
memory: 62640kb

input:

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

output:

1 2 1000000000

result:

ok