QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#618535#8319. Emiya 家明天的饭chenxinyang2006100 ✓451ms100080kbC++202.8kb2024-10-06 23:24:592024-10-06 23:25:01

Judging History

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

  • [2024-10-06 23:25:01]
  • 评测
  • 测评结果:100
  • 用时:451ms
  • 内存:100080kb
  • [2024-10-06 23:24:59]
  • 提交

answer

#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define eb emplace_back
#define SZ(S) (int)S.size()
//#define mod 998244353
//#define mod 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f
using namespace std;

template <class T>
void chkmax(T &x,T y){
	if(x < y) x = y;
}

template <class T>
void chkmin(T &x,T y){
	if(x > y) x = y;
}

inline int popcnt(int x){
	return __builtin_popcount(x);
}

inline int ctz(int x){
	return __builtin_ctz(x);
}


/*ll power(ll p,int k = mod - 2){
	ll ans = 1;
	while(k){
		if(k % 2 == 1) ans = ans * p % mod;
		p = p * p % mod;
		k /= 2;	
	}
	return ans;
}*/
namespace io {
	const int __SIZE = (1 << 22) + 1;
	char ibuf[__SIZE], *iS, *iT, obuf[__SIZE], *oS = obuf, *oT = oS + __SIZE - 1, __c, qu[55]; int __f, qr, _eof;
	#define Gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	inline void flush () { fwrite (obuf, 1, oS - obuf, stdout), oS = obuf; }
	inline void gc (char &x) { x = Gc(); }
	inline void pc (char x) { *oS ++ = x; if (oS == oT) flush (); }
	inline void pstr (const char *s) { int __len = strlen(s); for (__f = 0; __f < __len; ++__f) pc (s[__f]); }
	inline void gstr (char *s) { for(__c = Gc(); __c < 32 || __c > 126 || __c == ' ';)  __c = Gc();
		for(; __c > 31 && __c < 127 && __c != ' '; ++s, __c = Gc()) *s = __c; *s = 0; }
	template <class I> inline bool read (I &x) { _eof = 0;
		for (__f = 1, __c = Gc(); (__c < '0' || __c > '9') && !_eof; __c = Gc()) { if (__c == '-') __f = -1; _eof |= __c == EOF; }
		for (x = 0; __c <= '9' && __c >= '0' && !_eof; __c = Gc()) x = x * 10 + (__c & 15), _eof |= __c == EOF; x *= __f; return !_eof; }
	template <class I> inline void write (I x) { if (!x) pc ('0'); if (x < 0) pc ('-'), x = -x;
		while (x) qu[++ qr] = x % 10 + '0',  x /= 10; while (qr) pc (qu[qr --]); }
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
} using io::pc; using io::gc; using io::pstr; using io::gstr; using io::read; using io::write;

int n,m;
int a[20][1000005],msk[1000005];

