QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#839855#4. Gapbinminh0130 28ms6552kbC++238.2kb2025-01-02 11:02:582025-01-02 11:02:59

Judging History

你现在查看的是最新测评结果

  • [2025-01-02 11:02:59]
  • 评测
  • 测评结果:30
  • 用时:28ms
  • 内存:6552kb
  • [2025-01-02 11:02:58]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define int128 __int128_t
#define double long double
#define gcd __gcd
#define lcm(a, b) ((a)/gcd(a, b)*(b))
#define sqrt sqrtl
#define log2 log2l
#define log10 log10l
#define floor floorl
#define to_string str
#define yes cout << "YES"
#define no cout << "NO"
#define trav(i, a) for (auto &i: (a))
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)a.size()
#define Max(a) *max_element(all(a))
#define Min(a) *min_element(all(a))
#define Find(a, n) (find(all(a), n) - a.begin())
#define Count(a, n) count(all(a), n)
#define Upper(a, n) (upper_bound(all(a), n) - a.begin())
#define Lower(a, n) (lower_bound(all(a), n) - a.begin())
#define next_perm(a) next_permutation(all(a))
#define prev_perm(a) prev_permutation(all(a))
#define sorted(a) is_sorted(all(a))
#define sum(a) accumulate(all(a), 0)
#define sumll(a) accumulate(all(a), 0ll)
#define Sort(a) sort(all(a))
#define Reverse(a) reverse(all(a))
#define Unique(a) Sort(a), (a).resize(unique(all(a)) - a.begin())
#define pb push_back
#define eb emplace_back
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define clz __builtin_clz
#define clzll __buitlin_clzll
#define ctz __builtin_ctz
#define ctzll __builtin_ctzll
#define open(s) freopen(s, "r", stdin)
#define write(s) freopen(s, "w", stdout)
#define fileopen(s) open((string(s) + ".inp").c_str()), write((string(s) + ".out").c_str());
#define For(i, a, b) for (auto i = (a); i < (b); ++i)
#define Fore(i, a, b) for (auto i = (a); i >= (b); --i)
#define FOR(i, a, b) for (auto i = (a); i <= (b); ++i)
#define ret(s) return void(cout << s);

constexpr int mod = 1e9 + 7, mod2 = 998244353;
constexpr double eps = 1e-9;
const double PI = acos(-1);
constexpr ull npos = string::npos;
constexpr int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using cd = complex<double>;
mt19937 mt(chrono::system_clock::now().time_since_epoch().count());
mt19937_64 mt64(chrono::system_clock::now().time_since_epoch().count());
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<double> vdo;
typedef vector<vdo> vvdo;
typedef vector<string> vs;
typedef vector<pii> vpair;
typedef vector<vpair> vvpair;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<cd> vcd;
typedef priority_queue<int> pq;
typedef priority_queue<int, vi, greater<int>> pqg;
typedef priority_queue<ll> pqll;
typedef priority_queue<ll, vll, greater<ll>> pqgll;

