QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#509684#328. Cycle sortegypt_ioi2024b_04#100 ✓229ms46056kbC++202.2kb2024-08-08 17:15:482024-08-08 17:15:48

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

1 0
2

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #2:

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

input:

1 2
1

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #3:

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

input:

2 1
2 1

output:

-1

result:

ok OK, no solution

Test #4:

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

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: 3616kb

input:

2 0
2 1

output:

-1

result:

ok OK, no solution

Test #6:

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

input:

2 0
1 1

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #7:

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

input:

2 1
1 1

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #8:

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

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: 0ms
memory: 3544kb

input:

5 0
1000000000 1000000000 1000000000 1000000000 1000000000

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #10:

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

input:

1 0
258769137

output:

0

result:

ok OK, answer exists, pans = jans = 0

Test #11:

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

input:

5 0
884430748 884430748 708433020 708433020 708433020

output:

-1

result:

ok OK, no solution

Test #12:

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

input:

5 4
335381650 691981363 691981363 335381650 335381650

output:

1
4
5 3 4 2

result:

ok OK, answer exists, pans = jans = 1

Test #13:

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

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: 5680kb

input:

5 200000
682659092 302185582 518778252 29821187 14969298

output:

2
2
5 1
3
3 4 2

result:

ok OK, answer exists, pans = jans = 2

Test #15:

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

input:

5 4
167616600 574805150 651016425 150949603 379708534

output:

-1

result:

ok OK, no solution

Test #16:

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

input:

5 5
815605413 4894095 624809427 264202135 152952491

output:

2
3
5 2 1
2
4 3

result:

ok OK, answer exists, pans = jans = 2

Test #17:

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

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: 5660kb

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: 1ms
memory: 5840kb

input:

5 6
971458729 608568364 891718769 464295315 98863653

output:

2
2
5 1
3
3 4 2

result:

ok OK, answer exists, pans = jans = 2

Test #20:

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

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: 1ms
memory: 5680kb

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: 5888kb

input:

5 5
641494999 641494999 228574099 535883079 535883079

output:

1
5
5 2 4 3 1

result:

ok OK, answer exists, pans = jans = 1

Test #23:

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

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: 6ms
memory: 5108kb

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: 6100kb

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: 21ms
memory: 27856kb

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
200000 100000 199999 99999 199998 99998 199997 99997 199996 99996 199995 99995 199994 99994 199993 99993 199992 99992 199991 99991 199990 99990 199989 99989 199988 99988 199987 99987 199986 99986 199985 99985 199984 99984 199983 99983 199982 99982 199981 99981 199980 99980 199979 99979 1999...

result:

ok OK, answer exists, pans = jans = 1

Test #27:

score: 5
Accepted
time: 19ms
memory: 27840kb

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: 21ms
memory: 17584kb

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
200000 130761 199998 130759 199997 130755 199996 130751 199994 130750 199993 130747 199992 130743 199991 130738 199990 130735 199988 130734 199987 130732 199986 130729 199984 130726 199983 130723 199980 130720 199979 130716 199978 130711 199977 130705 199976 130703 199974 130700 199973 1306...

result:

ok OK, answer exists, pans = jans = 1

Test #29:

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

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: 6ms
memory: 5868kb

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
104722 196 70361 151 300 69

result:

ok OK, answer exists, pans = jans = 1

Test #31:

score: 5
Accepted
time: 19ms
memory: 27492kb

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: 17ms
memory: 9532kb

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
199997 159996 199995 159986 199994 159979 199991 159977 199990 159968 199989 159962 199987 159950 199986 159940 199984 159927 199983 159922 199982 159920 199980 159917 199979 159899 199977 159894 199974 159890 199973 159884 199972 159874 199970 159858 199969 159839 199968 159836 199967 15983...

result:

ok OK, answer exists, pans = jans = 1

Test #33:

score: 5
Accepted
time: 24ms
memory: 26516kb

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
200000 100000 199999 99999 199998 99998 199997 99997 199996 99995 199995 99994 199994 99993 199993 99992 199992 99990 199991 99989 199990 99988 199989 99987 199987 99985 199986 99984 199985 99983 199984 99982 199983 99981 199982 99980 199981 99979 199979 99978 199978 99977 199977 99976 1999...

result:

ok OK, answer exists, pans = jans = 1

Test #34:

score: 5
Accepted
time: 26ms
memory: 25740kb

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: 16ms
memory: 15156kb

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
199997 120000 199996 119996 199993 119994 199989 119989 199987 119984 199984 119981 199981 119979 199980 119977 199977 119976 199975 119974 199974 119972 199969 119969 199964 119967 199962 119964 199961 119959 199959 119953 199958 119951 199957 119949 199955 119943 199952 119942 199951 11993...

result:

ok OK, answer exists, pans = jans = 1

Test #36:

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

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
99996 23777 99994 23768 99984 23762 99978 23761 99977 23757 99972 23756 99969 23754 99962 23745 99950 23742 99948 23740 99944 23738 99941 23734 99939 23733 99935 23730 99928 23726 99912 23724 99904 23723 99902 23720 99901 23719 99899 23717 99894 23716 99892 23712 99879 23711 99859 23710 9985...

result:

ok OK, answer exists, pans = jans = 1

Test #37:

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

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: 29ms
memory: 26044kb

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
200000 95000 199999 94999 199998 94998 199997 94997 199996 94996 199995 94995 199994 94994 199992 94993 199990 94992 199989 94991 199988 94990 199987 94989 199986 94988 199984 94987 199983 94986 199982 94985 199981 94983 199980 94982 199979 94981 199978 94980 199977 94979 199976 94978 19997...

result:

ok OK, answer exists, pans = jans = 1

Subtask #4:

score: 10
Accepted

Test #39:

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

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
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 915 1085 701 1039 642 828 1227 372 425 903 748 128 480 309 ...

result:

ok OK, answer exists, pans = jans = 1

Test #40:

score: 10
Accepted
time: 78ms
memory: 24692kb

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
45504 39588 84164 86429 33285 48431 30702 59653 35448 56543 47177 74100 76575 64712 54340 84165 66600 55711 18675 58392 72414 95016 78244 60686 16438 58523 85097 58446 45996 80024 16538 82229 84692 6337 94666 32775 36219 19330 74342 47562 97082 57983 60479 37086 90199 69010 37482 66380 9228...

result:

ok OK, answer exists, pans = jans = 1

Test #41:

score: 10
Accepted
time: 52ms
memory: 17528kb

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
24252 20540 79208 14571 46043 21533 38531 33565 23278 38013 8677 10907 3764 20999 9008 38335 52370 66229 33455 19871 24510 48684 51394 48466 74120 16171 53626 70041 12390 20125 70156 77500 29837 71005 67767 48573 75919 49289 52000 49282 27149 39730 41381 38316 57997 43032 6479 5935 46664 336...

result:

ok OK, answer exists, pans = jans = 1

Test #42:

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

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: 81ms
memory: 26988kb

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
89689 95563 64383 51142 36672 54755 54504 10175 78679 72623 41528 98875 48843 46632 55183 16159 16539 1847 70134 44771 70378 19726 81320 40755 32663 13823 62714 82402 40182 25736 36380 46202 3555 83319 91763 99882 3511 5624 78575 69044 81667 54939 64874 8519 38520 99978 58522 75681 1507 12486 ...

