QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#755306#328. Cycle sortax_by_c100 ✓95ms38360kbC++172.5kb2024-11-16 17:00:062024-11-16 17:00:08

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 2ms
memory: 9724kb

input:

1 0
2

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #2:

score: 5
Accepted
time: 2ms
memory: 9708kb

input:

1 2
1

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #3:

score: 5
Accepted
time: 0ms
memory: 11980kb

input:

2 1
2 1

output:

-1

result:

ok OK, no solution

Test #4:

score: 5
Accepted
time: 1ms
memory: 9808kb

input:

2 2
2 1

output:

1
2
2 1 

result:

ok OK, answer exists, pans = jans = 1

Test #5:

score: 5
Accepted
time: 1ms
memory: 11832kb

input:

2 0
2 1

output:

-1

result:

ok OK, no solution

Test #6:

score: 5
Accepted
time: 1ms
memory: 11740kb

input:

2 0
1 1

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #7:

score: 5
Accepted
time: 0ms
memory: 11748kb

input:

2 1
1 1

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #8:

score: 5
Accepted
time: 2ms
memory: 10016kb

input:

2 2
2 2

output:

0

result:

ok OK, answer exists, pans = jans = 0

Subtask #2:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #9:

score: 5
Accepted
time: 1ms
memory: 9940kb

input:

5 0
1000000000 1000000000 1000000000 1000000000 1000000000

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #10:

score: 5
Accepted
time: 1ms
memory: 9716kb

input:

1 0
258769137

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #11:

score: 5
Accepted
time: 1ms
memory: 10004kb

input:

5 0
884430748 884430748 708433020 708433020 708433020

output:

-1

result:

ok OK, no solution

Test #12:

score: 5
Accepted
time: 2ms
memory: 11760kb

input:

5 4
335381650 691981363 691981363 335381650 335381650

output:

1
4
4 2 5 3 

result:

ok OK, answer exists, pans = jans = 1

Test #13:

score: 5
Accepted
time: 1ms
memory: 9600kb

input:

5 2
65390026 770505072 65390026 65390026 65390026

output:

1
2
5 2 

result:

ok OK, answer exists, pans = jans = 1

Test #14:

score: 5
Accepted
time: 1ms
memory: 9968kb

input:

5 200000
682659092 302185582 518778252 29821187 14969298

output:

2
3
3 4 2 
2
5 1 

result:

ok OK, answer exists, pans = jans = 2

Test #15:

score: 5
Accepted
time: 1ms
memory: 11976kb

input:

5 4
167616600 574805150 651016425 150949603 379708534

output:

-1

result:

ok OK, no solution

Test #16:

score: 5
Accepted
time: 2ms
memory: 12024kb

input:

5 5
815605413 4894095 624809427 264202135 152952491

output:

2
2
4 3 
3
5 2 1 

result:

ok OK, answer exists, pans = jans = 2

Test #17:

score: 5
Accepted
time: 1ms
memory: 12008kb

input:

5 4
201429826 845081337 219611799 598937628 680006294

output:

1
4
5 4 3 2 

result:

ok OK, answer exists, pans = jans = 1

Test #18:

score: 5
Accepted
time: 1ms
memory: 11800kb

input:

5 5
472778319 561757623 989296065 99763286 352037329

output:

1
5
3 5 2 4 1 

result:

ok OK, answer exists, pans = jans = 1

Test #19:

score: 5
Accepted
time: 0ms
memory: 11740kb

input:

5 6
971458729 608568364 891718769 464295315 98863653

output:

2
3
3 4 2 
2
5 1 

result:

ok OK, answer exists, pans = jans = 2

Test #20:

score: 5
Accepted
time: 2ms
memory: 11784kb

input:

5 4
579487081 564229995 665920667 665920667 644707366

output:

2
2
2 1 
2
5 3 

result:

ok OK, answer exists, pans = jans = 2

Test #21:

score: 5
Accepted
time: 2ms
memory: 11848kb

input:

5 4
81224924 319704343 319704343 210445208 128525140

output:

1
4
4 3 5 2 

result:

ok OK, answer exists, pans = jans = 1

Test #22:

score: 5
Accepted
time: 1ms
memory: 11812kb

input:

5 5
641494999 641494999 228574099 535883079 535883079

output:

1
5
4 2 5 3 1 

result:

ok OK, answer exists, pans = jans = 1

Test #23:

score: 5
Accepted
time: 1ms
memory: 9952kb

input:

5 4
812067558 674124159 106041640 106041640 674124159

output:

-1

result:

ok OK, no solution

Subtask #3:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #24:

score: 5
Accepted
time: 3ms
memory: 12120kb

input:

200000 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #25:

score: 5
Accepted
time: 9ms
memory: 12720kb

input:

200000 123456
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #26:

score: 5
Accepted
time: 20ms
memory: 33624kb

input:

200000 200000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

1
200000
100001 1 100002 2 100003 3 100004 4 100005 5 100006 6 100007 7 100008 8 100009 9 100010 10 100011 11 100012 12 100013 13 100014 14 100015 15 100016 16 100017 17 100018 18 100019 19 100020 20 100021 21 100022 22 100023 23 100024 24 100025 25 100026 26 100027 27 100028 28 100029 29 100030 30 ...

result:

ok OK, answer exists, pans = jans = 1

Test #27:

score: 5
Accepted
time: 11ms
memory: 14096kb

input:

200000 199999
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

-1

result:

ok OK, no solution

Test #28:

score: 5
Accepted
time: 18ms
memory: 22604kb

input:

200000 100000
2 2 1 2 2 1 2 2 1 1 2 1 1 1 2 2 1 2 1 1 2 2 1 2 1 1 2 1 1 1 2 1 1 1 1 1 1 1 2 2 2 1 2 1 2 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 2 2 2 1 2 1 2 1 2 1 2 2 1 2 1 1 2 1 1 1 2 1 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 1 1 2 1 2 2 1 1 1 1 1 1 1 2 1 1 2 1 1 2 2 1 1 2 2 2 1 1 1 1 2 2 1 2 1 2 ...

output:

1
100000
130762 1 130764 2 130766 4 130767 5 130769 7 130770 8 130771 11 130773 15 130774 16 130776 18 130777 21 130779 22 130780 24 130781 27 130783 31 130784 39 130785 40 130786 41 130788 43 130789 45 130792 46 130793 53 130794 62 130796 71 130797 72 130799 73 130800 75 130801 77 130802 79 130805 ...

result:

ok OK, answer exists, pans = jans = 1

Test #29:

score: 5
Accepted
time: 9ms
memory: 12784kb

input:

200000 99998
2 1 2 1 2 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 2 1 1 1 2 2 1 1 2 2 1 1 1 2 1 1 1 2 1 2 1 1 1 1 1 2 1 2 1 1 2 2 2 1 1 2 2 2 1 2 2 1 2 2 1 1 1 1 1 2 2 2 1 2 1 1 2 2 2 1 2 2 1 2 1 2 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 1 1 1 2 2 1...

output:

-1

result:

ok OK, no solution

Test #30:

score: 5
Accepted
time: 7ms
memory: 11364kb

input:

123981 200000
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 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 2 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 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
6
300 69 70361 151 104722 196 

result:

ok OK, answer exists, pans = jans = 1

Test #31:

score: 5
Accepted
time: 5ms
memory: 14084kb

input:

200000 0
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

-1

result:

ok OK, no solution

Test #32:

score: 5
Accepted
time: 16ms
memory: 16816kb

input:

200000 43842
1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1...

output:

1
43842
160001 5 160004 7 160007 22 160009 24 160012 27 160014 39 160016 41 160018 48 160019 55 160022 58 160024 60 160026 72 160027 78 160029 84 160030 91 160033 103 160035 114 160037 120 160039 126 160041 138 160044 151 160045 154 160047 165 160048 167 160050 170 160051 191 160053 195 160055 198 1...

result:

ok OK, answer exists, pans = jans = 1

Test #33:

score: 5
Accepted
time: 12ms
memory: 31628kb

input:

200000 180200
2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 ...

output:

1
180200
100001 1 100002 2 100004 3 100005 4 100006 5 100007 6 100008 7 100009 8 100010 10 100011 11 100012 12 100013 13 100014 14 100015 15 100016 17 100018 18 100019 19 100020 20 100021 21 100022 22 100024 23 100025 24 100026 25 100027 26 100028 27 100029 28 100030 30 100031 31 100032 32 100033 33...

result:

ok OK, answer exists, pans = jans = 1

Test #34:

score: 5
Accepted
time: 7ms
memory: 14208kb

input:

200000 181997
2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

-1

result:

ok OK, no solution

Test #35:

score: 5
Accepted
time: 17ms
memory: 20644kb

input:

200000 200000
2 1 2 2 1 1 2 2 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 2 2 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 2 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 1 2 1 1 2 1 2 1 2 2 1 2 2 2 2 1 1 2 1 1 2 1 2 1 1 2 2 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 2 ...

output:

1
80000
120002 1 120010 3 120012 4 120013 7 120015 8 120016 14 120018 15 120019 24 120021 25 120023 27 120025 30 120026 43 120027 45 120030 47 120032 53 120035 59 120036 61 120037 62 120039 65 120040 77 120042 80 120044 86 120046 88 120047 91 120050 93 120053 95 120054 96 120055 98 120059 99 120060 ...

result:

ok OK, answer exists, pans = jans = 1

Test #36:

score: 5
Accepted
time: 8ms
memory: 13912kb

input:

99999 20000
2 1 2 1 2 1 1 2 2 1 1 2 2 1 2 1 2 1 2 1 1 1 1 2 1 1 2 2 2 1 2 1 2 1 2 2 1 1 2 2 2 1 2 1 2 2 1 1 2 1 1 2 2 2 1 2 2 1 1 1 1 1 2 1 1 2 1 1 2 1 2 2 1 2 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 1 1 1 1 1 2 1 2 2 1 1 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 2 1 2 1 2 1 1 2 1 1 1 1 1 1 1 2 1 1 2 2 2 2 1 1 1 ...

output:

1
20000
23782 1 23784 3 23810 5 23813 8 23820 9 23822 12 23833 13 23846 15 23863 17 23865 19 23888 24 23890 27 23892 28 23893 29 23902 31 23916 33 23925 35 23947 36 23949 39 23963 40 23968 41 23970 43 23976 45 23978 46 23995 49 23998 52 24005 53 24009 54 24018 56 24022 57 24025 63 24027 66 24045 69 ...

result:

ok OK, answer exists, pans = jans = 1

Test #37:

score: 5
Accepted
time: 7ms
memory: 13908kb

input:

200000 155553
2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 1 2 2 2 2 2 2 ...

output:

-1

result:

ok OK, no solution

Test #38:

score: 5
Accepted
time: 15ms
memory: 31440kb

input:

200000 177776
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

1
177776
95001 1 95002 2 95003 3 95005 4 95006 5 95007 6 95009 7 95010 8 95011 9 95012 10 95014 11 95015 12 95016 13 95017 14 95019 15 95020 16 95021 17 95022 18 95023 19 95024 21 95026 22 95027 23 95028 24 95029 25 95030 26 95031 27 95032 28 95033 29 95034 30 95036 31 95037 32 95038 33 95039 34 950...

result:

ok OK, answer exists, pans = jans = 1

Subtask #4:

score: 10
Accepted

Test #39:

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

input:

1234 2468
1067 499 654 607 184 787 1019 515 767 1063 984 1195 810 724 933 98 33 971 783 365 1198 1154 1145 962 1189 123 592 999 1202 646 28 964 144 993 15 79 101 420 898 950 159 469 96 247 780 418 400 62 126 314 789 854 109 951 824 504 634 683 231 924 392 915 408 434 1066 315 751 230 18 590 356 1079...

output:

1
1207
854 209 856 357 821 1012 791 1058 1027 419 116 142 308 1 1067 756 377 471 545 1129 119 433 580 947 164 776 632 923 413 362 258 608 926 157 651 284 1121 1190 99 1043 352 321 95 1082 353 1033 669 443 843 161 1165 83 24 962 192 864 58 683 694 685 395 819 466 1102 542 287 966 517 107 927 48 62 91...

result:

ok OK, answer exists, pans = jans = 1

Test #40:

score: 10
Accepted
time: 39ms
memory: 24600kb

input:

100000 200000
45504 47804 45264 94863 54783 76516 98220 95370 74297 83009 82657 45299 5577 39293 65445 20416 85814 95227 68721 21345 78007 51041 66060 68578 82424 96542 82236 22006 15590 29466 34835 98558 91167 12227 57072 9688 87267 27002 35835 49704 11910 98195 78679 84132 49971 12466 64718 27518 ...

output:

1
100000
9850 47054 22965 76731 48687 86073 53804 39145 13299 42399 89408 53723 32661 81743 95865 46504 10590 26983 18283 30375 52150 86003 60907 6664 50228 58224 4618 42264 56264 39297 58590 84163 86629 3988 20603 23986 12435 36421 46181 29010 38988 28562 921 36970 43610 5841 41738 4265 70653 61904...

result:

ok OK, answer exists, pans = jans = 1

Test #41:

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

input:

79239 158478
24252 2 34156 4 5 30636 7 8 63508 19101 52923 12 12791 14 15 16 17 62863 19 20 32392 77158 41183 24 25 74233 27 28 29 17731 16787 2766 42993 33661 35 73932 27374 38 3770 21805 21186 42 43 44 45 63950 47 48 49 50 51 35896 53 54 6830 75850 57 60844 74583 10638 61 62 53921 64 65 66 67 7869...

output:

1
43684
8036 38567 11640 20090 48161 1806 74 43415 59957 14936 49541 42217 75015 58024 36383 43224 33309 71294 55369 32352 66822 41171 63503 11026 48152 9959 57643 46696 38416 41849 70086 12925 36610 16834 33636 9446 32387 23112 32260 17330 16901 3500 18050 14394 78857 5858 42787 51669 75710 43190 8...

result:

ok OK, answer exists, pans = jans = 1

Test #42:

score: 10
Accepted
time: 7ms
memory: 11476kb

input:

100000 200000
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:

0

result:

ok OK, answer exists, pans = jans = 0

Test #43:

score: 10
Accepted
time: 38ms
memory: 24272kb

input:

100000 200000
89689 95563 64383 51142 36672 54755 54504 10175 78679 72623 41528 40161 98875 48843 86704 46632 55183 16159 16539 1847 5327 70134 44771 70378 37978 19726 52108 81320 64745 15342 64307 40755 49124 32663 13823 30205 62714 9986 61279 82402 40182 25736 56592 97249 97848 36380 46202 83044 4...

output:

2
100
413 4166 5949 6803 8807 9986 12315 12745 13374 13675 13722 14194 15222 16763 17553 17819 18386 18844 19334 19979 20402 20508 21953 22027 22095 22548 22845 22993 23110 25041 25391 28071 30469 31770 32482 33687 35829 36751 38229 38266 38753 39363 39924 41179 41860 42203 42911 43786 45746 46631 4...

result:

ok OK, answer exists, pans = jans = 2

Test #44:

score: 10
Accepted
time: 39ms
memory: 24828kb

input:

99999 199998
62488 22847 3234 75894 62104 32803 94490 45879 14203 95120 8862 86642 47164 17002 170 80091 61433 88404 70269 77487 39577 82048 2664 34911 76639 70737 54291 64193 69732 63350 7749 31216 49153 30636 16291 20209 56818 77268 1286 90361 90544 74596 35211 74972 97954 14069 49427 50089 49437 ...

output:

2
23
6656 16028 22521 31579 32898 37282 37897 38434 42981 43924 44275 49196 51870 53680 64583 67961 70549 70882 72448 73288 82312 89519 99292 
99999
51870 73684 75175 75914 83249 58657 68051 88297 1696 33364 77270 36150 14012 40356 89634 71002 56180 12709 39181 54554 81291 51331 73785 88638 73874 32...

result:

ok OK, answer exists, pans = jans = 2

Test #45:

score: 10
Accepted
time: 44ms
memory: 20676kb

input:

100000 200000
10266 7482 24064 80041 38663 48813 76615 8024 29028 94063 85729 63988 7687 24244 75511 33300 79156 67841 85563 32314 79847 47152 18386 93892 81087 40108 63090 91463 30081 1534 63389 14048 62730 32536 26453 30995 76187 68373 33917 49221 88444 49 99073 5226 81063 19674 56234 98537 32931 ...

output:

2
54567
41974 19771 54503 8848 82129 42459 2003 34450 57529 19416 22297 74639 79596 96853 77504 47549 6268 15458 30110 83788 72528 67522 82440 63326 77778 59262 5923 23252 29683 7260 91958 85887 90407 68903 69880 78015 10809 73815 39665 39879 35255 35149 85676 76483 16670 12367 4903 43997 95798 3382...

result:

ok OK, answer exists, pans = jans = 2

Test #46:

score: 10
Accepted
time: 43ms
memory: 24172kb

input:

100000 200000
40445 91528 94778 36675 95569 93373 14763 65260 61358 87241 49140 76523 74568 13568 11850 74185 98615 475 10484 58033 45739 19986 76289 42276 14504 79705 49740 9877 1639 84842 40913 15597 17969 50218 14308 35281 18905 45122 65025 73388 6027 26651 52766 47425 86182 39346 7473 65855 8063...

output:

2
3
18904 23361 29314 
99445
51490 88496 92595 603 26220 24220 87637 93389 86329 20898 17053 88860 41942 3431 31547 82077 55995 93958 79863 29765 86741 46533 22578 74845 82110 95840 30745 17647 72441 72868 13046 43680 63478 18899 13120 45101 13868 15360 57600 52469 43330 22604 31561 28202 86771 6669...

result:

ok OK, answer exists, pans = jans = 2

Test #47:

score: 10
Accepted
time: 31ms
memory: 25152kb

input:

100000 200000
29067 19934 84099 17150 50281 30284 75645 53261 55387 79570 78428 20156 82073 94307 14525 1774 95981 77630 90349 6964 1671 53041 25162 4162 9025 41774 41262 64633 79971 60097 58264 65607 28281 41518 91012 87537 47229 60945 95451 53962 14927 78510 534 58087 44172 19264 186 49721 48256 2...

output:

2
50000
186 534 631 867 878 953 972 1026 1077 1081 1219 1293 1429 1445 1480 1671 1733 1760 1774 1851 1895 1916 1928 1945 2126 2187 2252 2355 2543 2559 2567 2592 2614 2618 2694 2704 2710 2741 2758 2803 2841 2885 2912 2976 2982 2988 3007 3025 3043 3069 3075 3085 3095 3118 3145 3150 3172 3282 3335 3387...

result:

ok OK, answer exists, pans = jans = 2

Test #48:

score: 10
Accepted
time: 35ms
memory: 24340kb

input:

100000 200000
49095 36827 85302 61355 24624 26024 59404 89006 49006 10306 80370 22901 38050 31399 38803 59741 53229 23389 39486 87519 62201 47274 91254 56358 79559 71072 76552 85923 76241 12158 96158 73424 59943 5358 5300 25806 13415 84631 29890 13031 84936 51401 46324 20165 96552 94002 3634 70273 8...

output:

2
23456
889 1025 1026 1028 1144 1265 1320 1404 1428 1828 1897 1916 2000 2041 2063 2137 2150 2165 2200 2281 2306 2318 2390 2405 2523 2539 2540 2585 2814 2838 2864 2875 2969 3011 3015 3088 3154 3310 3315 3351 3356 3396 3417 3421 3461 3469 3541 3582 3615 3634 3670 3673 3681 3717 3803 3828 3849 3868 387...

result:

ok OK, answer exists, pans = jans = 2

Test #49:

score: 10
Accepted
time: 39ms
memory: 25100kb

input:

100000 200000
41650 36821 23297 32390 10080 57556 22668 22841 65125 48949 71839 20309 97907 11968 86574 47220 44327 63294 82333 67484 87549 95374 91239 32944 14894 44015 35329 80374 95508 62972 15407 97273 44767 26083 71954 76328 87140 17383 38194 5720 27049 93804 63821 46813 8437 11117 16979 17969 ...

output:

2
10239
668 764 1070 1334 1385 1435 2116 2214 2283 2311 2841 3003 3066 3068 3070 3138 3172 3211 3243 3247 3283 3357 3456 3517 3577 3589 3650 3660 3919 3921 3944 4019 4135 4144 4179 4213 4285 4370 4381 4497 4580 4624 4652 4806 4845 4852 4878 5058 5065 5162 5200 5218 5286 5380 5394 5403 5424 5586 5597...

result:

ok OK, answer exists, pans = jans = 2

Test #50:

score: 10
Accepted
time: 35ms
memory: 25172kb

input:

100000 200000
30192 69146 22746 89542 92266 86631 67852 50511 87440 75856 12619 93967 50906 9202 3877 96526 72989 91357 23262 96213 91850 84114 77504 29360 20809 55415 96061 64303 58913 73666 64471 65701 49403 32493 88321 6431 60587 56001 5970 45610 72713 9030 77545 15943 91492 76086 48210 45158 836...

output:

2
531
2539 3086 4261 4854 5469 6091 6293 6717 7107 7194 7261 7594 9333 9827 9943 10221 10485 10580 11090 11261 11432 11830 12532 13694 14428 14492 15276 15851 15863 15947 16158 16229 16380 16777 16867 17114 17164 17244 17498 17523 17830 18310 18602 18809 18993 19255 19494 19683 19885 19905 20251 203...

result:

ok OK, answer exists, pans = jans = 2

Test #51:

score: 10
Accepted
time: 36ms
memory: 21420kb

input:

100000 200000
27471 38584 18082 4 83233 6 63533 88861 9 31649 31919 10375 17599 43081 8672 16 30654 45903 19 31954 10579 14433 22039 13908 1741 26 43017 25212 22417 30 47116 24956 16229 66306 85150 21611 61190 23411 39 48940 40448 15590 43 33476 9471 46 80468 36069 91465 61802 51 52 53 54 99060 56 1...

output:

2
76843
45694 63363 14788 77503 74383 40737 69595 35641 76747 94338 14332 87091 86369 60650 91199 35137 33283 66762 57244 16107 79189 16716 38571 3087 31346 39022 52610 90891 79262 38595 86073 69974 86642 35037 18785 20227 95682 74436 9444 45019 85081 58512 13274 61943 60072 65111 81670 49159 90795 ...

result:

ok OK, answer exists, pans = jans = 2

Test #52:

score: 10
Accepted
time: 35ms
memory: 24348kb

input:

100000 200000
86686 31504 62871 1129 58174 12126 83998 77175 82340 10557 78263 55088 63526 71664 7107 86659 56548 7035 91674 57204 45256 4829 58520 57846 78771 93594 73892 95020 45391 53546 24860 95840 12431 1397 72617 61658 71267 26450 57573 30293 11494 25591 57812 6561 50070 11886 62697 67344 7205...

output:

2
25000
304 306 656 957 961 1022 1110 1129 1231 1239 1284 1397 1479 1511 1591 1596 1623 1654 1751 1770 1809 1856 1908 1992 2016 2039 2111 2215 2265 2273 2275 2344 2371 2391 2397 2455 2477 2565 2573 2581 2637 2675 2702 2715 2761 2832 2841 2870 2900 2907 2978 2991 3005 3088 3089 3101 3115 3136 3167 31...

result:

ok OK, answer exists, pans = jans = 2

Test #53:

score: 10
Accepted
time: 39ms
memory: 24808kb

input:

100000 200000
35822 48325 92691 38539 9283 50834 52990 65545 63889 94252 79908 35428 41572 36935 20084 32100 7880 33345 1675 2393 11874 3961 47185 20080 57756 62808 72923 85698 48390 73294 69640 75616 40208 75270 64412 57472 47119 2773 15730 30108 29688 16358 27443 91768 61096 83728 17043 48316 1277...

output:

2
15000
381 593 776 798 917 1155 1560 1598 1802 1826 2122 2415 2437 2443 2451 2519 2614 2639 2646 2658 2680 2684 2822 2850 2893 2911 3002 3005 3053 3057 3069 3115 3132 3151 3181 3236 3295 3413 3439 3454 3500 3534 3551 3605 3610 3618 3623 3648 3696 3701 3711 3739 3741 3759 3792 3857 3929 3944 3953 41...

result:

ok OK, answer exists, pans = jans = 2

Subtask #5:

score: 10
Accepted

Test #54:

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

input:

1000 0
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 99 100 1...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #55:

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

input:

1000 990
478 218 672 192 577 465 378 574 3 829 632 535 641 822 210 598 541 890 986 256 561 45 567 7 21 539 341 300 555 572 499 223 30 76 519 888 818 291 39 63 671 838 524 827 280 122 898 592 294 327 488 840 657 233 793 792 221 527 940 548 361 705 701 266 839 653 370 564 112 716 172 628 298 588 724 1...

output:

3
87
593 41 671 50 327 109 328 264 802 402 356 926 810 318 578 723 87 250 409 85 204 837 408 549 349 777 187 438 301 444 931 37 818 245 153 970 620 16 598 565 387 83 992 664 626 715 817 891 29 555 38 291 833 911 687 665 82 877 683 319 796 426 850 635 347 734 857 407 747 938 544 963 807 603 215 350 6...

result:

ok OK, answer exists, pans = jans = 3

Test #56:

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

input:

1000 992
198 655 110 228 705 32 472 989 562 670 262 781 438 859 309 733 641 497 76 362 169 11 187 647 177 140 583 417 571 373 594 300 565 792 182 89 853 454 225 28 199 295 570 85 744 112 442 926 397 5 315 695 223 247 649 146 282 858 158 208 473 549 821 249 527 434 132 467 359 895 650 510 61 560 48 7...

output:

3
347
136 446 346 639 452 471 246 371 545 130 63 821 376 731 856 215 958 756 920 782 234 536 23 187 67 132 355 960 255 596 30 373 598 582 338 587 767 841 553 241 838 463 244 31 594 902 53 223 668 83 307 517 123 633 941 564 679 500 544 189 389 64 249 964 97 9 562 364 779 58 858 666 511 103 691 126 97...

result:

ok OK, answer exists, pans = jans = 3

Test #57:

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

input:

1000 200000
380 924 762 811 340 994 468 478 462 447 632 479 196 206 285 293 483 423 281 596 189 977 144 932 186 176 597 674 728 866 46 881 686 56 437 863 847 382 39 170 591 101 719 767 933 989 763 886 318 570 211 187 53 621 748 339 354 193 344 265 519 91 71 754 452 864 102 287 409 636 648 249 555 63...

output:

2
3
278 344 389 
990
344 424 520 89 140 880 744 213 639 660 146 694 578 939 894 579 634 310 280 874 324 727 911 528 68 287 603 35 437 142 235 48 886 319 199 22 977 712 709 535 730 201 456 695 129 173 150 739 814 789 500 669 323 385 182 17 483 303 262 19 281 697 475 38 382 300 152 668 851 357 230 757...

result:

ok OK, answer exists, pans = jans = 2

Test #58:

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

input:

1000 1010
328 243 762 995 445 449 336 827 105 237 185 685 942 975 256 82 135 534 77 403 303 688 565 448 453 444 671 667 214 714 130 86 518 304 233 131 437 136 937 676 584 609 193 930 462 144 200 92 333 41 261 458 650 889 1 886 490 741 564 860 665 711 29 728 267 493 903 777 278 481 314 524 948 381 23...

output:

2
972
188 900 323 178 588 365 720 422 467 510 112 867 607 26 444 621 715 210 642 383 814 872 732 434 785 926 570 198 366 928 662 60 860 472 250 771 36 131 263 213 931 306 516 603 709 216 954 690 387 81 410 979 526 593 992 989 169 658 165 15 256 792 910 680 423 80 644 219 784 305 359 491 324 25 453 3...

result:

ok OK, answer exists, pans = jans = 2

Test #59:

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

input:

1000 999
849 773 53 451 832 243 491 5 50 880 704 513 825 63 627 329 674 893 268 85 580 922 131 532 465 680 253 256 267 416 882 528 530 119 787 523 392 282 195 683 738 774 855 435 603 136 708 320 318 724 162 49 302 65 852 644 695 341 360 375 896 641 942 567 681 776 409 265 613 842 753 566 308 620 541...

output:

-1

result:

ok OK, no solution

Test #60:

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

input:

1000 899
849 30 612 427 515 90 446 700 482 894 706 955 72 341 979 325 876 744 19 909 89 573 23 773 668 493 428 724 87 86 682 852 468 359 35 420 967 279 957 577 144 555 567 990 371 976 793 795 49 873 674 197 805 915 925 56 987 607 344 490 61 775 63 64 551 492 311 652 907 280 738 766 889 764 511 322 7...