ll add(ll a, ll b, int m) {a = (a >= m ? a % m: a);b = (b >= m ? b % m: b);a+=b;return a >= m ? a - m: a;}
ll sub(ll a, ll b, int m) {a = (a >= m ? a % m: a);b = (b >= m ? b % m: b);a-=b;return a < 0 ? a + m: a;}
ll mul(ll a, ll b, int m) {a = (a >= m ? a % m: a);b = (b >= m ? b % m: b);return a*b % m;}
ll bin_mul(ll a, ll b, ll m) {a = (a >= m ? a % m: a);b = (b >= m ? b % m: b);ll x = 0;while (b) {if (b & 1) x = (x + a) % m;a = (a + a) % m;b>>=1;}return x;}
ll bin_pow(ll a, ll b, ll m) {ll x = 1;a = (a >= m ? a % m: a); while (b) {if (b & 1) x = bin_mul(x, a, m);a = bin_mul(a, a, m);b>>=1;}return x;}
ll power(ll a, ll b, int m) {ll x = 1;a = (a >= m ? a % m: a); while (b) {if (b & 1) x = x*a % m;a = a*a % m;b>>=1;}return x;}
ll power(ll a, ll b) {ll x = 1;while (b) {if (b & 1) x = x*a;a = a*a;b>>=1;}return x;}
ll ceil(ll a, ll b) {return (a + b - 1)/b;}
ll to_int(const string &s) {ll x = 0; for (int i = (s[0] == '-'); i < sz(s); ++i) x = x*10 + s[i] - '0';return x*(s[0] == '-' ? -1: 1);}
bool is_prime(ll n) {if (n < 2) return 0;if (n < 4) return 1;if (n % 2 == 0 || n % 3 == 0) return 0;for (ll i = 5; i*i <= n; i+=6) {if(n % i == 0 || n % (i + 2) == 0) return 0;}return 1;}
bool is_square(ll n) {ll k = sqrt(n); return k*k == n;}
ll factorial(int n) {ll x = 1;for (int i = 2; i <= n; ++i) x*=i;return x;}
ll factorial(int n, int m) {ll x = 1;for (ll i = 2; i <= n; ++i) x = x*i % m;return x;}
bool is_power(ll n, ll k) {while (n % k == 0) n/=k;return n == 1ll;}
string str(ll n) {if (n == 0) return "0"; string s = ""; bool c = 0; if (n < 0) c = 1, n = -n; while (n) {s+=n % 10 + '0'; n/=10;} if (c) s+='-'; Reverse(s); return s;}
string repeat(const string &s, int n) {if (n < 0) return ""; string x = ""; while (n--) x+=s; return x;}
string bin(ll n) {string s = ""; while (n) {s+=(n & 1) + '0'; n>>=1;} Reverse(s); return s;}
void sieve(vector<bool> &a) {int n = a.size(); a[0] = a[1] = 0; for (int i = 4; i < n; i+=2) a[i] = 0; for (int i = 3; i*i < n; i+=2) {if (a[i]) {for (int j = i*i; j < n; j+=(i << 1)) a[j] = 0;}}}
void sieve(bool a[], int n) {a[0] = a[1] = 0; for (int i = 4; i < n; i+=2) a[i] = 0; for (int i = 3; i*i < n; i+=2) {if (a[i]) {for (int j = i*i; j < n; j+=(i << 1)) a[j] = 0;}}}
void sieve(vector<int> &a) {int n = a.size(); for (int i = 2; i < n; i+=2) a[i] = 2; for (int i = 3; i*i < n; i+=2) {if (!a[i]) {for (int j = i; j < n; j+=(i << 1)) a[j] = i;}} for (int i = 3; i < n; i+=2) {if (!a[i]) a[i] = i;}}
void sieve(int a[], int n) {for (int i = 2; i < n; i+=2) a[i] = 2; for (int i = 3; i*i < n; i+=2) {if (!a[i]) {for (int j = i; j < n; j+=(i << 1)) a[j] = i;}} for (int i = 3; i < n; i+=2) {if (!a[i]) a[i] = i;}}
vector<pii> factorize(int n) {vector<pii> a; for (int i = 2; i*i <= n; ++i) {if (n % i == 0) {int k = 0; while (n % i == 0) ++k, n/=i; a.emplace_back(i, k);}} if (n > 1) a.emplace_back(n, 1); return a;}
int rand(int l, int r) {return uniform_int_distribution<int>(l, r)(mt);}
ll rand(ll l, ll r) {return uniform_int_distribution<ll>(l, r)(mt64);}
int Log2(int n) {return 31 - __builtin_clz(n);}
ll Log2(ll n) {return 63 - __builtin_clzll(n);}
template<class T> void compress(vector<T> &a) {vector<T> b; for (T &i: a) b.push_back(i); sort(all(b)); b.resize(unique(all(b)) - b.begin()); for (T &i: a) i = lower_bound(all(b), i) - b.begin() + 1;}
template<class A, class B> bool ckmin(A &a, const B &b) {return a > b ? a = b, 1: 0;}
template<class A, class B> bool ckmax(A &a, const B &b) {return a < b ? a = b, 1: 0;}