result:

ok OK, answer exists, pans = jans = 2

Test #44:

score: 10
Accepted
time: 88ms
memory: 26836kb

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
62488 22847 3234 75894 62104 95120 8862 170 61433 70269 77487 2664 63350 31216 49153 56818 39375 47536 96148 21768 99301 4903 95581
99999
62488 59618 74105 90900 93863 8744 90843 70655 57673 29230 99292 37200 8321 95581 16294 50871 61015 40783 66332 54274 22557 45175 44904 98644 40084 97231 564...

result:

ok OK, answer exists, pans = jans = 2

Test #45:

score: 10
Accepted
time: 87ms
memory: 21696kb

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
45433
10266 13937 20516 81150 65142 33871 72467 77970 15124 43975 40256 73008 42866 50771 64240 48353 68757 48578 6074 93890 3449 16994 82367 37984 57367 52863 14271 59943 54828 53560 30610 27078 83302 89961 20648 66668 86139 84166 80235 3413 46029 92460 81016 90252 96180 64129 36463 66609 79682 2...

result:

ok OK, answer exists, pans = jans = 2

Test #46:

score: 10
Accepted
time: 80ms
memory: 26572kb

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
40445 91528 36675
99445
40445 98855 49592 95827 30174 25117 68122 63649 92772 66329 15645 53678 48644 88851 37375 60010 95988 66724 98434 8982 92502 24446 90344 42109 94315 48313 10786 42218 97362 1377 86613 6284 87984 97256 54497 11433 78361 23836 22497 76717 25642 32377 27737 6689 58311 34478 ...

result:

ok OK, answer exists, pans = jans = 2

Test #47:

score: 10
Accepted
time: 78ms
memory: 28580kb

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
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 21438 4...

result:

ok OK, answer exists, pans = jans = 2

Test #48:

score: 10
Accepted
time: 78ms
memory: 27468kb

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
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 8368 84...

result:

ok OK, answer exists, pans = jans = 2

Test #49:

score: 10
Accepted
time: 86ms
memory: 25656kb

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
41650 36821 23297 32390 10080 22668 22841 48949 71839 11968 86574 47220 44327 82333 67484 95374 91239 14894 44015 80374 15407 97273 87140 38194 27049 11117 17969 37992 82416 56529 67693 10728 3921 74013 60129 70993 53985 37722 21135 45244 19350 99698 58894 90194 22722 69267 3211 82014 43445 ...

result:

ok OK, answer exists, pans = jans = 2

Test #50:

score: 10
Accepted
time: 74ms
memory: 26812kb

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
30192 69146 22746 89542 92266 86631 67852 50511 87440 75856 12619 93967 9202 3877 96526 72989 91357 23262 96213 91850 84114 77504 29360 20809 55415 96061 64303 58913 73666 64471 49403 32493 88321 6431 60587 56001 5970 45610 72713 9030 77545 91492 76086 48210 83646 35545 25077 58278 11131 68489...

result:

ok OK, answer exists, pans = jans = 2

Test #51:

score: 10
Accepted
time: 75ms
memory: 21676kb

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
27471 65890 62663 15159 72957 3385 52622 4100 25334 52502 36882 90403 63663 38122 98895 67292 31995 87004 7409 29381 36512 22407 50856 21625 32686 23657 55058 54398 74179 31270 62097 74281 67777 42857 35698 91668 97198 74663 71577 53071 88878 7856 27877 92512 82224 78692 60126 10084 87691 47...

result:

ok OK, answer exists, pans = jans = 2

Test #52:

score: 10
Accepted
time: 87ms
memory: 27448kb

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
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 72055 5062...

result:

ok OK, answer exists, pans = jans = 2

Test #53:

score: 10
Accepted
time: 90ms
memory: 27764kb

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
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 12777 5540...

result:

ok OK, answer exists, pans = jans = 2

Subtask #5:

score: 10
Accepted

Test #54:

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

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: 1ms
memory: 5820kb

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
419
478 689 43 524 203 851 871 78 486 472 194 826 42 838 897 732 714 595 14 822 224 198 391 944 514 690 279 875 392 505 305 650 372 124 718 709 551 74 588 323 659 497 383 232 730 865 18 890 273 570 412 608 131 874 200 581 185 68 564 702 738 934 814 340 969 471 749 534 773 481 65 839 177 831 995 88...

result:

ok OK, answer exists, pans = jans = 3

Test #56:

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

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
334
198 645 748 738 617 675 480 40 28 417 887 915 706 812 377 763 448 313 978 6 32 300 270 392 870 559 637 882 175 835 939 929 69 359 184 916 201 734 822 391 672 55 649 283 447 540 982 462 65 527 425 77 529 723 95 213 252 440 770 129 636 741 632 406 724 593 279 886 131 176 38 454 759 776 37 853 96...

result:

ok OK, answer exists, pans = jans = 3

Test #57:

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

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
380 924 285
990
380 57 354 209 769 888 232 517 343 299 59 344 624 788 588 490 132 796 884 335 521 82 205 67 102 892 81 844 536 390 210 644 469 774 15 285 998 934 541 869 907 61 519 257 438 992 544 746 112 221 546 703 919 289 856 448 725 194 386 393 755 685 598 181 833 987 913 592 724 325 518 439...

result:

ok OK, answer exists, pans = jans = 2

Test #58:

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

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
328 113 696 411 694 74 381 504 770 873 127 834 171 863 260 898 206 276 484 772 909 612 334 661 958 331 883 830 71 314 189 698 148 765 641 218 207 265 640 891 21 303 865 618 606 394 251 107 571 512 349 651 971 679 552 177 327 62 711 255 47 200 946 531 134 638 400 849 813 443 823 628 938 157 155...

result:

ok OK, answer exists, pans = jans = 2

Test #59:

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

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: 1ms
memory: 5864kb

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: 6000kb

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
214 707 974 784 266 397 601 626 558 927 948 920 961 426 623 772 825 418 148 96 529 750 954 619 138 326 429 998 90 963 375 457 561 140 176 702 719 555 533 849 345 547 678 451 658 281 151 253 282 335 173
618
214 941 186 491 92 173 238 694 202 808 91 335 701 785 819 556 550 960 971 89 282 504 991...

result:

ok OK, answer exists, pans = jans = 51

Test #62:

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

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
469 1
2
836 2
2
645 3
2
201 4
2
533 5
2
235 6
2
605 7
2
717 8
2
739 9
2
454 10
2
743 11
2
609 12
2
51 13
2
604 14
2
847 15
2
885 16
2
990 17
2
638 18
2
490 19
2
892 20
2
592 21
2
359 22
2
472 23
2
161 24
2
158 25
2
240 26
2
121 27
2
724 28
2
159 29
2
390 30
2
476 31
2
387 32
2
746 33
2
980 34
...

result:

ok OK, answer exists, pans = jans = 500

Test #63:

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

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
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 927 962 596 294 362 48 100 91 494 209 473 565 964 687 81 524 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 573 872...

result:

ok OK, answer exists, pans = jans = 263

