QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#517037 | #328. Cycle sort | BalintR# | 100 ✓ | 97ms | 36472kb | C++20 | 4.0kb | 2024-08-13 03:48:41 | 2024-08-13 03:48:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef complex<double> cpx;
template <typename T> using minPq = priority_queue<T, vector<T>, greater<T>>;
#define ms(a, x) memset(a, x, sizeof(a))
#define pb push_back
#define fs first
#define sn second
#define ALL(v) begin(v), end(v)
#define SZ(v) ((int) (v).size())
#define lbv(v, x) (lower_bound(ALL(v), x) - (v).begin())
#define ubv(v, x) (upper_bound(ALL(v), x) - (v).begin())
template <typename T> inline void UNIQUE(vector<T> &v){sort(ALL(v)); v.resize(unique(ALL(v)) - v.begin());}
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
#define FR(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define dbg(x) {cerr << #x << ' ' << x << endl;}
#define dbgArr(arr, n) {cerr << #arr; FR(_i, n) cerr << ' ' << (arr)[_i]; cerr << endl;}
template <typename T, typename U>
ostream& operator<<(ostream &os, pair<T, U> p){return os << "(" << p.fs << ", " << p.sn << ")";}
const int MN = 2e5 + 5;
int n, lim;
int arr[MN];
pii sorted[MN];
int nxt[MN], prv[MN];
vi groups[MN];
int gi;
int id[MN];
void genGroup(int src){
int n1 = src;
while(!id[n1]){
id[n1] = gi;
groups[gi].pb(n1);
n1 = nxt[n1];
}
gi++;
}
int main(){
cin.sync_with_stdio(0); cin.tie(0);
cin >> n >> lim;
FR(i, n) cin >> arr[i], sorted[i] = {arr[i], i};
sort(sorted, sorted+n);
FR(i, n) nxt[sorted[i].sn] = i, prv[i] = sorted[i].sn;
FR(i, n) if(arr[i] == sorted[i].fs && i != nxt[i]){
int a = prv[i], b = nxt[i];
nxt[a] = b, prv[b] = a;
nxt[i] = prv[i] = i;
}
gi = 1;
FR(i, n) if(!id[i]) genGroup(i);
map<int, vi> byVal;
FR(i, n) if(SZ(groups[id[i]]) != 1) byVal[sorted[i].fs].pb(i);
for(auto [v, vec] : byVal){
int p1 = vec[0];
FOR(i, 1, SZ(vec)){
int p2 = vec[i];
if(id[p1] == id[p2]) continue;
int g1 = id[p1], g2 = id[p2];
if(SZ(groups[g1]) < SZ(groups[g2])) swap(g1, g2);
if(SZ(groups[g2]) == 1) continue;
int a = prv[p1], b = prv[p2];
nxt[a] = p2, nxt[b] = p1;
prv[p1] = b, prv[p2] = a;
for(int x : groups[g2]) id[x] = g1, groups[g1].pb(x);
groups[g2].clear();
}
}
vi bigGroups;
FR(i, gi) if(SZ(groups[i]) > 1) lim -= SZ(groups[i]), bigGroups.pb(i);
if(lim < 0) return !printf("-1\n");
// dbgArr(nxt, n);
// dbgArr(prv, n);
// dbgArr(id, n);
int q = SZ(bigGroups);
int k = min(lim, SZ(bigGroups));
if(k >= 3){
q++;
q -= k-1;
vi shuf;
FR(i, k) shuf.pb(groups[bigGroups.end()[-1-i]][0]);
cout << q << '\n';
cout << k << '\n';
FR(i, k) cout << shuf[i]+1 << " \n"[i == k-1];
vi nxts;
FR(i, k) nxts.pb(nxt[shuf[i]]);
FR(i, k){
int a = shuf[i], b = shuf[(i+1)%k];
int c = nxts[i], d = nxts[(i+1)%k];
nxt[b] = c; prv[c] = b;
}
vi newGroup;
FR(i, k){
vi &vec = groups[bigGroups.end()[-1-i]];
for(int a : vec) newGroup.pb(a);
vec.clear();
}
FR(i, k-1) bigGroups.pop_back();
groups[bigGroups.back()] = newGroup;
}
else cout << q << '\n';
// dbgArr(nxt, n);
// dbgArr(prv, n);
for(int a : bigGroups){
vi vec;
int src = groups[a][0];
int n1 = src;
do {
vec.pb(n1);
n1 = nxt[n1];
} while(n1 != src);
assert(SZ(vec) == SZ(groups[a]));
cout << SZ(vec) << '\n';
FR(i, SZ(vec)) cout << vec[i]+1 << " \n"[i == SZ(vec)-1];
}
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 5
Accepted
Test #1:
score: 5
Accepted
time: 1ms
memory: 5852kb
input:
1 0 2
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #2:
score: 5
Accepted
time: 0ms
memory: 7940kb
input:
1 2 1
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #3:
score: 5
Accepted
time: 1ms
memory: 7860kb
input:
2 1 2 1
output:
-1
result:
ok OK, no solution
Test #4:
score: 5
Accepted
time: 1ms
memory: 7664kb
input:
2 2 2 1
output:
1 2 1 2
result:
ok OK, answer exists, pans = jans = 1
Test #5:
score: 5
Accepted
time: 1ms
memory: 9896kb
input:
2 0 2 1
output:
-1
result:
ok OK, no solution
Test #6:
score: 5
Accepted
time: 1ms
memory: 7664kb
input:
2 0 1 1
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #7:
score: 5
Accepted
time: 1ms
memory: 9700kb
input:
2 1 1 1
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #8:
score: 5
Accepted
time: 1ms
memory: 7596kb
input:
2 2 2 2
output:
0
result:
ok OK, answer exists, pans = jans = 0
Subtask #2:
score: 5
Accepted
Dependency #1:
100%
Accepted
Test #9:
score: 5
Accepted
time: 1ms
memory: 9736kb
input:
5 0 1000000000 1000000000 1000000000 1000000000 1000000000
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #10:
score: 5
Accepted
time: 1ms
memory: 9704kb
input:
1 0 258769137
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #11:
score: 5
Accepted
time: 1ms
memory: 7708kb
input:
5 0 884430748 884430748 708433020 708433020 708433020
output:
-1
result:
ok OK, no solution
Test #12:
score: 5
Accepted
time: 1ms
memory: 9780kb
input:
5 4 335381650 691981363 691981363 335381650 335381650
output:
1 4 2 4 3 5
result:
ok OK, answer exists, pans = jans = 1
Test #13:
score: 5
Accepted
time: 0ms
memory: 9772kb
input:
5 2 65390026 770505072 65390026 65390026 65390026
output:
1 2 2 5
result:
ok OK, answer exists, pans = jans = 1
Test #14:
score: 5
Accepted
time: 0ms
memory: 9972kb
input:
5 200000 682659092 302185582 518778252 29821187 14969298
output:
2 2 1 5 3 2 3 4
result:
ok OK, answer exists, pans = jans = 2
Test #15:
score: 5
Accepted
time: 1ms
memory: 7968kb
input:
5 4 167616600 574805150 651016425 150949603 379708534
output:
-1
result:
ok OK, no solution
Test #16:
score: 5
Accepted
time: 0ms
memory: 9972kb
input:
5 5 815605413 4894095 624809427 264202135 152952491
output:
2 3 1 5 2 2 3 4
result:
ok OK, answer exists, pans = jans = 2
Test #17:
score: 5
Accepted
time: 1ms
memory: 7868kb
input:
5 4 201429826 845081337 219611799 598937628 680006294
output:
1 4 2 5 4 3
result:
ok OK, answer exists, pans = jans = 1
Test #18:
score: 5
Accepted
time: 1ms
memory: 7664kb
input:
5 5 472778319 561757623 989296065 99763286 352037329
output:
1 5 1 3 5 2 4
result:
ok OK, answer exists, pans = jans = 1
Test #19:
score: 5
Accepted
time: 1ms
memory: 7592kb
input:
5 6 971458729 608568364 891718769 464295315 98863653
output:
2 2 1 5 3 2 3 4
result:
ok OK, answer exists, pans = jans = 2
Test #20:
score: 5
Accepted
time: 1ms
memory: 7864kb
input:
5 4 579487081 564229995 665920667 665920667 644707366
output:
2 2 1 2 2 3 5
result:
ok OK, answer exists, pans = jans = 2
Test #21:
score: 5
Accepted
time: 1ms
memory: 9908kb
input:
5 4 81224924 319704343 319704343 210445208 128525140
output:
1 4 2 4 3 5
result:
ok OK, answer exists, pans = jans = 1
Test #22:
score: 5
Accepted
time: 1ms
memory: 9748kb
input:
5 5 641494999 641494999 228574099 535883079 535883079
output:
1 5 1 4 2 5 3
result:
ok OK, answer exists, pans = jans = 1
Test #23:
score: 5
Accepted
time: 1ms
memory: 5812kb
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: 12ms
memory: 19452kb
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: 15ms
memory: 19140kb
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: 19ms
memory: 16888kb
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 1 100001 2 100002 3 100003 4 100004 5 100005 6 100006 7 100007 8 100008 9 100009 10 100010 11 100011 12 100012 13 100013 14 100014 15 100015 16 100016 17 100017 18 100018 19 100019 20 100020 21 100021 22 100022 23 100023 24 100024 25 100025 26 100026 27 100027 28 100028 29 100029 30 100030 ...
result:
ok OK, answer exists, pans = jans = 1
Test #27:
score: 5
Accepted
time: 19ms
memory: 15608kb
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: 30ms
memory: 16956kb
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 1 130762 49916 149836 22240 139322 86962 164002 104782 170835 109692 172709 42434 146999 92478 190589 123968 178187 71073 157906 23619 139855 87341 164142 64769 155500 98595 168470 107982 172044 110578 173040 26251 140852 88054 164433 105089 170957 109781 172749 6098 199621 130482 180659 72...
result:
ok OK, answer exists, pans = jans = 1
Test #29:
score: 5
Accepted
time: 15ms
memory: 16104kb
input:
200000 99998 2 1 2 1 2 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 1 2 2 1 1 1 2 2 1 1 2 2 1 1 1 2 1 1 1 2 1 2 1 1 1 1 1 2 1 2 1 1 2 2 2 1 1 2 2 2 1 2 2 1 2 2 1 1 1 1 1 2 2 2 1 2 1 1 2 2 2 1 2 2 1 2 1 2 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 2 1 1 1 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 1 2 1 1 2 1 2 1 2 1 1 1 1 1 1 1 2 2 1...
output:
-1
result:
ok OK, no solution
Test #30:
score: 5
Accepted
time: 7ms
memory: 15688kb
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 69 300 151 70361 196 104722
result:
ok OK, answer exists, pans = jans = 1
Test #31:
score: 5
Accepted
time: 17ms
memory: 16548kb
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: 21ms
memory: 18460kb
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 5 160001 76810 170493 107161 174609 21772 162933 67078 169198 106659 194913 56231 167698 91611 172464 4318 182215 62203 168486 44055 165987 91010 187567 63424 185844 113365 195094 41943 196949 87959 171979 80383 186923 54634 185311 14696 161967 24000 163252 90052 197550 158626 198419 102393 ...
result:
ok OK, answer exists, pans = jans = 1
Test #33:
score: 5
Accepted
time: 25ms
memory: 14544kb
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 2 100002 9902 108933 17951 116180 24479 122066 29779 126844 34070 130713 3716 103350 12922 111646 20399 118388 26467 123866 31400 128308 35389 131901 38632 193556 94199 184872 86368 177809 79993 172063 74818 167396 70613 163607 6669 106013 15318 113804 22337 120133 2762 102493 12148 199125 ...
result:
ok OK, answer exists, pans = jans = 1
Test #34:
score: 5
Accepted
time: 22ms
memory: 13396kb
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: 23ms
memory: 16816kb
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 1 160001 13332 195220 23436 163856 102062 176932 108505 156143 13045 124365 82195 173584 47643 135749 39314 166468 46081 195907 52551 137371 59261 139601 59978 196191 52620 192089 77387 145681 92886 150894 95494 196920 52783 137453 88764 193600 10374 123447 36553 132134 57525 184650 112358 1...
result:
ok OK, answer exists, pans = jans = 1
Test #36:
score: 5
Accepted
time: 15ms
memory: 13272kb
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 3 71604 1310 81386 12418 59574 18443 55094 3482 57458 10533 28203 4809 79070 162 23846 2680 72050 3919 57559 18181 40424 15983 93418 13313 73672 20363 66579 19379 66372 19347 66366 6508 68501 19638 87218 22161 61916 18742 61101 6275 76172 11999 28810 8345 64074 11022 64617 6423 26480 14103 7...
result:
ok OK, answer exists, pans = jans = 1
Test #37:
score: 5
Accepted
time: 23ms
memory: 13840kb
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: 28ms
memory: 14516kb
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 2 95002 6114 100724 10971 185451 82703 172384 71662 162058 62919 153873 55984 147388 50507 142270 46157 138197 42720 134983 40005 132444 37860 130437 36158 128839 34809 127579 33742 126583 32891 125785 32208 125146 2028 184172 81627 171377 4551 99259 9722 104097 13829 107936 17078 110980 19...
result:
ok OK, answer exists, pans = jans = 1
Subtask #4:
score: 10
Accepted
Test #39:
score: 10
Accepted
time: 0ms
memory: 9940kb
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 1 1067 756 377 471 545 1129 119 433 580 947 164 776 632 923 413 362 258 608 926 157 651 284 1121 1190 99 1043 352 321 95 1082 353 1033 669 443 843 161 1165 83 24 962 192 864 58 683 694 685 395 819 466 1102 542 287 966 517 107 927 48 62 915 1085 701 1039 642 828 1227 372 425 903 748 128 480 30...
result:
ok OK, answer exists, pans = jans = 1
Test #40:
score: 10
Accepted
time: 37ms
memory: 21924kb
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 1 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 92...
result:
ok OK, answer exists, pans = jans = 1
Test #41:
score: 10
Accepted
time: 15ms
memory: 16324kb
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 1 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 3...
result:
ok OK, answer exists, pans = jans = 1
Test #42:
score: 10
Accepted
time: 8ms
memory: 13904kb
input:
100000 200000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #43:
score: 10
Accepted
time: 38ms
memory: 22352kb
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 3741 3335 2164 1098 1092 1006 967 811 794 743 689 642 619 575 561 529 486 473 426 423 419 415 386 370 361 308 273 271 270 237 232 221 209 198 191 188 179 170 156 147 143 133 130 128 125 124 123 116 109 108 105 102 97 96 95 93 90 84 80 77 76 74 68 67 65 64 60 57 47 46 42 41 40 37 35 34 32 28 26...
result:
ok OK, answer exists, pans = jans = 2
Test #44:
score: 10
Accepted
time: 36ms
memory: 20244kb
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 8321 1475 1152 88 61 60 54 37 33 32 30 23 20 19 17 15 11 10 5 4 3 2 1 99999 8321 62488 22803 58423 48257 10328 98666 93620 99200 90093 89849 89453 73214 85287 51588 73453 19453 94702 86635 82575 42179 20970 68204 90977 5025 63379 56602 67204 7255 88929 20753 3027 20819 70632 26542 93590 74964 6...
result:
ok OK, answer exists, pans = jans = 2
Test #45:
score: 10
Accepted
time: 27ms
memory: 18204kb
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 1 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...
result:
ok OK, answer exists, pans = jans = 2
Test #46:
score: 10
Accepted
time: 31ms
memory: 18748kb
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 4 2 1 99445 4 40445 12415 86363 99996 37269 23001 61529 71870 2351 2377 95194 54167 74812 58940 41561 9920 86642 49565 26014 87433 44600 81318 12508 25383 28608 56203 21478 16679 61084 96271 42503 86527 16486 96971 44635 5632 5350 28818 15717 55174 80862 70051 97093 1796 37169 61012 42901 70584 ...
result:
ok OK, answer exists, pans = jans = 2
Test #47:
score: 10
Accepted
time: 37ms
memory: 23704kb
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 99252 99074 99029 98987 98893 98816 98632 98610 98528 98335 98260 98185 98184 98146 98141 98111 98019 97960 97863 97817 97800 97720 97718 97677 97670 97628 97614 97536 97522 97383 97377 97323 97298 97228 97207 97189 97168 97132 97121 97097 97066 97029 97019 97014 96991 96955 96920 96901 9690...
result:
ok OK, answer exists, pans = jans = 2
Test #48:
score: 10
Accepted
time: 40ms
memory: 22888kb
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 99278 96966 96801 96288 95995 95430 95250 95098 95088 94807 94785 94706 94513 94257 94094 93889 93493 93491 93405 93380 93300 93209 93136 92809 92721 92710 92680 92468 92446 92357 92121 92110 91823 91816 91638 91569 91463 91459 91415 91413 91278 91123 91085 91045 90972 90566 90451 90410 9039...
result:
ok OK, answer exists, pans = jans = 2
Test #49:
score: 10
Accepted
time: 45ms
memory: 23036kb
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 98239 96379 96176 96057 95982 95731 95666 95581 95557 95479 95360 95230 94501 94342 93236 92641 91899 91638 91527 91444 90615 90497 90436 90403 90289 90277 89700 89408 89304 88808 88396 88048 87763 87584 87477 87193 87134 87130 87112 86887 86868 86840 86642 86361 86359 86355 86317 86293 8622...
result:
ok OK, answer exists, pans = jans = 2
Test #50:
score: 10
Accepted
time: 36ms
memory: 22632kb
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 88444 86875 86138 85381 78564 78499 76757 74643 72319 72142 69939 69710 67335 64155 63494 63458 62271 61749 61639 61366 60811 58505 58142 57678 56042 55663 52679 52200 51886 49328 49041 48110 47493 47216 46881 46607 45619 45569 45089 45073 44955 44871 43956 43764 43651 43203 42954 42840 42778 ...
result:
ok OK, answer exists, pans = jans = 2
Test #51:
score: 10
Accepted
time: 19ms
memory: 18964kb
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 1 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 ...
result:
ok OK, answer exists, pans = jans = 2
Test #52:
score: 10
Accepted
time: 40ms
memory: 21800kb
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 98517 98424 98137 97473 97073 96946 96729 96651 96339 96321 95937 95897 95708 95594 95112 94475 94329 94016 93894 93702 93631 93550 93350 93293 93262 93114 93106 92901 92785 92660 92644 92475 92439 92206 92001 91964 91769 91749 91063 90987 90941 90933 90925 90770 90767 90766 90717 90468 9044...
result:
ok OK, answer exists, pans = jans = 2
Test #53:
score: 10
Accepted
time: 31ms
memory: 22872kb
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 99093 97532 97487 97273 97122 96502 96329 95920 95780 95694 95636 95216 94504 94482 94335 94283 93995 93741 93686 93638 93044 92817 92743 92391 92335 92283 92243 92070 91964 91451 91438 91372 91332 91331 91204 91176 91025 90993 90754 90585 90378 90334 90310 90283 89970 89824 89565 89157 8909...
result:
ok OK, answer exists, pans = jans = 2
Subtask #5:
score: 10
Accepted
Test #54:
score: 10
Accepted
time: 2ms
memory: 7664kb
input:
1000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
output:
0
result:
ok OK, answer exists, pans = jans = 0
Test #55:
score: 10
Accepted
time: 2ms
memory: 7728kb
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 1 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 ...
result:
ok OK, answer exists, pans = jans = 3
Test #56:
score: 10
Accepted
time: 2ms
memory: 9908kb
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 1 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 ...
result:
ok OK, answer exists, pans = jans = 3
Test #57:
score: 10
Accepted
time: 0ms
memory: 8088kb
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 15 2 1 990 15 380 962 846 248 920 941 809 154 696 968 773 945 481 973 83 508 673 88 522 28 674 614 198 572 654 461 459 234 320 524 108 865 169 742 372 387 364 683 560 732 997 96 41 591 377 307 322 29 728 539 30 866 960 887 631 839 514 407 498 587 312 286 117 797 255 785 765 122 993 922 741 192 5...
result:
ok OK, answer exists, pans = jans = 2
Test #58:
score: 10
Accepted
time: 1ms
memory: 7872kb
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 1 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 1...
result:
ok OK, answer exists, pans = jans = 2
Test #59:
score: 10
Accepted
time: 0ms
memory: 7988kb
input:
1000 999 849 773 53 451 832 243 491 5 50 880 704 513 825 63 627 329 674 893 268 85 580 922 131 532 465 680 253 256 267 416 882 528 530 119 787 523 392 282 195 683 738 774 855 435 603 136 708 320 318 724 162 49 302 65 852 644 695 341 360 375 896 641 942 567 681 776 409 265 613 842 753 566 308 620 541...
output:
-1
result:
ok OK, no solution
Test #60:
score: 10
Accepted
time: 2ms
memory: 9876kb
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: 9832kb
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 816 660 591 525 502 442 439 435 416 411 408 402 338 337 329 300 279 267 261 252 233 220 219 211 210 203 199 198 193 192 168 163 155 149 145 137 134 129 125 124 123 113 111 109 105 101 100 97 95 92 91 41 1 214 321 896 286 360 578 323 201 956 294 679 737 153 341 962 414 284 392 410 936 498 314 9...
result:
ok OK, answer exists, pans = jans = 51
Test #62:
score: 10
Accepted
time: 1ms
memory: 8084kb
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 1 469 2 2 836 2 3 645 2 4 201 2 5 533 2 6 235 2 7 605 2 8 717 2 9 739 2 10 454 2 11 743 2 12 609 2 13 51 2 14 604 2 15 847 2 16 885 2 17 990 2 18 638 2 19 490 2 20 892 2 21 592 2 22 359 2 23 472 2 24 161 2 25 158 2 26 240 2 27 121 2 28 724 2 29 159 2 30 390 2 31 476 2 32 387 2 33 746 2 34 980 ...
result:
ok OK, answer exists, pans = jans = 500
Test #63:
score: 10
Accepted
time: 1ms
memory: 7892kb
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 982 980 928 913 897 876 874 868 858 852 851 847 846 840 837 833 830 819 816 813 807 804 798 792 787 786 781 775 771 763 758 754 745 744 739 733 730 727 724 721 716 715 712 708 699 697 696 693 691 690 689 688 686 678 676 669 668 666 665 663 661 658 656 654 649 644 642 641 640 639 636 632 622 ...
result:
ok OK, answer exists, pans = jans = 263
Test #64:
score: 10
Accepted
time: 1ms
memory: 8064kb
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 765 753 722 570 543 510 505 460 437 396 390 376 359 712 1 67 756 670 382 391 552 443 910 442 680 572 955 423 225 373 885 478 795 303 257 24 855 169 569 393 810 992 441 504 785 769 21 364 631 62 450 715 420 397 170 310 819 64 850 456 613 731 444 896 348 459 203 326 498 634 939 120 213 289 380 8...
result:
ok OK, answer exists, pans = jans = 39
Test #65:
score: 10
Accepted
time: 1ms
memory: 7916kb
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: 9772kb
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 643 579 325 291 212 147 120 100 96 77 50 43 32 28 22 15 14 13 40 2 633 27 587 254 236 984 501 957 333 167 16 583 713 179 513 10 407 209 474 49 671 68 705 562 903 569 581 44 472 768 207 996 641 696 21 108 374 135 164 40 4 752 877 248 684 480 760 95 559 373 38 750 625 803 734 710 34 983 664 603 1...
result:
ok OK, answer exists, pans = jans = 5
Test #67:
score: 10
Accepted
time: 1ms
memory: 10044kb
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: 1ms
memory: 5952kb
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 1 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...
result:
ok OK, answer exists, pans = jans = 1
Subtask #6:
score: 15
Accepted
Dependency #5:
100%
Accepted
Test #69:
score: 15
Accepted
time: 7ms
memory: 19220kb
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: 27ms
memory: 21816kb
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 4 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 5...
result:
ok OK, answer exists, pans = jans = 3
Test #71:
score: 15
Accepted
time: 11ms
memory: 19228kb
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: 46ms
memory: 25292kb
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 121 7 1 67899 121 194594 29269 23951 130677 121061 139443 167651 127981 166890 9781 58019 140120 143925 153211 188806 867 92693 53826 116963 27173 13158 180397 15816 134896 2596 29803 97683 30876 99439 42593 150582 51968 133437 55661 22885 176704 181758 36299 83094 96000 27842 29232 178845 81711...
result:
ok OK, answer exists, pans = jans = 2
Test #73:
score: 15
Accepted
time: 76ms
memory: 33924kb
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 1 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 18...
result:
ok OK, answer exists, pans = jans = 2
Test #74:
score: 15
Accepted
time: 71ms
memory: 33220kb
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: 66ms
memory: 31132kb
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: 61ms
memory: 31860kb
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 168458 166759 166278 165690 165151 164472 164380 164111 163992 163867 163796 163688 163365 162911 162881 162816 162802 162709 162684 162514 162423 162293 162170 162154 161604 161378 161130 160996 160314 160268 160015 159982 159978 159850 159577 159539 159463 159283 159049 158837 158792 15...
result:
ok OK, answer exists, pans = jans = 9880
Test #77:
score: 15
Accepted
time: 87ms
memory: 33632kb
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 188287 188204 188164 188139 187584 187527 187094 186813 186619 186346 186337 186150 185947 185813 185661 185558 185442 185394 184907 184884 184758 184449 184362 184317 184247 183970 183842 183377 182996 182990 182937 182892 182848 182808 182731 182705 182638 182593 182472 182382 182339 1...
result:
ok OK, answer exists, pans = jans = 39686
Test #78:
score: 15
Accepted
time: 86ms
memory: 36136kb
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 1 39018 2 2 143114 2 3 105231 2 4 123355 2 5 103194 2 6 147756 2 7 131868 2 8 108627 2 9 16847 2 10 82863 2 11 121458 2 12 13103 2 13 14076 2 14 159140 2 15 111429 2 16 165648 2 17 38699 2 18 153023 2 19 114872 2 20 33889 2 21 26001 2 22 47652 2 23 163364 2 24 186475 2 25 163949 2 26 177924...
result:
ok OK, answer exists, pans = jans = 100000
Test #79:
score: 15
Accepted
time: 59ms
memory: 31584kb
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 169228 169107 169085 169028 168972 168873 168627 168611 168329 168323 168037 167931 167834 167831 167801 167789 167127 167032 166932 166824 166708 166677 166640 166617 166489 166439 166083 165915 165858 165731 165638 165591 165427 165191 165128 165060 164867 164485 164450 164396 164366 1...
result:
ok OK, answer exists, pans = jans = 31229
Test #80:
score: 15
Accepted
time: 80ms
memory: 30760kb
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 167562 164748 148376 142070 141432 125995 124665 119187 117063 116725 112224 111463 104846 102870 99853 99656 95882 95589 94631 90534 86853 86050 82837 81265 80675 79107 78181 76706 73300 72743 71979 71917 71538 70902 69948 67906 66972 65653 62821 61545 58680 57702 57411 56072 55972 55884 55...
result:
ok OK, answer exists, pans = jans = 149
Test #81:
score: 15
Accepted
time: 59ms
memory: 33680kb
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: 55ms
memory: 27412kb
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 2 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 1...
result:
ok OK, answer exists, pans = jans = 1
Test #83:
score: 15
Accepted
time: 39ms
memory: 22040kb
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 97938 89374 86184 85414 85269 83938 82961 82240 81686 81386 78675 78526 78429 78351 77856 77625 76777 76149 74970 73141 72737 72506 71942 71933 70970 70695 68148 68043 66689 66342 66100 65987 65745 65615 65484 65474 65070 64472 63846 63298 62891 62617 62354 62324 61991 60962 60881 60364 6020...
result:
ok OK, answer exists, pans = jans = 12
Subtask #7:
score: 15
Accepted
Test #84:
score: 15
Accepted
time: 8ms
memory: 14308kb
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: 11296kb
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 1 30001 8748 88339 29420 50846 16183 41455 1105 73953 24360 82443 27347 49388 15650 41078 12702 68665 6556 34641 10407 75744 24993 87968 29304 87096 8442 35977 292 30206 8822 55287 5172 87315 29051 79294 7649 54743 5113 66438 21726 86712 28841 64418 21016 44894 4088 32883 9762 67819 6465 541...
result:
ok OK, answer exists, pans = jans = 1
Test #86:
score: 15
Accepted
time: 46ms
memory: 21492kb
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 99641 98758 97999 96360 96333 96285 95954 95849 95691 95466 95399 95397 95386 95215 94880 94546 94403 94283 94162 94074 94048 93980 93921 93830 93717 93677 93624 93176 93151 92907 92876 92778 92643 92589 92569 92557 92540 92472 92455 92268 92243 92196 92036 91934 91898 91887 91638 91601 9156...
result:
ok OK, answer exists, pans = jans = 2
Test #87:
score: 15
Accepted
time: 31ms
memory: 23436kb
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 98906 98686 98492 98202 97989 97924 97673 97567 97270 97224 96983 96970 96936 96838 96194 96167 96067 96012 95949 95785 95769 95693 95529 95096 95001 94985 94714 94565 94433 94296 94228 94173 93823 93750 93568 93400 93331 93238 93137 92987 92683 92647 92612 92489 92486 92478 92440 92437 9241...
result:
ok OK, answer exists, pans = jans = 2
Test #88:
score: 15
Accepted
time: 16ms
memory: 10160kb
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 58 25299 73034 71353 21710 17901 42083 97713 90205 73681 33578 21199 94041 78430 16406 85197 81622 20177 53151 93193 51761 47980 11547 67311 28193 57624 67723 11722 61265 29193 5059 14509 93978 46081 14947 29748 74466 6594 35008 71976 28233 98977 8906 25371 75101 11802 25397 7156 30715 75149...
result:
ok OK, answer exists, pans = jans = 1
Test #89:
score: 15
Accepted
time: 15ms
memory: 11952kb
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 2 44537 4269 33885 59826 39560 71674 52166 5176 22901 58454 74065 12548 90444 54491 73587 63410 6610 78760 98643 55456 27902 70181 86414 99591 77908 8364 89915 54440 38937 82619 53520 95441 66130 40370 26021 2003 33590 2936 67038 18160 57882 73994 18997 24654 91867 43543 83170 42475 83057 75...
result:
ok OK, answer exists, pans = jans = 1
Test #90:
score: 15
Accepted
time: 18ms
memory: 12036kb
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 46 91444 56010 19979 27268 5628 56694 45988 32605 88575 86597 99566 87080 30078 62222 41873 32400 36526 10410 74619 51131 80742 73203 68447 98743 95627 39036 93228 86800 8342 52554 45816 67398 33585 71248 77345 29618 40618 36695 97273 86974 12735 83375 34352 14698 31374 14548 22599 18452 139...
result:
ok OK, answer exists, pans = jans = 1
Test #91:
score: 15
Accepted
time: 15ms
memory: 12124kb
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 2 33617 30204 61615 10359 93727 36146 86442 54257 11498 48608 15390 79690 64578 35125 82131 13063 98235 4808 36832 52209 81369 11538 54128 45210 88667 97712 16613 25315 193 47448 46832 83289 26492 69159 32538 68669 95511 86555 19931 99407 77695 23396 44030 95789 78345 43780 24372 65294 18718...
result:
ok OK, answer exists, pans = jans = 1
Test #92:
score: 15
Accepted
time: 23ms
memory: 12572kb
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 2 19591 33926 55571 99205 67026 80694 63942 14010 18392 91138 65756 9949 52063 62109 73723 5963 93678 8588 40603 74854 61234 37836 97522 8163 58221 20572 82106 71440 23156 63098 37925 69688 70861 12130 91957 47272 22819 16468 25697 42338 10623 73617 85223 34432 7113 80012 33484 51078 70461 ...
result:
ok OK, answer exists, pans = jans = 1
Test #93:
score: 15
Accepted
time: 23ms
memory: 12192kb
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 2 59929 14222 67498 33431 77875 6604 63435 52154 87949 8291 64342 26784 74284 35149 78799 1397 60659 3783 61902 96057 92801 47263 85299 28835 75411 24719 73184 22308 71923 59531 91981 47002 85153 27506 74682 9334 64908 21059 71223 16256 68628 59343 91881 11296 65964 44273 83695 26038 73867 2...
result:
ok OK, answer exists, pans = jans = 1
Test #94:
score: 15
Accepted
time: 17ms
memory: 9820kb
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 1 41289 8470 49611 96739 87589 5829 47018 95103 85982 11614 52699 95681 86552 8582 49721 5430 46625 96226 87084 13367 54406 11573 52659 39507 80014 40403 80890 3013 44250 38442 78971 39550 80057 21378 62267 98495 89319 6025 47211 32024 72702 22341 63216 92131 83077 9368 50493 34567 75183 392...
result:
ok OK, answer exists, pans = jans = 1
Test #95:
score: 15
Accepted
time: 23ms
memory: 10016kb
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 1 55096 20690 70352 95956 89694 13209 64868 22410 71661 21519 70972 5518 59210 44664 79453 96905 90352 3299 57656 43827 78779 41685 77045 5334 59154 25943 74174 10388 62617 10810 62936 52852 85635 7201 60524 16681 67383 95738 89562 46957 81205 6021 59588 27915 75739 42440 77662 46606 80967 4...
result:
ok OK, answer exists, pans = jans = 2
Test #96:
score: 15
Accepted
time: 26ms
memory: 17212kb
input:
100000 200000 642843205 642843205 35449 35449 35449 36793 57234 743553971 57234 118176 118176 573856453 118176 51837383 158902 174498 64228397 225784050 65762692 223536 223536 224935 243350666 800469566 800469566 769552754 324571698 332653 958433359 332653 388319 345399435 777871915 654727480 624677...
output:
2 15000 98846 97837 97559 97241 97103 97012 96986 96971 96625 96045 95761 95724 95693 95605 95572 95552 94751 94502 94471 94437 94314 94215 94191 94128 94065 93984 93936 93595 93569 93224 93201 92961 92844 92838 92694 92676 92581 92494 92336 92096 92081 91794 91722 91708 91697 91643 91562 91545 9121...
result:
ok OK, answer exists, pans = jans = 2
Test #97:
score: 15
Accepted
time: 18ms
memory: 10040kb
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 1 69789 26536 42944 33785 22536 62257 76553 17350 61660 86755 28427 43160 54643 45030 13902 21442 32485 53484 65772 16196 61549 86745 28422 83134 48075 74988 27134 43011 3645 50259 14496 21508 62140 45814 23872 52512 24628 52586 44794 94891 9409 80978 37918 23006 82528 48017 95263 29419 5314...
result:
ok OK, answer exists, pans = jans = 2
Test #98:
score: 15
Accepted
time: 14ms
memory: 11852kb
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 411 54538 8263 59673 21145 70179 10000 61324 50268 95395 12839 64030 9317 60678 39471 85318 49408 94572 36122 83874 29456 77802 17349 67172 16210 66082 1936 55991 8433 59829 8852 60231 8899 60276 50143 95277 43287 88954 12087 63315 465 54591 49486 94647 48708 93916 53859 98829 43694 89341 53...
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: 9744kb
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: 8056kb
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: 7768kb
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 4 702 141 757 457 893 345 842 316 831 182 768 468 896 596 949 5 703 403 871 14 706 234 792 492 906 606 955 81 731 431 882 46 720 243 796 496 907 607 956 656 982 225 788 488 903 350 845 318 832 183 769 36 717 417 877 577 943 643 976 384 862 562 937 131 754 159 762 61 726 247 798 290 818 23 710 ...
result:
ok OK, answer exists, pans = jans = 1
Test #102:
score: 15
Accepted
time: 2ms
memory: 9888kb
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 759 625 572 566 550 535 519 518 501 493 483 481 469 451 436 434 433 427 396 388 387 376 355 351 350 334 328 326 318 309 308 286 285 283 277 262 260 254 243 242 235 226 221 208 206 203 200 196 194 193 183 180 176 164 162 159 147 144 143 136 135 131 121 112 110 107 105 99 96 93 91 90 89 86 85 74...
result:
ok OK, answer exists, pans = jans = 2
Test #103:
score: 15
Accepted
time: 1ms
memory: 7788kb
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 838 788 767 741 738 710 699 683 667 632 593 581 579 575 493 491 486 479 474 464 454 442 439 437 432 430 429 425 413 412 411 409 404 403 399 395 392 381 380 365 352 348 343 342 341 333 332 326 322 315 8 1 726 105 291 4 676 780 917 6 2 694 837 585 804 230 3 5 17 345 2 6 648 4 7 417 283 905 3 8 ...
result:
ok OK, answer exists, pans = jans = 152
Test #104:
score: 15
Accepted
time: 1ms
memory: 7884kb
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: 1ms
memory: 9856kb
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 1 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 49...
result:
ok OK, answer exists, pans = jans = 1
Test #106:
score: 15
Accepted
time: 1ms
memory: 9900kb
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 1 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 8...
result:
ok OK, answer exists, pans = jans = 1
Test #107:
score: 15
Accepted
time: 1ms
memory: 7860kb
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 1 469 2 2 836 2 3 645 2 4 201 2 5 533 2 6 235 2 7 605 2 8 717 2 9 739 2 10 454 2 11 743 2 12 609 2 13 51 2 14 604 2 15 847 2 16 885 2 17 990 2 18 638 2 19 490 2 20 892 2 21 592 2 22 359 2 23 472 2 24 161 2 25 158 2 26 240 2 27 121 2 28 724 2 29 159 2 30 390 2 31 476 2 32 387 2 33 746 2 34 980 ...
result:
ok OK, answer exists, pans = jans = 500
Test #108:
score: 15
Accepted
time: 2ms
memory: 9908kb
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 918 886 885 880 860 852 841 836 835 833 831 828 823 821 818 814 813 806 802 793 792 787 777 768 761 751 750 749 745 743 742 740 737 729 724 723 722 721 720 719 713 710 706 700 698 697 692 691 688 687 686 684 682 677 675 674 673 671 664 662 661 660 657 656 655 650 647 646 643 642 641 640 636 63...
result:
ok OK, answer exists, pans = jans = 3
Test #109:
score: 15
Accepted
time: 0ms
memory: 7792kb
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 589 526 521 503 440 425 385 376 359 331 302 281 272 244 226 225 200 182 177 175 48 1 335 151 345 156 350 159 353 162 356 164 358 10 344 155 349 158 352 161 355 8 342 4 338 153 347 7 341 154 348 157 351 160 354 163 357 9 343 5 339 2 336 3 337 152 346 6 340 3 11 81 718 2 12 496 29 13 918 104 15 ...
result:
ok OK, answer exists, pans = jans = 22
Test #110:
score: 15
Accepted
time: 0ms
memory: 9816kb
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 624 486 409 396 391 383 342 303 288 278 273 204 140 107 101 96 93 82 75 68 11 3 393 57 394 690 138 395 2 948 691 155 37 4 628 211 131 348 630 54 780 212 781 325 349 6 324 5 778 129 215 209 629 350 128 90 208 52 464 210 804 782 351 216 53 779 465 805 130 51 10 8 526 10 638 514 9 983 515 7 513 3...
result:
ok OK, answer exists, pans = jans = 22
Test #111:
score: 15
Accepted
time: 1ms
memory: 7684kb
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 1 418 370 421 368 865 2 142 419 369 143 420 10 4 429 491 101 430 100 490 3 489 431 11 5 933 720 934 722 536 721 935 723 936 724 38 7 258 659 259 660 260 661 242 655 254 9 244 656 255 658 257 11 246 540 248 542 250 544 252 8 243 539 247 541 249 543 251 545 253 10 245 657 256 25 12 731 929 416 4...
result:
ok OK, answer exists, pans = jans = 40
Test #112:
score: 15
Accepted
time: 0ms
memory: 7996kb
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 2 500 858 507 861 510 7 505 860 509 6 504 859 508 862 511 863 512 8 506 5 503 4 502 3 501 201 26 9 530 925 17 534 926 18 535 12 922 15 533 11 531 10 921 14 532 13 923 537 16 924 19 536 927 12 22 416 722 25 662 24 721 418 21 661 23 417 15 26 985 174 986 195 990 614 175 987 196 991 177 989 176 9...
result:
ok OK, answer exists, pans = jans = 40
Test #113:
score: 15
Accepted
time: 1ms
memory: 10160kb
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: 0ms
memory: 7784kb
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: 9812kb
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 2 944 3 556 4 945 1 555 12 7 37 941 8 940 9 38 942 5 35 6 36 6 11 925 474 926 10 473 4 12 668 13 535 11 14 714 15 715 16 716 323 718 324 17 717 3 18 177 483 6 19 858 537 20 859 538 3 21 129 799 9 23 947 24 948 25 949 518 22 517 10 27 693 28 694 435 26 692 436 695 434 3 29 928 863 10 30 172 965...
result:
ok OK, answer exists, pans = jans = 125
Test #116:
score: 15
Accepted
time: 0ms
memory: 7692kb
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 474 420 402 399 354 352 351 350 320 319 297 203 164 101 55 54 52 19 18 177 5 980 542 667 922 347 7 335 986 16 578 683 587 341 240 580 228 912 999 334 226 326 533 989 592 10 322 338 664 996 924 248 224 325 532 988 546 992 547 682 345 534 679 232 659 230 913 671 344 987 545 991 689 235 914 588 99...
result:
ok OK, answer exists, pans = jans = 3
Test #117:
score: 15
Accepted
time: 1ms
memory: 10032kb
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 626 602 491 421 338 300 256 254 104 101 99 98 83 77 61 34 33 32 8 183 1 717 913 869 884 712 596 485 514 966 490 655 23 2 401 209 402 52 593 3 652 403 896 408 880 598 657 56 511 881 724 488 594 4 509 911 649 487 412 720 57 926 6 925 906 970 885 515 656 842 59 927 907 867 407 719 710 882 725 843 ...
result:
ok OK, answer exists, pans = jans = 3
Test #118:
score: 15
Accepted
time: 2ms
memory: 9812kb
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 591 422 314 291 262 183 167 157 102 101 90 71 41 37 36 35 31 28 21 176 2 443 992 152 751 941 481 254 537 10 508 710 107 934 452 938 968 208 250 477 432 17 3 103 510 620 11 613 240 962 755 244 146 16 748 450 965 482 89 428 239 88 509 995 540 940 151 707 449 205 325 430 936 997 712 108 749 711 24...
result:
ok OK, answer exists, pans = jans = 3
Test #119:
score: 15
Accepted
time: 2ms
memory: 9816kb
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 503 496 424 417 374 200 181 146 145 143 53 51 49 48 43 27 21 20 10 175 2 580 195 554 586 345 614 559 800 562 617 348 31 680 620 36 402 556 4 794 814 693 473 691 363 686 349 192 612 408 557 843 364 469 689 350 605 34 188 29 339 474 842 467 358 3 793 336 583 360 606 346 462 585 618 35 189 837 694...
result:
ok OK, answer exists, pans = jans = 3
Test #120:
score: 15
Accepted
time: 1ms
memory: 7784kb
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 371 351 341 322 296 290 182 175 174 153 140 128 127 109 101 97 96 5 2 7 1 367 299 704 297 396 298 974 371 13 147 30 383 47 527 69 399 52 510 66 326 39 997 92 531 73 999 94 328 41 148 31 104 14 573 74 577 78 108 18 116 19 508 64 576 77 529 71 144 103 15 120 23 117 20 495 55 105 9 145 28 500 60 4...
result:
ok OK, answer exists, pans = jans = 3
Test #121:
score: 15
Accepted
time: 1ms
memory: 7744kb
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 274 271 185 179 178 4 1 272 513 273 967 2 517 93 604 18 533 340 834 386 880 152 663 361 855 310 807 134 645 212 715 37 552 4 519 334 828 245 748 45 560 196 699 458 946 319 816 481 969 167 678 33 548 429 917 407 901 313 810 58 573 11 526 337 831 62 577 347 841 64 579 102 613 206 709 296 793 381 8...
result:
ok OK, answer exists, pans = jans = 7
Test #122:
score: 15
Accepted
time: 2ms
memory: 9760kb
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 818 811 800 793 751 5 1 414 86 134 85 3 2 49 90 3 3 265 105 3 4 311 131 3 5 106 259 5 6 21 210 119 22 5 7 302 116 301 744 3 8 195 12 4 10 420 750 419 5 11 41 212 42 177 5 13 798 112 799 111 4 14 888 875 889 2 15 961 5 16 406 209 129 407 5 17 297 58 298 216 3 18 205 292 5 19 822 876 20 50 4 23 9...
result:
ok OK, answer exists, pans = jans = 97
Test #123:
score: 15
Accepted
time: 1ms
memory: 9764kb
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 239 144 95 59 39 38 35 32 26 4 990 239 611 387 429 14 914 141 375 284 426 378 835 631 847 445 541 296 128 526 384 13 369 282 376 12 125 372 531 843 634 302 377 455 292 832 630 300 833 394 430 623 929 551 439 133 374 532 136 281 615 846 307 9 613 845 306 530 434 132 373 919 848 549 928 401 457 6...
result:
ok OK, answer exists, pans = jans = 2
Test #124:
score: 15
Accepted
time: 1ms
memory: 5748kb
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 874 738 650 641 637 622 617 594 561 547 542 540 525 524 498 485 482 463 461 450 409 389 380 379 366 365 332 329 313 303 301 293 292 284 280 279 272 263 239 238 237 230 217 212 209 207 206 205 202 199 196 194 187 176 168 160 154 148 141 134 124 122 121 118 116 113 111 109 106 105 104 97 89 88 8...
result:
ok OK, answer exists, pans = jans = 2
Test #125:
score: 15
Accepted
time: 0ms
memory: 7700kb
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 1 53 272 85 668 516 744 316 407 982 331 802 967 78 936 572 923 630 334 941 927 197 311 199 141 598 924 905 542 389 412 839 59 584 896 371 227 357 421 323 465 267 304 721 247 770 248 811 888 616 622 792 30 641 925 77 219 114 559 408 142 303 918 208 212 930 459 919 234 164 20 264 441 3 395 860 9...
result:
ok OK, answer exists, pans = jans = 1
Test #126:
score: 15
Accepted
time: 1ms
memory: 9804kb
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 1 872 954 423 99 516 394 808 217 632 226 641 366 780 214 629 313 728 961 879 989 907 148 565 218 633 135 552 54 475 959 877 958 876 244 659 16 438 363 777 195 610 272 687 144 561 303 718 992 910 230 645 373 787 236 651 297 712 941 859 343 758 316 731 175 592 978 896 147 564 172 589 251 666 320...
result:
ok OK, answer exists, pans = jans = 1
Test #127:
score: 15
Accepted
time: 0ms
memory: 7932kb
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 1 246 315 416 206 429 334 420 137 813 664 67 700 269 717 77 804 976 791 455 249 511 146 12 484 847 573 949 104 122 219 611 953 680 72 118 496 340 627 438 634 865 574 748 449 46 695 268 512 431 763 175 603 62 116 495 143 306 234 313 518 433 735 986 199 505 144 814 457 942 467 637 325 928 675 17...
result:
ok OK, answer exists, pans = jans = 1
Test #128:
score: 15
Accepted
time: 1ms
memory: 10028kb
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 3 275 180 735 411 201 984 716 267 399 99 721 410 282 725 976 174 710 856 608 240 6 541 746 434 128 213 321 529 365 324 738 508 838 861 649 330 80 879 92 981 573 12 293 420 644 709 72 936 415 146 939 337 446 28 797 286 801 606 428 888 624 265 867 412 261 848 896 571 425 108 195 917 626 871 346 ...
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: 21ms
memory: 19228kb
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: 36ms
memory: 18084kb
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: 25ms
memory: 14032kb
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 1 80001 6878 86291 10683 156984 53776 172339 63170 137750 42066 118451 30304 163973 58055 133070 39199 167124 59978 196060 6670 155529 52894 172030 62978 190425 74196 147820 48217 124081 33741 110846 25624 194214 76484 149910 49493 170793 62211 175351 65022 139447 43093 119392 30887 108237 ...
result:
ok OK, answer exists, pans = jans = 1
Test #132:
score: 20
Accepted
time: 79ms
memory: 33380kb
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 197563 197286 196792 196051 195950 195783 195093 194893 194573 194423 194342 194163 194115 193874 193860 193809 193549 193541 193191 193146 193037 192779 192744 192322 192220 191948 191935 190898 190641 190553 190143 190011 189960 189904 189767 189659 189553 189522 189395 189296 189095 1...
result:
ok OK, answer exists, pans = jans = 16073
Test #133:
score: 20
Accepted
time: 84ms
memory: 34060kb
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 7612 6376 3372 2304 2169 1319 1218 1120 990 911 738 701 669 498 482 447 439 397 374 373 318 304 301 282 272 266 242 217 207 202 196 194 192 186 176 175 169 163 147 134 130 127 125 120 113 108 106 103 97 95 4719 1 80572 55162 187969 157486 186462 19323 9734 100686 91869 137232 5829 89899 66097 ...
result:
ok OK, answer exists, pans = jans = 52
Test #134:
score: 20
Accepted
time: 87ms
memory: 34472kb
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 1 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...
result:
ok OK, answer exists, pans = jans = 1
Test #135:
score: 20
Accepted
time: 76ms
memory: 30972kb
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: 94ms
memory: 36472kb
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 1 39018 2 2 143114 2 3 105231 2 4 123355 2 5 103194 2 6 147756 2 7 131868 2 8 108627 2 9 16847 2 10 82863 2 11 121458 2 12 13103 2 13 14076 2 14 159140 2 15 111429 2 16 165648 2 17 38699 2 18 153023 2 19 114872 2 20 33889 2 21 26001 2 22 47652 2 23 163364 2 24 186475 2 25 163949 2 26 177924...
result:
ok OK, answer exists, pans = jans = 100000
Test #137:
score: 20
Accepted
time: 57ms
memory: 20908kb
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 40 19 7 199997 40 31502 194292 38387 46577 97123 181534 7451 63615 118038 142963 179622 129135 167923 161229 140799 18245 149264 188614 184817 120164 122409 148450 40356 5242 175977 130249 92891 27389 18135 198498 92748 25563 179230 127267 22111 45176 192859 67150 34288 48544 7115 6028 96639 765...
result:
ok OK, answer exists, pans = jans = 2
Test #138:
score: 20
Accepted
time: 56ms
memory: 20408kb
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 2 100284 9310 103413 70996 112766 195649 132144 182517 127779 11451 104124 80256 115893 181199 127324 23832 108158 19645 106764 99618 122372 31491 110742 86036 117782 73654 113654 189484 130122 27503 109420 174089 124925 189512 130137 198093 132969 74765 114022 84020 117134 185309 128732 198...
result:
ok OK, answer exists, pans = jans = 3
Test #139:
score: 20
Accepted
time: 56ms
memory: 17032kb
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 1 143239 92886 152978 61147 95286 124575 18999 5071 52232 113160 29883 132667 150452 93617 37951 99206 106351 194401 161480 187451 104972 98391 23651 165497 139450 80329 103641 57324 106757 105928 109528 193598 198801 170245 155259 184293 159453 187066 56293 188515 130688 77700 70134 3413 19...
result:
ok OK, answer exists, pans = jans = 2
Test #140:
score: 20
Accepted
time: 56ms
memory: 21004kb
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 2 184986 1437 88797 191053 132234 122487 142688 89477 71672 168818 66153 98905 66965 123585 131208 182454 136042 185856 100898 110335 107942 135790 124343 154994 179680 55935 85087 124179 69396 58080 59863 161328 195770 181780 418 127472 151223 173559 91239 73083 162373 58564 84717 59904 163...
result:
ok OK, answer exists, pans = jans = 2
Test #141:
score: 20
Accepted
time: 52ms
memory: 14920kb
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 74 70 26 122175 1 123162 176356 136120 144356 36119 120396 36404 121730 112507 167036 2902 82965 105011 84939 163071 18010 23298 97006 64431 149359 194495 92259 36116 121710 189682 165307 111457 157262 47306 191972 107819 27013 79048 34082 139854 132198 2411 138292 33514 49017 20396 14322 109548...
result:
ok OK, answer exists, pans = jans = 3
Test #142:
score: 20
Accepted
time: 63ms
memory: 21264kb
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 33 9 2 1 199996 33 164594 199205 159096 172618 111441 124253 161004 79595 109955 2840 103458 191453 18617 130555 151666 26305 90245 24298 15801 77734 97338 183099 152063 16930 11690 97610 144807 126791 158728 102609 129083 127901 21922 21788 54272 121927 88887 70133 141316 193086 20213 3563 3818...
result:
ok OK, answer exists, pans = jans = 2
Test #143:
score: 20
Accepted
time: 60ms
memory: 17112kb
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 29 21 20 56943 1 41583 196399 178040 119464 136153 86986 53778 173867 172538 34517 84162 36775 166306 190452 65776 17785 134255 120658 198097 106590 105011 87953 179605 180610 190114 131156 86572 122763 52494 64997 73812 112866 120131 27254 133147 199851 193738 165800 14751 16982 64879 120153 16...
result:
ok OK, answer exists, pans = jans = 4
Test #144:
score: 20
Accepted
time: 60ms
memory: 19856kb
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 16957 11 4 2 1 199995 16957 104578 24970 98316 3420 99200 85608 113542 5890 99801 12170 101312 37732 107806 195976 122291 156947 118764 125465 117139 196101 122331 24734 104510 72133 110145 84453 113271 76259 111136 81264 112468 28166 105406 84737 113335 79081 111867 10846 100990 13824 101750 48...
result:
ok OK, answer exists, pans = jans = 2
Test #145:
score: 20
Accepted
time: 46ms
memory: 15336kb
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 194658 190417 184617 177494 172927 170795 169421 162673 161511 160838 157931 154761 154590 153054 150943 149599 145266 144141 142164 140201 139653 138775 138009 137691 136091 134079 133665 133568 133303 132698 131224 131060 130705 129517 128341 128071 127483 126903 126113 125884 125568 124443...
result:
ok OK, answer exists, pans = jans = 2
Test #146:
score: 20
Accepted
time: 42ms
memory: 14424kb
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 53 95348 72939 166878 48730 143210 86791 180573 83349 177174 71852 165828 20848 115859 1236 96524 33647 128435 35427 130199 24408 119377 51731 146092 41964 136600 196745 191194 199758 194181 5575 100815 73220 167157 76982 170885 9827 104978 22988 117969 85416 179214 10311 105454 56727 15096...
result:
ok OK, answer exists, pans = jans = 1
Test #147:
score: 20
Accepted
time: 46ms
memory: 15344kb
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 2 126613 38 126628 53 48573 32 48560 19 126618 43 126630 55 48575 34 126626 51 48571 30 126624 49 126632 57 48576 35 48561 20 48554 13 48550 9 126615 40 126629 54 48574 33 126625 50 48570 29 126623 48 48569 28 48558 17 48552 11 48548 7 126614 39 48563 22 126620 45 48566 25 48556 15 48551 10...
result:
ok OK, answer exists, pans = jans = 2000
Test #148:
score: 20
Accepted
time: 46ms
memory: 12816kb
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 1 9964 110561 9958 190036 9966 190038 79792 38913 9961 188861 110569 38918 9962 110560 4 110557 9963 190037 79791 190042 134208 38920 110564 38916 79790 110566 38917 194736 110570 188864 194740 13 38912 110563 5 38910 134203 110568 9965 110562 38915 3 79788 110565 194737 110571 38919 190040 ...
result:
ok OK, answer exists, pans = jans = 2000
Test #149:
score: 20
Accepted
time: 40ms
memory: 15360kb
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: 22ms
memory: 14872kb
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 98941 95533 93680 92588 92317 89330 88346 87474 87151 86194 86140 85844 85348 85205 85161 85102 84919 84224 83548 82931 82748 82642 82267 81471 79559 79174 79073 77925 77587 77135 76061 75966 75756 75594 75478 75446 75385 75311 75224 74710 74518 74289 74021 73942 73833 73569 73498 73366 73340...
result:
ok OK, answer exists, pans = jans = 2
Test #151:
score: 20
Accepted
time: 81ms
memory: 29144kb
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 179066 178987 178921 178656 178099 177939 177752 177564 177507 177259 177165 176925 176568 176499 176074 175931 175928 175833 175764 175694 175439 175397 175394 175234 174942 174827 174665 174656 174580 174367 174268 174266 174158 174135 174069 173923 173843 173662 173416 173300 173128 173...
result:
ok OK, answer exists, pans = jans = 59763
Test #152:
score: 20
Accepted
time: 84ms
memory: 30336kb
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 198312 197256 196389 196032 195628 195618 195530 195243 195187 194978 194943 194938 194766 194718 194642 194575 194276 194164 194097 193878 193715 193664 193571 192865 192848 192715 192633 192314 192259 191933 191919 191602 191495 191397 191309 191257 191088 190880 190865 190782 190778 1...
result:
ok OK, answer exists, pans = jans = 30002
Test #153:
score: 20
Accepted
time: 39ms
memory: 15408kb
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 47090 28240 28234 22887 22881 22877 22565 20905 16887 16872 16566 15755 15050 13486 13043 12652 12306 11160 11154 8957 8956 8351 8337 7969 7961 7960 5484 5224 5221 4888 3618 3379 3057 2673 2670 2661 2660 2657 2128 1808 1533 1531 658 292 290 11 9 5 3 2 199950 47090 200000 48965 51411 150971 1309...
result:
ok OK, answer exists, pans = jans = 2
Test #154:
score: 20
Accepted
time: 39ms
memory: 14228kb
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 44683 24475 17053 15463 14073 13692 13447 11325 10899 8451 7681 7087 7009 6633 6337 6015 5735 5676 3656 3635 3303 3264 3032 2989 2553 2552 2436 2399 1413 1369 1174 1036 923 793 791 554 480 463 240 205 186 185 160 114 90 68 66 44 21 19770 1 68660 57076 89110 176121 139472 196442 67284 23537 1254...
result:
ok OK, answer exists, pans = jans = 3
Test #155:
score: 20
Accepted
time: 46ms
memory: 13796kb
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 54252 29840 29180 15840 14718 12684 11016 10733 8945 7772 7582 7007 6886 5957 5070 4914 3963 3727 3642 3372 3277 3200 3173 2951 2312 2151 2150 1779 1770 1594 1405 1347 1346 1021 788 644 643 480 321 254 218 168 144 107 73 63 40 25 19792 1 23111 136859 17122 134564 22906 154919 23875 1085 17235 1...
result:
ok OK, answer exists, pans = jans = 4
Test #156:
score: 20
Accepted
time: 55ms
memory: 19256kb
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 86559 70821 54182 46203 29746 29143 27922 26335 13079 9852 9181 8885 8655 8240 6962 6249 6052 4729 4721 4555 4457 4142 4071 3938 3584 3561 3162 3138 3068 2272 2045 1652 1615 1145 1005 906 681 622 341 181 82 69 62 45 32 26 16 19807 1 31588 82875 182913 2032 64004 102403 194574 52063 145542 15670...
result:
ok OK, answer exists, pans = jans = 5
Test #157:
score: 20
Accepted
time: 45ms
memory: 15740kb
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 163773 152007 149129 138639 137980 137243 137030 136966 136770 136667 136613 136214 136185 136096 135809 135460 135435 135331 125068 124965 124854 124642 124398 124365 114690 114436 114399 114396 114341 114217 114133 114128 114066 113974 113830 113794 113787 113755 113705 113677 113648 113585 ...
result:
ok OK, answer exists, pans = jans = 2
Test #158:
score: 20
Accepted
time: 48ms
memory: 16244kb
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 153111 151096 150924 146151 143253 143157 141584 141496 140985 139938 139928 138897 138462 134183 133887 132948 132834 130464 129113 127175 127096 127094 126973 125087 122992 122747 121757 121702 121694 120649 116952 116923 115691 115663 114425 114374 114368 114317 114254 114180 114162 114153 ...
result:
ok OK, answer exists, pans = jans = 3
Test #159:
score: 20
Accepted
time: 39ms
memory: 15452kb
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 161387 160554 156187 151593 147992 145932 144905 138357 135337 46273 44543 43608 41554 37574 37002 36905 36802 36329 36247 35250 34247 33825 33100 32836 32317 31873 30196 29426 29307 28956 28238 28237 26774 26580 26370 25870 25627 25229 25158 24409 24084 23599 23249 23248 23052 22933 22769 226...
result:
ok OK, answer exists, pans = jans = 2
Test #160:
score: 20
Accepted
time: 43ms
memory: 17024kb
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 175543 155672 152758 151518 60309 59923 57072 56279 54852 54056 50400 48761 48756 42467 41496 40759 40009 39791 38611 35700 35446 34686 34006 32094 31811 31582 30987 30599 29283 28118 27571 27492 27460 26856 26855 26628 26600 26004 25948 25779 25002 24744 24579 24482 22755 22421 22089 21899 21...
result:
ok OK, answer exists, pans = jans = 3
Test #161:
score: 20
Accepted
time: 62ms
memory: 21144kb
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 185305 177588 164974 161459 160433 155541 154444 153840 58771 56033 56003 51345 45920 37750 36159 34658 34536 34499 34095 33330 32816 31661 30892 30891 30422 30200 29806 28627 27929 25546 25261 25094 24031 23762 23669 23204 23165 22576 22496 22350 22160 22010 21735 21615 21524 20653 20486 2038...
result:
ok OK, answer exists, pans = jans = 2
Test #162:
score: 20
Accepted
time: 58ms
memory: 20876kb
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 191993 188409 188056 185696 182990 182220 179662 179530 178754 178753 177840 177479 177433 176778 176739 176524 175223 174554 173412 172755 172701 172371 172224 172012 170026 169838 168817 168814 168373 166710 166636 166593 166504 166164 166145 166144 165997 165752 165749 164626 164613 16425...
result:
ok OK, answer exists, pans = jans = 2
Test #163:
score: 20
Accepted
time: 52ms
memory: 15832kb
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 194195 186835 185098 179763 175567 174501 174275 173093 171245 170650 169958 169820 167340 167213 165710 164844 164417 163841 162787 162621 162610 161798 161565 160247 160200 156877 156613 156546 156476 156250 155962 155489 155283 154816 154603 154448 153720 153356 152874 151874 151766 151...
result:
ok OK, answer exists, pans = jans = 1002
Test #164:
score: 20
Accepted
time: 50ms
memory: 24760kb
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 173941 172969 172463 164263 160980 158096 156034 155721 148028 144556 141514 137964 137107 136031 133861 133217 132921 130964 129997 129376 124475 124100 123878 123577 122845 122569 121593 121546 119788 119069 118766 117018 115441 115015 114371 114315 113570 112843 110320 109914 109130 108517...
result:
ok OK, answer exists, pans = jans = 2
Test #165:
score: 20
Accepted
time: 97ms
memory: 33384kb
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 192506 192453 190502 188510 187803 187530 187396 186408 184256 182482 182471 181059 176380 175946 174758 174323 174161 173547 172589 172180 171936 169864 169664 169069 168704 167989 167751 167095 166987 166858 166573 166555 166243 166020 165772 165662 165452 165095 164671 164405 164401 1639...
result:
ok OK, answer exists, pans = jans = 9763
Test #166:
score: 20
Accepted
time: 59ms
memory: 25620kb
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: 55ms
memory: 21812kb
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 1 181903 106325 198577 71078 34649 191027 55168 179151 14289 127247 170502 192243 106300 66797 178805 49825 198590 27016 102705 191905 76515 108858 194914 90943 131216 79456 146670 41237 61824 132274 13154 135532 10623 69930 52067 50115 150286 164414 199444 136102 40920 19210 69551 44077 19...
result:
ok OK, answer exists, pans = jans = 1
Test #168:
score: 20
Accepted
time: 21ms
memory: 19360kb
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: 45ms
memory: 16064kb
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 1 169126 16366 178789 188327 18710 53252 70428 75810 14464 23678 180653 90927 144112 168423 176644 2957 158109 83372 107890 175122 25305 49780 141833 64236 170019 162740 39832 3958 62113 130366 94934 182511 38724 135790 120064 115476 70124 33876 132265 126204 156387 170515 133925 59973 1130...
result:
ok OK, answer exists, pans = jans = 1
Test #170:
score: 20
Accepted
time: 51ms
memory: 16068kb
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 3 59692 30481 87251 29345 86227 7590 66547 178198 134908 54140 108632 11879 70435 3271 62632 175099 132081 198060 152908 168763 126349 5865 64985 49758 104676 20211 77953 190583 146127 7804 66744 173548 130673 24741 82077 163149 121260 192589 147940 183241 139472 197306 152214 157495 116147...
result:
ok OK, answer exists, pans = jans = 1
Test #171:
score: 20
Accepted
time: 49ms
memory: 17860kb
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 7 21445 35450 184355 173340 188972 57131 119890 139609 198100 158262 111551 147711 6584 105795 73560 192345 8741 184813 22239 198074 75509 155451 148723 58041 194245 190747 84844 160796 127030 7226 26886 128891 69895 117890 118885 12268 194836 190288 30617 47733 140351 136257 100034 22288 1...
result:
ok OK, answer exists, pans = jans = 1
Test #172:
score: 20
Accepted
time: 78ms
memory: 28636kb
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 196662 194449 193675 192466 192422 192418 192411 192127 192034 191979 191880 191743 191646 190430 190403 190378 190352 190341 190250 190029 189694 189475 189318 188918 188820 188505 188080 187678 187673 187410 187238 187146 187120 187028 186616 186579 186221 185779 185564 185528 185486 1...
result:
ok OK, answer exists, pans = jans = 10002
Test #173:
score: 20
Accepted
time: 64ms
memory: 26944kb
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: 72ms
memory: 30560kb
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 198048 197512 197034 196752 194734 193781 193451 192845 192801 2 1 54499 5 2 36215 120088 94143 67998 4 3 145693 158160 24333 5 4 89088 186233 172971 133431 3 5 31404 106703 5 6 72734 69801 68983 3029 4 7 7861 46379 122522 2 8 110607 5 9 167514 95185 166391 175980 4 10 169431 42356 164799 5 ...
result:
ok OK, answer exists, pans = jans = 39993
Test #175:
score: 20
Accepted
time: 49ms
memory: 26208kb
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 198933 197515 197135 196864 196103 194754 194325 193223 193069 192119 191163 190347 190231 190057 189944 189231 188466 188028 187931 187622 187057 186980 186673 186440 186154 185755 185297 184624 184301 184142 183938 183668 183526 183472 183453 183361 183195 183122 182661 182511 182481 18247...
result:
ok OK, answer exists, pans = jans = 2
Extra Test:
score: 0
Extra Test Passed