output:

-1

result:

ok OK, no solution

Test #61:

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

input:

1000 951
214 707 974 784 266 397 7 601 626 558 927 12 948 920 689 961 10 18 19 426 623 772 825 418 148 96 166 26 529 30 489 750 178 954 35 20 880 183 619 138 152 326 699 858 429 998 90 963 869 375 457 52 561 54 140 176 1 702 719 555 533 62 63 849 598 99 116 170 69 889 345 662 802 547 678 451 658 281...

output:

51
51
90 96 138 151 173 183 188 214 227 234 270 271 281 282 293 310 326 340 351 359 375 407 418 419 426 429 437 441 451 460 464 468 471 480 511 513 514 515 518 524 529 531 535 542 546 549 554 558 561 562 572 
568
429 676 171 132 65 598 729 690 130 713 888 965 907 207 37 880 268 882 647 114 36 20 426...

result:

ok OK, answer exists, pans = jans = 51

Test #62:

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

input:

1000 1000
469 836 645 201 533 235 605 717 739 454 743 609 51 604 847 885 990 638 490 892 592 359 472 161 158 240 121 724 159 390 476 387 746 980 47 866 487 537 424 62 862 975 689 336 733 326 35 197 554 900 13 948 515 417 405 438 243 287 211 940 498 40 742 683 997 929 70 239 867 67 188 339 191 352 93...

output:

500
2
47 35 
2
51 13 
2
62 40 
2
70 67 
2
121 27 
2
138 78 
2
148 122 
2
152 96 
2
158 25 
2
159 29 
2
161 24 
2
166 140 
2
167 82 
2
174 105 
2
188 71 
2
190 129 
2
191 73 
2
195 185 
2
197 48 
2
199 194 
2
201 4 
2
211 59 
2
215 81 
2
232 189 
2
235 6 
2
239 68 
2
240 26 
2
243 57 
2
250 145 
2
25...

result:

ok OK, answer exists, pans = jans = 500

Test #63:

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

input:

1000 1239
487 932 31 515 908 434 517 612 113 803 581 711 159 613 84 165 534 969 865 942 429 695 529 258 970 794 773 703 230 881 3 927 962 596 294 362 48 100 91 494 209 473 565 964 687 81 524 37 463 643 571 992 85 848 552 806 971 152 167 861 163 397 351 426 766 321 440 87 420 645 899 523 131 677 660 ...

output:

263
239
31 48 81 84 85 87 91 100 113 128 131 137 140 152 159 160 163 165 167 168 171 184 185 190 193 196 209 214 217 219 224 230 251 258 259 261 263 267 270 275 286 294 301 304 310 320 321 325 326 331 345 346 348 351 353 355 357 359 360 361 362 367 368 373 376 381 383 394 397 400 402 404 408 410 412...

result:

ok OK, answer exists, pans = jans = 263

Test #64:

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

input:

1000 890
67 538 816 774 110 606 195 8 9 10 474 918 479 351 525 233 256 88 953 841 364 986 217 855 520 808 458 849 182 79 413 32 306 691 720 495 283 739 51 132 883 42 587 799 45 566 245 860 593 511 58 852 145 633 811 755 612 485 655 128 187 450 63 850 493 72 756 68 451 527 127 725 73 784 299 27 857 2...

output:

39
13
79 165 217 231 240 245 268 293 314 371 394 409 451 
712
474 608 547 629 826 645 333 82 760 914 777 941 957 234 551 564 809 554 7 195 355 867 18 88 681 513 967 111 75 299 59 655 515 452 282 948 502 215 5 110 453 763 675 834 666 528 1 67 756 670 382 391 552 443 910 442 680 572 955 423 225 373 88...

result:

ok OK, answer exists, pans = jans = 39

Test #65:

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

input:

1000 968
793 673 970 151 243 965 585 872 185 704 664 305 70 729 865 463 315 306 829 985 884 955 572 921 174 161 785 546 46 540 204 318 875 472 75 90 246 226 982 578 582 917 926 766 22 74 747 561 409 422 297 233 288 111 914 195 254 734 617 929 334 846 779 452 424 933 322 416 867 490 923 137 475 819 6...

output:

-1

result:

ok OK, no solution

Test #66:

score: 10
Accepted
time: 1ms
memory: 9812kb

input:

1000 487
1 633 3 752 5 6 438 154 9 407 11 8 914 256 933 583 872 107 19 20 108 353 23 24 217 26 587 484 29 706 676 285 33 983 35 36 37 750 39 40 41 42 283 472 201 46 47 48 671 284 51 851 810 54 114 974 57 58 357 60 61 62 271 52 65 910 67 705 69 588 71 72 14 74 89 76 385 78 482 596 81 82 83 84 85 86 8...

output:

5
18
148 154 155 169 201 242 284 347 453 474 517 563 582 588 596 601 613 729 
461
517 49 671 68 705 562 903 569 581 44 472 768 207 996 641 696 21 108 374 135 164 2 633 27 587 254 236 984 501 957 333 167 16 583 713 179 513 10 407 209 474 125 703 258 182 955 634 966 964 834 991 663 111 856 123 471 586...

result:

ok OK, answer exists, pans = jans = 5

Test #67:

score: 10
Accepted
time: 1ms
memory: 9988kb

input:

1000 0
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 99 100 1...

output:

-1

result:

ok OK, no solution

Test #68:

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

input:

999 1000
831 697 655 509 919 134 583 432 898 446 240 9 348 947 159 364 129 316 999 677 576 984 978 312 804 739 911 723 624 566 269 799 421 596 710 760 679 38 350 127 943 42 915 162 45 46 895 959 850 50 904 322 659 542 714 989 744 726 52 200 413 460 740 64 371 774 662 707 178 445 287 72 807 916 612 3...

output:

1
900
172 729 776 447 70 445 344 815 753 183 358 906 443 732 794 842 609 602 503 584 768 750 603 575 939 310 444 161 433 117 93 234 622 518 135 724 711 399 832 619 616 883 531 297 144 463 856 368 55 714 593 31 269 777 660 666 572 301 405 559 185 945 94 309 29 624 851 769 480 40 127 468 83 845 638 82...

result:

ok OK, answer exists, pans = jans = 1

Subtask #6:

score: 15
Accepted

Dependency #5:

100%
Accepted

Test #69:

score: 15
Accepted
time: 15ms
memory: 12180kb

input:

200000 0
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 99 100...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #70:

score: 15
Accepted
time: 33ms
memory: 15836kb

input:

200000 27899
1 2 3 190882 5 6 7 8 9 129484 11 97800 13 134424 15 16 17 18 19 20 21 175824 23 24 25 26 27 28 29 30 31 32 135997 121012 35 36 37 120912 119681 40 41 42 43 16366 45 46 47 48 84946 50 51 52 53 54 55 188738 57 138274 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 124576...

output:

3
6955
53732 140426 10167 22350 147261 91467 96062 92775 61836 51905 15917 40180 172111 55042 139228 103856 159230 14597 44867 2321 152907 1342 18255 108714 144000 162215 90136 12017 135768 38161 62121 149902 141472 150745 74380 137039 179697 69466 133194 127783 34945 24368 87193 55207 149536 145351...

result:

ok OK, answer exists, pans = jans = 3

Test #71:

score: 15
Accepted
time: 19ms
memory: 12180kb

input:

200000 0
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 99 100...

output:

-1

result:

ok OK, no solution

Test #72:

score: 15
Accepted
time: 50ms
memory: 21844kb

input:

200000 132101
194594 2 3 4 5 127602 10715 8 9 10 11 12 13 122973 180611 100812 178251 11178 19 11314 21 145480 23 9855 25 26 27 28 29 30 127664 32 33 152205 167814 36 28833 38 39 40 29372 42 43 44 45 46 47 48 49 50 192705 52 195393 54 7651 110267 57 58 59 60 180448 62 63 18714 65 66 67 184602 69 70 ...

output:

2
3
29407 57572 185646 
67899
92980 132449 135610 166279 118024 31190 123720 162338 181888 102556 60883 191255 97498 127841 5966 117722 6875 38106 15104 100290 120985 32448 31625 165680 29746 190304 170292 26164 179387 86977 52696 196698 124543 132156 123823 115668 29987 174064 97769 150340 193671 3...

result:

ok OK, answer exists, pans = jans = 2

Test #73:

score: 15
Accepted
time: 78ms
memory: 30724kb

input:

200000 200000
27350 197231 35384 139092 41842 58950 23291 51815 195076 159286 106305 21258 107228 153086 119872 143757 159958 187144 20521 21290 158785 187111 77497 32847 117004 85943 127041 82568 47679 12894 101632 112816 59485 46266 39186 88038 23646 38027 133589 147765 86191 157619 117869 114259 ...

output:

2
121236
125103 142618 7742 3038 186764 109514 154909 54287 84347 194360 110964 64610 128438 105806 71982 147832 75583 33201 77778 121386 106631 68359 171684 135055 40080 130059 53986 40032 8049 143383 129586 178992 40930 50187 16265 15000 85375 53926 145031 17311 24151 136069 132019 177310 145373 1...

result:

ok OK, answer exists, pans = jans = 2

Test #74:

score: 15
Accepted
time: 62ms
memory: 18728kb

input:

200000 199999
124474 155985 182156 173928 156511 58661 178987 151169 162461 51042 155499 37039 68711 198860 116904 90818 110321 53945 196315 182028 191028 4595 124714 75672 35323 96765 180267 44664 116290 8548 191620 13180 170809 89576 172029 157464 61851 183136 38638 70676 129287 181999 130911 1472...

output:

-1

result:

ok OK, no solution

Test #75:

score: 15
Accepted
time: 48ms
memory: 17980kb

input:

200000 176222
141700 198245 168427 44649 5 189063 177173 76996 188538 156463 102614 175687 12160 137742 153461 58598 80907 106264 19 114542 70801 175726 184677 29365 24849 473 181468 3588 149809 9353 31 102170 135965 84045 93096 60387 41352 107090 194252 6927 1348 73019 89364 184284 116546 25992 47 ...

output:

-1

result:

ok OK, no solution

Test #76:

score: 15
Accepted
time: 75ms
memory: 30700kb

input:

170001 200000
71821 37502 62828 90645 2350 115400 58178 22478 88210 28232 167745 105482 97079 14187 166287 43734 29668 32724 54720 152438 77376 42146 107695 46790 11411 115642 88370 36279 49424 63661 25305 149681 54311 59793 12984 32461 82904 100779 137672 73267 70574 80050 113797 25255 75533 14036 ...

output:

9880
30122
364 740 938 1217 1245 1394 1430 1636 1657 1658 1685 1703 1728 1793 1807 2092 2183 2350 2359 2626 2672 2751 2782 2794 2875 2893 2915 2983 3007 3070 3097 3215 3260 3341 3395 3411 3543 3566 3673 3777 3892 4084 4120 4219 4231 4251 4263 4346 4363 4380 4413 4417 4521 4559 4566 4593 4725 4767 47...

result:

ok OK, answer exists, pans = jans = 9880

Test #77:

score: 15
Accepted
time: 83ms
memory: 24516kb

input:

190055 200000
178149 31604 33005 152324 38601 27194 60769 32733 93099 24313 3297 174750 30179 64185 182608 189755 32535 19463 112270 37964 80455 5028 158265 122679 40277 100405 73723 10803 174822 90127 66923 35711 164055 136168 155290 96055 5910 161357 14074 139638 72477 96886 112855 133315 135182 2...

output:

39686
10316
654 885 1342 1715 1919 2391 2489 2585 2804 2879 3116 3138 3286 3513 3708 3849 3859 3883 3926 3944 4044 4097 4106 4197 4222 4328 4331 4342 4351 4393 4398 4405 4427 4486 4538 4543 4566 4624 4678 4741 4882 5005 5189 5368 5504 5521 5597 5653 5683 5697 5741 5833 5837 5862 5897 5903 5946 5951 ...

result:

ok OK, answer exists, pans = jans = 39686

Test #78:

score: 15
Accepted
time: 69ms
memory: 19252kb

input:

200000 200000
39018 143114 105231 123355 103194 147756 131868 108627 16847 82863 121458 13103 14076 159140 111429 165648 38699 153023 114872 33889 26001 47652 163364 186475 163949 177924 157516 75919 87498 172178 120690 29065 175191 117636 198913 190747 161155 102427 121169 199878 172762 173494 1596...

output:

100000
2
246 83 
2
768 243 
2
859 470 
2
913 646 
2
1100 977 
2
1186 181 
2
1259 903 
2
1288 894 
2
1483 513 
2
1559 819 
2
1706 1574 
2
1739 1696 
2
1759 239 
2
1984 351 
2
2068 1280 
2
2133 1993 
2
2293 1547 
2
2409 2220 
2
2437 519 
2
2551 864 
2
2792 681 
2
2854 2643 
2
2875 2700 
2
3058 2851 
2...

result:

ok OK, answer exists, pans = jans = 100000

Test #79:

score: 15
Accepted
time: 68ms
memory: 26252kb

input:

171231 200000
164075 13270 127502 118540 86179 162747 132435 97890 140248 153160 130815 166933 11652 98093 133833 153128 170990 159885 112731 68240 154107 45613 93201 642 130201 26599 64195 109779 60578 17611 433 118324 156800 170323 42633 120175 166052 151165 72779 54663 39524 83663 2587 89304 1301...

output:

31229
28774
323 402 433 556 642 750 949 991 1034 1262 1561 1569 1927 1934 2198 2269 2293 2308 2414 2453 2487 2587 2618 2856 2879 2945 2968 2972 3102 3340 3370 3464 3466 3540 3754 3772 3792 3828 3988 4167 4180 4181 4228 4255 4371 4389 4424 4448 4473 4496 4567 4602 4737 4789 4867 4878 4892 4931 4974 4...

result:

ok OK, answer exists, pans = jans = 31229

Test #80:

score: 15
Accepted
time: 88ms
memory: 35684kb

input:

200000 176700
82162 7286 16985 63125 171227 170147 33948 68016 137824 166954 18436 8558 181542 22876 197545 126761 161241 18 19 78853 9801 61543 56129 41921 24448 86706 118776 88935 30701 106671 39630 101061 81049 34 183953 111250 43590 106969 132955 80677 167190 42 43 5726 86145 49093 165059 166629...