Test #64:

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

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
67 538 606 918 479 841 217 520 79 691 883 245 612
754
67 917 57 612 921 47 245 41 883 757 34 691 30 79 439 781 25 520 933 302 325 23 217 674 754 20 841 13 479 86 656 352 12 918 253 129 912 6 606 930 160 2 538 756 670 382 391 552 443 910 442 680 572 955 423 225 373 885 478 795 303 257 24 855 16...

result:

ok OK, answer exists, pans = jans = 39

Test #65:

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

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: 5760kb

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
633 752 438 914 256 933 353 484 285 283 284 385 155 613 601 148 242 806
461
633 552 291 806 212 242 147 148 786 120 601 410 100 613 96 155 776 753 273 129 453 125 703 258 182 955 634 966 964 834 991 663 111 856 123 471 586 632 98 143 840 680 832 423 294 666 842 600 549 836 540 363 106 210 77 38...

result:

ok OK, answer exists, pans = jans = 5

Test #67:

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

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: 5796kb

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
831 198 960 905 785 805 501 126 552 385 133 964 540 276 970 293 567 926 374 104 295 713 923 689 586 637 260 772 307 90 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 1...

result:

ok OK, answer exists, pans = jans = 1

Subtask #6:

score: 15
Accepted

Dependency #5:

100%
Accepted

Test #69:

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

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: 97ms
memory: 22736kb

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
190882 185615 155103 157239 57401 108521 65600 23829 169685 79108 152689 127305 21819 197690 68600 174169 53718 58411 76648 75388 95417 138385 133420 127030 16589 39719 180327 93383 133671 7281 57282 67877 137134 184455 141364 46588 16358 64609 92670 102658 182778 51632 122444 95668 40221 524...

result:

ok OK, answer exists, pans = jans = 3

Test #71:

score: 15
Accepted
time: 73ms
memory: 16596kb

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: 131ms
memory: 28732kb

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
194594 10715 183710
67899
194594 135332 113950 64393 38993 42084 120311 190114 132010 76900 115773 1906 165995 54468 159165 52199 46060 89562 40249 188507 34028 43256 26167 92940 193319 77455 169674 158096 65306 38534 107477 178859 110853 115885 157305 5657 190571 107892 72104 44183 22056 20588 ...

result:

ok OK, answer exists, pans = jans = 2

Test #73:

score: 15
Accepted
time: 222ms
memory: 38412kb

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
27350 41638 132462 61151 40649 78988 88151 107320 139500 48557 140681 90758 17479 35349 192003 12747 76775 145242 160115 25721 81432 96600 177665 101165 162184 195413 99458 156671 151815 97041 166580 144917 110431 166472 41647 188502 158803 108214 123237 60578 140619 82144 110968 48392 1862...

result:

ok OK, answer exists, pans = jans = 2

Test #74:

score: 15
Accepted
time: 213ms
memory: 37888kb

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: 200ms
memory: 43148kb

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: 173ms
memory: 39068kb

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
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 549...

result:

ok OK, answer exists, pans = jans = 9880

Test #77:

score: 15
Accepted
time: 189ms
memory: 36916kb

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
178149 31604 33005 152324 38601 27194 32733 93099 24313 3297 174750 30179 64185 189755 32535 37964 158265 122679 100405 10803 164055 136168 155290 96055 161357 14074 139638 72477 96886 133315 135182 50395 12752 126982 80067 126132 158221 150625 162805 144403 50368 111015 174432 56531 179...

result:

ok OK, answer exists, pans = jans = 39686

Test #78:

score: 15
Accepted
time: 188ms
memory: 31384kb

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
39018 1
2
143114 2
2
105231 3
2
123355 4
2
103194 5
2
147756 6
2
131868 7
2
108627 8
2
16847 9
2
82863 10
2
121458 11
2
13103 12
2
14076 13
2
159140 14
2
111429 15
2
165648 16
2
38699 17
2
153023 18
2
114872 19
2
33889 20
2
26001 21
2
47652 22
2
163364 23
2
186475 24
2
163949 25
2
177924 26...

result:

ok OK, answer exists, pans = jans = 100000

Test #79:

score: 15
Accepted
time: 148ms
memory: 34188kb

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
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 130110...

result:

ok OK, answer exists, pans = jans = 31229

Test #80:

score: 15
Accepted
time: 200ms
memory: 43172kb

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
82162 124649 4067 9848 117280 45416 100265 60956 130234 185509 186138 174402 152874 28308 64111 55187 195351 69716 84697 45472 149833 152795 26419 134030 156982 69301 164896 123642 41927 197727 72545 142468 78437 139514 136333 62391 127945 69670 147179 68752 136190 16868 47111 83670 40983 18...

result:

ok OK, answer exists, pans = jans = 149

Test #81:

score: 15
Accepted
time: 210ms
memory: 26996kb

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: 144ms
memory: 32900kb

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
148466 25521 180636 54766 102475 134162 116577 76589 129225 21447 145121 26262 81370 144719 29742 192344 77392 25320 178853 74583 5487 54620 84675 125526 140677 52422 86782 74029 25663 199086 77143 118677 177896 161109 47435 105634 1607 176431 19457 82370 176184 90353 91784 27337 145125 121...

result:

ok OK, answer exists, pans = jans = 1

Test #83:

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

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
99336 11941 84155 44331 61638 95568 15247 82605 31962 96368 6511 51815 52375 96419 61395 97665 41858 95651 58058 43558 93111 73959 58188 65593 32520 88182 99083 91394 43194 29121 27566 45942 785 25758 91457 72601 88240 45452 38341 77496 67536 75684 13741 9583 53470 36526 39367 71824 72403 18...

result:

ok OK, answer exists, pans = jans = 12

Subtask #7:

score: 15
Accepted

Test #84:

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

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: 14ms
memory: 10344kb

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
89997 30000 89995 29998 89991 29996 89989 29995 89987 29994 89984 29993 89983 29992 89980 29991 89979 29990 89975 29988 89970 29987 89968 29986 89964 29984 89962 29983 89960 29981 89956 29980 89951 29979 89950 29977 89948 29975 89944 29974 89942 29972 89941 29971 89938 29969 89933 29968 8993...

result:

ok OK, answer exists, pans = jans = 1

Test #86:

score: 15
Accepted
time: 81ms
memory: 26852kb

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
39446 54218 21493 17738 47954 86942 23823 26283 7386 81815 68741 90199 46434 24186 30066 9089 67690 25326 15258 92457 5044 74279 38858 13523 83237 75345 55667 24372 93344 59796 5913 64058 4195 62595 99452 35941 66017 23505 49746 39106 75446 5662 45733 50064 11614 24737 78927 99478 8815 60290...

result:

ok OK, answer exists, pans = jans = 2

Test #87:

score: 15
Accepted
time: 84ms
memory: 27464kb

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
12525 29713 75212 53714 16853 62154 34165 82260 69268 53045 90901 61023 9301 9061 83594 26775 76981 59089 39759 74470 17241 87053 64080 92042 80162 28611 10274 47805 84983 35479 32637 70062 4467 62670 69900 93122 18657 22007 80623 25416 80594 67607 96308 85964 30404 38393 17135 33787 73449 9...

result:

ok OK, answer exists, pans = jans = 2

