QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#87135#1212. Navigation99pts_WA25 44ms7612kbC++14659b2023-03-11 18:05:292023-03-11 18:05:40

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 22ms
memory: 7612kb

input:

100000 94560 16294 1
91913 94560
94560 69503
94560 39684
47595 94560
94560 96623
8011 94560
94560 15498
94560 92403
94560 84183
94560 44035
39994 94560
82975 94560
94560 30698
94560 17596
93175 94560
12253 94560
94560 60807
94560 16111
35848 94560
94560 19061
94560 25435
64721 94560
94560 79086
9548...

output:

1 94560 2 99999
91913 69503 39684 47595 96623 8011 15498 92403 84183 44035 39994 82975 30698 17596 93175 12253 60807 16111 35848 19061 25435 64721 79086 95487 98059 93865 84074 47584 77418 15271 82666 57858 21726 62847 90603 40247 64714 59668 13698 15586 58276 57618 20231 16177 77966 44363 69669 679...

input:

1 94560 2 99999
91913 69503 39684 47595 96623 8011 15498 92403 84183 44035 39994 82975 30698 17596 93175 12253 60807 16111 35848 19061 25435 64721 79086 95487 98059 93865 84074 47584 77418 15271 82666 57858 21726 62847 90603 40247 64714 59668 13698 15586 58276 57618 20231 16177 77966 44363 69669 679...

output:

16294

result:

ok 

Test #2:

score: 10
Accepted
time: 6ms
memory: 5964kb

input:

100000 48333 48333 1
927 22305
87188 22305
22305 75567
22305 9347
22305 35901
84454 22305
22305 5403
95165 22305
22305 24449
22305 69669
67307 22305
22305 58710
22305 27193
22305 24006
22305 8159
22305 54726
22305 92239
22305 68605
10968 22305
98683 22305
22305 53333
56288 22305
22305 68487
22305 24...

output:

1 48333 1 1
22305 
1 

input:

1 48333 1 1
22305 
1 

output:

48333

result:

ok 

Test #3:

score: 10
Accepted
time: 6ms
memory: 6064kb

input:

100000 88397 36060 1
36060 49481
36060 89888
46104 36060
36060 6545
36060 10332
91103 36060
99366 36060
36060 91493
28482 36060
36060 50154
61776 36060
36060 86147
36060 26865
36060 59538
3007 36060
45932 36060
87940 36060
27557 36060
84830 36060
99039 36060
36060 56978
36060 67947
45731 36060
36060...

output:

1 88397 2 1
36060 
1 

input:

1 88397 2 1
36060 
1 

output:

36060

result:

ok 

Test #4:

score: 10
Accepted
time: 40ms
memory: 7496kb

input:

100000 38698 38698 1
37846 38698
38698 89559
78769 38698
38698 89020
7513 38698
38698 32101
38698 29025
12438 38698
18470 38698
38698 90109
38698 30769
38698 39527
10263 38698
65118 38698
38698 22415
64062 38698
97159 38698
69847 38698
39786 38698
51210 38698
43668 38698
36191 38698
38698 56728
3869...

output:

1 38698 1 99999
37846 89559 78769 89020 7513 32101 29025 12438 18470 90109 30769 39527 10263 65118 22415 64062 97159 69847 39786 51210 43668 36191 56728 64359 44538 82307 93616 84397 75820 2706 10140 87937 22018 42078 40298 19458 74608 59490 1552 75615 96884 9114 93872 4401 32423 44319 51612 90701 9...

input:

1 38698 1 99999
37846 89559 78769 89020 7513 32101 29025 12438 18470 90109 30769 39527 10263 65118 22415 64062 97159 69847 39786 51210 43668 36191 56728 64359 44538 82307 93616 84397 75820 2706 10140 87937 22018 42078 40298 19458 74608 59490 1552 75615 96884 9114 93872 4401 32423 44319 51612 90701 9...

output:

38698

result:

ok 

Test #5:

score: 10
Accepted
time: 6ms
memory: 5984kb

input:

100000 8245 84923 1
67623 27621
14268 21660
76847 23001
8526 89835
60294 27885
97998 3107
41202 81214
89046 77360
59880 37584
257 27165
98520 84969
86067 72018
56406 64542
8276 24019
2025 20508
41774 84036
98730 17060
95258 43701
9237 70504
60680 4981
37431 88381
35493 76263
67579 96557
38708 14317
...

output:

1 8245 1 1
84923 
1 

input:

1 8245 1 1
84923 
1 

output:

84923

result:

ok 

Test #6:

score: 10
Accepted
time: 6ms
memory: 5972kb

input:

100000 30244 30244 1
73878 14577
56095 37561
47600 77453
5775 66825
58458 94915
99798 36060
47365 16824
9669 42255
33430 40025
41498 48308
18806 35743
41949 2837
90413 81335
23192 16889
45568 74622
4612 60078
69326 26499
28615 69807
86447 94951
28921 39587
92130 49914
84613 67964
64759 79721
1311 61...

output:

1 30244 1 2
40964 19929 
2 1 

input:

1 30244 1 2
40964 19929 
2 1 

output:

30244

result:

ok 

Test #7:

score: 10
Accepted
time: 6ms
memory: 5960kb

input:

100000 96539 83473 1
70154 43134
32826 38352
57782 12788
92705 47501
35880 88824
40402 10256
10743 19914
43415 24282
51931 26190
22666 11483
99042 17829
96021 53017
54819 93863
51864 66957
87319 62434
6849 62344
78818 23795
96092 34357
94603 43233
12795 54707
98761 8205
77768 51553
32961 14830
5637 ...

output:

1 96539 2 2
83473 27443 
1 2 

input:

1 96539 2 2
83473 27443 
1 2 

output:

83473

result:

ok 

Test #8:

score: 10
Accepted
time: 0ms
memory: 5936kb

input:

100000 52817 52817 1
45829 28937
87621 46779
27742 44527
29132 94788
34866 83250
10067 22616
59505 47012
96094 630
61678 67600
71656 43018
34904 61814
76991 78179
94102 12730
40366 90348
7717 42472
68347 67300
14803 29352
26557 92986
20554 25074
36744 72498
39260 58715
67267 83312
35596 27056
93664 ...

output:

1 52817 1 1
115 
1 

input:

1 52817 1 1
115 
1 

output:

52817

result:

ok 

Test #9:

score: 10
Accepted
time: 2ms
memory: 5972kb

input:

100000 14195 67017 1
23788 47378
57548 95872
97584 25942
19288 20314
42260 30765
82001 68266
13774 72423
74387 24887
97 22922
15715 60006
90877 24174
89741 84096
73666 89510
16870 8055
39058 61116
15682 37838
84083 621
97991 8584
31526 9971
46740 96764
77084 70018
24790 67667
59099 77893
24595 18088...

output:

1 14195 1 1
57259 
1 

input:

1 14195 1 1
57259 
1 

output:

57259

result:

ok 

Test #10:

score: 10
Accepted
time: 0ms
memory: 5932kb

input:

100000 15020 75552 1
70212 19873
39566 51824
72068 30734
50469 52341
45274 22005
90199 3889
1305 93887
96152 44487
15814 30459
52217 65619
29437 28937
28822 60432
27605 9636
524 23527
32956 39952
54216 21069
89870 31269
60600 27898
5414 73324
63840 15129
68618 55508
43871 27794
45462 2089
22374 1384...

output:

1 15020 1 2
40787 12325 
1 1 

input:

1 15020 1 2
40787 12325 
1 1 

output:

40787

result:

ok 

Test #11:

score: 10
Accepted
time: 6ms
memory: 5956kb

input:

5 2 1 1
2 5
3 4
3 1
5 4

output:

1 2 2 1
5 
2 

input:

1 2 2 1
5 
2 

output:

5

result:

ok 

Test #12:

score: 10
Accepted
time: 6ms
memory: 6060kb

input:

100000 58067 15674 1
45725 64183
5112 87153
28531 75803
48435 53630
61953 75534
79055 50510
20726 41197
91397 92746
20005 71460
98204 69227
83560 88464
17860 67373
72068 35569
97241 18507
34920 71359
48876 67590
39953 65012
84674 8583
98702 53186
19391 62209
57431 16010
60098 46021
60100 18974
97335...

output:

1 58067 1 2
89366 28752 
1 1 

input:

1 58067 1 2
89366 28752 
1 1 

output:

89366

result:

ok 

Test #13:

score: 10
Accepted
time: 8ms
memory: 6040kb

input:

100000 33281 11995 1
58672 48908
38754 14558
64582 60186
43413 61411
77625 73219
45168 68139
3177 6625
17478 56482
55459 13182
90092 28171
10030 53095
48280 36296
74392 91035
36886 95781
14685 9181
10482 68116
18181 62605
3072 47176
57688 75503
92342 44915
71384 17845
48150 80905
95302 13169
72420 7...

output:

1 33281 2 2
30431 93535 
1 1 

input:

1 33281 2 2
30431 93535 
1 1 

output:

30431

result:

ok 

Test #14:

score: 10
Accepted
time: 0ms
memory: 5968kb

input:

100000 23253 50284 1
33036 8532
16987 23157
24725 11750
82213 25644
19245 26175
33859 72475
84407 19947
54564 86881
9302 71494
54009 18493
13106 61118
57915 16567
43573 81856
69334 73709
92627 10167
45965 79107
39970 26375
29530 62766
31976 46163
79866 68397
18112 264
40637 12599
62736 21658
60811 2...

output:

1 23253 2 1
72220 
2 

input:

1 23253 2 1
72220 
2 

output:

72220

result:

ok 

Test #15:

score: 10
Accepted
time: 8ms
memory: 5980kb

input:

5 2 1 1
2 5
3 4
3 1
5 4

output:

1 2 2 1
5 
2 

input:

1 2 2 1
5 
2 

output:

5

result:

ok 

Test #16:

score: 10
Accepted
time: 6ms
memory: 5916kb

input:

100000 36431 60397 1
17885 95203
62729 35705
17294 50767
52699 82966
52217 24958
82268 43809
51951 88691
3904 35519
47307 51267
69107 53308
96124 58039
480 16881
55918 23129
14004 75060
6440 82509
7484 36128
79431 30923
73398 4082
95871 70336
65848 45640
49823 95127
76767 60115
55027 31892
19212 101...

output:

1 36431 1 5
24830 16000 85236 56668 9570 
1 1 2 1 1 

input:

1 36431 1 5
24830 16000 85236 56668 9570 
1 1 2 1 1 

output:

56668

result:

ok 

Test #17:

score: 10
Accepted
time: 6ms
memory: 5964kb

input:

100000 26991 25105 1
58880 63047
77935 8208
42959 23874
5121 162
30393 86480
78919 38651
15722 8497
6062 2695
11535 61738
14477 16623
30718 50568
71363 57805
79766 92541
10360 58480
9400 89934
85167 59557
24898 24876
20432 3759
53940 92777
48098 72434
90917 40502
21115 66931
80982 1561
27599 41918
6...

output:

1 26991 1 7
983 90216 7275 87818 17497 31675 83454 
1 2 1 1 1 2 2 

input:

1 26991 1 7
983 90216 7275 87818 17497 31675 83454 
1 2 1 1 1 2 2 

output:

87818

result:

ok 

Test #18:

score: 10
Accepted
time: 6ms
memory: 5940kb

input:

100000 55178 17512 1
56702 62074
68613 42359
56090 39239
57168 29611
272 92025
97759 40414
36943 99724
68466 21366
92995 53699
94219 47642
38376 45625
88060 92007
49559 67247
51449 35521
19174 9476
29935 7655
31613 82776
98618 18916
53659 38484
64359 38434
58797 62692
31652 86882
98669 35675
34567 4...

output:

1 55178 1 4
18334 73508 552 39167 
1 1 1 1 

input:

1 55178 1 4
18334 73508 552 39167 
1 1 1 1 