output:

149
153
4461 9848 12343 14729 16868 19184 20574 21442 22831 23325 24833 26419 27469 27654 28308 30926 31108 31182 31520 32552 34437 35344 35408 36706 38828 39918 40983 41330 42627 43580 44216 45416 45472 46117 47111 47401 48672 49625 50405 51169 51952 52609 52849 53364 54008 54088 55444 55993 56013 ...

result:

ok OK, answer exists, pans = jans = 149

Test #81:

score: 15
Accepted
time: 57ms
memory: 19048kb

input:

200000 199968
46198 147998 57712 78498 130848 17009 107698 79187 179361 170921 59899 59129 158004 33356 7310 75064 164030 163834 59237 80267 66346 88742 198266 86641 132072 67825 49627 173829 116003 75735 51140 80812 166026 25340 174304 135368 187981 93432 49479 56209 49701 78806 1114 142449 173493 ...

output:

-1

result:

ok OK, no solution

Test #82:

score: 15
Accepted
time: 65ms
memory: 25856kb

input:

200000 187233
1 148466 3 8692 85910 15258 7 190599 9 17592 11 12 3921 14 189788 16 17 18 19 20 196436 22 95184 24 25 182578 27 127108 137456 30 31 32 159636 34 167209 36 158540 33013 100572 14634 87435 42 95540 44 45 46 47 68587 49 50 51 52 78103 85726 28841 161930 154438 58 160716 60 141490 62 1627...

output:

1
100000
121150 175020 49756 29087 93655 120970 185807 128601 32019 12268 41655 21973 56536 89444 130693 186554 129835 189796 51259 100747 49670 37426 82163 155637 114942 83357 48466 165441 130261 139736 53793 17314 17680 77093 167913 123895 164226 81537 133246 10140 64819 64290 32302 146095 97491 9...

result:

ok OK, answer exists, pans = jans = 1

Test #83:

score: 15
Accepted
time: 33ms
memory: 25028kb

input:

100000 101980
99336 32943 79842 11941 9317 1950 19284 87024 19783 2472 19267 40432 98653 84155 9213 94124 70008 93944 40581 70944 6175 62909 92613 7037 34221 21622 29705 94586 5497 8037 88857 44331 61638 55461 28160 67123 27390 56024 47572 86234 21100 49023 95568 15247 18240 82605 64338 28881 19522 ...

output:

12
1990
785 925 1108 1481 1624 1812 2314 2857 2941 3507 3517 4420 4599 4630 4734 4816 4917 4961 5583 5776 5852 5918 5924 6070 6180 6346 6511 6594 6637 6687 6879 6973 7019 7147 7503 7520 7765 8028 8309 8319 8507 8554 8591 8669 9096 9127 9342 9493 9502 9583 9793 9832 9874 9934 10017 10337 10350 10373 ...

result:

ok OK, answer exists, pans = jans = 12

Subtask #7:

score: 15
Accepted

Test #84:

score: 15
Accepted
time: 5ms
memory: 11860kb

input:

100000 200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 ...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #85:

score: 15
Accepted
time: 9ms
memory: 16472kb

input:

90000 180000
394900285 370831702 394900285 394900285 394900285 394900285 370831702 370831702 394900285 394900285 394900285 370831702 370831702 394900285 394900285 394900285 370831702 394900285 394900285 394900285 394900285 394900285 394900285 370831702 394900285 394900285 394900285 394900285 3708317...

output:

1
42506
30001 1 30003 3 30005 4 30009 5 30010 6 30012 9 30013 10 30015 11 30020 14 30024 15 30026 16 30027 18 30036 19 30038 20 30040 21 30042 22 30047 23 30050 25 30052 26 30054 27 30057 28 30059 30 30062 31 30070 32 30071 34 30074 35 30078 36 30083 38 30084 39 30088 40 30091 41 30094 43 30095 44 3...

result:

ok OK, answer exists, pans = jans = 1

Test #86:

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

input:

100000 200000
395100935 543127001 214182856 175873925 19706134 480647883 870552582 237481220 260946803 73589446 818830474 688586052 203606711 902863796 491264362 465384742 991398781 240973455 300045766 90084210 678241812 252011760 151160135 639822565 925021802 341465602 50360948 442786518 180897343 ...

output:

2
20000
465 871 874 1160 1175 1195 1412 1452 1531 1554 1619 1719 1779 1897 1903 2075 2218 2252 2369 2438 2473 2637 2656 2768 2828 2835 2892 3105 3169 3390 3419 3466 3496 3504 3538 3553 3584 3604 3656 3716 3763 3774 3818 3840 3849 3899 3935 3949 3960 3981 3992 4003 4085 4097 4140 4195 4220 4254 4262 ...

result:

ok OK, answer exists, pans = jans = 2

Test #87:

score: 15
Accepted
time: 35ms
memory: 24928kb

input:

100000 200000
125856453 297520881 753034948 537623372 167966995 622048312 340996890 823840623 693104917 530852062 909622355 610889018 93585301 90998424 835922804 268018088 770532873 591264492 397113920 745727319 171873536 871157799 641502063 920828329 802364446 286243826 103194514 478073659 85031657...

output:

2
30000
231 438 530 601 741 990 1190 1304 1318 1381 1439 1456 1624 1682 1699 1703 1767 1828 1961 2062 2176 2194 2215 2287 2316 2372 2431 2444 2465 2498 2516 2720 2724 2766 2784 2898 2914 2918 2930 2960 2975 2976 3061 3072 3135 3152 3171 3192 3207 3258 3294 3304 3336 3487 3505 3611 3615 3657 3676 369...

result:

ok OK, answer exists, pans = jans = 2

Test #88:

score: 15
Accepted
time: 20ms
memory: 20772kb

input:

100000 200000
97096 168734 218280 287877 381527 410003 588814 617450 688731 834572 936503 989217 1395837 1416032 1469041 1582283 1659828 1780747 1919538 1998378 2094941 2142068 2146812 2228046 2395174 2434685 2599234 2638724 2672852 2896600 2979329 2994040 3047230 3261426 3264744 3313607 3326946 335...

output:

1
80000
25299 72791 18748 72792 7879 20936 23032 91462 12125 77444 5794 38359 9975 15615 23033 6853 70543 36146 98717 83035 67177 41674 77445 78508 50834 60043 3442 21964 6854 78509 77446 73785 39481 3443 18749 72793 61151 74837 90355 23034 56297 73786 39483 12127 92735 24124 16649 4678 75867 32791 ...

result:

ok OK, answer exists, pans = jans = 1

Test #89:

score: 15
Accepted
time: 12ms
memory: 21300kb

input:

100000 200000
106952015 540317333 689198453 744540707 205922854 689198453 767316057 767316057 744540707 106952015 689198453 689198453 689198453 689198453 744540707 744540707 767316057 911684655 767316057 767316057 767316057 689198453 767316057 540317333 911684655 767316057 767316057 689198453 744540...

output:

1
99000
11153 66679 22276 1 11154 44537 2 44538 22277 55612 88895 55613 66680 88896 3 55614 44539 4 66681 77962 55615 5 22278 44540 6 55616 22279 7 77963 88897 66682 88898 11155 88899 55617 22280 44541 77964 8 77965 88900 55618 77966 44542 22281 55619 77967 33355 66683 11156 33356 11157 55620 22282 ...

result:

ok OK, answer exists, pans = jans = 1

Test #90:

score: 15
Accepted
time: 22ms
memory: 21408kb

input:

100000 200000
506842 1779764 1933447 2171605 3112388 3433827 5168160 6113572 7262768 7880988 8052232 9148442 9358188 10076583 11196775 12185919 12281427 14797620 16226353 16494431 16527666 17897613 18706842 19278334 19497587 22444094 23318255 23615842 26484981 27112508 27522401 28188717 28946741 317...

output:

1
99000
13340 91444 52211 43601 13341 87095 82803 4584 82804 35066 17675 13342 56466 78484 8973 78485 26334 60916 4585 95701 21965 17676 87096 95702 4586 43602 95703 60917 26335 78486 8974 95704 39294 95705 26336 8975 87097 74154 45 13343 65281 78487 95706 43603 35067 87098 95707 60918 26337 21966 5...

result:

ok OK, answer exists, pans = jans = 1

Test #91:

score: 15
Accepted
time: 28ms
memory: 21752kb

input:

100000 200000
129170573 326521052 57109036 365576384 401125977 834873988 946667628 91034943 399956809 620966594 603886909 795522832 138312729 266380357 15244710 620089609 899350641 689624026 476215460 508843921 113672418 816677517 810384223 492261534 523292122 441279408 242083950 975858389 365576384...

output:

1
99000
11570 42067 67594 65559 91179 54615 39864 96577 36165 50066 56582 88231 37482 28226 76173 90489 33782 29017 19957 23093 30630 58348 55631 63768 76843 57874 18783 50396 85710 74247 32929 89098 40032 66426 99367 1165 22132 51043 36166 62930 33938 13262 80773 26354 95719 89462 21290 95577 47446...

result:

ok OK, answer exists, pans = jans = 1

Test #92:

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

input:

100000 200000
240339255 195016556 490388035 940956586 958784806 27967641 692089801 267902323 92927259 194409707 563118753 97732524 501399880 591850724 983812591 119911804 265518074 186003408 601807133 20049622 417345246 964586607 405806879 936689225 666503711 227157965 807465092 308006413 137888232 ...

output:

1
100000
53827 17212 82912 36437 55301 83905 29543 70046 5258 42117 38796 90077 97271 76452 96498 4652 15454 22278 54737 99970 86837 39313 60764 21804 10017 23276 51833 24420 54206 14709 37645 70664 78743 55913 46747 71465 81514 32430 15626 64816 87667 35532 46670 47568 55688 69212 8734 86299 16799 ...

result:

ok OK, answer exists, pans = jans = 1

Test #93:

score: 15
Accepted
time: 26ms
memory: 19228kb

input:

100000 200000
25185 924086257 924086257 25185 924086257 40200 40200 924086257 924086257 141563 924086257 924086257 924086257 924086257 394717 924086257 924086257 441503 924086257 924086257 522164 522164 924086257 924086257 556761 556761 924086257 585767 924086257 924086257 665042 924086257 678244 92...

output:

1
70000
59929 14221 59930 55356 59931 16769 59932 33294 59933 22364 59934 57665 59935 94978 59936 15851 59937 41771 59938 59175 59939 27160 59940 55649 59941 1155 59942 15896 59943 12031 59944 4247 59945 33871 59946 39584 59947 11013 59948 20714 59949 40031 59950 52624 59951 4369 59952 44595 59953 4...

result:

ok OK, answer exists, pans = jans = 1

Test #94:

score: 15
Accepted
time: 22ms
memory: 21616kb

input:

100000 200000
812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 812481158 2141670 812481158 812481158 812481158 812481158 812481158 812481158 81248115...

output:

1
99000
41289 8469 41290 9381 41291 3223 41292 35177 41293 25998 41294 371 41295 93594 41296 7657 41297 19511 41298 35580 41299 93994 41300 22016 41301 98975 41302 92576 41303 9095 41304 23538 41305 40416 41306 16051 41307 31483 41308 32533 41309 4359 41310 26651 41311 38441 41312 40341 41313 32406 ...

result:

ok OK, answer exists, pans = jans = 1

Test #95:

score: 15
Accepted
time: 24ms
memory: 20484kb

input:

100000 200000
851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590820 851590...

output:

2
24203
28823 9514 28824 22864 28825 21154 28826 16907 28827 15686 28828 14372 28829 41362 28830 54109 28831 48867 28832 5268 28833 48529 28834 98746 28835 7888 28836 25646 28837 17113 28838 47294 28839 14373 28840 96868 28841 97899 28842 5040 28843 10291 28844 99183 28845 54144 28846 99406 28847 55...

result:

ok OK, answer exists, pans = jans = 2

Test #96:

score: 15
Accepted
time: 26ms
memory: 17212kb

input:

100000 200000
642843205 642843205 35449 35449 35449 36793 57234 743553971 57234 118176 118176 573856453 118176 51837383 158902 174498 64228397 225784050 65762692 223536 223536 224935 243350666 800469566 800469566 769552754 324571698 332653 958433359 332653 388319 345399435 777871915 654727480 624677...

output:

2
15000
415 627 1024 1254 1285 1413 1458 1668 1769 1842 1913 1978 2011 2120 2342 2468 2664 2734 2824 2912 2914 2949 3040 3166 3186 3233 3250 3440 3478 3488 3496 3524 3596 3636 3659 3690 3697 3836 3880 3897 4043 4070 4097 4099 4101 4104 4188 4231 4293 4397 4408 4446 4569 4598 4739 4750 4989 5014 5074...

result:

ok OK, answer exists, pans = jans = 2

Test #97:

score: 15
Accepted
time: 12ms
memory: 22376kb

input:

100000 200000
675483739 455029327 543069712 26152534 26152534 543069712 295587124 295587124 543069712 455029327 840201238 438815790 550813586 295587124 455029327 26152534 922462836 840201238 455029327 840201238 675483739 295587124 543069712 675483739 26152534 295587124 543069712 922462836 550813586 ...

output:

2
98990
69789 19858 49839 19859 49840 19860 90003 49841 30033 9971 40039 69790 90004 40040 19861 90005 19862 40041 59814 90006 79988 49842 9972 79989 90007 59815 40042 49843 9973 69791 1 69792 49844 90008 69793 9974 30034 9975 30035 49845 19863 9976 19864 49846 90009 40043 79990 30036 2 40044 59816 ...

result:

ok OK, answer exists, pans = jans = 2

Test #98:

score: 15
Accepted
time: 15ms
memory: 21660kb

input:

100000 200000
53073 103110 239930 275707 811947 1081674 1383757 1877145 2071787 2120937 2131271 2313444 2551068 2878142 3016310 3543092 3549565 3601546 3866946 4066570 4139836 4359674 5113129 5137679 5260696 5993190 6073241 6187014 6270847 6428691 6491926 6583820 6643105 6768826 6942865 7106852 7107...

output:

2
248
7141 38198 7142 6755 7144 14072 7145 38220 7146 37552 7147 38278 7150 37594 7152 37136 7154 6796 7155 37144 7156 99681 7159 13346 7165 37160 7169 5632 7170 5640 7174 20136 7175 6798 7176 13353 7177 37604 7178 99684 7186 20147 7189 5646 7190 6801 7200 37202 7201 13429 7203 6803 7205 99703 7210 ...

result:

ok OK, answer exists, pans = jans = 2

Subtask #8:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #5:

100%
Accepted

Test #99:

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

input:

1000 0
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #100:

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

input:

1000 313
477411548 253961823 477411548 477411548 477411548 253961823 477411548 477411548 253961823 477411548 477411548 253961823 477411548 477411548 253961823 477411548 253961823 477411548 477411548 253961823 253961823 477411548 477411548 477411548 253961823 477411548 253961823 477411548 477411548 4...

output:

-1

result:

ok OK, no solution

Test #101:

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

input:

1000 200000
361387188 361387188 365233459 365233459 365233459 365233459 361387188 361387188 361387188 365233459 361387188 361387188 361387188 365233459 361387188 365233459 361387188 365233459 365233459 361387188 361387188 361387188 365233459 365233459 365233459 361387188 365233459 361387188 36138718...

output:

1
600
701 3 702 4 703 5 704 6 705 10 706 14 707 16 708 18 709 19 710 23 711 24 712 25 713 27 714 30 715 31 716 33 717 36 718 39 719 45 720 46 721 48 722 53 723 54 724 57 725 58 726 61 727 65 728 70 729 73 730 77 731 81 732 82 733 84 734 86 735 88 736 89 737 91 738 93 739 98 740 102 741 105 742 108 7...

result:

ok OK, answer exists, pans = jans = 1

Test #102:

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

input:

1000 1000
28399625 782623364 367497325 54532240 918094680 5995692 380749646 194899601 705789507 9792610 426463549 5228190 134906551 16629399 567271934 175006296 57936214 23483010 24640942 25065581 166982510 26956493 636891937 726020649 313050314 4248649 613465011 31920131 450185514 331897119 9954973...

output:

2
100
23 42 59 123 127 145 167 207 211 212 220 225 231 244 275 279 294 301 305 306 307 310 320 330 357 367 368 381 385 391 429 459 472 488 490 491 526 533 542 546 554 558 570 579 582 591 598 609 616 621 627 649 697 708 718 720 729 730 732 733 739 754 757 758 763 773 777 778 783 785 792 796 804 805 8...

result:

ok OK, answer exists, pans = jans = 2

Test #103:

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

input:

1000 950
714545526 684960269 2999777 669283783 11446456 641436288 402090153 138154146 963427426 5972556 626246226 896812746 401239772 50655455 645635251 182135148 332848906 307021050 18761885 15556858 586221003 167019567 471514613 486507738 301600632 513128411 596036611 25274645 839565657 23539650 3...

output:

152
50
17 33 50 57 62 117 139 149 167 170 188 189 193 194 197 223 247 258 264 266 273 274 278 281 286 290 299 310 316 317 319 320 324 325 331 335 336 360 361 364 370 377 387 389 393 397 401 414 428 433 
227
360 489 620 255 336 844 588 828 86 645 521 358 235 335 868 65 881 858 103 331 612 321 18 325 ...

result:

ok OK, answer exists, pans = jans = 152

Test #104:

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

input:

1000 499
819317737 827509452 763079147 3763324 707315731 990757603 462008366 5526552 797752356 814820734 8392903 703553629 408639450 453157739 337283460 377136345 16679800 18562917 468914076 21258677 22879602 678956637 27866718 28584704 29654365 96739360 176105323 37044379 37166208 808993949 9573138...

output:

-1

result:

ok OK, no solution

Test #105:

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

input:

1000 500
839214525 453946685 5425894 6363039 6981415 155633145 692613557 958067854 12764819 15528909 999686340 18413418 945012221 898941051 324598638 563272918 24615033 24699142 24750701 522668165 26900451 28168252 28337388 30905164 30988333 31804894 148411947 35800078 731867961 36489441 36559264 36...

output:

1
500
706 925 421 298 352 379 639 234 898 577 318 245 525 209 545 295 867 705 758 468 933 597 834 792 936 80 315 848 248 301 646 586 82 422 27 150 172 592 350 405 830 611 682 928 362 557 603 987 134 503 565 650 105 252 977 464 123 873 636 279 813 121 207 567 253 428 20 509 712 576 759 665 385 653 88...

result:

ok OK, answer exists, pans = jans = 1

Test #106:

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

input:

1000 1001
73982052 110920170 797990346 477955396 944330769 108861853 506326319 229810093 121098278 260830147 639144369 430457797 97277703 782082660 695917899 579169033 464628175 955611313 713255254 426096522 195350098 693685083 470478177 504928437 469664787 516376294 504692903 940130643 501885255 40...

output:

1
1000
439 558 746 15 687 363 810 698 57 771 67 607 409 990 548 679 618 266 829 263 855 754 617 430 849 492 145 63 799 120 644 462 77 429 832 818 325 394 468 563 51 597 519 236 867 162 982 876 177 871 672 795 610 736 533 449 160 808 383 499 180 29 477 229 320 317 154 1 82 304 12 404 941 929 498 289 ...

result:

ok OK, answer exists, pans = jans = 1

Test #107:

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

input:

1000 1000
474165987 823692123 643219331 192387203 535936059 235048151 602900321 706431267 731334927 462392076 732659039 606294265 41278082 602588740 834907353 879792176 992814074 635138592 490222702 886619975 586260565 361920069 476210762 152159842 148990529 237521752 106118473 717177262 150350656 3...

output:

500
2
47 35 
2
51 13 
2
62 40 
2
70 67 
2
121 27 
2
138 78 
2
148 122 
2
152 96 
2
158 25 
2
159 29 
2
161 24 
2
166 140 
2
167 82 
2
174 105 
2
188 71 
2
190 129 
2
191 73 
2
195 185 
2
197 48 
2
199 194 
2
201 4 
2
211 59 
2
215 81 
2
232 189 
2
235 6 
2
239 68 
2
240 26 
2
243 57 
2
250 145 
2
25...

result:

ok OK, answer exists, pans = jans = 500

Test #108:

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

input:

1000 1499
693923505 90041091 386655223 707935432 529191375 406743461 954146122 358840646 258158701 308411665 965571161 871309678 67724352 751678236 751306405 465074548 531488308 280705839 843662555 378006949 188919396 382067038 38089079 460107103 107265724 889434000 565300376 343415362 364921583 393...

output:

3
499
43 68 74 89 103 105 116 118 122 126 131 135 147 166 169 171 172 177 194 195 202 209 211 228 232 234 239 251 258 259 262 266 270 275 278 279 283 289 291 294 296 297 298 299 306 314 315 316 317 322 323 325 329 333 339 341 343 344 345 352 361 365 366 371 378 380 385 388 390 391 392 394 400 402 40...

result:

ok OK, answer exists, pans = jans = 3

Test #109:

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

input:

1000 1000
311574534 311574534 311574534 311574534 311574534 311574534 311574534 311574534 311574534 311574534 59551172 451639069 858015244 68504455 808125414 68504455 808125414 858015244 68504455 858015244 808125414 17898685 17898685 663714456 585526066 175859257 209508538 209508538 209508538 175859...

output:

22
20
81 228 235 243 264 335 397 412 423 452 483 491 496 504 551 567 568 608 609 625 
459
228 718 11 81 123 626 124 627 125 628 126 847 127 848 128 629 129 597 130 598 131 849 132 850 133 599 134 600 135 630 136 631 137 632 138 25 633 139 601 140 602 141 603 142 604 143 634 144 635 145 605 146 606 1...

result:

ok OK, answer exists, pans = jans = 22

Test #110:

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

input:

1000 1000
1451896 935173526 369163552 630949488 782383640 308720498 464825543 490300387 983158139 631590538 540981240 691540150 913709197 913709197 913709197 558001422 431133804 431133804 660833524 364297994 813021208 760855696 289046472 289046472 994467214 808171584 808171584 808171584 808171584 80...

output:

22
20
103 109 110 156 221 308 315 378 388 421 423 428 429 438 500 513 535 558 560 563 
613
378 651 316 652 317 653 318 64 319 654 320 65 321 655 322 66 323 67 315 684 23 309 682 670 683 997 25 998 671 685 24 308 78 222 79 223 80 224 357 225 358 226 81 227 359 228 360 229 361 230 362 231 363 232 364 ...

result:

ok OK, answer exists, pans = jans = 22

Test #111:

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

input:

1000 980
442938664 166963157 535359404 451351059 900776401 41221328 260781618 260781618 260781618 260781618 260781618 725802590 888047430 888047430 436081040 454997508 149215654 966843315 58271379 365547006 365547006 62334232 62334232 83577057 819462091 819462091 83577057 83577057 819462091 83577057...

output:

40
31
64 284 65 169 66 170 67 285 68 171 69 172 70 173 71 174 72 286 73 81 287 74 288 75 175 76 22 77 289 78 23 
80
83 24 84 25 843 26 844 27 85 28 86 29 845 30 87 31 88 32 89 33 919 34 846 35 847 36 848 37 90 38 91 39 920 40 92 41 921 42 849 43 850 44 93 45 851 46 852 47 853 48 854 49 94 50 95 51 8...

result:

ok OK, answer exists, pans = jans = 40

Test #112:

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

input:

1000 981
4010961 532002638 532002638 532002638 532002638 532002638 532002638 532002638 545119772 941475422 545119772 941475422 941475422 545119772 545119772 941475422 545119772 545119772 545119772 14041543 663844471 432673694 432673694 699259914 663844471 988609596 653486843 560159811 800964544 5601...

output:

40
9
197 679 198 915 199 608 56 200 916 
6
295 80 341 81 342 79 
10
312 287 313 288 314 289 315 290 316 291 
7
348 675 349 676 350 678 343 
2
354 344 
25
427 67 428 68 429 69 430 70 431 71 819 72 89 73 407 432 74 90 75 91 76 820 77 92 78 
62
433 616 434 627 435 323 436 324 437 362 438 617 439 618 44...

result:

ok OK, answer exists, pans = jans = 40

Test #113:

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

input:

1000 979
6107173 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 426537130 669586879 669586879 669586879 669586879 669586879 669586879 276550655 661707257 530301950 742991633 570845377 676549445 676549445 676...

output:

-1

result:

ok OK, no solution

Test #114:

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

input:

1000 0
118915 824721 2565382 5295212 5692286 9207935 9811845 12262169 13328574 13706177 16007027 16531408 18508476 18952064 20562118 21259970 21315776 21652716 25977236 27004462 27813022 28852654 28941913 31560923 31806178 33004426 33492493 33761459 33771996 33807920 36750441 36851444 37570259 38486...

output:

-1

result:

ok OK, no solution

Test #115:

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

input:

1000 1000
534094254 939858322 534094254 939858322 46903207 46903207 46903207 937140712 46903207 458324925 922337130 641236713 515821304 690369406 690369406 690369406 690369406 181077134 850361555 850361555 149777219 508502318 951006113 951006113 951006113 666892884 666892884 666892884 925729960 1788...

output:

125
12
35 5 36 6 37 940 7 38 941 8 942 9 
7
113 57 114 58 795 115 796 
3
129 799 21 
3
161 549 127 
10
172 964 30 173 31 965 174 966 175 32 
3
177 483 18 
8
235 631 195 236 632 237 633 196 
4
241 47 242 924 
2
268 135 
13
273 914 91 274 92 915 93 916 94 917 96 918 95 
36
279 814 205 280 206 281 815 ...

result:

ok OK, answer exists, pans = jans = 125

Test #116:

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

input:

1000 1000
238358940 693462713 898240279 693462713 982419228 694258450 253740707 693462713 146582997 238358940 153206887 238358940 238358940 693462713 982419228 624475493 405553909 809344066 859672830 759049446 915158772 948581654 859672830 354063664 354063664 216822596 36168522 859672830 216822596 9...

output:

3
19
299 321 356 404 406 409 417 427 550 602 691 748 751 872 874 875 905 929 976 
978
321 349 908 601 407 598 907 754 297 299 421 977 552 52 422 51 976 753 420 929 400 408 399 903 749 599 906 750 905 930 149 304 150 384 151 876 385 877 957 152 878 958 756 931 19 879 932 386 305 153 387 306 880 307 3...

result:

ok OK, answer exists, pans = jans = 3

Test #117:

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

input:

1000 1000
688099747 399662791 638522894 502069985 403143567 878381963 788126958 326282707 778040233 115436998 456315544 299597783 519087828 38278087 778040233 187075039 502069985 209982168 688099747 11418125 1770863 403143567 1770863 467441837 467441837 467441837 638522894 39163712 935223472 8490670...

output:

3
19
221 290 314 318 389 420 501 523 568 625 628 636 695 717 742 769 770 846 924 
973
318 316 758 184 581 102 101 276 317 288 314 991 759 992 821 933 951 431 752 34 291 676 822 934 432 492 35 450 292 993 493 668 339 451 277 760 952 340 36 433 293 494 349 753 953 341 994 278 368 279 995 553 589 823 6...

result:

ok OK, answer exists, pans = jans = 3

Test #118:

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

input:

1000 1000
58270380 394664784 109243892 241759163 236132743 925992515 23962060 156116447 236132743 447482905 602734228 394664784 394664784 16842718 972840951 764767036 16842718 602734228 317455814 412780260 930747784 882813981 698606878 882813981 290449258 67122827 62288619 197656413 444873767 295792...

output:

3
19
40 57 142 330 331 421 436 443 454 455 459 541 592 633 681 684 810 845 954 
975
331 781 981 651 291 330 184 32 747 33 143 31 142 302 26 58 653 158 185 170 638 581 159 186 303 497 487 59 639 45 93 622 640 761 273 27 46 28 187 623 757 782 498 171 499 304 29 500 793 783 60 488 654 188 794 582 134 1...

result:

ok OK, answer exists, pans = jans = 3

Test #119:

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

input:

1000 1000
615975329 615975329 731588326 731588326 622770400 404920142 331607727 759909660 350105712 830151301 830151301 830151301 830151301 830151301 830151301 830151301 830151301 830151301 830151301 365574885 72646768 830151301 830151301 830151301 830151301 830151301 734782237 72646768 350105712 47...

output:

3
19
46 278 281 353 419 497 498 579 591 670 696 698 785 801 802 849 850 938 948 
806
579 818 499 820 500 496 498 202 143 497 199 420 423 337 421 200 422 201 419 807 956 308 808 141 957 168 140 20 353 501 43 282 602 44 502 603 45 281 979 375 279 297 51 278 478 144 477 978 21 47 995 28 46 816 233 50 7...

result:

ok OK, answer exists, pans = jans = 3

Test #120:

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

input:

1000 1000
344063362 19707976 19707976 19707976 860291186 739924779 494596921 751401448 90666286 287242140 890937541 90666286 90666286 757353223 62122133 757353223 694373590 61042681 626552104 614524746 626552104 890937541 61042681 890937541 614524746 694373590 999713185 617358092 617358092 370670764...

output:

3
19
9 185 186 276 292 305 367 369 370 402 443 463 578 580 598 608 705 714 785 
805
9 411 786 488 787 424 788 697 789 711 790 160 791 698 792 699 793 348 794 161 795 886 796 412 797 489 798 700 799 425 800 752 801 386 802 349 803 753 804 440 805 413 806 483 807 319 808 452 809 162 810 163 811 887 81...

result:

ok OK, answer exists, pans = jans = 3

Test #121:

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

input:

1000 1000
493614601 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 903519606 ...

output:

7
5
180 182 184 272 331 
16
182 270 90 180 422 185 331 513 273 1 272 88 184 179 183 421 
2
419 274 
2
420 271 
3
512 1000 178 
5
516 515 89 514 424 
967
517 92 518 333 519 334 520 425 521 335 522 93 523 275 524 336 525 186 526 337 527 338 528 2 529 187 530 188 531 189 532 339 533 340 534 94 535 3 53...

result:

ok OK, answer exists, pans = jans = 7

Test #122:

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

input:

1000 1000
719047098 146929333 502402097 591360862 232133457 70999990 571942963 394997007 332804793 733111349 109324604 44290831 778835413 900375910 986529665 697260962 558927640 418641157 856957430 147714543 424257206 34175768 947012837 878022486 502498930 199597286 322092537 848960036 716704032 573...

output:

97
5
21 41 49 91 95 
22
21 54 412 53 95 878 92 269 31 91 90 2 49 212 42 177 11 41 210 119 22 6 
3
106 259 5 
2
109 43 
3
113 88 57 
5
123 196 47 55 46 
5
132 125 408 126 27 
3
133 959 38 
2
135 51 
4
188 103 217 102 
5
191 122 807 396 121 
2
192 39 
2
193 52 
3
195 12 8 
3
205 292 18 
5
206 890 108 ...

result:

ok OK, answer exists, pans = jans = 97

Test #123:

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

input:

1000 1000
67443 935908652 133918450 578737010 471893157 578737010 531129674 471893157 578737010 471893157 788470533 133918450 420924469 935908652 133918450 788470533 420924469 531129674 420924469 133918450 578737010 788470533 788470533 236921491 580990032 580990032 443006117 302288737 647918461 4628...

output:

2
10
70 170 201 568 608 811 891 909 913 977 
990
70 583 978 32 979 584 980 887 50 217 603 585 54 33 888 143 604 981 51 55 982 889 586 605 56 883 218 890 587 884 53 57 34 606 52 885 977 369 280 824 2 914 124 3 125 370 4 611 371 281 612 524 426 372 525 446 825 427 447 526 373 915 126 282 374 527 5 448...

result:

ok OK, answer exists, pans = jans = 2

Test #124:

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

input:

1000 1000
393415 28090118 28090118 186131995 186131995 325625188 329059311 329059311 169415225 221199506 221199506 822733931 38848113 309411627 221199506 36711422 589521528 759363679 542564518 442148694 16025117 128839683 466622328 128839683 235820137 235820137 186131995 325625188 1749589 1749589 57...

output:

2
100
27 36 125 182 226 252 254 285 286 294 306 330 364 370 395 413 420 428 440 452 467 474 488 492 502 509 515 518 528 530 534 538 552 556 558 572 600 601 602 607 610 612 613 638 649 652 668 675 677 683 684 686 695 696 699 705 708 717 719 720 721 729 733 735 741 753 761 768 780 797 803 806 811 830 ...

result:

ok OK, answer exists, pans = jans = 2

Test #125:

score: 15
Accepted
time: 1ms
memory: 9892kb

input:

1000 990
33528487 224623560 394828590 667709896 882786136 439933807 391646429 700758829 402826562 502566794 780346415 19017532 36156105 566098096 257805109 667709896 391646429 473273447 421011880 224623560 931036941 212247422 382679378 608595706 941788169 780346415 238451722 125006536 92119925 56494...

output:

1
990
53 271 690 173 24 677 987 460 69 633 618 845 79 746 906 532 598 916 824 988 599 649 619 25 900 718 85 667 609 678 103 137 917 251 219 111 263 889 936 558 318 174 288 800 878 907 858 650 481 468 365 161 768 417 112 610 86 740 113 545 989 870 719 54 583 95 345 818 499 469 308 836 679 210 559 406...

result:

ok OK, answer exists, pans = jans = 1

Test #126:

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

input:

1000 990
896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 896046493 8...

output:

1
990
423 99 424 329 425 47 426 332 427 48 428 66 429 249 430 286 431 225 432 127 433 67 434 977 435 200 436 283 437 68 438 363 439 100 440 924 441 208 442 972 443 59 444 378 445 287 446 402 447 293 448 372 449 276 450 179 451 416 452 931 453 973 454 133 455 158 456 974 457 38 458 284 459 96 460 301...

result:

ok OK, answer exists, pans = jans = 1

Test #127:

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

input:

1000 200000
199492796 199492796 512957172 666540612 52705184 447367584 52705184 824543897 666540612 241619013 675576252 447367584 824543897 512957172 113895088 824543897 675576252 241619013 447367584 675576252 824543897 675576252 205487902 447367584 241619013 447367584 447367584 199492796 675576252 ...

output:

1
900
206 388 483 207 585 389 484 793 586 794 390 294 208 795 587 295 796 1 209 588 112 485 2 210 902 692 486 693 3 589 694 211 590 487 297 488 797 695 212 591 213 489 696 113 697 592 4 698 593 798 114 490 799 298 392 491 115 903 393 6 492 116 493 800 594 117 214 494 801 118 495 119 802 120 8 904 21...

result:

ok OK, answer exists, pans = jans = 1

Test #128:

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

input:

1000 900
27213604 38142442 371314068 286123026 725665335 585831235 480055354 249138097 795035646 415328097 595528397 375944137 850556022 375944137 280512099 180222581 180222581 468053716 608011846 863151884 249138097 585831235 39131326 505374298 987054664 261333031 286123026 850556022 468053716 5825...

output:

1
900
275 175 695 590 393 177 936 394 51 657 417 696 70 717 140 497 659 591 698 123 339 937 439 879 71 767 276 96 178 592 418 313 419 557 180 734 915 161 959 440 181 880 141 370 52 469 441 3 277 960 541 735 395 736 542 36 843 371 124 498 470 442 981 558 631 678 182 251 865 758 612 53 613 796 252 37 ...

result:

ok OK, answer exists, pans = jans = 1

Subtask #9:

score: 20
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Dependency #7:

100%
Accepted

Dependency #8:

100%
Accepted

Test #129:

score: 20
Accepted
time: 14ms
memory: 12188kb

input:

200000 0
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 10000...

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #130:

score: 20
Accepted
time: 15ms
memory: 12728kb

input:

200000 39998
669810484 669810484 669810484 669810484 49585045 669810484 49585045 669810484 669810484 669810484 49585045 669810484 49585045 669810484 669810484 49585045 669810484 669810484 49585045 669810484 669810484 669810484 49585045 49585045 669810484 669810484 49585045 669810484 669810484 669810...

output:

-1

result:

ok OK, no solution

Test #131:

score: 20
Accepted
time: 18ms
memory: 28700kb

input:

200000 146248
418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 335629260 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 418288544 335629260 418288544 418288...

output:

1
146246
80001 1 80002 2 80005 3 80008 4 80009 5 80010 6 80011 7 80013 8 80015 9 80017 10 80018 12 80019 13 80021 14 80023 15 80025 16 80026 17 80029 18 80033 19 80034 20 80035 21 80036 22 80039 23 80040 24 80041 25 80043 26 80044 28 80046 29 80047 30 80050 31 80051 32 80053 33 80054 34 80055 35 800...

result:

ok OK, answer exists, pans = jans = 1

Test #132:

score: 20
Accepted
time: 84ms
memory: 29528kb

input:

200000 200000
1669 335919197 14416 992295708 600956250 748292729 34526 845105590 356854358 207513877 580032971 77792 566318890 539138273 179145160 96966 557400688 957498013 300082825 867572496 102800641 4800971 586656202 621370101 619350378 861815015 146451 645208985 836531389 157671 164075 97538308...

output:

16073
23929
470 632 782 966 1600 1979 1992 2461 2607 2739 2742 2871 2932 2948 3023 3099 3113 3223 3361 3460 3571 3608 3624 3669 3800 3920 3952 4007 4063 4375 4378 4492 4669 4763 4786 4800 4803 4860 4866 4877 4928 4967 5026 5044 5108 5209 5220 5338 5397 5451 5497 5518 5563 5571 5578 5630 5710 5719 57...

result:

ok OK, answer exists, pans = jans = 16073

Test #133:

score: 20
Accepted
time: 95ms
memory: 30328kb

input:

200000 199950
403157156 970867640 883668862 710532149 599369030 772615980 540288068 632861821 735600637 892455380 521864684 688265382 918311157 292189662 225058081 721895419 897469362 419749525 637333457 811165760 294395529 816935938 167107968 14558705 160100225 596184710 814035285 343666957 9815241...

output:

52
50
8109 13531 14808 16135 20790 21393 23924 28079 29068 39287 39590 39779 43897 46891 47080 48225 49688 50239 53284 53576 53722 54133 54948 55154 55433 56436 57924 58956 59671 62309 62693 63210 67260 68379 70667 73810 74227 74324 74554 78288 78400 78647 80783 80950 82174 82884 84440 84705 85180 8...

result:

ok OK, answer exists, pans = jans = 52

Test #134:

score: 20
Accepted
time: 85ms
memory: 38360kb

input:

200000 199000
933681371 120960928 358991519 98660894 390922955 282815623 569329457 32632012 861940505 819766798 784230194 217874594 161016805 560299988 134545306 481931053 191022685 735652080 518771941 690545269 899572828 295935966 479212027 444255222 651922684 889043649 263110517 607521027 87406001...

output:

1
199000
75148 24153 103726 80039 90554 118355 87294 40331 77970 174881 64484 146438 77684 72188 38052 163489 116057 100861 83514 1691 144656 180039 117898 167044 78887 52704 27764 127766 76907 29127 36802 45812 182346 130716 129166 82965 48854 140463 56558 109603 92452 170304 79194 177310 107747 15...

result:

ok OK, answer exists, pans = jans = 1

Test #135:

score: 20
Accepted
time: 60ms
memory: 18412kb

input:

200000 198999
701889248 25967262 760887547 56642962 27707686 618460234 335806426 756738255 594711931 527675595 740966314 978944005 973297725 668754361 814684047 760490557 456853064 927108678 723428123 175746040 733926390 457627567 395978082 172580570 910928733 989271645 854157429 851119671 325227242...

output:

-1

result:

ok OK, no solution

Test #136:

score: 20
Accepted
time: 70ms
memory: 19300kb

input:

200000 200000
195774097 715338233 526691196 617269630 516449963 738477488 659200495 543925246 83998600 415447933 607541007 65623172 70563702 795539225 557749752 828089434 194226646 765036906 574746759 169740782 129909916 239033675 817037528 932190328 819746394 889365547 787422728 381057459 438556866...

output:

100000
2
246 83 
2
768 243 
2
859 470 
2
913 646 
2
1100 977 
2
1186 181 
2
1259 903 
2
1288 894 
2
1483 513 
2
1559 819 
2
1706 1574 
2
1739 1696 
2
1759 239 
2
1984 351 
2
2068 1280 
2
2133 1993 
2
2293 1547 
2
2409 2220 
2
2437 519 
2
2551 864 
2
2792 681 
2
2854 2643 
2
2875 2700 
2
3058 2851 
2...

result:

ok OK, answer exists, pans = jans = 100000

Test #137:

score: 20
Accepted
time: 70ms
memory: 23888kb

input:

200000 200000
970753994 187567902 118987121 188667202 702100951 945803301 159475686 835711341 730196498 260188496 691607208 43650142 570900797 201773308 372479631 177460208 91778075 453719941 844473366 58937550 32488913 174928955 500820451 85988742 705983216 210529301 12009632 878230271 55796133 915...

output:

2
3
25591 192238 195358 
199997
195358 150429 107580 77644 19459 9085 194776 27002 38807 47276 50206 100783 17392 24292 70700 58806 115045 175228 23404 76113 154962 140327 92961 46618 52996 134351 137739 120587 146011 102541 187698 166216 109549 79809 60111 27369 154328 61304 70665 37632 109517 1285...

result:

ok OK, answer exists, pans = jans = 2

Test #138:

score: 20
Accepted
time: 55ms
memory: 22492kb

input:

200000 200000
673363164 673363164 707313276 707313276 374875544 673363164 673363164 707313276 374875544 374875544 374875544 707313276 673363164 673363164 673363164 707313276 673363164 673363164 673363164 707313276 707313276 707313276 673363164 673363164 673363164 673363164 673363164 673363164 673363...

output:

3
66666
37449 92956 37450 26466 37451 15285 37452 80600 37453 71648 37454 2825 37455 1416 37456 30124 37457 75259 37458 183719 37459 188228 37460 19411 37461 73160 37462 22353 37463 6565 37464 8750 37465 28639 37466 81184 37467 194463 37468 13942 37469 8783 37470 74345 37471 2828 37472 14098 37473 1...

result:

ok OK, answer exists, pans = jans = 3

Test #139:

score: 20
Accepted
time: 70ms
memory: 24576kb

input:

200000 200000
714872913 654502510 87872538 805606050 258984811 16069178 831245083 938166374 946370058 441076278 270514255 741437192 879267792 39107712 795435198 657074943 252399176 131890058 961420716 511509248 14276272 321079992 58612814 422236835 354277514 564429487 905340590 21576501 287273805 91...

output:

2
100000
15048 91498 26573 95197 172673 133175 68618 35273 46705 103709 116706 155505 112738 111261 95397 79607 117333 63100 16077 157692 138619 190773 177712 163204 70182 171131 161105 85827 19060 188264 101352 67559 93200 14346 37120 146037 192940 146739 189023 37533 49050 98109 161106 192785 6854...

result:

ok OK, answer exists, pans = jans = 2

Test #140:

score: 20
Accepted
time: 69ms
memory: 25800kb

input:

200000 200000
205979750 900522426 927109572 450383099 345594524 950313250 291783275 410191517 681310917 38984006 727328297 18676089 354445094 72259574 906879101 2725928 636823401 18676089 596416961 601314194 295689977 658311815 18676089 18676089 18676089 18676089 18676089 18676089 821681852 96680835...

output:

2
99999
2643 67229 2644 147777 2645 68124 2646 146659 2647 66058 2648 198728 2649 70287 2650 182583 2651 190913 2652 196861 2653 144820 2654 191375 2655 126291 2656 177109 2657 131568 2658 175023 2659 123687 2660 121220 2661 93989 2662 92105 2663 117907 2664 127391 2665 68205 2666 2597 2667 179702 2...

result:

ok OK, answer exists, pans = jans = 2

Test #141:

score: 20
Accepted
time: 67ms
memory: 27880kb

input:

200000 200000
616183072 524192834 33674938 566977347 84628727 92139789 551031252 624114927 406074439 183001165 240080633 264010495 958325698 47385748 628695217 778138236 693641777 457677901 160872485 347561342 723502231 381564161 737924126 631811263 795604661 811445991 377243426 973792541 264388272 ...

output:

3
3
22987 60034 107485 
169876
107485 180570 60102 105080 154731 16821 132555 90398 2376 103468 9590 165675 199433 157388 134622 29450 132859 131911 54878 54912 193883 9592 16721 18676 14015 89004 38767 76621 173822 74 104722 25736 135890 35056 99165 35524 86516 179934 26068 15226 39578 127516 14300...

result:

ok OK, answer exists, pans = jans = 3

Test #142:

score: 20
Accepted
time: 78ms
memory: 23264kb

input:

200000 200000
822070971 974226008 242994591 556634370 298098543 419250531 160659071 868126137 824126791 874835358 703169220 808888526 999573674 996451235 410078665 697207185 408752368 816610732 268763815 563123919 50533988 763087682 568970514 94157683 295325151 636866270 592090122 651977943 50039153...

output:

2
4
94474 97874 162026 174151 
199996
94474 65968 38047 150290 122279 96244 196043 29992 67621 153231 126030 175896 59242 199866 148556 135215 79318 114462 119211 48163 108451 181392 194897 103508 102451 163659 130037 156869 146303 138221 184885 78907 13759 7637 76892 121665 23545 72107 105842 4463 ...

result:

ok OK, answer exists, pans = jans = 2

Test #143:

score: 20
Accepted
time: 65ms
memory: 23308kb

input:

200000 200000
224151331 533132410 616442576 768115198 521773315 778831077 465586252 774370290 73471631 54571283 996259978 18407287 110643512 578379222 701311989 348208705 57092292 326751203 186051152 789123022 546055087 919174381 730208664 173628895 330085949 843199240 26650706 799013184 817909652 4...

output:

4
3
23434 45657 83795 
135572
23434 119461 114143 69460 137100 48993 114404 170577 94949 108923 99517 187111 23830 31972 77329 114762 84435 171263 52261 168717 183267 47377 195624 139545 41073 43447 105626 85960 180374 80734 91468 26029 171816 189220 55234 110568 143494 62085 35752 34367 4 141614 13...

result:

ok OK, answer exists, pans = jans = 4

Test #144:

score: 20
Accepted
time: 54ms
memory: 21104kb

input:

200000 200000
737859726 415741610 415741610 848330823 848330823 848330823 848330823 415741610 415741610 790484054 790484054 790484054 848330823 737859726 790484054 737859726 737859726 737859726 737859726 848330823 848330823 790484054 790484054 848330823 848330823 737859726 737859726 737859726 415741...

output:

2
5
41328 95271 98316 128740 159793 
199995
41328 68716 159794 583 159795 38843 159796 33535 159797 34956 159798 126551 159799 124989 159800 197419 159801 88474 159802 154356 159803 24728 159804 85118 159805 26672 159806 88156 159807 96684 159808 29968 159809 185088 159810 80022 159811 70469 159812 ...

result:

ok OK, answer exists, pans = jans = 2

Test #145:

score: 20
Accepted
time: 42ms
memory: 15756kb

input:

200000 200000
242995467 242995467 242995467 662284868 662284868 88850577 662284868 662284868 799310826 662284868 889331207 848754264 88850577 726475571 88850577 708810046 391279161 391279161 391279161 391279161 810636987 538546034 655684697 655684697 278957427 655684697 278957427 538546034 655684697...

output:

2
2000
3051 3502 3907 6434 7188 7212 8186 8619 9948 10350 10586 10609 10734 10962 11854 12221 12335 12450 12720 12796 12898 13219 13456 14529 14721 14822 14962 15154 15434 15456 15500 16126 16193 16622 16847 16948 17056 17134 17362 17376 17448 17529 17559 17816 17827 17985 18020 18294 18618 18761 19...

result:

ok OK, answer exists, pans = jans = 2

Test #146:

score: 20
Accepted
time: 21ms
memory: 33340kb

input:

200000 200000
2839432 3565613 4288691 5520091 6663067 6743571 7022525 7530145 7811432 9570990 10574753 10592451 11091807 11460061 11573746 15969036 16290550 18814628 19561794 21858619 23612495 25459004 25503872 26663526 26860177 27329474 29073956 29177352 30604153 30879064 31082698 32319557 33641024...

output:

1
198000
95348 72883 95349 5635 95350 44691 95351 56081 95352 27946 95353 53 95354 84136 95355 61682 95356 89674 95357 89675 95358 5636 95359 89676 95360 44692 95361 11194 95362 22423 95363 84137 95364 16819 95365 22424 95366 16820 95367 67258 95368 54 95369 5637 95370 67259 95371 39100 95372 50330 ...

result:

ok OK, answer exists, pans = jans = 1

Test #147:

score: 20
Accepted
time: 40ms
memory: 14960kb

input:

200000 198000
635183777 635183777 247127149 247127149 247127149 247127149 635183777 247127149 635183777 247127149 247127149 247127149 247127149 635183777 247127149 635183777 247127149 247127149 635183777 247127149 635183777 635183777 635183777 247127149 247127149 247127149 635183777 247127149 635183...

output:

2000
120
3510 2607 3511 12862 190871 2608 3512 78416 190872 2609 12863 77220 78417 12864 78418 3513 78419 190873 2610 12865 78420 77221 3514 2611 3515 77222 190874 12866 190875 12867 78421 3516 190876 77223 2612 78422 77224 190877 2613 77225 12868 78423 12869 2614 190878 78424 12870 190879 12871 351...

result:

ok OK, answer exists, pans = jans = 2000

Test #148:

score: 20
Accepted
time: 48ms
memory: 14796kb

input:

200000 198001
46967278 950649273 404331695 557477604 192709403 976267040 46967278 46967278 404331695 557477604 557477604 192709403 192709403 135982561 544901495 544901495 84241844 544901495 151299679 195958522 84241844 135982561 544901495 151299679 84241844 73747767 135982561 544901495 195958522 842...

output:

2000
71
2957 158601 32236 191801 98447 16352 624 2958 32237 98448 32238 146484 198985 98449 32239 98450 16353 191802 32240 114893 191803 2959 198986 32241 625 114894 16354 626 191804 158602 114895 2960 158603 627 198987 114896 16355 198988 32242 158604 146485 32243 114897 146486 628 191805 629 2961 ...

result:

ok OK, answer exists, pans = jans = 2000

Test #149:

score: 20
Accepted
time: 37ms
memory: 14772kb

input:

200000 197999
508355950 510015335 756069990 508355950 219813 510015335 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 732488756 562981757 372308 309767158 931936016 668518342 725199431 81019034 409...

output:

-1

result:

ok OK, no solution

Test #150:

score: 20
Accepted
time: 27ms
memory: 14932kb

input:

100000 199900
560162419 991214677 691500094 964852927 964852927 964852927 964852927 816165712 373772852 832603713 13506770 86234148 832603713 650625936 373772852 178752 181587 992609524 169874165 867352511 510321796 635610571 917762772 917762772 917762772 917762772 917762772 917762772 917762772 9177...

output:

2
4000
212 771 1480 2084 2547 2641 2814 2886 3035 3098 3154 3178 3397 3411 3532 3549 3612 3798 3830 3916 4278 4292 4505 4597 4646 4677 4679 4772 4849 4879 4893 4916 4945 5468 5509 5539 5617 5635 5684 5805 5914 6073 6190 6406 6523 6663 6691 6788 6861 6899 7126 7407 7482 7536 7745 7814 7966 7989 8010 ...

result:

ok OK, answer exists, pans = jans = 2

Test #151:

score: 20
Accepted
time: 71ms
memory: 17744kb

input:

180000 180239
635490489 540776226 86859942 921038725 392464497 255839026 895853436 743273586 444091432 265634079 691551208 866402967 866402967 866402967 294128498 578727421 253391975 490570847 779368513 779368513 47383519 710598882 826726703 616898368 553409351 659687362 793250045 191654448 95519814...

output:

59763
239
225 984 987 1220 1248 1300 1304 1411 1543 1838 1920 1977 2019 2095 2331 2355 2374 2521 2575 2667 2820 2822 2910 2992 3010 3062 3122 3142 3321 3470 3536 3589 3681 3734 3737 3765 3811 3824 3864 3888 3892 3966 3994 4046 4063 4187 4195 4228 4327 4426 4469 4508 4514 4517 4538 4569 4594 4620 465...

result:

ok OK, answer exists, pans = jans = 59763

Test #152:

score: 20
Accepted
time: 76ms
memory: 21900kb

input:

200000 200000
22993 355263421 697849331 546003948 691283464 376899319 851712838 734188955 34648 219005468 620446028 733850287 320206498 231517908 901497067 901497067 979248043 314680881 349183651 108463 123032 123032 345650831 366862484 366862484 901742577 138336 98299445 359949655 846322030 3517990...

output:

30002
20000
660 987 1018 1121 1287 1335 1530 1721 1738 1881 2299 2548 2622 2726 2748 2753 2913 3111 3182 3241 3312 3368 3534 3626 3699 3877 3886 3987 4083 4261 4321 4465 4529 4691 4763 4923 4942 4963 4969 5030 5154 5177 5190 5367 5389 5420 5427 5461 5513 5563 5573 5575 5589 5630 5651 5662 5878 5880 ...

result:

ok OK, answer exists, pans = jans = 30002

Test #153:

score: 20
Accepted
time: 39ms
memory: 16964kb

input:

200000 200000
144351459 999791877 363529181 904915526 472579601 640000647 33054972 229202098 400739707 533839516 247977468 980802709 625582854 346793279 667166668 100652754 118226993 929599210 234899919 467543595 837277107 265988270 980802709 837277107 929599210 133930557 429866412 234899919 2317467...

output:

2
50
11421 20919 24274 27557 33675 51418 53473 55240 71689 79660 84004 89002 93921 98346 98933 99829 99849 103742 106061 107150 109524 109536 109811 115378 120410 125305 136700 146367 146904 148640 157015 161964 162500 168413 168703 169360 173319 173587 174852 174860 175536 177466 180335 184586 1849...

result:

ok OK, answer exists, pans = jans = 2

Test #154:

score: 20
Accepted
time: 57ms
memory: 17616kb

input:

200000 200000
336782308 798076653 738999708 442717359 51935125 917878901 474870638 157897919 668048851 13917224 742300241 315969171 832017248 180032926 214350136 525512727 733271054 311719876 603953467 621574468 354318366 309910791 691584702 506469613 787004837 259641722 221011305 490018273 71853538...

output:

3
49
15390 18626 21994 39336 43243 43470 45650 54081 55360 55381 58249 58448 65523 68232 68518 68544 68660 68928 71932 78760 78816 83666 87053 87305 92290 92965 94934 97351 99374 100244 100475 100874 103908 110866 114028 115519 115694 118147 118199 124726 129031 137156 145140 152027 152810 157829 15...

result:

ok OK, answer exists, pans = jans = 3

Test #155:

score: 20
Accepted
time: 45ms
memory: 16908kb

input:

200000 200000
153896307 153896307 153896307 153896307 153896307 153896307 153896307 153896307 153896307 153896307 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 269937309 432718324 564270138 846042083 45207985 7121969...

output:

4
48
5955 7199 7868 9790 10731 15832 17122 30625 31204 31900 41979 52519 52660 54521 56468 57514 59191 59449 70107 74555 76897 79537 79809 83801 85642 86635 97305 100328 102560 103650 103877 107885 118965 129075 129422 136223 138052 139942 140022 143675 154431 160684 160771 164365 166194 179072 1806...

result:

ok OK, answer exists, pans = jans = 4

Test #156:

score: 20
Accepted
time: 64ms
memory: 18016kb

input:

200000 200000
134733140 7431105 528521861 854239254 702986671 607007584 986693270 646421627 646421627 85093217 85093217 274450482 583046840 867583582 646421627 364425403 594601455 330674898 851462462 838050291 646421627 358097258 274209505 938653774 500532820 736086406 689381614 479859084 754112069 ...

output:

5
47
5346 5910 10556 12437 13095 25581 27796 31588 33313 33918 33966 47292 62992 63546 63955 64887 65770 66650 69681 72839 74116 77412 82660 86337 87723 98011 100643 103960 107621 108112 118235 120154 125359 125546 133227 133603 143522 143863 144363 152589 157309 157985 162562 172394 178744 180635 1...

result:

ok OK, answer exists, pans = jans = 5

Test #157:

score: 20
Accepted
time: 33ms
memory: 31964kb

input:

200000 200000
813967662 335549812 922674608 922674608 922674608 922674608 922674608 922674608 922674608 531176142 531176142 531176142 531176142 531176142 531176142 531176142 531176142 531176142 994541668 994541668 994541668 994541668 870008780 870008780 555840820 555840820 555840820 606557244 690428...

output:

2
500
386 776 903 933 1005 1304 1360 1784 1891 1939 2006 2049 2093 2101 2149 2247 2373 2510 2542 2597 2640 2699 2731 12568 12598 12759 12818 12867 12888 12941 13034 13070 13161 13230 13289 13327 13337 13372 13397 13426 13506 13612 13687 13747 13750 13757 13789 13822 13875 13919 13976 14020 14079 141...

result:

ok OK, answer exists, pans = jans = 2

Test #158:

score: 20
Accepted
time: 35ms
memory: 31748kb

input:

200000 200000
672092018 612108660 622168717 18338545 755076926 474654027 192455922 621780221 934331844 693081079 997132558 535120236 221213643 694826055 317948421 788430737 458979804 390630407 849982681 538967352 591715909 102858128 375186353 706098369 535120236 210419977 863273352 16866847 31794842...

output:

3
499
1273 1316 5931 6106 6112 6220 7238 7352 8371 8537 8567 10397 10458 10537 10595 11560 11611 11689 11761 11812 12743 12831 13742 13770 13871 14829 14877 14956 101689 101834 101849 102774 102811 102879 103800 103850 103991 104024 104098 104107 104163 104206 104265 104286 104334 104370 104444 1044...

result:

ok OK, answer exists, pans = jans = 3

Test #159:

score: 20
Accepted
time: 33ms
memory: 31768kb

input:

200000 200000
721203757 326892389 164518998 406264651 320187500 623386456 798011827 860681530 18556934 525339498 354539033 458969046 164518998 460304692 555323507 826112277 113887913 85404180 158488968 541480667 143605007 450326179 944557998 206832265 349445784 2670104 617200939 591032373 98110085 7...

output:

2
500
1306 1471 2720 3196 3563 3611 4331 5116 5854 6146 6154 6213 7341 7475 7477 7512 7551 7574 8085 8106 8488 9503 9534 9649 9696 10099 10119 10175 10325 10350 10669 10720 10839 10968 10978 11122 12403 12629 13356 13475 13744 14473 14520 14542 14658 14707 15089 15179 15213 15326 15450 16004 16050 1...

result:

ok OK, answer exists, pans = jans = 2

Test #160:

score: 20
Accepted
time: 35ms
memory: 31964kb

input:

200000 200000
906290493 755915792 496067029 447013681 992883163 535143325 535143325 535143325 535143325 535143325 275948319 728885563 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 535143325 256272...

output:

3
499
2940 3528 3903 4217 4370 5360 6462 6717 7816 8010 8193 8338 8912 8972 9220 9495 9645 9935 10093 10773 10966 11020 11097 11250 11261 11793 11913 12027 12244 12390 12848 13080 13331 13791 14120 14422 14560 14671 14848 15008 15336 15422 15558 15650 15824 15949 16055 16150 16210 16662 16699 17840 ...

result:

ok OK, answer exists, pans = jans = 3

Test #161:

score: 20
Accepted
time: 49ms
memory: 33376kb

input:

200000 200000
569316528 569316528 569316528 569316528 188778549 536594768 532628105 220800341 466949833 243611442 186381618 109723451 785482820 7165628 598896376 201722560 54155919 269144775 27307432 320173323 480953599 951684612 177955379 636976190 364509542 427692988 928663821 360226937 980541530 ...

output:

2
500
1802 2242 2389 2413 2919 3587 3875 4288 4960 5113 6499 6554 6832 7590 8390 8697 9068 9302 9637 9912 9960 9987 10251 10825 10927 11418 11680 12094 12132 12184 12670 12872 12969 13275 13503 13803 14045 14136 14365 14696 14804 15148 15195 15223 15400 15803 15988 16169 16447 16693 16863 17281 1781...

result:

ok OK, answer exists, pans = jans = 2

Test #162:

score: 20
Accepted
time: 60ms
memory: 20312kb

input:

200000 200000
771455301 122019265 768401870 291305469 291305469 672850592 958352057 836525765 10257678 522579878 136661 925648170 745263942 307784523 737401686 603942955 681321280 254577 443100213 712023859 639652946 780107946 573204972 293464 545393386 405193 888956657 778948386 469406 547739906 56...

output:

2
10000
1187 1237 1323 1798 2212 3043 3068 3963 3987 4245 4254 4529 4813 4821 5031 5179 5323 5428 5633 5660 6122 6129 6180 6336 6488 6495 6525 6534 6696 6709 6719 6928 6943 6992 7026 7040 7579 7737 7781 7786 7792 7816 7839 7897 8078 8086 8090 8443 8657 8712 8756 8783 9122 9152 9155 9623 9630 9640 96...

result:

ok OK, answer exists, pans = jans = 2

Test #163:

score: 20
Accepted
time: 63ms
memory: 18792kb

input:

200000 200000
557472292 878537199 76822031 479742848 84890200 313652217 966402259 145184494 754061382 425139619 412545081 679485868 850627363 182188441 91838 90296771 160244629 947930102 938538267 251628221 301117421 31144298 881793046 39176346 951742333 128348525 752198018 941454076 815482857 59811...

output:

1002
4000
1393 2644 2825 3669 4015 4171 4186 4247 4306 4550 4764 4796 5030 5073 5623 5667 5714 6427 6605 7200 7263 7287 7534 7586 7678 7736 8043 8287 8531 9233 9241 9351 9365 9521 9616 9650 9735 9786 10189 10284 10352 10379 10672 10983 10988 11080 11157 11399 11419 11793 11949 12030 12106 12491 1262...

result:

ok OK, answer exists, pans = jans = 1002

Test #164:

score: 20
Accepted
time: 71ms
memory: 19860kb

input:

200000 200000
286129563 147784014 124955057 905617182 661704301 154179729 201708637 94839869 693202321 328316784 806312690 248137750 37828653 618799377 737015416 264691981 198584331 633273714 680807383 105325575 173732149 691479073 858487180 188444 435342042 250546534 239875017 90147019 949068561 15...

output:

2
1000
2592 3835 4486 4549 4610 5404 5488 6110 6152 6722 6831 7168 7739 7849 8501 8945 9315 9972 10026 10176 10463 12198 12680 14744 15131 15176 15239 15420 15434 15806 16024 16160 16766 17115 17626 17629 17701 17842 18240 18310 19005 19431 19546 19628 19770 20058 20460 20913 21346 21587 21667 21916...

result:

ok OK, answer exists, pans = jans = 2

Test #165:

score: 20
Accepted
time: 81ms
memory: 19876kb

input:

200000 200000
953874019 887781059 987406678 837760808 802554157 527837321 180082425 952145241 468169836 14900046 353729481 887282193 855402973 386472368 280007416 952566443 501943764 335735062 740549443 12153783 376816083 871559010 762617067 258666634 16047144 783509341 664549868 118011850 901948430...

output:

9763
239
506 1056 1071 1406 2373 3005 3097 3182 3465 3665 3872 3958 4126 4604 4710 4988 5141 5382 5706 5717 5836 6082 6093 6203 6501 6638 6642 6709 6754 6868 6880 7001 7037 7040 7147 7199 7491 7555 7691 7756 7761 8214 8476 8524 8536 8555 8563 8574 8938 8959 9044 9219 9279 9475 9523 9574 9677 9745 97...

result:

ok OK, answer exists, pans = jans = 9763

Test #166:

score: 20
Accepted
time: 62ms
memory: 17132kb

input:

200000 189999
370738334 944556307 774188996 279210144 142440354 629135772 28937 225698405 597170915 622537551 787205199 703460980 997628525 674452087 754817215 146235817 461754871 805307795 290457885 905447169 535223665 511778710 800278463 164670600 370765680 520868033 652624013 809071072 455827642 ...

output:

-1

result:

ok OK, no solution

Test #167:

score: 20
Accepted
time: 81ms
memory: 34332kb

input:

200000 190000
907599816 917874087 930191854 498889686 898049386 474775341 543505738 326630863 672070914 282609179 155207888 534352086 534511369 606224686 861663633 962280892 533074855 833142719 11392941 876312426 86568 593826256 792888677 361172432 920481631 351872797 438117005 815625647 698925742 7...

output:

1
190000
84439 55237 32047 30343 103231 105656 24572 51170 7601 98491 168909 20887 14600 178057 41395 131505 21911 141933 61306 103895 4161 198873 63464 169880 10494 140439 30997 50510 30466 130211 19845 85263 155274 138108 199012 15569 97471 113468 132398 171463 4863 139738 110518 55562 158697 6341...

result:

ok OK, answer exists, pans = jans = 1

Test #168:

score: 20
Accepted
time: 16ms
memory: 12152kb

input:

200000 0
504 17456 24790 36985 38752 39625 40448 40727 45562 47954 51066 58092 62142 63594 65504 66940 69506 88473 98961 99354 101155 103043 104981 105380 135499 144803 145704 168436 170442 180037 188283 194839 196964 203155 204003 206671 208102 210350 221209 222930 227880 229298 231639 239466 24197...

output:

-1

result:

ok OK, no solution

Test #169:

score: 20
Accepted
time: 65ms
memory: 32940kb

input:

200000 200000
846258126 198487980 47865693 652575554 250286109 161158 179595901 315924148 155231697 43123676 353324969 232746490 46489873 559653689 406343771 286017631 56560549 174131 567204077 48854923 723144403 174131 718525243 40537795 125159942 828837956 931871180 526194124 550500047 281063562 7...

output:

1
190000
14650 122025 39717 115061 20271 60550 52662 63070 119283 184395 11810 169916 63776 152494 53275 164789 118367 10592 74305 160656 70649 22005 95081 78613 195451 126795 30954 125261 63100 130418 103078 159807 7172 35278 191653 131255 39526 190258 43711 24435 129674 115208 85288 6716 120466 12...

result:

ok OK, answer exists, pans = jans = 1

Test #170:

score: 20
Accepted
time: 47ms
memory: 34128kb

input:

200000 190000
26869 77986 571618666 571618666 571618666 129439 199191 571618666 571618666 571618666 571618666 571618666 571618666 248178 253473 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618666 571618...

output:

1
190000
59692 30481 59693 6724 59694 189242 59695 184480 59696 192184 59697 181955 59698 157212 59699 158252 59700 178207 59701 26206 59702 157779 59703 27911 59704 165960 59705 31403 59706 181131 59707 171251 59708 12492 59709 163474 59710 49219 59711 155662 59712 11815 59713 50912 59714 16888 597...

result:

ok OK, answer exists, pans = jans = 1

Test #171:

score: 20
Accepted
time: 43ms
memory: 23084kb

input:

200000 100000
37415 29993549 37415 37415 37415 37415 102985063 37415 90880304 37415 140461294 379828779 667386043 197232652 37415 37415 132822159 342306 238437512 681412943 366150470 342306 334182750 914142821 498233158 91027542 827384964 928403180 342306 996719811 993439901 80408885 342306 47489973...

output:

1
100000
94240 133183 38338 19696 187140 197364 47351 44788 14540 132846 118069 125354 180513 18515 49584 66136 4489 184832 113578 35950 132795 62778 1954 122830 5083 85505 27170 77607 127245 13576 190278 43114 77333 69026 106096 2049 62258 70772 63645 162466 17446 20222 52931 173607 105539 151855 9...

result:

ok OK, answer exists, pans = jans = 1

Test #172:

score: 20
Accepted
time: 83ms
memory: 26348kb

input:

200000 200000
669972406 96100638 815142583 440643953 875674808 299019510 826309916 17949983 999146006 679356395 219214107 123520179 930944649 116669050 413839591 310598704 24660443 995197649 136210846 619890072 60543028 809938592 46170441 530167875 371176655 944294658 590223664 171375 171375 1656213...

output:

10002
20000
406 917 939 1147 1477 1697 1706 2514 2680 2687 2824 2894 2920 2949 3020 3067 3144 3296 3530 3572 3676 3913 4045 4056 4140 4156 4286 4297 4400 4488 4494 4731 4784 4786 4858 4903 4928 5086 5198 5202 5213 5215 5272 5321 5333 5472 5533 5590 5609 5624 5670 5704 5726 5775 5780 5830 5864 5924 5...

result:

ok OK, answer exists, pans = jans = 10002

Test #173:

score: 20
Accepted
time: 46ms
memory: 16464kb

input:

200000 199999
924460167 605110448 304797961 923147788 721148613 732840720 487913813 574917045 178402386 600838252 565114399 578355654 291589135 51268256 405931895 812449561 416123806 435947010 435947010 311898730 420861134 615282131 647107441 604488514 156475051 849212137 796648905 709494166 9316310...

output:

-1

result:

ok OK, no solution

Test #174:

score: 20
Accepted
time: 79ms
memory: 19404kb

input:

200000 199999
273231797 181164733 729238254 445904352 156595678 363621984 39326807 552883104 837895726 847963520 516583926 912841400 153126637 295444358 854469628 336079188 924610264 264647708 879902838 388421728 306787852 234498539 792117888 963206166 808868480 633773728 918645800 793376861 6364879...

output:

39993
9
549 1543 1884 1899 1932 1948 1958 2016 2080 
32
2080 34447 134368 802 2016 178157 1116 1958 139561 591 1948 30192 44800 337 1932 1783 1899 187997 1056 1884 159044 833 1543 86529 102022 39102 182 549 156398 150183 74925 1430 
5
2233 180373 72906 92653 1291 
4
2365 137874 163523 207 
5
2417 15...

result:

ok OK, answer exists, pans = jans = 39993

Test #175:

score: 20
Accepted
time: 55ms
memory: 23200kb

input:

200000 200000
737762705 306907445 49543 720678148 106888478 64062 478025196 220454400 176369775 105735 198668731 121318 93284497 121318 121318 742667931 126857 126857 126857 191491945 372237865 147879 728397049 153539 403033414 812884115 746207429 160045 160045 161474 161474 212032246 176783 5620645...

output:

2
20000
436 571 888 2109 2259 2372 2867 2879 3063 3328 3416 3498 3596 3734 3864 3949 4079 4230 4263 4459 4622 5158 5252 5274 5422 5533 5564 5595 5651 5784 5974 6000 6170 6282 6301 6312 6779 6895 7038 7041 7045 7062 7145 7285 7353 7381 7511 7540 7801 7874 8026 8107 8128 8253 8287 8383 8475 8568 8576 ...

result:

ok OK, answer exists, pans = jans = 2

Extra Test:

score: 0
Extra Test Passed