Test #88:

score: 15
Accepted
time: 27ms
memory: 15176kb

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
26251 98314 99624 98289 99222 98151 99206 98058 98910 97904 98898 97569 98857 97555 98768 97450 99744 97228 97390 99735 97319 99557 97189 99547 96922 99505 96883 99238 96801 99060 96630 99048 96567 98837 96534 98820 96322 99760 95988 99588 95917 99578 95771 99494 95745 99434 95731 99408 9554...

result:

ok OK, answer exists, pans = jans = 1

Test #89:

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

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
22256 77957 88889 99991 88887 99978 88872 99966 88856 99965 88844 99935 88842 99934 88838 99929 88832 99912 88829 99911 88820 99909 88799 99905 88795 99903 88785 99900 88777 99889 88771 99876 88757 99869 88755 99859 88744 99849 88743 99847 88735 99845 88734 99814 88733 99813 88729 99811 8871...

result:

ok OK, answer exists, pans = jans = 1

Test #90:

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

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
17609 99974 95681 99962 95593 99942 95592 99932 95571 99907 95537 99894 95534 99890 95533 99887 95520 99841 95505 99793 95497 99780 95489 99722 95453 99708 95451 99677 95419 99670 95385 99660 95370 99653 95350 99640 95330 99584 95300 99570 95285 99555 95255 99517 95227 99482 95217 99474 9520...

result:

ok OK, answer exists, pans = jans = 1

Test #91:

score: 15
Accepted
time: 29ms
memory: 15532kb

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
11625 99809 99165 98751 99986 98629 99942 97870 99966 99250 98618 99641 98322 98718 99389 99132 98688 98442 99631 98338 98479 99761 97782 99941 97065 99814 99232 98160 98257 99654 97672 98287 98542 97823 99534 98987 96990 99655 96291 98229 97850 99500 95835 99788 99251 94145 98255 98670 9551...

result:

ok OK, answer exists, pans = jans = 1

Test #92:

score: 15
Accepted
time: 46ms
memory: 19844kb

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
24122 81577 98679 78609 59010 75407 75075 66003 96309 99502 81386 93168 79678 73539 84314 96973 58510 68175 79446 85031 82850 86710 47802 94003 75705 88366 67190 97951 97892 70934 85034 48747 98868 60737 9408 88678 63839 84308 74855 55045 93374 84636 89403 68285 99003 96801 62783 85446 7803...

result:

ok OK, answer exists, pans = jans = 1

Test #93:

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

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
76025 99999 76545 99997 61229 99996 59962 99994 85312 99993 89381 99991 89622 99990 93197 99988 89827 99987 61153 99986 60801 99984 81931 99982 93238 99980 89021 99979 78405 99978 62688 99977 87749 99976 83017 99975 78992 99974 86437 99972 72795 99970 80734 99967 78919 99966 60420 99965 8883...

result:

ok OK, answer exists, pans = jans = 1

Test #94:

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

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
89095 99998 88486 99997 88252 99996 87911 99995 87683 99993 87613 99992 85687 99991 85104 99990 84471 99989 83373 99988 82505 99986 81303 99985 79816 99984 79315 99983 78535 99982 78226 99981 77861 99980 77555 99979 74781 99978 74461 99977 74451 99976 72150 99975 71752 99974 71221 99973 7015...

result:

ok OK, answer exists, pans = jans = 1

Test #95:

score: 15
Accepted
time: 27ms
memory: 14236kb

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
74797
92333 100000 91568 99999 88924 99998 88694 99997 88516 99996 81198 99995 79291 99994 76644 99993 74985 99992 73948 99991 73701 99990 69862 99989 64297 99988 64096 99987 62690 99986 59951 99985 59870 99984 59853 99983 57327 99982 55772 99981 88094 99980 86501 99979 83780 99978 83579 99977 831...

result:

ok OK, answer exists, pans = jans = 2

Test #96:

score: 15
Accepted
time: 39ms
memory: 15496kb

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
64462 74310 57575 5161 6352 6524 24609 80096 76950 32926 95922 34903 77857 65640 70905 34226 44259 22089 38306 19067 9989 77624 57364 99225 4447 82588 97980 17038 32471 71687 40092 48348 47725 96482 29414 80889 2342 63190 19593 66137 73797 42681 74403 57665 10720 72413 65628 73566 79481 6514...

result:

ok OK, answer exists, pans = jans = 2

Test #97:

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

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
79784 99989 89933 99982 89930 99971 89911 99969 89906 99967 89896 99959 89894 99956 89881 99955 89880 99953 89879 99943 89847 99933 89836 99931 89831 99926 89825 99925 89821 99924 89816 99921 89814 99894 89811 99891 89804 99880 89790 99878 89786 99873 89771 99863 89770 99780 89767 99772 8974...

result:

ok OK, answer exists, pans = jans = 2

Test #98:

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

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
89752
99647 54471 99641 54470 99639 54469 99620 54468 99612 54467 99600 54466 99596 54465 99583 54464 99577 54463 99567 54462 99556 54461 99553 54460 99538 54459 99534 54458 99525 54457 99524 54456 99516 54455 99509 54454 99484 54453 99469 54452 99449 54451 99445 54450 99439 54449 99435 54448 9942...

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: 0ms
memory: 5812kb

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: 1ms
memory: 5628kb

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: 1ms
memory: 5956kb

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
1000 700 999 699 998 697 997 694 996 689 995 688 994 684 993 677 992 674 991 673 990 672 989 670 988 669 987 665 986 661 985 660 984 658 983 657 982 656 981 653 980 652 979 648 978 646 977 644 976 643 975 642 974 638 973 636 972 635 971 633 970 632 969 631 968 629 967 627 966 626 965 625 964 6...

result:

ok OK, answer exists, pans = jans = 1

Test #102:

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

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 769 330 42 341 175 689 123 533 153 718 583 995 690 59 846 490 708 307 101 474 275 472 558 447 773 127 228 953 513 305 989 627 145 579 958 881 928 609 231 785 786 621 814 259 956 585 570 211 598 582 225 448 459 357 951 220 306 244 716 616 591 294 917 301 310 488 837 679 731 732 554 804 620 3...

result:

ok OK, answer exists, pans = jans = 2

Test #103:

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

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
726 694 17 648 417 139 963 634 893 416 57 655 190 325 24 598 170 488 319 528 604 33 847 393 320 733 817 607 390 656 50 427 600 915 946 841 658 62 455 370 894 117 759 310 881 965 499 558 711 481
258
726 73 481 533 277 544 515 72 711 459 71 558 897 535 69 499 451 67 965 858 103 331 868 65 881 6...

result:

ok OK, answer exists, pans = jans = 152

Test #104:

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

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: 2ms
memory: 5984kb

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
835 444 704 644 262 188 258 916 715 89 460 153 155 51 11 1000 806 178 869 406 14 899 741 761 535 402 596 280 919 581 95 226 895 122 973 329 976 858 647 979 698 13 952 948 917 512 450 664 2 436 358 240 827 702 666 868 440 477 673 579 302 832 455 36 766 430 980 456 911 8 961 167 904 259 124 495 ...

result:

ok OK, answer exists, pans = jans = 1

