QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#519725 | #7688. Alea Iacta Est | pandapythoner | WA | 876ms | 107304kb | C++23 | 16.3kb | 2024-08-15 00:42:59 | 2024-08-15 00:42:59 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i += 1)
#define rng(i, start, end, step) for(int i = start; i < end; i += step)
#define len(a) ((int)(a).size())
mt19937 rnd(234);
const ll mod = 998244353;
ll bin_pow(ll x, ll n) {
ll rs = 1;
for (ll i = 1, a = x; i <= n; i *= 2, a = a * a % mod)
if (n & i) rs = rs * a % mod;
return rs;
}
ll inv(ll x) {
return bin_pow(x, mod - 2);
}
namespace fft {
int mxpw;
int mxn;
ll w;
void build_w() {
ll phi = mod - 1;
ll f = phi;
vector<ll> p;
for (ll i = 2; i * i <= f; i += 1) {
if (f % i == 0) {
p.push_back(i);
while (f % i == 0) {
f /= i;
}
}
}
if (f > 1) {
p.push_back(f);
}
for (int i = 1; i < mod; i += 1) {
bool ok = true;
for (auto q : p) {
if (bin_pow(i, phi / q) == 1) {
ok = false;
break;
}
}
if (ok) {
w = bin_pow(i, phi / (1 << mxpw));
break;
}
}
}
vector<ll> rvx;
void build_rvx(int n) {
rvx.resize(n + 1);
for (int i = 1; i <= n; i += 1) {
rvx[i] = inv(i);
}
}
vector<ll> rvi, wpws;
void build(int _mxpw) {
mxpw = _mxpw;
mxn = (1 << mxpw);
build_w();
int n = (1 << mxpw);
rvi.resize(n);
rvi[0] = 0;
for (int i = 1; i < n; i += 1) {
rvi[i] = (rvi[i >> 1] >> 1);
if (i & 1) {
rvi[i] += (1 << (mxpw - 1));
}
}
wpws.resize(n + 1);
wpws[0] = 1;
for (int i = 1; i <= n; i += 1) {
wpws[i] = (wpws[i - 1] * w) % mod;
}
build_rvx(mxn);
}
void fft(vector<ll>& a, int nk) {
int n = (1 << nk);
for (int i = 0; i < n; i += 1) {
int mrv = (rvi[i] >> (mxpw - nk));
if (mrv < i) {
swap(a[mrv], a[i]);
}
}
for (int ln = 1; ln < n; ln *= 2) {
int ln2 = ln + ln;
for (int i = 0; i < n; i += ln2) {
for (int j = 0; j < ln; j += 1) {
ll mw = wpws[mxn / ln2 * j];
int u = i + j;
int v = u + ln;
ll y = a[v] * mw % mod;
a[v] = a[u] - y;
if (a[v] < 0) {
a[v] += mod;
}
a[u] += y;
if (a[u] >= mod) {
a[u] -= mod;
}
}
}
}
}
void rev_fft(vector<ll>& a, int nk) {
int n = (1 << nk);
fft(a, nk);
ll rvn = inv(n);
reverse(a.begin() + 1, a.end());
for (int i = 0; i < n; i += 1) {
a[i] = (a[i] * rvn) % mod;
}
}
vector<ll> square(vector<ll> a) {
int nk = 0;
while ((1 << nk) < (int)a.size() + (int)a.size() - 1) {
nk += 1;
}
int n = (1 << nk);
a.resize(n, 0);
fft(a, nk);
for (int i = 0; i < n; i += 1) {
a[i] = (a[i] * a[i]) % mod;
}
rev_fft(a, nk);
while (!a.empty() && a.back() == 0) {
a.pop_back();
}
return a;
}
vector<ll> mul(vector<ll> a, vector<ll> b) {
int nk = 0;
while ((1 << nk) < (int)a.size() + (int)b.size() - 1) {
nk += 1;
}
int n = (1 << nk);
a.resize(n, 0);
b.resize(n, 0);
fft(a, nk);
fft(b, nk);
for (int i = 0; i < n; i += 1) {
a[i] = (a[i] * b[i]) % mod;
}
rev_fft(a, nk);
while (!a.empty() && a.back() == 0) {
a.pop_back();
}
return a;
}
void add_inplace(vector<ll>& a, const vector<ll>& b, ll k = 1) {
a.resize(max(a.size(), b.size()), 0);
for (int i = 0; i < (int)b.size(); i += 1) {
a[i] = (a[i] + b[i] * k) % mod;
}
}
vector<ll> add(vector<ll> a, const vector<ll>& b, ll k = 1) {
a.resize(max(a.size(), b.size()), 0);
for (int i = 0; i < (int)b.size(); i += 1) {
a[i] = (a[i] + b[i] * k) % mod;
}
return a;
}
vector<ll> sub(vector<ll> a, const vector<ll>& b, ll k = 1) {
a.resize(max(a.size(), b.size()), 0);
for (int i = 0; i < (int)b.size(); i += 1) {
a[i] = (a[i] + mod - b[i] * k % mod) % mod;
}
return a;
}
vector<ll> replace_x_slow(vector<ll>& a, const vector<ll>& b) {
vector<ll> rs = {};
vector<ll> bpw = { 1 };
for (int i = 0; i < (int)a.size(); i += 1) {
if (i > 0) {
bpw = mul(bpw, b);
}
add_inplace(rs, bpw, a[i]);
}
return rs;
}
vector<ll> replace_x(vector<ll>& a, const vector<ll>& b) {
vector<ll> rs = {};
vector<ll> bpw = b;
int n = a.size();
vector<vector<ll>> d(n);
for (int i = 0; i < n; i += 1) {
d[i] = { a[i] };
}
while (n > 1) {
int m = (n + 1) / 2;
vector<vector<ll>> nd(m);
for (int i = 0; i < n; i += 1) {
if (i % 2 == 0) {
nd[i / 2] = d[i];
} else {
add_inplace(nd[i / 2], mul(d[i], bpw));
}
}
n = m;
d.swap(nd);
if (n != 1) {
bpw = square(bpw);
}
}
return d[0];
}
vector<ll> shift_x(vector<ll> a, ll t) {
if (a.empty()) {
return {};
}
int n = (int)a.size() - 1;
vector<ll> f(n + 1), rf(n + 1);
f[0] = rf[0] = 1;
for (int i = 1; i <= n; i += 1) {
f[i] = (f[i - 1] * i) % mod;
rf[i] = inv(f[i]);
}
vector<ll> b(n + 1), c(n + 1);
ll tpw = 1;
for (int i = 0; i <= n; i += 1) {
b[i] = (a[i] * tpw % mod * f[i] % mod);
tpw = (tpw * t) % mod;
}
for (int i = 0; i <= n; i += 1) {
c[n - i] = rf[i];
}
a = mul(b, c);
vector<ll> d(n + 1);
ll rvt = inv(t);
ll rvt_pw = 1;
for (int i = 0; i <= n; i += 1) {
d[i] = rvt_pw * rf[i] % mod * a[i + n] % mod;
rvt_pw = (rvt_pw * rvt) % mod;
}
return d;
}
vector<ll> rev_polynom(const vector<ll>& a, int n) {
int sz = a.size();
vector<ll> b = { inv(a[0]) };
int m = 1;
int mk = 0;
while (m < n) {
int m2 = m + m;
int m4 = m2 + m2;
b.resize(m4);
fft(b, mk + 2);
vector<ll> nb(m4);
for (int i = 0; i < sz && i < m2; i += 1) {
nb[i] = a[i];
}
fft(nb, mk + 2);
for (int i = 0; i < m4; i += 1) {
nb[i] = (2 * b[i] - nb[i] * b[i] % mod * b[i]) % mod;
if (nb[i] < 0) {
nb[i] += mod;
}
}
rev_fft(nb, mk + 2);
nb.resize(m2);
b.swap(nb);
m = m2;
mk += 1;
}
b.resize(n);
return b;
}
vector<ll> square_root(const vector<ll>& a, int n) {
ll sz = a.size();
ll rv2 = inv(2);
vector<ll> b = { 1 };
int m = 1;
while (m < n) {
ll m2 = m + m;
vector<ll> rvb = rev_polynom(b, m2);
vector<ll> ab(m2);
for (int i = 0; i < m2 && i < sz; i += 1) {
ab[i] = a[i];
}
ab = mul(ab, rvb);
ab.resize(m2);
b.resize(m2);
for (int i = 0; i < m2; i += 1) {
b[i] = (rv2 * ((b[i] + ab[i]) % mod)) % mod;
}
m = m2;
}
b.resize(n);
return b;
}
vector<ll> derivative(vector<ll> a) {
int n = a.size();
if (n == 0) {
return {};
}
for (int i = 0; i + 1 < n; i += 1) {
a[i] = (a[i + 1] * (i + 1)) % mod;
}
a.resize(n - 1);
return a;
}
vector<ll> integrate(vector<ll> a) {
int n = a.size();
a.resize(n + 1);
for (int i = n; i > 0; i -= 1) {
a[i] = (a[i - 1] * rvx[i]) % mod;
}
a[0] = 0;
return a;
}
vector<ll> sin_polynomial(int n) {
vector<ll> a(n, 0);
ll fct = 1;
for (int i = 0; i < n; i += 1) {
if (i != 0) {
fct = (fct * i) % mod;
}
if (i % 2 == 1) {
int sign = 1;
if ((i / 2) % 2 == 1) {
sign = -1;
}
a[i] = (mod + sign * inv(fct)) % mod;
}
}
return a;
}
vector<ll> cos_polynomial(int n) {
vector<ll> a(n, 0);
ll fct = 1;
for (int i = 0; i < n; i += 1) {
if (i != 0) {
fct = (fct * i) % mod;
}
if (i % 2 == 0) {
int sign = 1;
if ((i / 2) % 2 == 1) {
sign = -1;
}
a[i] = (mod + sign * inv(fct)) % mod;
}
}
return a;
}
vector<ll> super_cos_polynomial(int n, int k) {
vector<ll> a(n, 0);
ll fct = 1;
for (int i = 0; i < n; i += 1) {
if (i != 0) {
fct = (fct * i) % mod;
}
if (i % k == 0) {
int sign = 1;
if ((i / k) % 2 == 1) {
sign = -1;
}
a[i] = (mod + sign * inv(fct)) % mod;
}
}
return a;
}
vector<ll> logarithm(const vector<ll>& a, int n) {
if (n == 0) {
return {};
}
vector<ll> b = integrate(mul(derivative(a), rev_polynom(a, n)));
b.resize(n);
return b;
}
vector<ll> exponent(const vector<ll>& a, int n) {
vector<ll> b = { 1 };
int m = 1;
while (m < n) {
int m2 = m + m;
vector<ll> t = logarithm(b, m2);
for (int i = 0; i < m2 && i < (int)a.size(); i += 1) {
t[i] = (t[i] - a[i]);
if (t[i] < 0) {
t[i] += mod;
}
}
vector<ll> q = fft::mul(t, b);
q.resize(m2);
b.resize(m2);
for (int i = 0; i < m2; i += 1) {
b[i] -= q[i];
if (b[i] < 0) {
b[i] += mod;
}
}
m = m2;
}
b.resize(n);
return b;
}
vector<ll> solve_differential(const vector<ll>& a, const vector<ll>& b, int n) {
vector<ll> e = exponent(integrate(a), n);
vector<ll> result = mul(e, integrate(mul(b, rev_polynom(e, n))));
result.resize(n);
return result;
}
vector<ll> pure_exponent(int n, ll k = 1) {
if (n == 0) {
return {};
}
k %= mod;
if (k < 0) {
k += mod;
}
vector<ll> rs(n);
rs[0] = 1;
ll rv_fct = 1;
for (int i = 1; i < n; i += 1) {
rv_fct = (rv_fct * rvx[i]) % mod * k % mod;
rs[i] = rv_fct;
}
return rs;
}
} // namespace fft
vector<ll> get_flex(int step, int num_steps) {
vector<ll> result(step * num_steps);
rep(i, num_steps) result[i * step] = 1;
return result;
}
vector<ll> get_dice(vector<ll> flex) {
vector<ll> result;
rep(i, len(flex)) {
assert(flex[i] >= 0);
rep(j, flex[i]) result.push_back(i);
}
return result;
}
void print_flex(ll n, ll m, ll a, ll b) {
ll nm = n * m;
assert(n % a == 0 and m % b == 0);
auto first_dice = get_dice(fft::mul(get_flex(a, n / a), get_flex(m / b, b)));
auto second_dice = get_dice(fft::mul(get_flex(1, m / b), get_flex(1, a)));
cout << len(first_dice); for (auto x : first_dice) cout << " " << x + 1;
cout << "\n";
cout << len(second_dice); for (auto x : second_dice) cout << " " << x + 1;
cout << "\n\n";
}
int32_t main() {
fft::build(21);
if (1) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int t;
cin >> t;
rep(itr, t) {
int n, m;
cin >> n >> m;
if (n > m) swap(n, m);
ll nm = ll(n) * m;
ll opt = 1;
for (ll x = 1; x * x <= nm; x += 1) {
if (nm % x != 0) continue;
if (opt + nm / opt > x + nm / x) opt = x;
}
if (opt != n) {
ll g = gcd(opt, n);
ll a = n / g;
ll b = opt / g;
print_flex(n, m, a, b);
continue;
}
ll g = gcd(n, m);
ll frst = -1;
for (ll i = 2; i <= g; i += 1) if (g % i == 0) { frst = i; break; }
if (frst != -1 and frst < m) {
print_flex(n, m, frst, frst);
continue;
}
bool ok = false;
rep(itr, 2) {
swap(n, m);
ll a = -1, b = -1;
for (ll i = 2; i < n; i += 1) if (n % i == 0 and gcd(n / i, i) == 1 and min(i, n / i) <= m) {
a = i; b = n / i; break;
};
if (a != -1) {
vector<ll> biba(a + b);
vector<ll> boba(n + m);
biba[0] = boba[0] = 1;
for (int i = len(biba) - 1; i - a >= 0; i -= 1) {
biba[i] -= biba[i - a];
}
for (int i = len(biba) - 1; i - b >= 0; i -= 1) {
biba[i] -= biba[i - b];
}
for (int i = 1; i < len(biba); i += 1) {
biba[i] += biba[i - 1];
}
for (int i = 1; i < len(biba); i += 1) {
biba[i] += biba[i - 1];
}
for (int i = len(boba) - 1; i - n >= 0; i -= 1) {
boba[i] -= boba[i - n];
}
for (int i = len(boba) - 1; i - m >= 0; i -= 1) {
boba[i] -= boba[i - m];
}
for (int i = a; i < len(boba); i += 1) {
boba[i] += boba[i - a];
}
for (int i = b; i < len(boba); i += 1) {
boba[i] += boba[i - b];
}
bool bad = false;
for (auto x : boba) if (x < 0) bad = true;
if (bad) {
continue;
}
auto first_dice = get_dice(biba);
auto second_dice = get_dice(boba);
cout << len(first_dice); for (auto x : first_dice) cout << " " << x + 1;
cout << "\n";
cout << len(second_dice); for (auto x : second_dice) cout << " " << x + 1;
cout << "\n\n";
ok = true;
break;
}
}
if (ok) {
continue;
}
opt = -1;
for (ll x = 1; x * x <= nm; x += 1) {
if (nm % x != 0) continue;
if (x == n) continue;
if (opt == -1 or opt + nm / opt > x + nm / x) opt = x;
}
if (opt != -1 and opt + nm / opt < 2 * n + m) {
ll g = gcd(opt, n);
ll a = n / g;
ll b = opt / g;
print_flex(n, m, a, b);
continue;
}
cout << 2 * n; rep(i, n) cout << " " << i + 1 << " " << i + 1; cout << "\n";
cout << m; rep(i, m) cout << " " << i + 1; cout << "\n";
cout << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 231ms
memory: 52304kb
input:
3 2 8 1 9 2 9
output:
4 1 2 5 6 4 1 2 3 4 3 1 4 7 3 1 2 3 3 1 4 7 6 1 2 2 3 3 4
result:
ok Correct. (3 test cases)
Test #2:
score: 0
Accepted
time: 240ms
memory: 52160kb
input:
1 40013 40013
output:
80026 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 ...
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 243ms
memory: 52416kb
input:
1 40013 1
output:
2 1 1 40013 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 ...
result:
ok Correct. (1 test case)
Test #4:
score: 0
Accepted
time: 240ms
memory: 52344kb
input:
1 2 40013
output:
4 1 1 2 2 40013 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...
result:
ok Correct. (1 test case)
Test #5:
score: 0
Accepted
time: 244ms
memory: 52164kb
input:
1 3 40013
output:
6 1 1 2 2 3 3 40013 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 9...
result:
ok Correct. (1 test case)
Test #6:
score: 0
Accepted
time: 236ms
memory: 52308kb
input:
1 4 40013
output:
8 1 1 2 2 3 3 4 4 40013 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 ...
result:
ok Correct. (1 test case)
Test #7:
score: 0
Accepted
time: 379ms
memory: 52336kb
input:
1 999983 999983
output:
1999966 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 5...
result:
ok Correct. (1 test case)
Test #8:
score: 0
Accepted
time: 288ms
memory: 52260kb
input:
1 1 999983
output:
2 1 1 999983 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...
result:
ok Correct. (1 test case)
Test #9:
score: 0
Accepted
time: 273ms
memory: 52308kb
input:
1 2 999983
output:
4 1 1 2 2 999983 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 9...
result:
ok Correct. (1 test case)
Test #10:
score: 0
Accepted
time: 286ms
memory: 52264kb
input:
1 999983 3
output:
6 1 1 2 2 3 3 999983 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 ...
result:
ok Correct. (1 test case)
Test #11:
score: 0
Accepted
time: 280ms
memory: 52116kb
input:
1 999983 4
output:
8 1 1 2 2 3 3 4 4 999983 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...
result:
ok Correct. (1 test case)
Test #12:
score: 0
Accepted
time: 818ms
memory: 100964kb
input:
1 1000000 1000000
output:
1000000 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173...
result:
ok Correct. (1 test case)
Test #13:
score: 0
Accepted
time: 407ms
memory: 78084kb
input:
1 1000000 1
output:
1000 1 1001 2001 3001 4001 5001 6001 7001 8001 9001 10001 11001 12001 13001 14001 15001 16001 17001 18001 19001 20001 21001 22001 23001 24001 25001 26001 27001 28001 29001 30001 31001 32001 33001 34001 35001 36001 37001 38001 39001 40001 41001 42001 43001 44001 45001 46001 47001 48001 49001 50001 51...
result:
ok Correct. (1 test case)
Test #14:
score: 0
Accepted
time: 411ms
memory: 78400kb
input:
1 1000000 2
output:
1250 1 2 1601 1602 3201 3202 4801 4802 6401 6402 8001 8002 9601 9602 11201 11202 12801 12802 14401 14402 16001 16002 17601 17602 19201 19202 20801 20802 22401 22402 24001 24002 25601 25602 27201 27202 28801 28802 30401 30402 32001 32002 33601 33602 35201 35202 36801 36802 38401 38402 40001 40002 416...
result:
ok Correct. (1 test case)
Test #15:
score: 0
Accepted
time: 413ms
memory: 77392kb
input:
1 3 1000000
output:
1600 1 626 1251 1876 2501 3126 3751 4376 5001 5626 6251 6876 7501 8126 8751 9376 10001 10626 11251 11876 12501 13126 13751 14376 15001 15626 16251 16876 17501 18126 18751 19376 20001 20626 21251 21876 22501 23126 23751 24376 25001 25626 26251 26876 27501 28126 28751 29376 30001 30626 31251 31876 325...
result:
ok Correct. (1 test case)
Test #16:
score: 0
Accepted
time: 431ms
memory: 78068kb
input:
1 4 1000000
output:
2000 1 2 3 4 2001 2002 2003 2004 4001 4002 4003 4004 6001 6002 6003 6004 8001 8002 8003 8004 10001 10002 10003 10004 12001 12002 12003 12004 14001 14002 14003 14004 16001 16002 16003 16004 18001 18002 18003 18004 20001 20002 20003 20004 22001 22002 22003 22004 24001 24002 24003 24004 26001 26002 260...
result:
ok Correct. (1 test case)
Test #17:
score: 0
Accepted
time: 739ms
memory: 101040kb
input:
1 988027 988027
output:
988027 1 992 998 1983 1989 1995 2974 2980 2986 2992 3965 3971 3977 3983 3989 4956 4962 4968 4974 4980 4986 5947 5953 5959 5965 5971 5977 5983 6938 6944 6950 6956 6962 6968 6974 6980 7929 7935 7941 7947 7953 7959 7965 7971 7977 8920 8926 8932 8938 8944 8950 8956 8962 8968 8974 9911 9917 9923 9929 993...
result:
ok Correct. (1 test case)
Test #18:
score: 0
Accepted
time: 418ms
memory: 78312kb
input:
1 988027 1
output:
991 1 998 1995 2992 3989 4986 5983 6980 7977 8974 9971 10968 11965 12962 13959 14956 15953 16950 17947 18944 19941 20938 21935 22932 23929 24926 25923 26920 27917 28914 29911 30908 31905 32902 33899 34896 35893 36890 37887 38884 39881 40878 41875 42872 43869 44866 45863 46860 47857 48854 49851 50848...
result:
ok Correct. (1 test case)
Test #19:
score: 0
Accepted
time: 455ms
memory: 76748kb
input:
1 2 988027
output:
997 1 992 1983 2974 3965 4956 5947 6938 7929 8920 9911 10902 11893 12884 13875 14866 15857 16848 17839 18830 19821 20812 21803 22794 23785 24776 25767 26758 27749 28740 29731 30722 31713 32704 33695 34686 35677 36668 37659 38650 39641 40632 41623 42614 43605 44596 45587 46578 47569 48560 49551 50542...
result:
ok Correct. (1 test case)
Test #20:
score: 0
Accepted
time: 422ms
memory: 77232kb
input:
1 3 988027
output:
997 1 992 1983 2974 3965 4956 5947 6938 7929 8920 9911 10902 11893 12884 13875 14866 15857 16848 17839 18830 19821 20812 21803 22794 23785 24776 25767 26758 27749 28740 29731 30722 31713 32704 33695 34686 35677 36668 37659 38650 39641 40632 41623 42614 43605 44596 45587 46578 47569 48560 49551 50542...
result:
ok Correct. (1 test case)
Test #21:
score: 0
Accepted
time: 416ms
memory: 78184kb
input:
1 4 988027
output:
1982 1 3 998 1000 1995 1997 2992 2994 3989 3991 4986 4988 5983 5985 6980 6982 7977 7979 8974 8976 9971 9973 10968 10970 11965 11967 12962 12964 13959 13961 14956 14958 15953 15955 16950 16952 17947 17949 18944 18946 19941 19943 20938 20940 21935 21937 22932 22934 23929 23931 24926 24928 25923 25925 ...
result:
ok Correct. (1 test case)
Test #22:
score: 0
Accepted
time: 718ms
memory: 101288kb
input:
1 995779 995779
output:
995779 1 984 1014 1967 1997 2027 2950 2980 3010 3040 3933 3963 3993 4023 4053 4916 4946 4976 5006 5036 5066 5899 5929 5959 5989 6019 6049 6079 6882 6912 6942 6972 7002 7032 7062 7092 7865 7895 7925 7955 7985 8015 8045 8075 8105 8848 8878 8908 8938 8968 8998 9028 9058 9088 9118 9831 9861 9891 9921 99...
result:
ok Correct. (1 test case)
Test #23:
score: 0
Accepted
time: 411ms
memory: 78400kb
input:
1 1 995779
output:
983 1 1014 2027 3040 4053 5066 6079 7092 8105 9118 10131 11144 12157 13170 14183 15196 16209 17222 18235 19248 20261 21274 22287 23300 24313 25326 26339 27352 28365 29378 30391 31404 32417 33430 34443 35456 36469 37482 38495 39508 40521 41534 42547 43560 44573 45586 46599 47612 48625 49638 50651 516...
result:
ok Correct. (1 test case)
Test #24:
score: 0
Accepted
time: 418ms
memory: 77344kb
input:
1 995779 2
output:
1013 1 984 1967 2950 3933 4916 5899 6882 7865 8848 9831 10814 11797 12780 13763 14746 15729 16712 17695 18678 19661 20644 21627 22610 23593 24576 25559 26542 27525 28508 29491 30474 31457 32440 33423 34406 35389 36372 37355 38338 39321 40304 41287 42270 43253 44236 45219 46202 47185 48168 49151 5013...
result:
ok Correct. (1 test case)
Test #25:
score: 0
Accepted
time: 417ms
memory: 76732kb
input:
1 995779 3
output:
1013 1 984 1967 2950 3933 4916 5899 6882 7865 8848 9831 10814 11797 12780 13763 14746 15729 16712 17695 18678 19661 20644 21627 22610 23593 24576 25559 26542 27525 28508 29491 30474 31457 32440 33423 34406 35389 36372 37355 38338 39321 40304 41287 42270 43253 44236 45219 46202 47185 48168 49151 5013...
result:
ok Correct. (1 test case)
Test #26:
score: 0
Accepted
time: 413ms
memory: 78072kb
input:
1 995779 4
output:
1966 1 3 1014 1016 2027 2029 3040 3042 4053 4055 5066 5068 6079 6081 7092 7094 8105 8107 9118 9120 10131 10133 11144 11146 12157 12159 13170 13172 14183 14185 15196 15198 16209 16211 17222 17224 18235 18237 19248 19250 20261 20263 21274 21276 22287 22289 23300 23302 24313 24315 25326 25328 26339 263...
result:
ok Correct. (1 test case)
Test #27:
score: 0
Accepted
time: 764ms
memory: 99788kb
input:
1 720720 720720
output:
720720 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 ...
result:
ok Correct. (1 test case)
Test #28:
score: 0
Accepted
time: 412ms
memory: 76348kb
input:
1 720720 1
output:
840 1 859 1717 2575 3433 4291 5149 6007 6865 7723 8581 9439 10297 11155 12013 12871 13729 14587 15445 16303 17161 18019 18877 19735 20593 21451 22309 23167 24025 24883 25741 26599 27457 28315 29173 30031 30889 31747 32605 33463 34321 35179 36037 36895 37753 38611 39469 40327 41185 42043 42901 43759 ...
result:
ok Correct. (1 test case)
Test #29:
score: 0
Accepted
time: 422ms
memory: 74912kb
input:
1 2 720720
output:
1170 1 2 1233 1234 2465 2466 3697 3698 4929 4930 6161 6162 7393 7394 8625 8626 9857 9858 11089 11090 12321 12322 13553 13554 14785 14786 16017 16018 17249 17250 18481 18482 19713 19714 20945 20946 22177 22178 23409 23410 24641 24642 25873 25874 27105 27106 28337 28338 29569 29570 30801 30802 32033 3...
result:
ok Correct. (1 test case)
Test #30:
score: 0
Accepted
time: 400ms
memory: 76420kb
input:
1 3 720720
output:
1456 1 496 991 1486 1981 2476 2971 3466 3961 4456 4951 5446 5941 6436 6931 7426 7921 8416 8911 9406 9901 10396 10891 11386 11881 12376 12871 13366 13861 14356 14851 15346 15841 16336 16831 17326 17821 18316 18811 19306 19801 20296 20791 21286 21781 22276 22771 23266 23761 24256 24751 25246 25741 262...
result:
ok Correct. (1 test case)
Test #31:
score: 0
Accepted
time: 418ms
memory: 75364kb
input:
1 4 720720
output:
1680 1 2 3 4 1717 1718 1719 1720 3433 3434 3435 3436 5149 5150 5151 5152 6865 6866 6867 6868 8581 8582 8583 8584 10297 10298 10299 10300 12013 12014 12015 12016 13729 13730 13731 13732 15445 15446 15447 15448 17161 17162 17163 17164 18877 18878 18879 18880 20593 20594 20595 20596 22309 22310 22311 2...
result:
ok Correct. (1 test case)
Test #32:
score: 0
Accepted
time: 562ms
memory: 77044kb
input:
1 524288 524288
output:
524288 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 ...
result:
ok Correct. (1 test case)
Test #33:
score: 0
Accepted
time: 311ms
memory: 60408kb
input:
1 1 524288
output:
512 1 1025 2049 3073 4097 5121 6145 7169 8193 9217 10241 11265 12289 13313 14337 15361 16385 17409 18433 19457 20481 21505 22529 23553 24577 25601 26625 27649 28673 29697 30721 31745 32769 33793 34817 35841 36865 37889 38913 39937 40961 41985 43009 44033 45057 46081 47105 48129 49153 50177 51201 522...
result:
ok Correct. (1 test case)
Test #34:
score: 0
Accepted
time: 411ms
memory: 72716kb
input:
1 2 524288
output:
1024 1 2 1025 1026 2049 2050 3073 3074 4097 4098 5121 5122 6145 6146 7169 7170 8193 8194 9217 9218 10241 10242 11265 11266 12289 12290 13313 13314 14337 14338 15361 15362 16385 16386 17409 17410 18433 18434 19457 19458 20481 20482 21505 21506 22529 22530 23553 23554 24577 24578 25601 25602 26625 266...
result:
ok Correct. (1 test case)
Test #35:
score: 0
Accepted
time: 408ms
memory: 72784kb
input:
1 3 524288
output:
1024 1 513 1025 1537 2049 2561 3073 3585 4097 4609 5121 5633 6145 6657 7169 7681 8193 8705 9217 9729 10241 10753 11265 11777 12289 12801 13313 13825 14337 14849 15361 15873 16385 16897 17409 17921 18433 18945 19457 19969 20481 20993 21505 22017 22529 23041 23553 24065 24577 25089 25601 26113 26625 2...
result:
ok Correct. (1 test case)
Test #36:
score: 0
Accepted
time: 410ms
memory: 72756kb
input:
1 524288 4
output:
1024 1 2 3 4 2049 2050 2051 2052 4097 4098 4099 4100 6145 6146 6147 6148 8193 8194 8195 8196 10241 10242 10243 10244 12289 12290 12291 12292 14337 14338 14339 14340 16385 16386 16387 16388 18433 18434 18435 18436 20481 20482 20483 20484 22529 22530 22531 22532 24577 24578 24579 24580 26625 26626 266...
result:
ok Correct. (1 test case)
Test #37:
score: 0
Accepted
time: 720ms
memory: 99236kb
input:
1 531441 531441
output:
531441 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 103 106 109 112 115 118 121 124 127 130 133 136 139 142 145 148 151 154 157 160 163 166 169 172 175 178 181 184 187 190 193 196 199 202 205 208 211 214 217 220 223 226 229 232 235 238 241 244 2...
result:
ok Correct. (1 test case)
Test #38:
score: 0
Accepted
time: 409ms
memory: 72788kb
input:
1 1 531441
output:
729 1 730 1459 2188 2917 3646 4375 5104 5833 6562 7291 8020 8749 9478 10207 10936 11665 12394 13123 13852 14581 15310 16039 16768 17497 18226 18955 19684 20413 21142 21871 22600 23329 24058 24787 25516 26245 26974 27703 28432 29161 29890 30619 31348 32077 32806 33535 34264 34993 35722 36451 37180 37...
result:
ok Correct. (1 test case)
Test #39:
score: 0
Accepted
time: 411ms
memory: 73056kb
input:
1 2 531441
output:
729 1 730 1459 2188 2917 3646 4375 5104 5833 6562 7291 8020 8749 9478 10207 10936 11665 12394 13123 13852 14581 15310 16039 16768 17497 18226 18955 19684 20413 21142 21871 22600 23329 24058 24787 25516 26245 26974 27703 28432 29161 29890 30619 31348 32077 32806 33535 34264 34993 35722 36451 37180 37...
result:
ok Correct. (1 test case)
Test #40:
score: 0
Accepted
time: 423ms
memory: 72860kb
input:
1 531441 3
output:
729 1 2 3 2188 2189 2190 4375 4376 4377 6562 6563 6564 8749 8750 8751 10936 10937 10938 13123 13124 13125 15310 15311 15312 17497 17498 17499 19684 19685 19686 21871 21872 21873 24058 24059 24060 26245 26246 26247 28432 28433 28434 30619 30620 30621 32806 32807 32808 34993 34994 34995 37180 37181 37...
result:
ok Correct. (1 test case)
Test #41:
score: 0
Accepted
time: 409ms
memory: 72792kb
input:
1 531441 4
output:
1458 1 3 730 732 1459 1461 2188 2190 2917 2919 3646 3648 4375 4377 5104 5106 5833 5835 6562 6564 7291 7293 8020 8022 8749 8751 9478 9480 10207 10209 10936 10938 11665 11667 12394 12396 13123 13125 13852 13854 14581 14583 15310 15312 16039 16041 16768 16770 17497 17499 18226 18228 18955 18957 19684 1...
result:
ok Correct. (1 test case)
Test #42:
score: 0
Accepted
time: 504ms
memory: 76820kb
input:
1 510510 510510
output:
510510 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 ...
result:
ok Correct. (1 test case)
Test #43:
score: 0
Accepted
time: 312ms
memory: 65784kb
input:
1 510510 1
output:
714 1 716 1431 2146 2861 3576 4291 5006 5721 6436 7151 7866 8581 9296 10011 10726 11441 12156 12871 13586 14301 15016 15731 16446 17161 17876 18591 19306 20021 20736 21451 22166 22881 23596 24311 25026 25741 26456 27171 27886 28601 29316 30031 30746 31461 32176 32891 33606 34321 35036 35751 36466 37...
result:
ok Correct. (1 test case)
Test #44:
score: 0
Accepted
time: 313ms
memory: 65580kb
input:
1 510510 2
output:
1001 1 511 1021 1531 2041 2551 3061 3571 4081 4591 5101 5611 6121 6631 7141 7651 8161 8671 9181 9691 10201 10711 11221 11731 12241 12751 13261 13771 14281 14791 15301 15811 16321 16831 17341 17851 18361 18871 19381 19891 20401 20911 21421 21931 22441 22951 23461 23971 24481 24991 25501 26011 26521 2...
result:
ok Correct. (1 test case)
Test #45:
score: 0
Accepted
time: 311ms
memory: 65512kb
input:
1 3 510510
output:
1190 1 430 859 1288 1717 2146 2575 3004 3433 3862 4291 4720 5149 5578 6007 6436 6865 7294 7723 8152 8581 9010 9439 9868 10297 10726 11155 11584 12013 12442 12871 13300 13729 14158 14587 15016 15445 15874 16303 16732 17161 17590 18019 18448 18877 19306 19735 20164 20593 21022 21451 21880 22309 22738 ...
result:
ok Correct. (1 test case)
Test #46:
score: 0
Accepted
time: 308ms
memory: 65284kb
input:
1 4 510510
output:
1428 1 2 3 4 1431 1432 1433 1434 2861 2862 2863 2864 4291 4292 4293 4294 5721 5722 5723 5724 7151 7152 7153 7154 8581 8582 8583 8584 10011 10012 10013 10014 11441 11442 11443 11444 12871 12872 12873 12874 14301 14302 14303 14304 15731 15732 15733 15734 17161 17162 17163 17164 18591 18592 18593 18594...
result:
ok Correct. (1 test case)
Test #47:
score: 0
Accepted
time: 486ms
memory: 76804kb
input:
1 279936 279936
output:
279936 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 ...
result:
ok Correct. (1 test case)
Test #48:
score: 0
Accepted
time: 319ms
memory: 62684kb
input:
1 279936 1
output:
486 1 577 1153 1729 2305 2881 3457 4033 4609 5185 5761 6337 6913 7489 8065 8641 9217 9793 10369 10945 11521 12097 12673 13249 13825 14401 14977 15553 16129 16705 17281 17857 18433 19009 19585 20161 20737 21313 21889 22465 23041 23617 24193 24769 25345 25921 26497 27073 27649 28225 28801 29377 29953 ...
result:
ok Correct. (1 test case)
Test #49:
score: 0
Accepted
time: 317ms
memory: 62956kb
input:
1 279936 2
output:
729 1 385 769 1153 1537 1921 2305 2689 3073 3457 3841 4225 4609 4993 5377 5761 6145 6529 6913 7297 7681 8065 8449 8833 9217 9601 9985 10369 10753 11137 11521 11905 12289 12673 13057 13441 13825 14209 14593 14977 15361 15745 16129 16513 16897 17281 17665 18049 18433 18817 19201 19585 19969 20353 2073...
result:
ok Correct. (1 test case)
Test #50:
score: 0
Accepted
time: 316ms
memory: 62796kb
input:
1 279936 3
output:
864 1 2 3 973 974 975 1945 1946 1947 2917 2918 2919 3889 3890 3891 4861 4862 4863 5833 5834 5835 6805 6806 6807 7777 7778 7779 8749 8750 8751 9721 9722 9723 10693 10694 10695 11665 11666 11667 12637 12638 12639 13609 13610 13611 14581 14582 14583 15553 15554 15555 16525 16526 16527 17497 17498 17499...
result:
ok Correct. (1 test case)
Test #51:
score: 0
Accepted
time: 315ms
memory: 62788kb
input:
1 4 279936
output:
972 1 2 3 4 1153 1154 1155 1156 2305 2306 2307 2308 3457 3458 3459 3460 4609 4610 4611 4612 5761 5762 5763 5764 6913 6914 6915 6916 8065 8066 8067 8068 9217 9218 9219 9220 10369 10370 10371 10372 11521 11522 11523 11524 12673 12674 12675 12676 13825 13826 13827 13828 14977 14978 14979 14980 16129 16...
result:
ok Correct. (1 test case)
Test #52:
score: 0
Accepted
time: 714ms
memory: 101268kb
input:
1 871933 871933
output:
871933 1 90 179 268 357 446 535 624 713 802 891 980 1069 1158 1247 1336 1425 1514 1603 1692 1781 1870 1959 2048 2137 2226 2315 2404 2493 2582 2671 2760 2849 2938 3027 3116 3205 3294 3383 3472 3561 3650 3739 3828 3917 4006 4095 4184 4273 4362 4451 4540 4629 4718 4807 4896 4985 5074 5163 5252 5341 543...
result:
ok Correct. (1 test case)
Test #53:
score: 0
Accepted
time: 422ms
memory: 77000kb
input:
1 871933 1
output:
101 1 8634 17267 25900 34533 43166 51799 60432 69065 77698 86331 94964 103597 112230 120863 129496 138129 146762 155395 164028 172661 181294 189927 198560 207193 215826 224459 233092 241725 250358 258991 267624 276257 284890 293523 302156 310789 319422 328055 336688 345321 353954 362587 371220 37985...
result:
ok Correct. (1 test case)
Test #54:
score: 0
Accepted
time: 418ms
memory: 76996kb
input:
1 2 871933
output:
202 1 2 8634 8635 17267 17268 25900 25901 34533 34534 43166 43167 51799 51800 60432 60433 69065 69066 77698 77699 86331 86332 94964 94965 103597 103598 112230 112231 120863 120864 129496 129497 138129 138130 146762 146763 155395 155396 164028 164029 172661 172662 181294 181295 189927 189928 198560 1...
result:
ok Correct. (1 test case)
Test #55:
score: 0
Accepted
time: 420ms
memory: 76288kb
input:
1 3 871933
output:
303 1 2 3 8634 8635 8636 17267 17268 17269 25900 25901 25902 34533 34534 34535 43166 43167 43168 51799 51800 51801 60432 60433 60434 69065 69066 69067 77698 77699 77700 86331 86332 86333 94964 94965 94966 103597 103598 103599 112230 112231 112232 120863 120864 120865 129496 129497 129498 138129 1381...
result:
ok Correct. (1 test case)
Test #56:
score: 0
Accepted
time: 413ms
memory: 76040kb
input:
1 4 871933
output:
404 1 2 3 4 8634 8635 8636 8637 17267 17268 17269 17270 25900 25901 25902 25903 34533 34534 34535 34536 43166 43167 43168 43169 51799 51800 51801 51802 60432 60433 60434 60435 69065 69066 69067 69068 77698 77699 77700 77701 86331 86332 86333 86334 94964 94965 94966 94967 103597 103598 103599 103600 ...
result:
ok Correct. (1 test case)
Test #57:
score: 0
Accepted
time: 324ms
memory: 104756kb
input:
1 1000000 999999
output:
1000000 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 1...
result:
ok Correct. (1 test case)
Test #58:
score: 0
Accepted
time: 803ms
memory: 101284kb
input:
1 1000000 999998
output:
999998 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 ...
result:
ok Correct. (1 test case)
Test #59:
score: 0
Accepted
time: 344ms
memory: 105172kb
input:
1 1000000 999983
output:
1000000 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 1...
result:
ok Correct. (1 test case)
Test #60:
score: 0
Accepted
time: 761ms
memory: 100468kb
input:
1 1000000 900000
output:
937500 1 25 49 73 97 121 145 169 193 217 241 265 289 313 337 361 385 409 433 457 481 505 529 553 577 601 625 649 673 697 721 745 769 793 817 841 865 889 913 937 961 985 1009 1033 1057 1081 1105 1129 1153 1177 1201 1225 1249 1273 1297 1321 1345 1369 1393 1417 1441 1465 1489 1513 1537 1561 1585 1609 1...
result:
ok Correct. (1 test case)
Test #61:
score: 0
Accepted
time: 710ms
memory: 99760kb
input:
1 500000 1000000
output:
640000 1 26 51 76 101 126 151 176 201 226 251 276 301 326 351 376 401 426 451 476 501 526 551 576 601 626 651 676 701 726 751 776 801 826 851 876 901 926 951 976 1001 1026 1051 1076 1101 1126 1151 1176 1201 1226 1251 1276 1301 1326 1351 1376 1401 1426 1451 1476 1501 1526 1551 1576 1601 1626 1651 167...
result:
ok Correct. (1 test case)
Test #62:
score: 0
Accepted
time: 748ms
memory: 98452kb
input:
1 524288 1000000
output:
655360 1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101 105 109 113 117 121 125 129 133 137 141 145 149 153 157 161 165 169 173 177 181 185 189 193 197 201 205 209 213 217 221 225 229 233 237 241 245 249 253 257 261 265 269 273 277 281 285 289 293 297 301 305 309 313 317 3...
result:
ok Correct. (1 test case)
Test #63:
score: 0
Accepted
time: 342ms
memory: 52108kb
input:
6 1 4 531441 999983 2 2 1 1 1 6 4 3
output:
2 1 3 2 1 2 1062882 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 ...
result:
ok Correct. (6 test cases)
Test #64:
score: 0
Accepted
time: 337ms
memory: 52420kb
input:
7 1 1 7 6 1 1 3 3 1 1 4 4 999983 524288
output:
2 1 1 1 1 6 1 2 2 3 3 4 7 1 3 4 5 6 7 9 2 1 1 1 1 6 1 1 2 2 3 3 3 1 2 3 2 1 1 1 1 4 1 3 3 5 4 1 2 2 3 1048576 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 3...
result:
ok Correct. (7 test cases)
Test #65:
score: 0
Accepted
time: 876ms
memory: 93136kb
input:
42 4698 12061 519 18 4 11 1 1 1 1 30 105 106 18 53 45 14230 7541 15 15 36035 39105 7430 11797 101 269 1 1 11 39 12 12 1677 1550 38 54 15974 33669 4 3 14928 32774 27 20 1354 2368 7 49 1 1 1 11 1 1 37 192 1604 1970 135 114 22095 16791 12317 28762 524288 531441 125 18 35746 16893 921 3453 344 42 70290 ...
output:
5481 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 121 127 133 139 145 151 157 163 169 175 181 187 193 199 205 211 217 223 229 235 241 247 253 259 265 271 277 283 289 295 301 307 313 319 325 331 337 343 349 355 361 367 373 379 385 391 397 403 409 415 421 427 433 439 445 451 457 463 46...
result:
ok Correct. (42 test cases)
Test #66:
score: 0
Accepted
time: 327ms
memory: 99828kb
input:
9 1 1 1 1 1 1 2 2 1 2 999983 720720 1 1 8 4 1 1
output:
2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 1 4 1 2 2 3 2 1 1 2 1 2 720720 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 ...
result:
ok Correct. (9 test cases)
Test #67:
score: 0
Accepted
time: 409ms
memory: 94916kb
input:
38 1427 1873 2 4 1537 896 1 1 1750 1553 1 1 5610 31561 35 2 332 354 6 173 4 6 181 71 3647 3589 6 1 5331 3265 48 965 111270 88190 8097 3502 2 1 17 30 30 50 3 2 1801 1152 720720 720703 101 101 70821 44842 2 3 70 316 1 8 7 7 739 1024 4 21 586 12898 1 2 257 132 19172 1718 5283 5970 2 2
output:
2854 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...
result:
ok Correct. (38 test cases)
Test #68:
score: 0
Accepted
time: 344ms
memory: 52164kb
input:
8 1 1 999983 720703 2 2 3 3 1 1 3 4 5 4 1 1
output:
2 1 1 1 1 1441406 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50...
result:
ok Correct. (8 test cases)
Test #69:
score: 0
Accepted
time: 739ms
memory: 101016kb
input:
29 1 1 41 42 2 22 1220 451 8 2 58 94 2 4 1 1 255 179 5 1 3514 591 3 4 22 4 232 702 1 2 358 320 2768 497 928 525 2 51 1 9 85 207 41 47 221 174 5 5 988027 986040 1251 80 217 220 2 11 1 1
output:
2 1 1 1 1 42 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 41 1 3 5 7 9 11 13 15 17 19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 43 45 47 49 51 53 55 57 59 61 4 1 2 12 13 11 1 2 3 4 5 6 7 8 9 10 11 671 1 21 41 42 ...
result:
ok Correct. (29 test cases)
Test #70:
score: 0
Accepted
time: 320ms
memory: 107304kb
input:
25 84 35 1 1 110 118 1163 724 1 2 1 1 19 6 38 55 62 50 4 151 5866 4399 2 3 5 3 13 13 986039 988027 1 1 184 869 255 717 1 1 67 57 6 15 21 24 4 3 2474 284 258 145
output:
49 1 6 11 13 16 18 21 23 25 26 28 30 31 33 35 37 38 40 42 43 45 47 49 50 52 54 55 57 59 61 62 64 66 67 69 71 73 74 76 78 79 81 83 86 88 91 93 98 103 60 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 14 14 14 15 15 16 2 ...
result:
ok Correct. (25 test cases)
Test #71:
score: 0
Accepted
time: 325ms
memory: 104616kb
input:
34 59 174 406 33 1 1 7 7 16 11 1 1 2 6 168 897 9 10 442 292 1 1 86 120 821 424 40 14 68 2758 367 449 3 4 148 243 20 4 184 142 1 2 2 1 1 9 107 129 173 636 6 2 3 14 1531 405 131 142 633 2649 23 59 18 50 988027 986023 57 144
output:
87 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 118 ...
result:
ok Correct. (34 test cases)
Test #72:
score: 0
Accepted
time: 339ms
memory: 105036kb
input:
28 708 966 59 13 6 10 6 16 30 38 9 2 2 2 8 8 1 142 10 20 5 20 393 77 230 465 210 9 622 329 1276 1402 1 1 72 380 3 1 264 364 880 679 1 1 11 42 21 27 986041 988027 2175 468 2680 427 66 1038
output:
826 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 121 127 133 139 139 145 145 151 151 157 157 163 163 169 169 175 175 181 181 187 187 193 193 199 199 205 205 211 211 217 217 223 223 229 229 235 235 241 241 247 247 253 253 259 259 265 265 271 271 277 277 277 283 283 283 289 289 289 295...
result:
ok Correct. (28 test cases)
Test #73:
score: 0
Accepted
time: 349ms
memory: 68232kb
input:
4 1 1 2 3 999995 799991 1 1
output:
2 1 1 1 1 4 1 1 2 2 3 1 2 3 1599982 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 4...
result:
ok Correct. (4 test cases)
Test #74:
score: 0
Accepted
time: 798ms
memory: 99928kb
input:
6 1 1 1 1 1 1 1 1 1 1 999995 799992
output:
2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 799996 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 101 106 111 116 121 126 131 136 141 146 151 156 161 166 171 176 181 186 191 196 201 206 211 216 221 226 231 236 241 246 251 256 261 266 271 276 281 286 291 296 301 306 311 316 321 ...
result:
ok Correct. (6 test cases)
Test #75:
score: 0
Accepted
time: 338ms
memory: 103192kb
input:
5 2 2 1 1 1 1 1 1 799993 999995
output:
1 1 4 1 2 2 3 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 999995 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10 11 11 11 11 11 12 12 12 12 12 13 13 13 13 13 14 14 14 14 14 15 15 15 15 15 16 16 16 16 16 17 17 17 17 17 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 21 21 21 2...
result:
ok Correct. (5 test cases)
Test #76:
score: -100
Wrong Answer
time: 665ms
memory: 72952kb
input:
47 1 1 22 26 2883 3705 3 21 3184 132 287 521 4024 8251 5411 995 262144 524288 13 7 108 160 10999 146603 5695 4137 211 130 64 542 2 6 91 10 159 223 27 46 4 3 37992 10217 1292 1509 130194 143457 3924 1771 53 76 68 137 15 12 6 6 1 1 1264 307 13283 76 62 15 1 1 5 9 1295 1592 6 2 352 288 1 1 10526 25592 ...
output:
2 1 1 1 1 22 1 3 5 7 9 11 13 14 15 16 17 18 19 20 21 22 24 26 28 30 32 34 26 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 2945 1 40 79 94 118 133 157 172 187 196 211 226 235 250 265 274 280 289 304 313 319 328 343 352 358 367 373 382 391 397 406 412 421 430 436 445 451 460 466 469 ...
result:
wrong answer Jury has a better answer. (test case 25)