QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#329590 | #8255. Room Temperature | triple__a | 100 ✓ | 64ms | 7752kb | C++20 | 11.1kb | 2024-02-16 22:22:46 | 2024-02-16 22:22:47 |
Judging History
answer
// #pragma GCC optimize("trapv")
#include<bits/stdc++.h>
#define int long long
#define i128 __int128_t
using namespace std;
constexpr int P = 998244353;
// constexpr int P = 1e9+7;
using i64 = long long;
// assume -P <= x < 2P
int norm(int x) {
if (x < 0) {
x += P;
}
if (x >= P) {
x -= P;
}
return x;
}
template<class T>
T power(T a, i64 b) {
T res = 1;
for (; b; b /= 2, a *= a) {
if (b % 2) {
res *= a;
}
}
return res;
}
struct Z {
int x;
Z(int x = 0) : x(norm(x%P)) {}
int val() const {
return x;
}
Z operator-() const {
return Z(norm(P - x));
}
Z inv() const {
assert(x != 0);
return power(*this, P - 2);
}
Z &operator*=(const Z &rhs) {
x = i64(x) * rhs.x % P;
return *this;
}
Z &operator+=(const Z &rhs) {
x = norm(x + rhs.x);
return *this;
}
Z &operator-=(const Z &rhs) {
x = norm(x - rhs.x);
return *this;
}
Z &operator/=(const Z &rhs) {
return *this *= rhs.inv();
}
friend Z operator*(const Z &lhs, const Z &rhs) {
Z res = lhs;
res *= rhs;
return res;
}
friend Z operator+(const Z &lhs, const Z &rhs) {
Z res = lhs;
res += rhs;
return res;
}
friend Z operator-(const Z &lhs, const Z &rhs) {
Z res = lhs;
res -= rhs;
return res;
}
friend Z operator/(const Z &lhs, const Z &rhs) {
Z res = lhs;
res /= rhs;
return res;
}
friend std::istream &operator>>(std::istream &is, Z &a) {
i64 v;
is >> v;
a = Z(v);
return is;
}
friend std::ostream &operator<<(std::ostream &os, const Z &a) {
return os << a.val();
}
};
std::vector<int> rev;
std::vector<Z> roots{0, 1};
void dft(std::vector<Z> &a) {
int n = a.size();
if ((int)(rev.size()) != n) {
int k = __builtin_ctz(n) - 1;
rev.resize(n);
for (int i = 0; i < n; i++) {
rev[i] = rev[i >> 1] >> 1 | (i & 1) << k;
}
}
for (int i = 0; i < n; i++) {
if (rev[i] < i) {
std::swap(a[i], a[rev[i]]);
}
}
if ((int)(roots.size()) < n) {
int k = __builtin_ctz(roots.size());
roots.resize(n);
while ((1 << k) < n) {
Z e = power(Z(3), (P - 1) >> (k + 1));
for (int i = 1 << (k - 1); i < (1 << k); i++) {
roots[2 * i] = roots[i];
roots[2 * i + 1] = roots[i] * e;
}
k++;
}
}
for (int k = 1; k < n; k *= 2) {
for (int i = 0; i < n; i += 2 * k) {
for (int j = 0; j < k; j++) {
Z u = a[i + j];
Z v = a[i + j + k] * roots[k + j];
a[i + j] = u + v;
a[i + j + k] = u - v;
}
}
}
}
void idft(std::vector<Z> &a) {
int n = a.size();
std::reverse(a.begin() + 1, a.end());
dft(a);
Z inv = (1 - P) / n;
for (int i = 0; i < n; i++) {
a[i] *= inv;
}
}
struct Poly {
std::vector<Z> a;
Poly() {}
explicit Poly(int size, std::function<Z(int)> f = [](int) { return 0; }) : a(size) {
for (int i = 0; i < size; i++) {
a[i] = f(i);
}
}
Poly(const std::vector<Z> &a) : a(a) {}
Poly(const std::initializer_list<Z> &a) : a(a) {}
int size() const {
return a.size();
}
void resize(int n) {
a.resize(n);
}
Z operator[](int idx) const {
if (idx < size()) {
return a[idx];
} else {
return 0;
}
}
Z &operator[](int idx) {
return a[idx];
}
Poly mulxk(int k) const {
auto b = a;
b.insert(b.begin(), k, 0);
return Poly(b);
}
Poly modxk(int k) const {
k = std::min(k, size());
return Poly(std::vector<Z>(a.begin(), a.begin() + k));
}
Poly divxk(int k) const {
if (size() <= k) {
return Poly();
}
return Poly(std::vector<Z>(a.begin() + k, a.end()));
}
friend Poly operator+(const Poly &a, const Poly &b) {
std::vector<Z> res(std::max(a.size(), b.size()));
for (int i = 0; i < (int)(res.size()); i++) {
res[i] = a[i] + b[i];
}
return Poly(res);
}
friend Poly operator-(const Poly &a, const Poly &b) {
std::vector<Z> res(std::max(a.size(), b.size()));
for (int i = 0; i < (int)(res.size()); i++) {
res[i] = a[i] - b[i];
}
return Poly(res);
}
friend Poly operator-(const Poly &a) {
std::vector<Z> res(a.size());
for (int i = 0; i < (int)(res.size()); i++) {
res[i] = -a[i];
}
return Poly(res);
}
friend Poly operator*(Poly a, Poly b) {
if (a.size() == 0 || b.size() == 0) {
return Poly();
}
if (a.size() < b.size()) {
std::swap(a, b);
}
if (b.size() < 128) {
Poly c(a.size() + b.size() - 1);
for (int i = 0; i < a.size(); i++) {
for (int j = 0; j < b.size(); j++) {
c[i + j] += a[i] * b[j];
}
}
return c;
}
int sz = 1, tot = a.size() + b.size() - 1;
while (sz < tot) {
sz *= 2;
}
a.a.resize(sz);
b.a.resize(sz);
dft(a.a);
dft(b.a);
for (int i = 0; i < sz; ++i) {
a.a[i] = a[i] * b[i];
}
idft(a.a);
a.resize(tot);
return a;
}
friend Poly operator*(Z a, Poly b) {
for (int i = 0; i < (int)(b.size()); i++) {
b[i] *= a;
}
return b;
}
friend Poly operator*(Poly a, Z b) {
for (int i = 0; i < (int)(a.size()); i++) {
a[i] *= b;
}
return a;
}
Poly &operator+=(Poly b) {
return (*this) = (*this) + b;
}
Poly &operator-=(Poly b) {
return (*this) = (*this) - b;
}
Poly &operator*=(Poly b) {
return (*this) = (*this) * b;
}
Poly deriv() const {
if (a.empty()) {
return Poly();
}
std::vector<Z> res(size() - 1);
for (int i = 0; i < size() - 1; ++i) {
res[i] = (i + 1) * a[i + 1];
}
return Poly(res);
}
Poly integr() const {
std::vector<Z> res(size() + 1);
for (int i = 0; i < size(); ++i) {
res[i + 1] = a[i] / (i + 1);
}
return Poly(res);
}
Poly inv(int m) const {
Poly x{a[0].inv()};
int k = 1;
while (k < m) {
k *= 2;
x = (x * (Poly{2} - modxk(k) * x)).modxk(k);
}
return x.modxk(m);
}
Poly log(int m) const {
return (deriv() * inv(m)).integr().modxk(m);
}
Poly exp(int m) const {
Poly x{1};
int k = 1;
while (k < m) {
k *= 2;
x = (x * (Poly{1} - x.log(k) + modxk(k))).modxk(k);
}
return x.modxk(m);
}
Poly pow(int k, int m) const {
int i = 0;
while (i < size() && a[i].val() == 0) {
i++;
}
if (i == size() || 1LL * i * k >= m) {
return Poly(std::vector<Z>(m));
}
Z v = a[i];
auto f = divxk(i) * v.inv();
return (f.log(m - i * k) * k).exp(m - i * k).mulxk(i * k) * power(v, k);
}
Poly sqrt(int m) const {
Poly x{1};
int k = 1;
while (k < m) {
k *= 2;
x = (x + (modxk(k) * x.inv(k)).modxk(k)) * ((P + 1) / 2);
}
return x.modxk(m);
}
Poly mulT(Poly b) const {
if (b.size() == 0) {
return Poly();
}
int n = b.size();
std::reverse(b.a.begin(), b.a.end());
return ((*this) * b).divxk(n - 1);
}
std::vector<Z> eval(std::vector<Z> x) const {
if (size() == 0) {
return std::vector<Z>(x.size(), 0);
}
const int n = std::max((int)(x.size()), size());
std::vector<Poly> q(4 * n);
std::vector<Z> ans(x.size());
x.resize(n);
std::function<void(int, int, int)> build = [&](int p, int l, int r) {
if (r - l == 1) {
q[p] = Poly{1, -x[l]};
} else {
int m = (l + r) / 2;
build(2 * p, l, m);
build(2 * p + 1, m, r);
q[p] = q[2 * p] * q[2 * p + 1];
}
};
build(1, 0, n);
std::function<void(int, int, int, const Poly &)> work = [&](int p, int l, int r, const Poly &num) {
if (r - l == 1) {
if (l < (int)(ans.size())) {
ans[l] = num[0];
}
} else {
int m = (l + r) / 2;
work(2 * p, l, m, num.mulT(q[2 * p + 1]).modxk(m - l));
work(2 * p + 1, m, r, num.mulT(q[2 * p]).modxk(r - m));
}
};
work(1, 0, n, mulT(q[1].inv(n)));
return ans;
}
};
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
bool dfs(int a, int L, vector<vi>& g, vi& btoa, vi& A, vi& B) {
if (A[a] != L) return 0;
A[a] = -1;
for (int b : g[a]) if (B[b] == L + 1) {
B[b] = 0;
if (btoa[b] == -1 || dfs(btoa[b], L + 1, g, btoa, A, B))
return btoa[b] = a, 1;
}
return 0;
}
int hopcroftKarp(vector<vi>& g, vi& btoa) {
int res = 0;
vi A(g.size()), B(btoa.size()), cur, next;
for (;;) {
fill(all(A), 0);
fill(all(B), 0);
/// Find the starting nodes for BFS (i.e. layer 0).
cur.clear();
for (int a : btoa) if(a != -1) A[a] = -1;
rep(a,0,sz(g)) if(A[a] == 0) cur.push_back(a);
/// Find all layers using bfs.
for (int lay = 1;; lay++) {
bool islast = 0;
next.clear();
for (int a : cur) for (int b : g[a]) {
if (btoa[b] == -1) {
B[b] = lay;
islast = 1;
}
else if (btoa[b] != a && !B[b]) {
B[b] = lay;
next.push_back(btoa[b]);
}
}
if (islast) break;
if (next.empty()) return res;
for (int a : next) A[a] = lay;
cur.swap(next);
}
/// Use DFS to scan for augmenting paths.
rep(a,0,sz(g))
res += dfs(a, 0, g, btoa, A, B);
}
}
const int N=500007;
const int K=57;
const int INF=1e18;
mt19937 rng(1235);
int n,m;
int a[N];
signed main(){
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
cout.precision(25);
cin>>n>>m;
for (int i=0;i<n;++i) cin>>a[i], a[i]%=m;
sort(a,a+n);
int ans=m;
for (int i=0;i<n-1;++i){
int diff=m-(a[i+1]-a[i]);
ans=min(ans,(diff+1)/2);
}
int diff=m-(a[0]-a[n-1]+m);
ans=min(ans,(diff+1)/2);
cout<<ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 15
Accepted
Test #1:
score: 15
Accepted
time: 0ms
memory: 3616kb
input:
2 1000000000 870851814 881870957
output:
5509572
result:
ok 1 number(s): "5509572"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
2 2691 205734472 599908142
output:
660
result:
ok 1 number(s): "660"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
2 1000000000 594215883 41345726
output:
223564922
result:
ok 1 number(s): "223564922"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
2 2691 667489049 282547821
output:
470
result:
ok 1 number(s): "470"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
2 1000000000 263981200 857652688
output:
203164256
result:
ok 1 number(s): "203164256"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
2 2691 938568750 473949653
output:
445
result:
ok 1 number(s): "445"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
2 1000000000 40944021 145199528
output:
52127754
result:
ok 1 number(s): "52127754"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
2 2691 907627168 852663911
output:
209
result:
ok 1 number(s): "209"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
2 1 1 1000000000
output:
0
result:
ok 1 number(s): "0"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
2 1 999999999 1
output:
0
result:
ok 1 number(s): "0"
Subtask #2:
score: 5
Accepted
Test #11:
score: 5
Accepted
time: 0ms
memory: 3568kb
input:
3000 1 527962400 375396162 403550632 368119563 98122336 575071005 735930417 713872349 126691431 587408550 68301442 78445831 779182574 900615066 540352310 97512141 56370167 875603720 977151830 187655072 321929392 68890256 341544318 18277276 427645487 5442872 264570852 285260601 560506154 919011927 20...
output:
0
result:
ok 1 number(s): "0"
Test #12:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
3000 1 125514453 768659053 486755528 299945084 862360713 8675510 858615908 36113622 852434719 631544026 152565003 248475502 152208269 372824161 605166385 947406972 22495491 16144197 428103403 540600274 825892700 402884826 869448753 21131099 563254083 482692292 836456471 136772702 161953814 632591878...
output:
0
result:
ok 1 number(s): "0"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
500 1 877137499 911480798 105327978 808804265 727937304 637853446 718031798 765195806 838206927 484239981 607467844 605792967 38697323 332194610 273988993 323047109 798562931 435509933 372308228 443534704 707117313 487932300 211775548 761591411 77454451 882287790 277784787 263090914 819288580 176177...
output:
0
result:
ok 1 number(s): "0"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
3000 1 302072813 159511621 389241523 87239051 654013995 612092525 811507271 759331557 82587805 4610835 527337463 225987819 848995387 369192513 837790413 257183405 827634015 124043241 120492531 441525119 740937 215335731 287893333 646763119 353975191 806994341 813045851 410859105 603701099 713224409 ...
output:
0
result:
ok 1 number(s): "0"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
500 1 81888042 43067133 107207954 11840122 12213120 1564709 591852273 88838690 961663051 516561909 168803248 844631608 873195256 827482724 743609376 619362989 538294587 82184630 144127319 243409882 211682139 271003483 663591071 168473717 654369346 16498799 591919038 700712177 385773734 618206739 813...
output:
0
result:
ok 1 number(s): "0"
Subtask #3:
score: 30
Accepted
Dependency #2:
100%
Accepted
Test #16:
score: 30
Accepted
time: 1ms
memory: 3600kb
input:
3000 2 885745611 864341459 300047319 287916141 644603625 884166447 590534965 653358937 990188463 990316905 558306521 980116759 553013905 519316677 185497721 825112521 474133783 274235087 415114857 272795329 667603077 923296831 577923973 907451785 74744583 582644091 637370755 55344013 145242745 11163...
output:
0
result:
ok 1 number(s): "0"
Test #17:
score: 0
Accepted
time: 1ms
memory: 3872kb
input:
3000 2 815254336 124748890 922650362 491188496 844408566 4477401 897872910 543206825 520044175 152252928 137325742 296978488 94941447 128102092 232850362 442060951 176696075 19548785 80969000 215525942 924301170 837296603 303165509 108844385 266183198 990018404 686038287 219436341 911589193 14746520...
output:
1
result:
ok 1 number(s): "1"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
500 2 401665219 27125575 775455335 839862311 960668465 238565856 738888265 901690231 304617077 103869276 209825343 618624634 605291100 268367109 261071747 998379490 704657059 187305917 910307778 870658986 536558030 6581819 190056964 211565999 892305820 620959159 360551386 791369750 697844538 6282286...
output:
1
result:
ok 1 number(s): "1"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
3000 2 522476642 810060218 147624038 855137278 915087104 81884778 525414244 894662888 410263396 941820940 423155602 520147790 615706710 710760688 226912160 596683116 203181268 324211490 679562872 268407934 204591892 80890276 839993536 16090044 796081826 673760802 901037356 780466340 43952110 3614940...
output:
0
result:
ok 1 number(s): "0"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
500 2 401575885 412743311 771792855 497402889 589191539 886766329 406659227 453993629 496243093 779810717 930633301 930956619 242644227 356605399 364800377 126585217 707620365 253271779 307180205 20790719 91049019 110549957 578458983 224326281 202269525 831044405 944165261 175228805 838484973 876412...
output:
0
result:
ok 1 number(s): "0"
Test #21:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
3000 2 303563168 71740834 195834514 3380992 22250404 75355492 9181252 637320910 700179430 343368856 609982580 819446272 657025786 417130700 869124046 29260574 635565794 960260466 88361168 62855338 937906970 272056128 691558732 38964352 156445024 972341020 952652654 209319766 866597994 310506834 8648...
output:
0
result:
ok 1 number(s): "0"
Test #22:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
3000 2 354850469 308022921 982030052 204243429 81359634 396352087 818660632 346171682 414089414 858843314 833282674 666064122 822445534 820666553 65489973 666985874 349651060 420770828 851434715 109309679 326719078 292037079 553269053 165517023 457752713 386379859 34971829 142091597 181586420 199000...
output:
1
result:
ok 1 number(s): "1"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
500 2 203412544 61851007 586535587 486968143 875369021 985875249 316089162 929955174 401867218 186579046 471528419 82273912 962932206 269786079 680174046 836866080 761653128 283496098 474840952 11671544 148873680 913438388 102086606 188883488 192992369 187379128 552781119 473926266 433670893 2121962...
output:
1
result:
ok 1 number(s): "1"
Test #24:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
3000 2 68755410 923083310 590388927 432449601 829287927 156119923 831497540 435929505 202167093 259654068 823404393 366667751 387824239 255289399 474809364 311198520 223107837 18229805 206717099 58481453 562234436 251622772 215421828 775829160 630537818 120589081 704348542 84404675 973185256 1896456...
output:
1
result:
ok 1 number(s): "1"
Test #25:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
500 2 398516650 938858974 267530994 514280855 599861463 585730873 708929375 981837909 821418825 964204380 702106030 787046858 954738784 93005000 423786944 361707689 817985175 354667355 531023809 937831653 751111899 882967067 829961299 869476136 196715580 479362190 377271787 67536934 231224157 225451...
output:
1
result:
ok 1 number(s): "1"
Subtask #4:
score: 35
Accepted
Dependency #3:
100%
Accepted
Test #26:
score: 35
Accepted
time: 0ms
memory: 3796kb
input:
3000 3000 533153071 239070382 708344889 674533552 483802927 296899924 329086 80884554 732953835 62102396 940008178 492401942 781501549 216632603 706953056 20746870 92094171 384067282 621705878 480022796 695971496 146935760 479123274 831630107 278433192 534994849 102542881 278470399 551357803 6073189...
output:
1496
result:
ok 1 number(s): "1496"
Test #27:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
42 3000 754274998 822961596 932465876 339412345 177684528 963952164 141030764 517806972 680542461 968488186 80253359 782540517 56441822 356863563 600705089 728862566 319632076 362033128 807266164 872727071 658130967 851081128 980844898 361681389 206524648 205561797 386232279 672567842 956335507 1787...
output:
1324
result:
ok 1 number(s): "1324"
Test #28:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
3000 42 354854941 822325099 524749982 990951393 151897977 122977243 542161994 655100949 657272310 978121545 673586877 210362436 221729103 655831609 607486955 634591549 990298100 733294844 496109191 729492128 502001539 582808377 945935328 756682179 536380863 659042891 466968394 858574147 894569965 35...
output:
21
result:
ok 1 number(s): "21"
Test #29:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
3000 3000 341 1006 1626 1994 1995 2767 928709780 489934049 973950233 34045023 570451389 622069514 925369591 994101097 518157214 982962074 471463087 576145296 369286010 685863008 39459065 764734433 89921876 382849272 155995295 856789469 354343509 374863173 341451236 81026972 710563117 380432893 97200...
output:
1114
result:
ok 1 number(s): "1114"
Test #30:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
3000 3000 154 543 986 1058 2068 2356 76975978 571609787 429155934 191832099 653094554 286657063 149264888 416591665 938459865 900094061 802815011 561845952 560703869 937912361 696240096 442755866 47886766 610158837 970105542 63467008 628984153 45092877 913119895 508992798 723808880 845194104 8414800...
output:
1306
result:
ok 1 number(s): "1306"
Test #31:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
3000 3000 867812036 605396783 654104856 32282887 301964616 48878673 607454640 165020919 31454939 62189200 460280407 485405181 57098764 321542252 107039982 909005296 835574151 251516202 47750439 559625154 618752748 666191811 29093705 699404815 120530719 403025483 197741673 777620225 258203676 4154908...
output:
482
result:
ok 1 number(s): "482"
Test #32:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
3000 3000 111553216 530301520 489590335 181438307 95628580 136221843 554198672 776918628 395824037 659551027 339165394 946668392 761257603 673427641 936608620 356228954 829564142 267297718 773462389 842276300 173454539 159026437 820723252 291558526 494685862 811904787 727049878 388121105 683760572 3...
output:
1495
result:
ok 1 number(s): "1495"
Test #33:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
42 3000 771491221 728682918 430527432 600092582 297642202 977456633 764136477 562632695 717105791 890157410 306932665 820288030 773111500 849977588 963538571 804358075 705347182 733581358 537602342 64209887 374454962 207795851 16039161 908676658 803633305 90259469 393018087 790843506 857591734 14204...
output:
1324
result:
ok 1 number(s): "1324"
Test #34:
score: 0
Accepted
time: 1ms
memory: 3644kb
input:
3000 42 565202812 947984705 153915530 131046786 606381431 868085234 565035708 820745652 636886530 158249879 344249999 80730146 10849647 190176769 407396863 846442654 262129931 996836276 764872530 631148468 339347288 131889397 894286206 945772653 880702362 61935197 52356595 396688994 264344342 230627...
output:
21
result:
ok 1 number(s): "21"
Subtask #5:
score: 15
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Test #35:
score: 15
Accepted
time: 63ms
memory: 7520kb
input:
500000 1000000000 630508671 110404795 845304804 982383111 410629108 882479561 660871876 938901329 896704981 68655143 438642844 366107936 79487854 78479257 198921400 44557534 220128219 663177963 597033974 418707953 520947143 423646478 594525906 974489220 330237089 109614240 231725216 110016856 391564...
output:
499986203
result:
ok 1 number(s): "499986203"
Test #36:
score: 0
Accepted
time: 58ms
memory: 7512kb
input:
500000 899999999 758790772 65219209 803678182 257220196 583153581 477033725 656490226 895818859 830546477 68959827 365195829 726396612 870590319 62904645 880043932 549071994 576870944 683290117 425402284 623804512 704736422 628779549 201199112 518558048 727583157 32994164 337061105 264817873 7256567...
output:
449988000
result:
ok 1 number(s): "449988000"
Test #37:
score: 0
Accepted
time: 63ms
memory: 7752kb
input:
500000 700000000 950809989 62641797 281111253 549007973 921371769 211524583 461054497 373512510 225759601 131096872 500373374 896513323 654674343 442928672 404045678 188093439 304803385 938661583 204198415 550531619 441745123 51911373 817967287 115259616 384582853 216859992 304717175 821338552 37137...
output:
349988151
result:
ok 1 number(s): "349988151"
Test #38:
score: 0
Accepted
time: 59ms
memory: 7736kb
input:
500000 500000 279294319 950932496 540186765 535758038 400370138 180901011 45412668 349183770 250716345 855133530 521590113 406050235 834905519 248600139 756742860 262084301 245402416 371533741 280303251 607809033 819107461 761788011 986363810 565285555 355754507 156055995 108553464 902045232 9814889...
output:
249993
result:
ok 1 number(s): "249993"
Test #39:
score: 0
Accepted
time: 62ms
memory: 7448kb
input:
500000 1000000000 25444564 192432836 398562796 582216457 611733883 828656565 18003286 305686313 928328803 950241185 985040617 246271659 953316116 926240320 388712712 943344243 890328989 267042743 970404377 304815155 207159116 359249707 328365934 924197598 280572125 328310094 966956489 198410945 2361...
output:
391538659
result:
ok 1 number(s): "391538659"
Test #40:
score: 0
Accepted
time: 63ms
memory: 7448kb
input:
500000 899999999 29450564 359058189 470102912 493428816 538996572 593526027 871559785 424442109 995859 798965269 364658184 721716190 460438126 691596706 736243543 456163154 381474774 857911136 880038303 506402255 535238481 656927793 502974334 431439210 627571895 411067376 895258950 857986863 8729473...
output:
285196187
result:
ok 1 number(s): "285196187"
Test #41:
score: 0
Accepted
time: 62ms
memory: 7472kb
input:
500000 700000000 36745043 399793810 405259494 505349389 607941651 670746511 687288769 600020584 698360890 598891379 540911548 690462874 7686838 596449063 400257004 676393342 562918479 578621860 566477742 594068778 602279129 709897981 679406629 404814556 539240070 563582814 603903225 607372441 518891...
output:
168475617
result:
ok 1 number(s): "168475617"
Test #42:
score: 0
Accepted
time: 54ms
memory: 7616kb
input:
500000 500000 7524 229753 269024 289454 365928 392573 299001199 466915267 288758977 437235548 687796504 869469941 926986746 836920999 348938062 251909726 818246512 41339501 54402051 849409002 507005025 440903428 517811955 541852078 17742588 366333116 635250445 644453987 62249855 997921599 623939469 ...
output:
138886
result:
ok 1 number(s): "138886"
Test #43:
score: 0
Accepted
time: 64ms
memory: 7708kb
input:
500000 5000000 518631014 754620183 264496362 964193184 724748607 183654311 668854172 538994419 84844007 354020450 678793908 598922388 853746285 34003743 888636572 974791715 68719411 703956189 203907410 284831533 954672057 169129107 689466532 434219104 39376414 504816684 739433437 228671046 39671921 ...
output:
684492
result:
ok 1 number(s): "684492"
Extra Test:
score: 0
Extra Test Passed