template<class A, class B> istream& operator>>(istream& in, pair<A, B> &p) {in >> p.first >> p.second; return in;}
template<class A, class B> ostream& operator<<(ostream& out, const pair<A, B> &p) {out << p.first << ' ' << p.second; return out;}
template<class T> istream& operator>>(istream& in, vector<T> &a) {for (auto &i: a) in >> i; return in;}
template<class T> ostream& operator<<(ostream& out, const vector<T> &a) {for (auto &i: a) out << i << ' '; return out;}
template<class T> istream& operator>>(istream& in, vector<vector<T>> &a) {for (auto &i: a) in >> i; return in;}
template<class T> ostream& operator<<(ostream& out, const vector<vector<T>> &a) {for (auto &i: a) out << i << '\n'; return out;}
template<class T> istream& operator>>(istream& in, deque<T> &a) {for (auto &i: a) in >> i; return in;}
template<class T> ostream& operator<<(ostream& out, const deque<T> &a) {for (auto &i: a) out << i << ' '; return out;}
// istream& operator>>(istream& in, __int128_t &a) {string s; in >> s; a = 0; for (auto &i: s) a = a*10 + (i - '0'); return in;}
// ostream& operator<<(ostream& out, __int128_t a) {string s = ""; if (a < 0) s+='-', a = -a; if (a == 0) s+='0'; while (a > 0) {s+=(int)(a % 10) + '0'; a/=10;} Reverse(s); out << s; return out;}