Test #106:

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

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
82 304 12 404 941 929 498 289 217 732 83 639 600 686 942 212 575 198 292 913 596 272 864 20 402 572 653 879 414 281 789 441 341 591 467 782 311 881 176 991 513 188 726 743 171 779 670 777 159 210 241 683 53 514 346 199 134 920 692 637 71 428 135 214 668 373 968 125 784 319 489 473 767 523 840...

result:

ok OK, answer exists, pans = jans = 1

Test #107:

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

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
469 1
2
836 2
2
645 3
2
201 4
2
533 5
2
235 6
2
605 7
2
717 8
2
739 9
2
454 10
2
743 11
2
609 12
2
51 13
2
604 14
2
847 15
2
885 16
2
990 17
2
638 18
2
490 19
2
892 20
2
592 21
2
359 22
2
472 23
2
161 24
2
158 25
2
240 26
2
121 27
2
724 28
2
159 29
2
390 30
2
476 31
2
387 32
2
746 33
2
980 34
...

result:

ok OK, answer exists, pans = jans = 500

Test #108:

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

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
699 89 417 717 551 436 965 388 275 325 979 863 68 763 762 492 554 296 838 408 194 412 43 489 103 883 585 366 391 425 570 491 262 315 195 781 944 970 299 322 467 135 116 837 289 329 753 602 427 118 345 435 433 815 816 74 517 967 341 735 638 972 908 900 560 258 610 126 587 166 637 911 537 829 95...

result:

ok OK, answer exists, pans = jans = 3

Test #109:

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

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
356 81 496 922 692 635 234 509 493 715 696 965 268 664 242 574 424 412 608 982
476
354 164 353 163 352 162 351 161 350 160 349 159 348 158 345 157 344 156 341 155 338 154 337 153 335 152 356 942 980 941 977 940 976 939 975 938 974 937 970 936 969 935 968 934 973 693 933 983 782 979 781 966 780...

result:

ok OK, answer exists, pans = jans = 22

Test #110:

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

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
948 630 515 577 692 927 598 457 660 390 309 827 115 427 310 721 369 973 1000 799
508
948 848 546 801 56 800 687 108 271 686 55 799 894 669 760 893 668 761 999 609 667 762 431 561 610 433 759 204 560 432 758 50 1000 993 792 995 974 274 994 48 991 977 699 277 701 976 46 992 789 594 971 794 47 97...

result:

ok OK, answer exists, pans = jans = 22

Test #111:

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

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
12
421 370 419 369 143 418 368 865 2 142 420 1
10
489 429 491 101 430 100 490 4 431 3
11
936 723 935 721 934 720 933 722 536 724 5
38
260 661 259 660 258 659 255 658 245 657 244 656 242 655 251 545 250 544 249 543 248 542 247 541 246 540 243 539 257 11 256 10 254 9 253 8 252 7
25
731 929 415 928 ...

result:

ok OK, answer exists, pans = jans = 40

Test #112:

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

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
27
511 863 508 862 507 861 505 860 504 859 500 858 512 8 510 7 509 6 506 5 503 4 502 3 501 201 2
26
536 923 534 927 19 530 926 16 925 13 924 12 922 10 921 18 537 17 535 15 533 14 532 11 531 9
12
662 24 721 416 722 25 661 23 418 22 417 21
15
987 196 986 195 991 177 989 176 985 175 990 614 174 988 ...

result:

ok OK, answer exists, pans = jans = 40

Test #113:

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

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: 1ms
memory: 5652kb

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: 1ms
memory: 3612kb

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
8
556 4 945 2 944 3 555 1
12
38 942 9 37 941 8 940 7 36 6 35 5
6
474 926 11 925 473 10
4
668 13 535 12
11
718 323 717 17 715 16 714 15 716 324 14
3
177 483 18
6
859 538 20 858 537 19
3
129 799 21
9
518 25 948 24 947 23 949 517 22
10
695 436 693 28 694 435 27 692 434 26
3
928 863 29
10
174 966 17...

result:

ok OK, answer exists, pans = jans = 125

Test #116:

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

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
333 406 901 976 600 379 303 651 872 299 752 423 404 873 418 411 903 979 929
805
333 753 420 929 553 402 979 750 906 749 599 905 400 408 399 903 596 410 597 355 595 354 409 353 411 927 954 425 417 426 352 418 909 576 956 432 414 748 351 873 405 320 404 419 751 319 423 430 926 428 413 427 350 429...

result:

ok OK, answer exists, pans = jans = 3

Test #117:

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

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
722 322 859 194 292 231 537 624 420 636 276 568 742 695 389 769 846 628 625
977
718 915 868 913 860 912 717 910 865 899 927 898 925 907 861 931 840 930 418 929 836 864 903 725 839 656 843 906 970 882 726 654 837 902 967 650 968 715 917 646 964 713 869 885 514 966 485 509 916 711 881 722 909 602...

result:

ok OK, answer exists, pans = jans = 3

Test #118:

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

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
43 453 467 58 142 685 543 932 405 955 455 982 731 436 681 454 330 421 635
975
43 814 636 746 633 546 634 441 637 422 635 314 837 984 313 421 781 981 651 291 330 567 263 420 262 454 202 668 457 730 260 456 261 183 681 168 722 551 169 220 167 436 652 210 592 604 836 157 731 514 983 301 434 102 98...

result:

ok OK, answer exists, pans = jans = 3

Test #119:

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

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
579 929 353 47 801 281 788 948 278 601 497 263 969 696 420 671 938 806 499
978
579 820 498 818 500 496 499 428 805 427 804 426 803 425 802 424 806 695 374 938 792 673 646 791 672 417 670 203 671 423 337 422 201 421 200 419 199 420 183 418 940 182 819 181 696 986 966 985 964 990 835 981 833 972 ...

result:

ok OK, answer exists, pans = jans = 3

Test #120:

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

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
367 91 714 294 864 276 253 971 580 443 185 309 705 694 371 405 465 578 598
974
367 881 599 368 600 341 598 439 579 322 578 784 463 757 466 469 467 342 464 296 465 470 737 404 710 402 524 403 290 405 736 372 468 370 289 371 880 690 879 687 878 686 877 677 876 656 875 625 874 657 762 622 761 614 ...

result:

ok OK, answer exists, pans = jans = 3

Test #121:

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

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
272 996 184 514 180
981
272 270 90 180 424 516 515 89 514 88 184 511 984 510 964 509 963 508 956 507 954 506 945 505 941 504 937 503 936 502 932 501 929 500 926 499 918 498 913 497 904 496 899 495 896 494 891 493 890 492 884 491 883 490 877 489 876 488 874 487 868 486 842 485 835 484 822 483 817...

result:

ok OK, answer exists, pans = jans = 7

Test #122:

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

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
414 49 265 311 106
17
414 259 5 106 131 4 311 105 3 265 90 2 49 86 134 85 1
5
21 210 119 22 6
5
302 116 301 744 7
3
195 12 8
5
137 89 816 136 9
4
420 750 419 10
5
41 212 42 177 11
5
799 112 798 111 13
4
888 875 889 14
2
961 15
5
406 209 129 407 16
5
297 58 298 216 17
3
205 292 18
5
822 876 20 5...