ll dp[1 << 20];
int main(){	
	read(n);read(m);
	rep(i,1,m) msk[i] = (1 << n) - 1;
	rep(i,0,n - 1){
		rep(j,1,m){
			read(a[i][j]);
			if(a[i][j] == -1) msk[j] ^= 1 << i;
		}
	}
	rep(i,0,n - 1){
		rep(j,1,m){
			if(a[i][j] == -1) continue;
			dp[msk[j]] += a[i][j];
			dp[msk[j] ^ (1 << i)] -= a[i][j];
		}
	}
	rep(i,0,n - 1){
		rep(S,0,(1 << n) - 1) if((S >> i) & 1) dp[S - (1 << i)] += dp[S];
	}
	ll answer = 0;
	rep(S,0,(1 << n) - 1) chkmax(answer,dp[S]);
	printf("%lld\n",answer);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 20
Accepted

Test #1:

score: 20
Accepted
time: 0ms
memory: 30692kb

input:

10 2000
577534 -1 -1 1510473 1954923 -1 3088519 -1 9958770 -1 -1 789229936 7476647 -1 -1 -1 -1 -1 8959559 -1 -1 8222549 2329485 -1 -1 -1 -1 -1 9438768 -1 5521504 -1 -1 -1 -1 -1 -1 8497790 1061851 9092355 7487890 5950767 7099280 4539854 -1 873314 -1 2079774 4461992 681211 -1 -1 -1 9453031 -1 -1 31860...

output:

144921545910

result:

ok 1 number(s): "144921545910"

Test #2:

score: 20
Accepted
time: 0ms
memory: 28420kb

input:

10 1981
36854 -1 -1 -1 58589 365339 -1 -1 -1 -1 -1 -1 -1 -1 -1 13451 -1 -1 378380 -1 -1 105086 348305 -1 -1 142112 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 70791 -1 -1 357983 -1 127530 -1 -1 -1 -1 -1 -1 717177876 -1 -1 -1 -1 -1 -1 -1 -1 -1 85569 -1 -1 -1 -1 319836 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

output:

143781283794

result:

ok 1 number(s): "143781283794"

Test #3:

score: 20
Accepted
time: 0ms
memory: 28420kb

input:

10 1980
-1 -1 -1 -1 212643 125070 -1 2384112 -1 1083667 929176 -1 966102 -1 -1 -1 2282563 -1 1517526 1857317 -1 -1 -1 949372 -1 -1 -1 1919723 -1 -1 571990 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 414879 -1 -1 -1 -1 -1 1548061 -1 -1 -1 211579 -1 317755 -1 2253398 -1 1342148 -1 -1 1846907 -1 -1 -1 161059 2014...

output:

135858523900

result:

ok 1 number(s): "135858523900"

Test #4:

score: 20
Accepted
time: 0ms
memory: 28496kb

input:

10 1977
-1 5079259 5207799 1469061 6112915 -1 1937995 -1 2679781 -1 5237215 -1 4588981 6700093 7443852 5890076 -1 4785134 6615436 -1 6170584 -1 -1 -1 -1 -1 8034785 -1 -1 -1 7613414 -1 -1 4302759 4953012 -1 677643 6979231 6603668 9154773 7721719 728934 -1 -1 5304117 -1 2969285 -1 -1 -1 -1 5048218 -1 ...

output:

152900832222

result:

ok 1 number(s): "152900832222"

Test #5:

score: 20
Accepted
time: 0ms
memory: 28428kb

input:

10 1966
191182 3542353 -1 1449491 1918173 -1 521607060 -1 404200 2592966 -1 3157674 1764430 1169543 291226 -1 -1 3414911 2816172 -1 1155424 1877374 -1 362214 2017417 1951302 363494 3208779 1285214 1021340 -1 2352176 -1 2109275 -1 2982958 -1 510425436 2610010 3583665 -1 -1 1498259 -1 -1 -1 2509123 -1...

output:

133379948003

result:

ok 1 number(s): "133379948003"

Test #6:

score: 20
Accepted
time: 0ms
memory: 28572kb

input:

10 2000
-1 -1 -1 8676752 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 8950050 -1 -1 5047530 -1 -1 -1 -1 -1 -1 -1 -1 3596456 -1 -1 -1 -1 5644804 1285133 -1 -1 -1 1993454 -1 515091 -1 2031387 -1 -1 -1 260858 -1 -1 -1 5634739 -1 -1 -1 -1 4140488 -1 -1 7499368 -1 -1 4223049 -1 -1 -1 -1 -1 -1 8515336 292...

output:

88272613721

result:

ok 1 number(s): "88272613721"

Test #7:

score: 20
Accepted
time: 3ms
memory: 28504kb

input:

10 1957
-1 -1 -1 9258822 5042715 -1 5655856 -1 -1 -1 -1 5999144 -1 3886842 102480 -1 -1 -1 -1 3971400 1305044 1923125 2173799 7508660 62893 6471290 3568831 -1 -1 -1 -1 -1 -1 -1 1508641 2989329 8201935 3611211 819952157 -1 -1 7426076 7243997 4059260 9010620 9422058 -1 -1 5005478 -1 -1 -1 -1 3901931 -...

output:

152846234928

result:

ok 1 number(s): "152846234928"

Test #8:

score: 20
Accepted
time: 0ms
memory: 28444kb

input:

10 2000
378530 1045009 246082 -1 208242 4289571 4835797 2576660 -1 4416431 -1 689375 1314926 -1 -1 4610822 -1 4169735 -1 -1 -1 2654630 3283410 4474333 -1 2369066 -1 3466683 1335332 3818665 474639 1390456 3288233 -1 3435379 2859743 3965183 1120511 -1 884011 -1 3914697 3701748 4252926 3433721 -1 11999...

output:

125541101976

result:

ok 1 number(s): "125541101976"

Test #9:

score: 20
Accepted
time: 0ms
memory: 26512kb

input:

9 1993
-1 56347 739534 -1 -1 -1 -1 326395 -1 227069 -1 436937 -1 -1 382924 1026500 135915 255758 -1 588439728 254549 -1 477098 -1 631568 993709 129499 194238 -1 -1 180370 456426 -1 631788 -1 -1 318418 56941 450496 750006 1021723 -1 735611 -1 36273 298461 313880 -1 -1 -1 538658 741309 -1 -1 506445 29...

output:

137551454390

result:

ok 1 number(s): "137551454390"

Test #10:

score: 20
Accepted
time: 2ms
memory: 24372kb

input:

8 2000
5899593 8169541 -1 -1 -1 -1 -1 8013793 7032240 -1 8358173 1239485 -1 4001022 -1 -1 412779 971598 3920348 2190856 8485141 2854457 7123379 -1 -1 7800012 3694457 -1 1448931 8963790 924865 2416364 5419218 -1 4368480 76137 1262253 -1 -1 4617253 -1 9396462 -1 8118842 4296674 -1 -1 -1 -1 -1 -1 55106...

output:

90782422398

result:

ok 1 number(s): "90782422398"

Subtask #2:

score: 20
Accepted

Dependency #1:

100%
Accepted

Test #11:

score: 20
Accepted
time: 227ms
memory: 63176kb

input:

12 999842
8351128 8274172 7778980 -1 -1 -1 867914 8667911 5064647 734974899 8728096 -1 -1 -1 -1 9260101 9170550 -1 -1 3918380 -1 5516927 -1 -1 1497260 3234767 4467407 4260505 -1 -1 3049312 1035780 -1 -1 -1 -1 3160955 9642578 -1 -1 -1 8401788 -1 -1 -1 8123208 -1 5891916 9598028 -1 -1 7250111 -1 17075...

output:

5471074751111

result:

ok 1 number(s): "5471074751111"

Test #12:

score: 20
Accepted
time: 216ms
memory: 71472kb

input:

14 999255
-1 -1 -1 -1 447334 403041 -1 -1 -1 -1 311256 452465 -1 10722 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 238316 -1 -1 -1 -1 -1 -1 -1 -1 27807 -1 438516 -1 133297 -1 -1 30352 150327 -1 -1 288218 -1 -1 -1 354085 -1 368563 -1 -1 -1 420125 345869 409737 -1 -1 -1 -1 -1 -1 -1 116981 -1 44...

output:

9187420681227

result:

ok 1 number(s): "9187420681227"

Test #13:

score: 20
Accepted
time: 216ms
memory: 71520kb

input:

14 1000000
27376 255265 -1 77973 17150 22178 43524 112893 19015 219489 -1 -1 54402 -1 -1 -1 -1 -1 243886 154846 150638 60294 -1 105043 183646 -1 -1 95917 19201 -1 -1 -1 -1 65556 -1 202356 39105 221523 -1 183588 39274 -1 -1 249820 123770 62946 217459 -1 94444 -1 124223 -1 -1 -1 129031 -1 25863 170451...

output:

1984210288399

result:

ok 1 number(s): "1984210288399"

Test #14:

score: 20
Accepted
time: 282ms
memory: 71664kb

input:

14 999836
2664220 8393524 -1 8447950 -1 7673778 1970642 751040 -1 1238798 -1 -1 9501482 1312805 -1 5174533 -1 -1 -1 3605783 8422103 -1 647871 3050793 7623676 9983715 -1 -1 -1 5670146 -1 -1 -1 9916783 2347596 -1 591641 2510503 -1 2415638 -1 9862480 -1 1143735 3363125 8803317 4821233 945135 6484824 -1...

output:

3746845955363

result:

ok 1 number(s): "3746845955363"

Test #15:

score: 20
Accepted
time: 235ms
memory: 69552kb

input:

14 1000000
-1 -1 -1 -1 46846 -1 122011 156782 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 122043 155220 -1 114399 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 183458 -1 -1 -1 -1 -1 -1 183432 -1 -1 -1 -1 -1 70084 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

output:

9701660447593

result:

ok 1 number(s): "9701660447593"

Test #16:

score: 20
Accepted
time: 208ms
memory: 71604kb

input:

14 1000000
72231 71333 -1 23482 -1 -1 -1 -1 14078 96039 222274 29281 63850 170473 228127 -1 82543 -1 -1 -1 -1 -1 -1 -1 33916 -1 36092 129778 -1 100386 22607 191358 -1 -1 -1 -1 -1 127872 186093 108767 -1 5102 -1 -1 127078 87675 -1 54537 255892 89684 -1 -1 -1 68638 110374 -1 -1 -1 -1 30748 55603 -1 -1...

output:

3003093266284

result:

ok 1 number(s): "3003093266284"

Test #17:

score: 20
Accepted
time: 236ms
memory: 63252kb

input:

12 999161
-1 5917388 -1 -1 -1 -1 3895488 88301 -1 -1 -1 -1 -1 1244422 -1 -1 -1 3268890 -1 1557772 8567456 -1 -1 1634516 -1 9103009 -1 3424735 -1 7820320 -1 -1 3020370 -1 8418003 -1 -1 3519227 -1 -1 -1 -1 7191450 -1 -1 -1 5503709 -1 -1 6439154 9724423 2248187 -1 -1 679111 -1 -1 3536275 -1 -1 -1 -1 -1...

output:

5053614418856

result:

ok 1 number(s): "5053614418856"

Test #18:

score: 20
Accepted
time: 241ms
memory: 71464kb

input:

14 999742
-1 122262 322968 -1 414280 -1 375812 -1 -1 -1 -1 -1 265869 -1 -1 -1 -1 -1 -1 -1 -1 84711 -1 378336 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 405399 -1 -1 -1 -1 322360 -1 -1 -1 359363 50561 -1 21121 -1 -1 -1 -1 -1 80430 70006 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 320455 62295 -1 -1 -1 -1 -1 -1 -1 -...

output:

9219310271446

result:

ok 1 number(s): "9219310271446"

Test #19:

score: 20
Accepted
time: 230ms
memory: 71516kb

input:

14 1000000
265317 215412 159375 20642 86441 -1 386467 74834 68219 -1 -1 108132 -1 -1 -1 66892 61016 -1 -1 -1 -1 398745 -1 -1 -1 -1 -1 -1 -1 -1 -1 355440 153278 167113 -1 -1 325866 315718 297268 -1 -1 -1 44111 82016 -1 -1 -1 312522 91306 -1 -1 -1 -1 -1 -1 -1 -1 225083 313396 -1 -1 -1 -1 -1 17097 -1 2...

output:

2075287371388

result:

ok 1 number(s): "2075287371388"

Test #20:

score: 20
Accepted
time: 277ms
memory: 69468kb

input:

14 1000000
-1 4014659 -1 1406557 4498551 -1 -1 -1 8463382 5125618 4343590 -1 -1 -1 -1 -1 4399355 3459304 -1 7900765 -1 7428917 -1 1012616 3541798 -1 -1 -1 -1 -1 -1 2212556 3733085 1319013 3077590 7627542 5840654 -1 8617766 -1 4916116 -1 3101285 -1 -1 5222593 -1 -1 -1 7304218 4167369 3959677 -1 -1 -1...

output:

4145165034293

result:

ok 1 number(s): "4145165034293"

Subtask #3:

score: 20
Accepted

Test #21:

score: 20
Accepted
time: 212ms
memory: 78036kb

input:

16 1000000
1678292 3506611 3517442 7482059 3235169 7850879 2719736 3579860 8212996 8672372 7235114 6351463 6539238 3596242 517079 6853239 6033392 9054320 7042766 9890810 8455403 8916458 9785849 1807102 1412966 4281493 8750874 8326572 5481267 7653917 40034 4405576 1523421 3568949 6846331 5491786 3132...

output:

22206120770174

result:

ok 1 number(s): "22206120770174"

Test #22:

score: 20
Accepted
time: 299ms
memory: 100080kb

input:

20 999337
7962 261862 394368 84978 371886 390829 229413 258152 151076 272803 50841 261776 294476 17549 355384 315013 250559 191181 239307 184740 336467 110808 296673 282182 397701 34348 322548 273854 129328 347816 231304 127903 151033 247944 352320 130954 235267 86998 122532 370648 73642 230206 1213...

output:

12054261506588

result:

ok 1 number(s): "12054261506588"

Test #23:

score: 20
Accepted
time: 295ms
memory: 98300kb

input:

20 1000000
479235 41601 366230 103965 352836 615206 439267 687057 389497 71074 942 798691 570019 107915 551287 390932 773479 635346 311824 513310 790838 425095 389465 704632 407958 375044 538529 279886 472985 263813 629449 639523 706497 353115 557750 581781 440946 447599 710682 786576 605233 546525 ...

output:

5602218447737

result:

ok 1 number(s): "5602218447737"

Test #24:

score: 20
Accepted
time: 215ms
memory: 81884kb

input:

16 1000000
5504229 9754982 7793674 3059262 761392 4239025 6175008 2609361 5330859 3089037 7947836 5119585 1484696 6255804 3915496 7901858 894232 4353293 8859743 7818696 4728237 3491308 8243476 3053123 1966424 1359255 3160472 6652765 4773035 4357487 2486176 2749188 9822758 6569476 2499384 3003291 491...

output:

23472728841237

result:

ok 1 number(s): "23472728841237"

Test #25:

score: 20
Accepted
time: 333ms
memory: 99136kb

input:

20 1000000
858366 91913 1585506 25562 1387088 524574 76802 1443339 1347794 1485662 1163323 1351848 823576 1448922 738679 876559 1036860 544355 1324510 1391694 1394395 956462 304414 114270 1234359 852241 1374720 247538 190678 931956 1100376 957943 1014608 1115277 1073485 1401779 1482453 69801 1080468...

output:

8808359950353

result:

ok 1 number(s): "8808359950353"

Test #26:

score: 20
Accepted
time: 319ms
memory: 98268kb

input:

20 1000000
718280 1776774 1032283 35296 998260 886031 586835 344017 1648872 973499 1134672 963675 1949651 1417303 693503 1483895 1405806 563733 1245440 1219098 868637 1192331 844531 2180300 408926 1970791 468051 2117149 956919 154093 2178256 45266 2244639 602212 2255774 736605 1845708 645962 273263 ...

output:

8520478927174

result:

ok 1 number(s): "8520478927174"

Test #27:

score: 20
Accepted
time: 307ms
memory: 98988kb

input:

20 1000000
4404280 1119875 7205266 9488232 6919674 984389 5753311 5141910 510973 8018543 6073622 3372153 7301432 4126349 5436048 348929 3645625 5391265 3595993 9232987 1736203 8043456 5882557 7938473 3705517 1930330 7792359 2353909 3935178 5660223 5875632 3037648 111972 1684015 4686895 1114109 43319...

output:

22781598231515

result:

ok 1 number(s): "22781598231515"

Test #28:

score: 20
Accepted
time: 348ms
memory: 98700kb

input:

20 1000000
157302 55064 66135 254239 1531068 116835 1149611 1297043 268383 729823 623671 44703 599404 1339095 721362 824172 870684 685015 210666 37031 481845 321441 458824 1366300 91329 53315 1153839 768128 741387 969459 401049 1154479 1546075 550466 1260667 495403 87550 1214865 1146466 593999 14792...

output:

12187361182190

result:

ok 1 number(s): "12187361182190"

Test #29:

score: 20
Accepted
time: 323ms
memory: 98556kb

input:

20 1000000
7289 2275 29667 26710 7507 11674 22084 11288 16190 25951 5706 1264 9569 2564 11242 22840 5787 12016 6542 18236 28808 2536 3452 24564 22687 13384 13102 21333 32687 22674 15175 27218 32397 24307 12751 27293 18134 6975 31114 10124 24951 28579 19583 21261 17106 25522 8890 32042 8321 17405 817...

output:

5677029018456

result:

ok 1 number(s): "5677029018456"

Test #30:

score: 20
Accepted
time: 332ms
memory: 98852kb

input:

20 1000000
5400964 9721242 8461722 5161531 3567898 8164919 7346036 1420945 1716683 6740536 6952262 1012305 7569678 7293300 7817214 3773755 415796 6917769 1998336 9665029 7808897 5616721 1628176 5778382 6988508 72942 2485276 8213741 6754884 3640779 9820471 6378164 6560840 1270304 710003 3983517 86653...

output:

32381820722156

result:

ok 1 number(s): "32381820722156"

Subtask #4:

score: 40
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #31:

score: 40
Accepted
time: 428ms
memory: 98844kb

input:

20 1000000
-1 7263272 -1 -1 7294444 -1 4581927 -1 3431610 -1 1811948 1116664 7730270 9471400 1096958 -1 4537697 1767102 2351842 6812364 271878 -1 -1 -1 -1 -1 -1 -1 -1 3233048 9203682 1204386 7325008 -1 -1 -1 -1 -1 -1 -1 9845408 -1 -1 3098558 -1 8857654 -1 -1 -1 64198 -1 -1 -1 -1 -1 -1 3417175 -1 494...

output:

4987113787938

result:

ok 1 number(s): "4987113787938"

Test #32:

score: 40
Accepted
time: 380ms
memory: 99216kb

input:

20 1000000
4499810 7207140 4085458 3495950 4398943 -1 8291345 348054 1461819 6009895 -1 8608564 4697141 8659405 5167727 8463201 7901324 3315911 2246607 1220875 1608298 3796428 3485250 8809663 4216410 3690370 6548171 1069518 8911271 1312106 -1 5015681 -1 2694288 8543618 5730144 5478288 3184436 477395...

output:

11424429006751

result:

ok 1 number(s): "11424429006751"

Test #33:

score: 40
Accepted
time: 269ms
memory: 96144kb

input:

19 999449
2091 11180 -1 7117 -1 26787 1959 -1 -1 -1 16201 32669 5336 4975 -1 22358 6375 -1 -1 -1 -1 13166 -1 -1 5018 10161 3907 -1 -1 7236 16180 3131 -1 16015 31119 17441 5757 16094 -1 -1 -1 9681 16615 19447 27531 6525 3590 6298 2831 19291 18144 2303 -1 8622 -1 -1 -1 11639 28463 30465 -1 22820 -1 -1...

output:

5975632389776

result:

ok 1 number(s): "5975632389776"

Test #34:

score: 40
Accepted
time: 306ms
memory: 81716kb

input:

16 999097
6635747 93668 -1 6885108 -1 -1 5089335 -1 -1 -1 -1 2257743 5900791 -1 2596140 -1 -1 6584700 -1 6319912 5088578 -1 7707884 -1 -1 1326976 -1 -1 -1 5146897 -1 -1 3815207 -1 2313769 4791152 1544558 9783712 6698425 1243941 8396926 8971517 5535937 -1 5771893 -1 -1 5247635 954949 -1 -1 4011481 57...

output:

4600855578671

result:

ok 1 number(s): "4600855578671"

Test #35:

score: 40
Accepted
time: 376ms
memory: 98544kb

input:

20 1000000
-1 -1 -1 -1 -1 26622 20373 183366 -1 -1 93311 -1 49142 -1 218770 -1 -1 -1 95468 -1 107554 -1 -1 -1 -1 -1 -1 205124 -1 94443 -1 98550 -1 -1 -1 -1 -1 -1 -1 -1 -1 31755 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 41138 -1 52510 -1 -1 -1 -1 -1 -1 198227 -1 -1 -1 -1 -1 -1 -1 -1 79301 -1 103213 -1 -...

output:

10184369653872

result:

ok 1 number(s): "10184369653872"

Test #36:

score: 40
Accepted
time: 286ms
memory: 95092kb

input:

19 1000000
37456 33391 31623 29183 -1 15478 14472 27542 192 38395 8722 -1 -1 -1 -1 -1 33202 1369 -1 27908 -1 9046 -1 24100 42339 -1 -1 -1 19152 -1 11882 -1 23300 6005 -1 6480 -1 25146 7410 -1 34275 16339 -1 36558 -1 3512 40003 -1 13082 -1 8821 -1 40350 -1 -1 46852 11007 -1 28150 7858 46361 -1 37907 ...

output:

5502422871796

result:

ok 1 number(s): "5502422871796"

Test #37:

score: 40
Accepted
time: 445ms
memory: 99568kb

input:

20 1000000
-1 -1 -1 1964227 -1 -1 -1 -1 2103210 2645096 -1 6875189 6391898 -1 -1 9227646 6017361 -1 -1 4314821 -1 -1 -1 5527199 -1 8006441 8281959 9109564 -1 -1 8983789 3624757 4745291 8183394 -1 -1 -1 3828423 9974710 -1 -1 -1 5349349 23286 -1 2794765 9234719 -1 -1 3492834 6315559 9535410 2955941 54...

output:

6497030279484

result:

ok 1 number(s): "6497030279484"

Test #38:

score: 40
Accepted
time: 395ms
memory: 99716kb

input:

20 999723
664478 2777021 -1 2871650 2072394 -1 -1 -1 974424 1506484 -1 3527653 2535102 33876 2013346 -1 277923 3586891 2042664 -1 826605 3482 -1 -1 1450784 2791175 1317355 31760 1573849 -1 3603 911048 -1 1485991 2238956 -1 3354010 2470772 -1 -1 1821345 3513888 -1 -1 -1 3236081 863566 55094 -1 119129...

output:

11528888229322

result:

ok 1 number(s): "11528888229322"

Test #39:

score: 40
Accepted
time: 269ms
memory: 98680kb

input:

20 1000000
1870 10985 12563 -1 -1 2197 -1 1923 7088 -1 13575 796 1344 10107 -1 7227 5142 -1 335 13686 5240 229 1303 6162 15364 12562 12501 3218 11110 15716 -1 3418 -1 8610 750 14505 13983 6766 15723 616 15031 6134 9323 6616 9635 -1 -1 56 6586 9571 13589 -1 4554 7430 11267 -1 -1 6606 7538 -1 15465 71...

output:

5427504062237

result:

ok 1 number(s): "5427504062237"

Test #40:

score: 40
Accepted
time: 451ms
memory: 98776kb

input:

20 999089
-1 -1 7752397 -1 6944750 3449462 1038069 9622270 7085677 4668540 5985745 -1 -1 -1 -1 -1 4225230 4792722 8408509 -1 -1 8436507 3261412 -1 9531400 4739882 1784686 2839878 5872317 -1 -1 -1 -1 -1 1432889 -1 6013681 9860282 9936684 -1 -1 -1 -1 -1 4355765 9509596 4016208 -1 2550200 -1 -1 -1 -1 -...

output:

5534396137455

result:

ok 1 number(s): "5534396137455"

Test #41:

score: 40
Accepted
time: 334ms
memory: 94620kb

input:

19 1000000
2356264 -1 -1 298948 -1 429994 -1 1690902 -1 2122860 -1 -1 924451 2678219 -1 1727861 -1 2677787 171436 1900879 1620649 559592 -1 -1 -1 914388 884054 -1 543214 1646628 -1 170 -1 -1 -1 -1 889218 -1 -1 -1 1779324 -1 -1 -1 1062940 159873 -1 62725 -1 577976 -1 -1 1316523 -1 2701141 1736430 -1 ...

output:

10663257905045

result:

ok 1 number(s): "10663257905045"

Test #42:

score: 40
Accepted
time: 288ms
memory: 98584kb

input:

20 1000000
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 111686 -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 -1 -1 -1 -1 -1 ...

output:

6008614353035

result:

ok 1 number(s): "6008614353035"

Test #43:

score: 40
Accepted
time: 431ms
memory: 99316kb

input:

20 999832
-1 8124 5449467 1790870 -1 -1 -1 -1 -1 -1 -1 8687785 3907816 6281920 -1 649922 322658 -1 64387 -1 -1 5005673 -1 -1 -1 -1 7005875 -1 4978876 1252725 -1 -1 1202721 -1 8698904 -1 -1 -1 3776916 -1 -1 -1 2925224 6360455 -1 -1 3557825 6531490 2216198 -1 69462 -1 7991833 8057796 4027060 -1 703317...

output:

4606238310052

result:

ok 1 number(s): "4606238310052"

Test #44:

score: 40
Accepted
time: 380ms
memory: 98368kb

input:

20 1000000
311583 396131 -1 -1 623382 -1 739926 780497 -1 -1 954692 -1 72195 -1 -1 -1 -1 692677 -1 -1 -1 -1 1159422 -1 -1 -1 -1 -1 137914 -1 452678 -1 -1 -1 -1 377450 -1 -1 1055912 6113 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 555528 -1 -1 -1 -1 -1 -1 -1 -1 333671 -1 70931 -1 -1 -1 -1 992302 842592 -1 -1...

output:

10893889316016

result:

ok 1 number(s): "10893889316016"

Test #45:

score: 40
Accepted
time: 304ms
memory: 99548kb

input:

20 999795
-1 70442 49137 -1 -1 -1 -1 4459 -1 -1 -1 -1 47915 31990 92811 -1 46699 -1 -1 56464 63824 -1 -1 -1 -1 -1 -1 -1 -1 19543 49947 -1 -1 -1 87020 -1 37842 43204 -1 86980 -1 25580 -1 54520 -1 4035 -1 504 -1 -1 -1 15279 74228 8115 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 27306 -1 -1 -1 -1 -1 -1 -...

output:

5032827586629

result:

ok 1 number(s): "5032827586629"

Test #46:

score: 40
Accepted
time: 357ms
memory: 88972kb

input:

18 999831
-1 3996425 5734881 -1 5997790 -1 -1 1373549 2763171 -1 -1 3544875 -1 3732219 630562 8575672 4421961 4584590 823748 -1 5314143 -1 -1 -1 9840962 -1 3134640 5249462 2122679 -1 2264477 -1 1875186 -1 -1 -1 1535125 -1 1988392 9036882 2486426 -1 -1 -1 7817241 -1 -1 7020108 -1 -1 -1 3701391 -1 771...

output:

5551339116840

result:

ok 1 number(s): "5551339116840"

Test #47:

score: 40
Accepted
time: 325ms
memory: 89460kb

input:

18 999836
-1 29382 -1 -1 -1 -1 -1 -1 -1 -1 -1 21783 -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 16574 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 11418 -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:

11043214719362

result:

ok 1 number(s): "11043214719362"

Test #48:

score: 40
Accepted
time: 282ms
memory: 98640kb

input:

20 1000000
-1 88242 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 257378 -1 -1 -1 -1 -1 90304 -1 -1 139871 -1 -1 -1 -1 -1 -1 -1 -1 125308 -1 -1 -1 -1 -1 226000 -1 -1 106154 -1 -1 -1 30271 -1 -1 -1 -1 220738 -1 -1 52094 196104 243597 -1 -1 -1 218506 -1 -1 -1 -1 -1 -1 153985 -1 -1 -1 187946...

output:

3984780502361

result:

ok 1 number(s): "3984780502361"

Test #49:

score: 40
Accepted
time: 431ms
memory: 99360kb

input:

20 1000000
-1 506985 -1 3988743 2675294 -1 -1 -1 6173112 9093026 3528213 -1 -1 1370624 -1 5228662 -1 6895615 -1 3274298 3757828 -1 -1 4279347 -1 -1 3365541 -1 -1 -1 -1 -1 1140810 737656 9969733 6169666 -1 8776729 7064816 8853462 508161 2593220 -1 -1 -1 8773802 -1 -1 3797568 -1 6589217 1728338 -1 911...

output:

3512342428912

result:

ok 1 number(s): "3512342428912"

Test #50:

score: 40
Accepted
time: 389ms
memory: 98864kb

input:

20 999714
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 11520 -1 -1 -1 -1 -1 63520 -1 -1 -1 -1 49722 -1 -1 -1 -1 -1 -1 13585 -1 -1 36494 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 21012 -1 -1 -1 -1 -1 -1 -1 55200 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4898 -1 -1 -1 -1 28186 -1 -1 -1 -1 -1 -1 -1 ...

output:

10545402777373

result:

ok 1 number(s): "10545402777373"