#include "gap.h"
ll findGap(int task, int n) {
    ll mn, mx;
    if (task == 1) {
        vll a(n);
        int i = 1, j = n - 2;
        MinMax(0, 1e18, &a[0], &a[n - 1]);
        while (i <= j) {
            if (i < j) {
                MinMax(a[i - 1] + 1, a[j + 1] - 1, &a[i], &a[j]);
            } else {
                MinMax(a[i - 1] + 1, 1e18, &a[i], &mx);
            }
            ++i, --j;
        }
        ll x = 0;
        For(i,1,n) ckmax(x, a[i] - a[i - 1]);
        return x;
    }
    ll u, v, s, t;
    MinMax(0, 1e18, &u, &v);
    ll d = ceil(v - u, n - 1), w = d;
    vll a;
    for (ll i = u; i <= v; i+=d) {
        ll j = min(v, i + d - 1);
        MinMax(i, j, &mn, &mx);
        if (~mn && ~mx) a.pb(i), a.pb(j);
    }
    For(i,1,sz(a)) ckmax(w, a[i] - a[i - 1]);
    return w;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 30
Accepted

Test #1:

score: 30
Accepted
time: 1ms
memory: 3692kb

input:

1 2
29659227736649406 728704890713443211

output:

699045662976793805
1

result:

points 1 M = 1

Test #2:

score: 30
Accepted
time: 1ms
memory: 5992kb

input:

1 15
4910834401530995 82366510858893943 154224513006215114 167111470747458922 291518420333647381 360708376904159067 475438451423179257 514521822479974099 544779904916816505 631359818684602077 636047253191505154 815280682985156693 908104066692014481 977273719899584711 997330329109444588

output:

179233429793651539
8

result:

points 1 M = 8

Test #3:

score: 30
Accepted
time: 0ms
memory: 5764kb

input:

1 15
26822012613602297 83016336616322262 240236403235204784 251263501103080046 267418872581278273 283465011506182121 387188614324429897 405999856871910796 621222868183510412 705139383465288123 737738410068055892 825642738416654428 854722383986606367 855077944176184296 908358416490444978

output:

215223011311599616
8

result:

points 1 M = 8

Test #4:

score: 30
Accepted
time: 0ms
memory: 3932kb

input:

1 15
9924552505919890 20650946047777351 137465276238229613 316776581684046368 328799260840899945 352871104748474083 461843498111917783 467004768858109370 483649564461099301 522358288815328209 604961424367736207 741995299386981061 796141495301995014 806409479876611358 985852922191990473

output:

179443442315379115
8

result:

points 1 M = 8

Test #5:

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

input:

1 15
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144

output:

2018243
8

result:

points 1 M = 8

Test #6:

score: 30
Accepted
time: 1ms
memory: 5864kb

input:

1 100
3343298378001251 17484402436127123 23692744930918786 26627871378097607 27094733652649548 36364042508477388 38440289626273354 51568172689743427 59547297792096252 69378457790067663 90898643112854066 126667262868037819 128409326258917243 151146480509633563 160238662778949922 169891116525178350 17...

output:

51057453672116406
50

result:

points 1 M = 50

Test #7:

score: 30
Accepted
time: 0ms
memory: 3736kb

input:

1 100
6615965004180765 13185207460451761 23734307750252029 24158382668441223 49162776469681165 50213865766220511 56584679171324873 72355935174261200 78534230832420118 86100851851862565 89979985531351472 98750915670727392 109538473420377753 110428987732941952 111325085136921829 114262413730167727 118...

output:

49328838642377492
50

result:

points 1 M = 50

Test #8:

score: 30
Accepted
time: 1ms
memory: 3972kb

input:

1 100
709357564623321 7712824696571068 24393851130421107 27005556867201291 28185446351046950 59253483486983895 66103734017093545 90874504779503203 94536894293511165 101066291988100224 132440848420581011 136611074783604734 139508009804041082 146397349745117579 155563877383458473 182718838546797030 19...

output:

44115425462423692
50

result:

points 1 M = 50

Test #9:

score: 30
Accepted
time: 1ms
memory: 5896kb

input:

1 100
14237546663715875 26898867314446811 32923852684187028 35501560148931192 42094588678535703 46313954319267128 46780297957478675 54140230845661659 69717122031105868 85227834377828719 87123433354912852 87694208848816839 100294949511635763 100640491384053889 117783048175404598 120498517471861537 12...

output:

45345737967249636
50

result:

points 1 M = 50

Test #10:

score: 30
Accepted
time: 0ms
memory: 3980kb

input:

1 100
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 482771 482772 482773 482774 482775 482776 482777 482778 482779 482780 482781 482782 482783 482784 482785 482786 482787 482788 482789 482790 482791 482792 482793 482794 965533 965534 965535 965536 965537 9...

output:

482739
50

result:

points 1 M = 50

Test #11:

score: 30
Accepted
time: 0ms
memory: 3816kb

input:

1 1500
393226341882178 1321649646861936 1364933587797097 1889765428846896 2456116238504757 2518733965088369 3825795947577367 5405580152527417 5570252473787754 6350713065107462 6581444896242136 6656726663294586 8363165203490333 9558500171039813 9586690516318136 9673890229897646 12861707206480546 1294...

output:

5607705563272188
750

result:

points 1 M = 750

Test #12:

score: 30
Accepted
time: 1ms
memory: 5912kb

input:

1 1500
276387254568267 348298566021308 1125215387592508 1923588239039903 2955434210783111 3356563093662062 3954646930267164 4075124529772830 5324942771348103 6615468346955442 6997348010487097 7438352604440139 8115335024997761 8684463607233403 8919700770029490 9110179826351266 9192758850283477 974192...

output:

5550787805329272
750

result:

points 1 M = 750

Test #13:

score: 30
Accepted
time: 1ms
memory: 3968kb

input:

1 1500
394502620394491 477595652087208 1780588042371800 2567382279231585 3433538158427605 5126964998146432 5540015402387536 5863708707865343 7204628472359887 7409780941504842 7460021205004392 7947558620073481 8773299171413406 8907935113700215 9502489274784574 9828824230085381 10250737830740541 10348...

output:

5773483938914314
750

result:

points 1 M = 750

Test #14:

score: 30
Accepted
time: 1ms
memory: 5752kb

input:

1 1500
232644703989174 914925623772208 1780788508756344 1942956344014084 1951540326583367 2705677420197432 3315127930499324 3530924082453323 4063095195421877 5878910158522313 6191425649884323 7474281913739540 8005162170319151 9689629284273377 10553282724580534 11302266974886461 11328427098980173 131...

output:

5130685060193677
750

result:

points 1 M = 750

Test #15:

score: 30
Accepted
time: 1ms
memory: 5932kb

input:

1 1500
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144 36103387 38121630 40139873 42158116 44176359 46194602 48212845 50231088 52249331 54267574 56285817 58304060 60322303 62340546 64358789 66377032 68395275 70413518...

output:

2018243
750

result:

points 1 M = 750

Test #16:

score: 30
Accepted
time: 7ms
memory: 4076kb

input:

1 25000
9133780858698 37909498824529 46424274433061 70160050989590 125416618927966 131263384497746 138567320950042 147982747026601 169954574711772 416414702693488 521633254355739 604620659815966 630248301432581 636599651288513 649591523233109 673879027226892 743167222805134 1050284364947427 10667909...

output:

400443289050740
12500

result:

points 1 M = 12500

Test #17:

score: 30
Accepted
time: 3ms
memory: 5936kb

input:

1 25000
95371433023390 183850194127179 204901134589572 252754062343800 256294085315900 272877283746967 359297770213316 362185632533591 367274595807277 538035954679833 574635344070507 592259524690062 732544214561464 736176455194807 747090611983790 751067222940691 764188551907236 792924484902295 86134...

output:

505979566183486
12500

result:

points 1 M = 12500

Test #18:

score: 30
Accepted
time: 7ms
memory: 5872kb

input:

1 25000
7504645895952 60172453317399 82471651467385 101821286783379 128772758422292 142128421583576 176046308040656 189670285914911 195166891755926 332153022335956 337772092961783 445143919770092 471801980403459 521901385689244 557011875311943 657204669416734 693608324078908 720572981724339 72166032...

output:

509260497524918
12500

result:

points 1 M = 12500

Test #19:

score: 30
Accepted
time: 3ms
memory: 5960kb

input:

1 25000
39499604978204 102114332324801 160517211313931 188637308000017 238002860728363 287351974543450 335961801282777 396999481527880 415187881071623 450041544343299 462992172994970 499000116280155 510734447770100 522124078388134 558759362727955 583635064368750 586330026742164 637440358336379 68038...

output:

476196269160204
12500

result:

points 1 M = 12500

Test #20:

score: 30
Accepted
time: 6ms
memory: 6136kb

input:

1 25000
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:

482739
12500

result:

points 1 M = 12500

Test #21:

score: 30
Accepted
time: 28ms
memory: 6432kb

input:

1 100000
4488179349610 16973330836139 44660350011287 46649694101657 54515631864687 62626048878225 77067984967371 77638306380215 86736649958265 106182394950493 109712006055182 112079135090560 120631618256852 131475831109715 132583034287859 147254369707135 149714669535946 158044969527118 1703406482415...

output:

113609171549866
50000

result:

points 1 M = 50000

Test #22:

score: 30
Accepted
time: 27ms
memory: 4848kb

input:

1 100000
13149709307416 18293717155215 25043623630885 44879400902614 49407376018350 52861802361795 53857880880850 58694832631466 63622284751967 66208436709721 73862222390267 79620705266666 94876232845299 132331415691214 153768757924367 164956420682250 180021859691119 182562169198074 188033608246735 ...

output:

127809210425414
50000

result:

points 1 M = 50000

Test #23:

score: 30
Accepted
time: 28ms
memory: 4856kb

input:

1 100000
5111699493996 19396274992433 20967237804327 32517505001678 37420536389187 42062575012054 52881565873541 55473734871126 96464144900326 102867496482900 108570627831112 121793007313548 125311330574962 133276275768191 148249097647989 152433525451301 152869309246267 153620613141705 1980527029859...

output:

145636692074772
50000

result:

points 1 M = 50000

Test #24:

score: 30
Accepted
time: 28ms
memory: 4760kb

input:

1 100000
12448126808805 14955287440308 18957486171700 26205108342440 35429821492473 37014077981695 37057923771744 56479710514435 74696614009460 79512505727286 81392393692907 83937107044022 86860753091654 90757682139231 97943450459170 100413143098496 104905348694766 111192555705468 137528216217108 14...

output:

124782173142764
50000

result:

points 1 M = 50000

Test #25:

score: 30
Accepted
time: 25ms
memory: 4780kb

input:

1 100000
5829742 7847985 9866228 11884471 13902714 15920957 17939200 19957443 21975686 23993929 26012172 28030415 30048658 32066901 34085144 36103387 38121630 40139873 42158116 44176359 46194602 48212845 50231088 52249331 54267574 56285817 58304060 60322303 62340546 64358789 66377032 68395275 704135...

output:

2018243
50000

result:

points 1 M = 50000

Test #26:

score: 30
Accepted
time: 24ms
memory: 4768kb

input:

1 100000
15609355723226 28246203120916 30534297616421 30860828332767 39610757317274 51747678705316 59431565063656 65334112957168 73755518304209 73983782735249 85678154678498 88615327621076 119910216575517 135696757222159 146948840815723 153918026203480 154953312049266 198110592039235 208594061499708...

output:

118147358961195
50000

result:

points 1 M = 50000

Test #27:

score: 30
Accepted
time: 28ms
memory: 4716kb

input:

1 100000
10126035265316 18812438778817 21939562196718 34894638833527 38854235463395 40111115712840 42519043571969 43016952934044 69976845297204 72056983241149 92536484920211 103356244768685 120903354118841 144620368621389 156984924786619 157738788406302 157904138655286 165482438928337 16686535822451...

output:

131778553155869
50000

result:

points 1 M = 50000

Test #28:

score: 30
Accepted
time: 28ms
memory: 4844kb

input:

1 100000
5196984998043 10787031331530 50135404987503 54792304198458 77983401426640 83070904825088 118151991355567 119230477408462 132306550794169 134404059623264 151597039637359 160097671531535 163732034708578 189765789913722 195170548694892 205393730407830 207208693338456 213544197686227 2144304840...

output:

125388883971902
50000

result:

points 1 M = 50000

Test #29:

score: 30
Accepted
time: 28ms
memory: 6272kb

input:

1 100000
19821024745776 35883956869682 37055128006390 73846930057178 74584703826867 75294939571297 79182722559431 79785889433372 82670507176415 106089250957212 112890558692026 127521606324433 174230033489231 177420213949701 184639822084732 195957538680526 209919488393415 209969657281950 213974569728...

output:

128742514930586
50000

result:

points 1 M = 50000

Test #30:

score: 30
Accepted
time: 24ms
memory: 6552kb

input:

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

482739
50000

result:

points 1 M = 50000

Test #31:

score: 30
Accepted
time: 0ms
memory: 6040kb

input:

1 118
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 62 68 81 108 163 273 494 937 1824 3599 7151 14255 28465 56886 113728 227414 454787 909533 1819027 3638015 7275993 14551950 ...

output:

500000000000000000
59

result:

points 1 M = 59

Test #32:

score: 30
Accepted
time: 0ms
memory: 3708kb

input:

1 118
1 500000000000000001 750000000000000000 874999999999999999 937499999999999998 968749999999999997 984374999999999996 992187499999999995 996093749999999994 998046874999999993 999023437499999992 999511718749999991 999755859374999990 999877929687499989 999938964843749988 999969482421874987 9999847...

output:

500000000000000000
59

result:

points 1 M = 59

Subtask #2:

score: 0
Wrong Answer

Test #33:

score: 53.5083
Acceptable Answer
time: 1ms
memory: 5836kb

input:

2 2
78103569500113815 605712887753065418

output:

527609318252951603
7

result:

points 0.76440498210 M = 7

Test #34:

score: 0
Wrong Answer
time: 1ms
memory: 5976kb

input:

2 15
61436558421029682 83429206007963488 214541359837684412 243514252712970384 305484811504551902 336434369562156870 338340290496962958 497057755642276106 550273649621370145 553677540845214422 598379388791730666 658501786507934652 711557595985663747 814649872154415032 878126866231709433

output:

116670043972954253
45

result:

wrong answer returned 116670043972954253 but expected 158717465145313148