result:

ok OK, answer exists, pans = jans = 97

Test #123:

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

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
923 171 979 912 891 91 569 610 205 823
990
919 849 920 631 831 918 615 843 613 839 623 929 549 925 540 848 531 830 536 924 463 827 529 921 466 916 446 847 438 841 465 928 383 837 629 454 927 382 825 435 926 399 913 381 838 379 836 378 834 388 931 304 833 373 930 299 917 300 846 292 845 280 840 ...

result:

ok OK, answer exists, pans = jans = 2

Test #124:

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

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 362 172 226 36 756 535 126 262 560 519 488 600 710 720 395 285 975 913 604 182 842 557 857 554 330 422 676 919 925 748 735 443 699 797 969 768 493 967 781 509 295 741 515 754 475 306 607 707 867 538 653 370 802 437 364 698 905 253 290 734 994 612 884 670 530 452 428 615 914 809 601 502 649 ...

result:

ok OK, answer exists, pans = jans = 2

Test #125:

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

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
59 584 894 777 957 941 916 833 811 878 914 954 944 847 801 736 949 861 986 977 991 760 907 863 924 904 726 984 535 983 979 785 800 887 989 871 860 992 776 789 866 390 666 885 773 806 978 620 802 964 889 942 759 782 842 900 729 975 683 963 821 758 893 707 783 946 670 974 627 886 857 709 958 870...

result:

ok OK, answer exists, pans = jans = 1

Test #126:

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

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
577 1000 525 999 505 998 488 997 487 995 853 994 796 993 718 992 702 991 882 990 879 989 860 988 769 987 766 986 604 985 523 984 485 983 889 982 765 981 751 980 705 979 592 978 434 977 870 976 771 975 456 974 453 973 442 972 755 971 647 970 619 969 598 968 593 967 468 966 915 965 856 964 825 9...

result:

ok OK, answer exists, pans = jans = 1

Test #127:

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

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
282 888 960 874 958 869 924 868 914 864 980 778 843 976 774 811 969 772 804 964 790 961 788 956 783 939 779 917 757 910 751 902 771 891 765 887 759 879 756 878 754 875 752 870 743 867 733 856 732 848 719 844 707 838 703 826 701 825 749 984 679 822 735 977 662 816 727 965 656 810 718 963 640 80...

result:

ok OK, answer exists, pans = jans = 1

Test #128:

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

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
277 966 992 955 882 854 980 836 985 907 838 850 969 785 987 921 784 984 705 819 848 886 779 853 909 743 991 944 923 713 986 813 883 773 846 902 582 994 763 911 930 668 889 922 661 821 832 975 725 968 511 988 493 990 691 978 874 957 803 584 959 442 998 645 887 919 723 845 954 517 973 682 586 82...

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: 16ms
memory: 5608kb

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: 18ms
memory: 11184kb

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: 21ms
memory: 21668kb

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
200000 80000 199997 79999 199996 79998 199994 79997 199993 79995 199991 79994 199990 79993 199988 79992 199986 79991 199985 79990 199984 79989 199982 79988 199979 79987 199978 79986 199975 79985 199974 79984 199971 79982 199970 79981 199968 79980 199967 79979 199966 79978 199964 79977 19996...

result:

ok OK, answer exists, pans = jans = 1

Test #132:

score: 20
Accepted
time: 193ms
memory: 40384kb

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
66954 198401 120193 149650 168869 71330 41629 116121 113400 107861 111620 191223 59906 173329 966 117402 124319 123926 172230 129086 167143 194881 152346 95494 79785 171186 71378 52715 165454 86193 74704 13122 114673 12855 195094 97630 11381 65388 80191 74171 142130 66377 37464 159231 84...

result:

ok OK, answer exists, pans = jans = 16073

Test #133:

score: 20
Accepted
time: 222ms
memory: 41292kb

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
80572 194099 176700 142360 120160 154632 126723 147357 178490 104424 137892 58636 45221 144647 179562 83937 127629 33538 119540 162860 68797 19758 54933 1514 80586 165140 113499 41026 66554 110283 140259 52365 104786 13795 109621 75713 159876 38377 15461 184144 180547 22183 146568 18904 117575...

result:

ok OK, answer exists, pans = jans = 52

Test #134:

score: 20
Accepted
time: 229ms
memory: 46056kb

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
186849 95137 96317 88736 110794 21383 3576 7703 163382 18225 76167 49088 169361 162920 72446 155939 118262 181186 137653 4971 150661 135146 42178 84370 84579 164213 10159 167701 5804 173005 49221 31783 93309 88356 26287 87715 29256 179751 63124 198937 191926 48823 181998 88934 59751 46739 3...

result:

ok OK, answer exists, pans = jans = 1

Test #135:

score: 20
Accepted
time: 210ms
memory: 45928kb

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: 195ms
memory: 31288kb

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
39018 1
2
143114 2
2
105231 3
2
123355 4
2
103194 5
2
147756 6
2
131868 7
2
108627 8
2
16847 9
2
82863 10
2
121458 11
2
13103 12
2
14076 13
2
159140 14
2
111429 15
2
165648 16
2
38699 17
2
153023 18
2
114872 19
2
33889 20
2
26001 21
2
47652 22
2
163364 23
2
186475 24
2
163949 25
2
177924 26...

result:

ok OK, answer exists, pans = jans = 100000

Test #137:

score: 20
Accepted
time: 120ms
memory: 29824kb

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
193871 37299 122296
199997
193875 181191 129326 104358 173421 157069 166001 192927 151897 153371 165152 192509 187064 194162 141723 168534 142118 54770 188118 166905 174231 189406 156008 195433 166946 196954 141467 197774 177250 188239 169794 197769 163457 166902 180417 109981 38495 191736 89469...

result:

ok OK, answer exists, pans = jans = 2

Test #138:

score: 20
Accepted
time: 92ms
memory: 21300kb

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
113669 199995 130578 199990 116749 199989 119574 199981 125304 199980 118934 199979 107286 199978 100343 199977 108503 199975 121982 199973 110458 199972 106387 199971 123062 199969 120635 199967 133283 199966 101676 199964 127252 199959 133572 199953 124787 199952 124740 199951 107368 19995...

result:

ok OK, answer exists, pans = jans = 3

Test #139:

score: 20
Accepted
time: 103ms
memory: 23100kb

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
99999
143242 102552 193254 98966 178148 173343 156858 128203 146933 191808 198831 184948 168313 162171 189398 173917 193422 178143 192385 190274 176468 198819 183445 199701 177898 160938 71505 193455 190806 186695 83803 194802 171049 193998 151951 198307 195836 197565 184356 182411 199169 196557 1...

result:

ok OK, answer exists, pans = jans = 2

Test #140:

score: 20
Accepted
time: 117ms
memory: 26096kb

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
80817 107349 175713 120969 157355 73927 102525 154319 112443 86320 123341 143749 190127 148898 147032 192326 159663 194111 188245 107083 189548 126352 170655 198731 182660 181447 113603 108139 155515 152548 178686 89202 103051 159771 93983 135675 197782 114816 161508 178504 171276 187486 196...

result:

ok OK, answer exists, pans = jans = 2

Test #141:

score: 20
Accepted
time: 101ms
memory: 25716kb

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
123173 36941 162709
155111
123164 183074 174506 193788 194400 180433 197034 170696 191339 160841 189346 176303 196911 199693 107553 192654 189189 191152 198236 198168 199971 186322 149312 198586 195727 158938 198580 182627 164527 178250 186108 197318 191819 187405 179539 197492 195089 183293 199...

result:

ok OK, answer exists, pans = jans = 3

Test #142:

score: 20
Accepted
time: 138ms
memory: 33360kb

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
164594 195090 31872 152478
199996
164594 108842 109750 154905 181936 160452 106560 48112 142382 116185 141173 138305 148678 165163 180948 152683 178503 70699 193376 161117 185113 112535 117729 150945 193450 67159 169491 148684 128121 173662 172086 180000 194836 174630 194576 195141 58896 130269 ...

result:

ok OK, answer exists, pans = jans = 2

Test #143:

score: 20
Accepted
time: 98ms
memory: 24560kb

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
41590 142759 151186
121368
41590 200000 149038 199999 155805 199973 155036 199972 147398 199971 151634 199968 148243 199947 147720 199923 156984 199911 154716 199910 147070 199909 152526 199908 161501 199903 156900 199902 146125 199901 157407 199864 161553 199856 159860 199855 155219 199854 1475...

result:

ok OK, answer exists, pans = jans = 4

Test #144:

score: 20
Accepted
time: 86ms
memory: 33396kb

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
110619 56300 168899 138403 95271
199995
110619 16962 197102 16960 94590 16965 87669 16964 85053 16966 81845 16959 78742 16963 76487 16961 76486 16968 67885 16958 35924 16967 28660 16957 95271 199998 143823 199997 144408 199992 136344 199991 133832 199990 146374 199989 140557 199988 149554 199984...

result:

ok OK, answer exists, pans = jans = 2

Test #145:

score: 20
Accepted
time: 52ms
memory: 26980kb

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
47129 132094 76418 161351 151646 88477 144284 198665 110832 16712 58473 159041 181430 57961 142311 8621 58161 130345 106723 152573 17524 22216 17447 125643 87163 152773 142033 77103 124225 107856 131585 65813 75390 91984 37321 183147 115087 70906 132146 115441 67963 59575 61648 35499 69661 17...

result:

ok OK, answer exists, pans = jans = 2

Test #146:

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

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
194397 199979 194389 199978 194379 199977 194375 199976 194358 199975 194341 199974 194339 199973 194335 199972 194324 199971 194295 199970 194292 199969 194285 199968 194268 199967 194212 199966 194167 199965 194165 199964 194141 199963 194120 199962 194111 199961 194091 199960 194077 1999...

result:

ok OK, answer exists, pans = jans = 1

Test #147:

score: 20
Accepted
time: 44ms
memory: 10724kb

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
118
126634 58 126633 56 126632 49 126631 44 126630 43 126629 40 126628 38 126627 36 126626 34 126625 33 126624 30 126623 29 126622 27 126621 23 126620 22 126619 21 126618 19 126617 16 126616 14 126615 9 126614 7 126613 2 126612 59 48577 57 48576 55 48575 54 48574 53 48573 52 48572 51 48571 50 4...

result:

ok OK, answer exists, pans = jans = 2000

Test #148:

score: 20
Accepted
time: 56ms
memory: 11136kb

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
85
9966 190043 194738 190042 134204 188864 194737 110570 188862 194736 110558 190040 134206 194741 79795 188861 110567 134203 110565 194739 79793 190045 79791 190038 79789 190044 38911 134208 38919 190037 79794 110571 38916 79790 110569 38917 194740 6 194735 9 79788 110566 38920 110564 38912 11...

result:

ok OK, answer exists, pans = jans = 2000

Test #149:

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

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: 32ms
memory: 17340kb

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
55613 98933 68644 81382 99064 86639 91627 75688 59258 36312 32596 6190 88984 47739 35452 63970 47546 71605 43723 87609 92313 8306 13352 69558 10461 32097 90111 73191 24311 93536 74318 71934 11974 67183 90014 26438 63727 24357 1480 17243 43965 55064 85900 46523 42896 47425 98282 80208 240 2450...

result:

ok OK, answer exists, pans = jans = 2

Test #151:

score: 20
Accepted
time: 159ms
memory: 25000kb

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
114457 97284 165883 70752 46131 161319 133797 47939 124439 155897 53243 104165 45680 88268 140391 8480 127830 148808 111116 99603 118742 142842 34416 17036 46064 108880 143243 117408 145364 158325 108472 109832 84215 22584 103050 26095 138073 56158 41762 41217 23798 167305 143412 72410 130...

result:

ok OK, answer exists, pans = jans = 59763

Test #152:

score: 20
Accepted
time: 157ms
memory: 30776kb

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
71551 109504 75919 170327 146972 44048 124146 146893 64380 180487 63302 70280 69590 180538 19786 72567 169243 661 128090 118134 151388 174518 134528 30620 57165 80609 102487 138183 192380 139096 80123 111299 136455 34094 64304 20039 150336 183725 94418 79686 109720 59617 97032 162499 137...

result:

ok OK, answer exists, pans = jans = 30002

Test #153:

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

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
29870 200000 80417 99851 85304 55414 63761 184597 148918 34575 199996 98338 99227 117167 114471 162500 71689 27860 53480 80706 185286 134700 128672 99832 185558 159805 177124 120074 42898 194744 178457 103742 53473 62688 136700 168703 86046 11421 93923 174852 169760 52289 191435 146628 120078 1...

result:

ok OK, answer exists, pans = jans = 2

Test #154:

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

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
68673 71938 124736 150267 78824 197923 83677 144584 22004 74826 65678 160416 58247 100475 158466 127986 77079 188693 130306 145140 15634 106501 146046 74511 86421 150157 162676 37108 186135 44149 53311 183472 60886 73526 176321 107083 94935 181055 39296 140872 184983 187227 45326 107282 13448 6...

result:

ok OK, answer exists, pans = jans = 3

Test #155:

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

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
25776 67397 97320 175580 127907 41401 51461 159634 97349 59075 94023 151367 102567 116763 74564 139975 183731 100331 164378 31226 141126 79565 7199 5389 9801 76899 5964 54529 7882 160530 160792 79820 56478 4214 102840 154469 30625 5776 57514 10732 136230 31284 198673 160684 186914 30094 82583 1...

result:

ok OK, answer exists, pans = jans = 4

Test #156:

score: 20
Accepted
time: 97ms
memory: 29668kb

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
31590 176451 139957 20393 78646 100392 5426 81084 43600 98016 117385 189576 190006 101105 33322 12453 98823 70665 25604 178745 194739 90757 195018 197717 180649 78737 63552 157325 33924 63966 75655 144365 74116 72852 6187 183210 47296 64810 27800 29937 118238 118608 157985 65770 64887 66650 914...

result:

ok OK, answer exists, pans = jans = 5

Test #157:

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

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
175491 114680 188292 138690 199881 176988 149378 150571 25168 163375 1007 177017 14679 188132 175013 14288 174561 174209 138182 175772 135832 136738 114024 14628 398 176249 151914 163450 188014 151170 15042 189457 2150 114424 138045 150866 174631 177433 164084 189075 25037 137687 163913 189188...