output:

73508

result:

ok 

Test #19:

score: 10
Accepted
time: 6ms
memory: 6040kb

input:

2 2 2 1
2 1

output:

1 2 1 1
1 
1 

input:

1 2 1 1
1 
1 

output:

2

result:

ok 

Test #20:

score: 10
Accepted
time: 0ms
memory: 5936kb

input:

2 1 1 1
2 1

output:

1 1 1 1
2 
2 

input:

1 1 1 1
2 
2 

output:

1

result:

ok 

Test #21:

score: 10
Accepted
time: 6ms
memory: 5964kb

input:

3 1 1 1
3 1
1 2

output:

1 1 1 2
3 2 
2 2 

input:

1 1 1 2
3 2 
2 2 

output:

1

result:

ok 

Test #22:

score: 10
Accepted
time: 6ms
memory: 5948kb

input:

3 1 3 1
2 3
1 2

output:

1 1 1 1
2 
1 

input:

1 1 1 1
2 
1 

output:

2

result:

ok 

Test #23:

score: 10
Accepted
time: 6ms
memory: 5976kb

input:

3 3 3 1
3 1
1 2

output:

1 3 1 1
1 
1 

input:

1 3 1 1
1 
1 

output:

3

result:

ok 

Test #24:

score: 10
Accepted
time: 6ms
memory: 5972kb

input:

3 1 3 1
1 2
3 2

output:

1 1 1 1
2 
1 

input:

1 1 1 1
2 
1 

output:

2

result:

ok 

Test #25:

score: 10
Accepted
time: 6ms
memory: 6060kb

input:

3 1 1 1
3 2
3 1

output:

1 1 1 1
3 
2 

input:

1 1 1 1
3 
2 

output:

1

result:

ok 

Subtask #2:

score: 15
Accepted

Test #26:

score: 15
Accepted
time: 38ms
memory: 7500kb

input:

100000 57165 10261 2
57165 48992
57165 19387
71033 57165
13350 57165
52013 57165
39911 57165
31569 57165
57165 57655
47865 57165
57165 61895
79639 57165
35978 57165
47454 57165
76859 57165
57165 45447
31140 57165
57165 67169
57165 95791
57165 60405
57165 80905
57165 55354
57165 95642
8667 57165
8827...

output:

2 57165 2 99999
48992 19387 71033 13350 52013 39911 31569 57655 47865 61895 79639 35978 47454 76859 45447 31140 67169 95791 60405 80905 55354 95642 8667 88274 721 61541 31467 62158 93646 5791 37673 90967 70822 50373 6922 9211 12493 55791 99612 86337 52418 27225 13284 54010 57405 99213 36389 5528 532...

input:

2 57165 2 99999
48992 19387 71033 13350 52013 39911 31569 57655 47865 61895 79639 35978 47454 76859 45447 31140 67169 95791 60405 80905 55354 95642 8667 88274 721 61541 31467 62158 93646 5791 37673 90967 70822 50373 6922 9211 12493 55791 99612 86337 52418 27225 13284 54010 57405 99213 36389 5528 532...

output:

10261

result:

ok 

Test #27:

score: 15
Accepted
time: 2ms
memory: 5972kb

input:

100000 20690 20690 2
97025 11592
8829 11592
11592 95625
11592 30832
11592 71951
11592 59839
11592 58624
65454 11592
46862 11592
86426 11592
11592 2542
11592 43812
59361 11592
11592 89769
84488 11592
11592 97510
77985 11592
11592 74093
20808 11592
22285 11592
11592 78659
11592 69395
51936 11592
10374...

output:

2 20690 1 1
11592 
1 

input:

2 20690 1 1
11592 
1 

output:

20690

result:

ok 

Test #28:

score: 15
Accepted
time: 2ms
memory: 6064kb

input:

100000 65054 52134 2
52134 74093
74895 52134
19206 52134
4235 52134
52134 74265
52134 96316
52134 22349
52134 81235
24872 52134
52134 18500
65129 52134
4289 52134
52134 41502
52134 62507
52134 58062
52134 9319
52134 9898
52134 98743
52134 73792
62834 52134
71095 52134
52134 50084
16065 52134
68492 5...

output:

2 65054 2 1
52134 
1 

input:

2 65054 2 1
52134 
1 

output:

52134

result:

ok 

Test #29:

score: 15
Accepted
time: 44ms
memory: 7604kb

input:

100000 77363 77363 2
1124 77363
77363 76872
77363 55161
82007 77363
68938 77363
51460 77363
77363 89625
77363 19141
77363 93908
77363 60862
84152 77363
77363 14422
77363 63469
77363 60128
77363 23779
56985 77363
77363 44495
77363 70405
33650 77363
48283 77363
57092 77363
37217 77363
53815 77363
7921...

output:

2 77363 1 99999
1124 76872 55161 82007 68938 51460 89625 19141 93908 60862 84152 14422 63469 60128 23779 56985 44495 70405 33650 48283 57092 37217 53815 79212 18151 21576 9156 40524 58866 61012 13634 47074 71660 61247 9905 35741 62260 39549 6514 48989 68201 6118 63298 59900 55307 44090 11614 32131 3...

input:

2 77363 1 99999
1124 76872 55161 82007 68938 51460 89625 19141 93908 60862 84152 14422 63469 60128 23779 56985 44495 70405 33650 48283 57092 37217 53815 79212 18151 21576 9156 40524 58866 61012 13634 47074 71660 61247 9905 35741 62260 39549 6514 48989 68201 6118 63298 59900 55307 44090 11614 32131 3...

output:

77363

result:

ok 

Test #30:

score: 15
Accepted
time: 2ms
memory: 5972kb

input:

5 3 2 2
2 1
5 1
5 4
2 3

output:

2 3 2 1
2 
1 

input:

2 3 2 1
2 
1 

output:

2

result:

ok 

Test #31:

score: 15
Accepted
time: 4ms
memory: 5960kb

input:

5 1 1 2
1 4
3 4
2 5
5 3

output:

2 1 1 1
4 
2 

input:

2 1 1 1
4 
2 

output:

1

result:

ok 

Test #32:

score: 15
Accepted
time: 2ms
memory: 5940kb

input:

5 5 5 2
1 4
3 1
5 2
5 3

output:

2 5 1 2
2 3 
1 1 

input:

2 5 1 2
2 3 
1 1 

output:

5

result:

ok 

Test #33:

score: 15
Accepted
time: 0ms
memory: 5984kb

input:

5 1 3 2
2 1
5 2
3 1
5 4

output:

2 1 1 2
2 3 
2 1 

input:

2 1 1 2
2 3 
2 1 

output:

3

result:

ok 

Test #34:

score: 15
Accepted
time: 6ms
memory: 5900kb

input:

5 1 5 2
2 5
4 3
5 4
3 1

output:

2 1 1 1
3 
1 

input:

2 1 1 1
3 
1 

output:

3

result:

ok 

Test #35:

score: 15
Accepted
time: 4ms
memory: 5936kb

input:

5 4 3 2
5 4
1 3
5 1
2 4

output:

2 4 2 2
5 2 
2 2 

input:

2 4 2 2
5 2 
2 2 

output:

5

result:

ok 

Test #36:

score: 15
Accepted
time: 6ms
memory: 5916kb

input:

100000 23979 85431 2
8021 56912
10503 76689
26288 92632
41590 89656
71614 4680
7052 49719
48777 44360
80643 3019
65567 53937
80417 64878
78820 29084
73618 24522
960 99774
95415 28446
14225 66907
47234 73704
69540 62019
30668 80360
60924 72272
94562 40783
19263 5431
35087 44496
29324 1281
67978 46994...

output:

2 23979 1 1
18244 
2 

input:

2 23979 1 1
18244 
2 

output:

18244

result:

ok 

Test #37:

score: 15
Accepted
time: 6ms
memory: 5896kb

input:

100000 36733 60881 2
80147 86156
11060 43885
84196 46747
45664 69729
74702 74185
79268 43010
71671 83489
87442 24603
20842 5103
24802 66423
42617 63554
33374 87119
9497 70888
88187 54274
48989 30887
36322 85447
7844 88469
16844 30626
6941 40029
29312 12959
14222 51508
87906 2694
41789 24242
32143 91...

output:

2 36733 2 2
91096 34972 
2 2 

input:

2 36733 2 2
91096 34972 
2 2 

output:

91096

result:

ok 

Test #38:

score: 15
Accepted
time: 0ms
memory: 5948kb

input:

100000 21792 41596 2
57591 85046
79384 35600
56379 34895
30404 45347
42934 4689
89254 66623
17070 40703
17167 14829
44625 61964
14889 5744
90305 20067
44701 41016
89462 44682
9527 29698
5391 36085
92431 20049
73079 61362
6013 68598
40983 43057
20230 55766
47032 4811
90941 74757
17767 73835
35944 453...

output:

2 21792 2 1
23369 
2 

input:

2 21792 2 1
23369 
2 

output:

23369

result:

ok 

Test #39:

score: 15
Accepted
time: 6ms
memory: 5916kb

input:

100000 64043 14342 2
85792 63229
95339 30162
25490 40989
47150 73365
6714 73468
26342 35008
10055 18738
45745 62797
19975 65166
77799 67471
30653 96512
79035 74183
26358 11632
82402 78556
66140 30359
24658 70730
62076 23875
8677 79098
57019 15823
52575 63548
81858 87224
56859 4937
58780 25703
33335 ...

output:

2 64043 1 2
68157 85647 
2 1 

input:

2 64043 1 2
68157 85647 
2 1 

output:

85647

result:

ok 

Test #40:

score: 15
Accepted
time: 6ms
memory: 5856kb

input:

100000 75553 39217 2
11676 82599
10716 10773
27906 95464
2744 30185
62413 98466
41025 41487
42277 79707
60525 84299
9085 14108
19427 12181
32546 21837
76311 96550
59576 36407
15781 16981
78641 11880
37063 66249
51153 32078
13718 38586
68036 97478
59698 44246
58377 55325
17917 29044
72063 79955
61158...

output:

2 75553 2 1
87033 
2 

input:

2 75553 2 1
87033 
2 

output:

87033

result:

ok 

Test #41:

score: 15
Accepted
time: 6ms
memory: 5908kb

input:

100000 21917 59250 2
13148 63090
12649 50271
3310 86136
20232 38587
44316 6107
46029 56537
4615 41678
70126 41892
31662 90178
34847 86090
43955 68556
54719 73987
87604 18071
3634 11565
92296 55240
57131 17570
89995 95646
42613 24657
94268 13510
99171 60222
99920 63245
66092 66115
63629 65740
2694 52...

output:

2 21917 2 2
43084 76779 
2 1 

input:

2 21917 2 2
43084 76779 
2 1 

output:

43084

result:

ok 

Test #42:

score: 15
Accepted
time: 8ms
memory: 5972kb

input:

100000 10599 64793 2
68263 64737
92774 70343
61521 55518
31393 41312
67062 38539
27583 7834
38108 68148
28467 21316
51609 6806
96835 55941
63136 63774
73593 28975
91965 70437
60187 92076
12545 67161
24818 84837
31796 2012
78675 4189
41557 5875
82947 65487
672 3006
64244 60913
11777 61744
28507 3176
...

output:

2 10599 2 4
40969 38121 55244 65315 
2 1 1 1 

input:

2 10599 2 4
40969 38121 55244 65315 
2 1 1 1 

output:

40969

result:

ok 

Test #43:

score: 15
Accepted
time: 6ms
memory: 5968kb

input:

100000 36428 90052 2
3635 46478
76825 1950
71310 3150
91655 59406
53063 3113
41419 28809
24424 55601
93522 52928
57446 35409
29244 51473
24470 47107
74040 70180
87398 98190
55205 67625
75879 73400
58664 43024
3241 56042
13644 63181
78417 15719
76619 14788
65584 29933
7844 2021
21036 3787
71465 58842...