result:

ok OK, answer exists, pans = jans = 2

Test #158:

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

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
164901 157971 158204 114328 11839 169399 181685 13760 160536 176245 8597 154370 168892 137243 8383 124151 109036 129090 194845 171498 141289 5945 167884 104197 122946 172995 158154 138468 160320 174067 174397 134108 141982 182900 129156 172841 156290 101123 114187 102907 175881 150587 189357 1...

result:

ok OK, answer exists, pans = jans = 3

Test #159:

score: 20
Accepted
time: 44ms
memory: 30236kb

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
168507 37298 20034 45949 36376 157464 176573 183632 1319 147812 39768 139448 139620 150409 179992 14666 10713 19553 148896 17810 138189 193156 24378 39438 156674 154398 12666 10099 155241 3624 131749 30918 197273 2736 17590 144354 17566 179164 194788 143150 147551 165243 190583 190006 185003 5...

result:

ok OK, answer exists, pans = jans = 2

Test #160:

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

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
188778 172091 56780 51189 199129 147070 31875 169243 29584 39444 193737 159375 164131 43446 22853 159072 194543 56194 12851 194159 8942 55751 12038 198455 53854 40283 186021 56520 178119 53429 2940 189799 155410 196004 174896 12287 175952 15949 9227 176049 41321 43949 25951 53613 150428 59578 ...

result:

ok OK, answer exists, pans = jans = 3

Test #161:

score: 20
Accepted
time: 88ms
memory: 34048kb

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
146685 21584 171594 17296 192430 52506 154221 58111 199244 193493 62406 161056 63807 57913 166636 171864 177976 26952 32165 156229 51952 51661 194018 157650 181317 198180 29242 183481 167715 32349 182984 8699 166924 6559 174062 12132 29855 21022 26358 50789 16891 62220 49321 36018 45430 53633 ...

result:

ok OK, answer exists, pans = jans = 2

Test #162:

score: 20
Accepted
time: 93ms
memory: 29740kb

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
153562 24442 153244 58942 133775 191149 166438 105313 183183 62835 146094 135395 90731 141213 155277 114619 109649 176350 154959 110311 113216 140572 183258 100859 137274 103050 135067 126827 54659 163646 162117 177987 133531 87181 70280 186015 6697 20950 141555 184260 104790 16325 46309 157...

result:

ok OK, answer exists, pans = jans = 2

Test #163:

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

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
112831 136515 169558 36769 18430 31949 189733 187714 50197 60152 130541 169531 115346 139221 154984 66969 10189 172491 123456 177635 74870 191861 133824 1393 191240 181263 113620 61652 103977 9233 117454 160041 51287 193284 140872 26980 127385 118811 195032 27732 88001 185748 102443 83187 ...

result:

ok OK, answer exists, pans = jans = 1002

Test #164:

score: 20
Accepted
time: 142ms
memory: 29228kb

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
56854 24641 181193 30414 18483 7313 147455 52591 126359 34405 171784 49821 47658 17531 189671 30144 61034 98487 129621 37176 170944 18707 16206 146893 107798 61829 126105 133210 151548 73345 155565 196884 181255 46318 32633 57144 98409 112512 104231 185472 103179 60846 147299 125779 108045 40...

result:

ok OK, answer exists, pans = jans = 2

Test #165:

score: 20
Accepted
time: 224ms
memory: 34300kb

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
190590 177290 197449 167236 160027 35810 190247 93550 3005 70618 177174 170770 77164 55909 190328 100188 147583 2438 174022 151926 156222 23488 180203 140219 147036 119999 121325 139234 49487 62909 50126 94751 101809 10270 117657 76890 152554 126356 126775 109491 107036 92570 79017 133025 1...

result:

ok OK, answer exists, pans = jans = 9763

Test #166:

score: 20
Accepted
time: 156ms
memory: 20296kb

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: 145ms
memory: 35344kb

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
181903 106325 198575 108276 157308 199850 122310 107153 82243 184687 169771 42654 171967 144891 156523 117963 143629 177725 197654 181944 185453 169146 102479 136925 150646 164528 158795 180507 132302 114742 113177 102068 162894 113131 4999 89030 142253 129656 170772 149841 161310 38665 187...

result:

ok OK, answer exists, pans = jans = 1

Test #168:

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

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: 99ms
memory: 29028kb

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
169133 192365 167688 148355 172050 179872 159117 193795 92209 194801 190781 196519 199990 174276 171533 198417 193177 193196 175300 192466 193148 192323 195923 175159 198719 194860 162690 182251 193228 194667 171375 176457 199431 192411 168963 195317 182549 199808 178583 175115 174305 19675...

result:

ok OK, answer exists, pans = jans = 1

Test #170:

score: 20
Accepted
time: 61ms
memory: 28632kb

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
145237 199999 122881 199998 113431 199997 109275 199996 85411 199995 75318 199994 60911 199993 151644 199992 86305 199991 142933 199990 138525 199989 132293 199988 120605 199987 114295 199986 121435 199984 87218 199983 77755 199982 76017 199981 59726 199980 119672 199978 92854 199977 86652 ...

result:

ok OK, answer exists, pans = jans = 1

Test #171:

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

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
6047 144207 189462 180651 194979 197049 172356 192533 132312 189390 199569 176811 151269 191755 198561 172763 169341 194390 186418 196555 191166 199403 179051 199603 184822 197383 172794 184014 178838 179523 176881 168184 193879 179994 174625 179104 181007 197667 193037 199089 186238 192655...

result:

ok OK, answer exists, pans = jans = 1

Test #172:

score: 20
Accepted
time: 160ms
memory: 34972kb

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
133835 19085 162739 87812 175079 59467 165066 3572 199847 135720 43598 185992 23139 82378 61777 199032 26988 161706 9101 105700 117982 32694 29314 172520 37674 3144 72030 108744 81107 175493 73912 158752 62184 18040 43075 145807 917 69788 137841 41620 19657 5333 12649 61704 77692 46020 3...

result:

ok OK, answer exists, pans = jans = 10002

Test #173:

score: 20
Accepted
time: 124ms
memory: 22992kb

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: 177ms
memory: 26808kb

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
54499 36215 145693 89088 31404 72734 7861 110607 167514
35
54499 95185 166391 175980 9 167514 8 110607 46379 122522 7 7861 69801 68983 3029 6 72734 106703 5 31404 186233 172971 133431 4 89088 158160 24333 3 145693 120088 94143 67998 2 36215 1
4
169431 42356 164799 10
5
103247 168943 36864 19...

result:

ok OK, answer exists, pans = jans = 39993

Test #175:

score: 20
Accepted
time: 99ms
memory: 25604kb

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
147648 61622 144125 21549 95314 35400 39924 18905 148558 38467 74668 145693 80633 162950 149246 42686 112069 123043 133436 15138 110606 123532 198710 100589 179264 139137 64218 48174 19690 5274 68153 187539 10478 79181 131826 23489 76738 888 114370 120952 163227 56642 103014 82758 97018 1098...

result:

ok OK, answer exists, pans = jans = 2

Extra Test:

score: 0
Extra Test Passed