output:

2 36428 2 2
62766 58860 
1 2 

input:

2 36428 2 2
62766 58860 
1 2 

output:

58860

result:

ok 

Test #44:

score: 15
Accepted
time: 4ms
memory: 5964kb

input:

100000 93814 13980 2
12879 95970
88657 43515
35152 35369
54031 66011
83539 14492
51534 69335
24994 75741
66405 81259
48790 2777
13626 67544
72836 7107
27112 14714
58045 91668
97716 76443
34048 36880
48347 73335
46773 10460
58962 12863
76197 98841
87073 82940
29007 97806
76323 26628
21738 15794
82484...

output:

2 93814 1 6
90841 33901 91307 90206 73677 35168 
1 1 1 1 2 1 

input:

2 93814 1 6
90841 33901 91307 90206 73677 35168 
1 1 1 1 2 1 

output:

73677

result:

ok 

Test #45:

score: 15
Accepted
time: 6ms
memory: 5960kb

input:

100000 89302 22103 2
13951 37836
89725 17201
99662 93122
98984 79006
97838 61737
8622 66857
42301 78812
31431 90998
1099 83426
81995 3812
16664 64387
98474 23209
98974 69592
54292 26495
42272 2981
93307 21292
61871 88562
9015 60574
14507 2176
71767 45973
5750 7623
36489 23847
6517 55616
35684 56849
...

output:

2 89302 2 2
60102 45141 
1 2 

input:

2 89302 2 2
60102 45141 
1 2 

output:

60102

result:

ok 

Test #46:

score: 15
Accepted
time: 6ms
memory: 5892kb

input:

2 2 2 2
2 1

output:

2 2 1 1
1 
1 

input:

2 2 1 1
1 
1 

output:

2

result:

ok 

Test #47:

score: 15
Accepted
time: 0ms
memory: 5932kb

input:

2 2 1 2
1 2

output:

2 2 2 1
1 
1 

input:

2 2 2 1
1 
1 

output:

1

result:

ok 

Test #48:

score: 15
Accepted
time: 0ms
memory: 5964kb

input:

3 3 3 2
1 3
3 2

output:

2 3 1 2
1 2 
1 1 

input:

2 3 1 2
1 2 
1 1 

output:

3

result:

ok 

Test #49:

score: 15
Accepted
time: 2ms
memory: 5968kb

input:

3 2 3 2
1 2
2 3

output:

2 2 1 2
1 3 
1 1 

input:

2 2 1 2
1 3 
1 1 

output:

3

result:

ok 

Test #50:

score: 15
Accepted
time: 10ms
memory: 6060kb

input:

3 2 2 2
1 3
3 2

output:

2 2 1 1
3 
2 

input:

2 2 1 1
3 
2 

output:

2

result:

ok 

Test #51:

score: 15
Accepted
time: 8ms
memory: 6052kb

input:

3 1 3 2
2 3
3 1

output:

2 1 1 1
3 
1 

input:

2 1 1 1
3 
1 

output:

3

result:

ok 

Test #52:

score: 15
Accepted
time: 8ms
memory: 5968kb

input:

3 3 1 2
2 3
1 2

output:

2 3 1 1
2 
2 

input:

2 3 1 1
2 
2 

output:

2

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Test #53:

score: 0
Wrong Answer
time: 6ms
memory: 5932kb

input:

5 4 1 3
2 4
3 4
5 4
4 1

output:

3 4 2 4
2 3 5 1 
2 2 1 1 

input:

3 4 2 4
2 3 5 1 
2 2 1 1 

output:

1

result:

wrong answer the value of V is bigger than 1

Subtask #4:

score: 0
Wrong Answer

Test #85:

score: 0
Wrong Answer
time: 6ms
memory: 5964kb

input:

5 5 4 4
5 1
5 4
5 3
2 5

output:

4 5 2 4
1 4 3 2 
2 1 2 2 

input:

4 5 2 4
1 4 3 2 
2 1 2 2 

output:

4

result:

wrong answer the value of V is bigger than 1