QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#472851#2785. Boxes with souvenirsRafi22100 ✓229ms199244kbC++141.2kb2024-07-11 19:53:002024-07-11 19:53:01

Judging History

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

  • [2024-07-11 19:53:01]
  • 评测
  • 测评结果:100
  • 用时:229ms
  • 内存:199244kb
  • [2024-07-11 19:53:00]
  • 提交

answer

#include <bits/stdc++.h>
#include "boxes.h"
using namespace std;

#ifdef DEBUG
auto&operator<<(auto&o,pair<auto,auto>p){return o<<"("<<p.first<<", "<<p.second<<")";}
auto operator<<(auto&o,auto x)->decltype(x.end(),o){o<<"{";int i=0;for(auto e:x)o<<","+!i++<<e;return o<<"}";}
#define debug(X...)cerr<<"["#X"]: ",[](auto...$){((cerr<<$<<"; "),...)<<endl;}(X)
#else
#define debug(...){}
#endif

#define ll long long
#define ld long double
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define FOR(i,l,r) for(int i=(l);i<=(r);i++)
#define ROF(i,r,l) for(int i=(r);i>=(l);i--)
int inf=2000000007;
ll infl=1000000000000000007;
ll mod=1000000007;

const int N=10000007;

ll DP[N];
ll a[N];
ll L;

ll cost(int l,int r)
{
	if(l>r) return 0;
	return min({L,2*a[r],2*(L-a[l])});
}

ll delivery(int n, int k, int l,int p[])
{
	L=l;
	FOR(i,0,n-1) a[i+1]=p[i];
	FOR(i,1,n) DP[i]=infl;
	FOR(i,1,k) DP[i]=cost(1,i);
	ll ans=infl;
	for(int i=1;i<=n;i++)
	{
		if(i>=k) DP[i]=min(DP[i],DP[i-k]+cost(i-k+1,i));
		if(n-i<=k) ans=min(ans,DP[i]+cost(i+1,n));
	}
	debug(ans);
	return ans;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 5804kb

input:

1 1 1000000000
210758687

output:

421517374

result:

ok single line: '421517374'

Test #2:

score: 0
Accepted
time: 1ms
memory: 5772kb

input:

1000 1 1000000000
1808509 2182084 3015527 4447494 7769779 8792029 9883237 12829051 12902231 13338930 16688684 16992515 17866419 19063417 20124997 20125047 20514891 20917910 24004241 25917774 30411202 34419407 34944244 36371532 36402573 39271076 39612282 40912226 41119528 41176691 42741034 42801382 4...

output:

511681980406

result:

ok single line: '511681980406'

Test #3:

score: 0
Accepted
time: 1ms
memory: 5936kb

input:

1000 1 1000
2 3 4 4 4 7 7 8 10 12 12 13 14 15 16 16 17 17 18 21 22 23 24 24 25 28 30 30 30 30 32 32 34 34 34 34 35 35 35 35 35 36 36 36 37 39 41 42 42 43 43 44 44 44 45 46 46 46 47 48 49 51 52 53 55 56 58 60 61 61 62 63 64 68 69 70 72 74 75 76 76 76 78 78 80 81 83 83 84 84 85 85 86 86 88 88 90 92 92...

output:

511638

result:

ok single line: '511638'

Test #4:

score: 0
Accepted
time: 1ms
memory: 5808kb

input:

1000 1 5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2322

result:

ok single line: '2322'

Test #5:

score: 0
Accepted
time: 1ms
memory: 5996kb

input:

1000 1 1000000000
447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 447532220 44...

output:

895064440000

result:

ok single line: '895064440000'

Test #6:

score: 0
Accepted
time: 1ms
memory: 5816kb

input:

1000 1 1000000000
18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 18457857 61895049 61895049 61895049 61895049 61895049 61895049 61895049 61895049 61895049 61895049 618...

output:

619577021140

result:

ok single line: '619577021140'

Test #7:

score: 0
Accepted
time: 1ms
memory: 5776kb

input:

1000 1 1000000000
159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 159227065 15...

output:

294049546692

result:

ok single line: '294049546692'

Subtask #2:

score: 10
Accepted

Test #8:

score: 10
Accepted
time: 1ms
memory: 5772kb

input:

1000 1000 1000
0 0 1 2 3 3 4 5 5 6 6 7 8 8 8 9 10 11 11 11 12 13 13 13 14 14 15 16 17 17 17 18 20 20 21 21 24 25 25 26 30 31 34 34 35 38 40 43 44 46 46 46 47 47 51 52 52 52 55 56 58 62 64 65 67 68 69 72 73 75 76 77 78 79 79 80 83 84 85 85 86 86 87 88 88 88 92 92 92 95 95 96 98 98 99 99 100 100 101 1...

output:

1000

result:

ok single line: '1000'

Test #9:

score: 0
Accepted
time: 1ms
memory: 5868kb

input:

1000 1000 5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

5

result:

ok single line: '5'

Test #10:

score: 0
Accepted
time: 0ms
memory: 5776kb

input:

1000 1000 1000000000
154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846 154376846...

output:

308753692

result:

ok single line: '308753692'

Test #11:

score: 0
Accepted
time: 1ms
memory: 5776kb

input:

1000 1000 1000000000
198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287 198812287...

output:

1000000000

result:

ok single line: '1000000000'

Test #12:

score: 0
Accepted
time: 1ms
memory: 5800kb

input:

1000 1000 1000000000
84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 84700188 ...

output:

665477708

result:

ok single line: '665477708'

Test #13:

score: 0
Accepted
time: 0ms
memory: 5992kb

input:

1000 1000 1000000000
999000464 999001671 999001764 999002621 999002638 999003276 999003514 999005294 999005677 999005939 999006089 999008721 999009077 999012938 999014321 999015139 999015321 999015639 999016078 999016400 999016872 999017560 999017819 999018653 999019793 999019959 999021115 999021456...

output:

1999072

result:

ok single line: '1999072'

Test #14:

score: 0
Accepted
time: 1ms
memory: 5784kb

input:

1000 1000 1000
800 800 800 800 800 800 800 800 800 800 800 800 801 801 801 801 801 801 802 802 802 802 802 802 803 803 803 803 804 804 805 805 805 805 806 806 806 806 806 806 806 807 807 807 807 807 807 807 807 807 807 808 808 808 808 808 808 809 809 809 809 809 810 810 810 810 811 811 811 811 812 8...

output:

400

result:

ok single line: '400'

Subtask #3:

score: 15
Accepted

Test #15:

score: 15
Accepted
time: 1ms
memory: 5796kb

input:

10 5 5
0 0 0 0 0 1 3 3 3 4

output:

5

result:

ok single line: '5'

Test #16:

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

input:

10 5 1000000000
334882664 334882664 334882664 334882664 334882664 334882664 334882664 334882664 334882664 334882664

output:

1339530656

result:

ok single line: '1339530656'

Test #17:

score: 0
Accepted
time: 0ms
memory: 5920kb

input:

10 2 1000000000
85975415 85975415 85975415 85975415 85975415 85975415 85975415 85975415 85975415 105352579

output:

898508478

result:

ok single line: '898508478'

Test #18:

score: 0
Accepted
time: 0ms
memory: 5756kb

input:

10 2 1000000000
450369670 450369670 450369670 450369670 450369670 450369670 450369670 450369670 973255696 973255696

output:

3656445968

result:

ok single line: '3656445968'

Test #19:

score: 0
Accepted
time: 1ms
memory: 5788kb

input:

10 10 1000000000
20859 165911 251492 256622 477740 805842 835605 999196078 999415731 999776268

output:

3279054

result:

ok single line: '3279054'

Test #20:

score: 0
Accepted
time: 1ms
memory: 5828kb

input:

10 5 1000
7 63 166 821 853 857 930 934 989 995

output:

712

result:

ok single line: '712'

Test #21:

score: 0
Accepted
time: 0ms
memory: 5808kb

input:

10 3 1000000000
999047045 999128015 999188976 999210145 999404712 999486411 999527465 999770649 999830703 999904465

output:

4621760

result:

ok single line: '4621760'

Test #22:

score: 0
Accepted
time: 1ms
memory: 5792kb

input:

10 4 1000
810 820 883 904 912 924 940 943 991 999

output:

574

result:

ok single line: '574'

Subtask #4:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #23:

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

input:

1000 1000 1000000000
325942 1204336 1612183 2893660 5229507 5594519 6900231 8529570 10109022 11952220 14385840 15224378 15427006 15460653 16267558 18182056 19024727 19448694 21171021 21976036 22199267 23683490 24156493 24169712 28958155 29308895 30228647 32068074 32363555 33028799 34696392 37439068 ...

output:

1000000000

result:

ok single line: '1000000000'

Test #24:

score: 0
Accepted
time: 0ms
memory: 5820kb

input:

1000 500 5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

8

result:

ok single line: '8'

Test #25:

score: 0
Accepted
time: 1ms
memory: 5772kb

input:

1000 4 5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

584

result:

ok single line: '584'

Test #26:

score: 0
Accepted
time: 1ms
memory: 5820kb

input:

1000 500 1000000000
834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 834798641 ...

output:

660805436

result:

ok single line: '660805436'

Test #27:

score: 0
Accepted
time: 1ms
memory: 5816kb

input:

1000 200 1000000000
133968427 182543342 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 220610806 ...

output:

3073193500

result:

ok single line: '3073193500'

Test #28:

score: 0
Accepted
time: 0ms
memory: 5992kb

input:

1000 200 1000000000
803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 803993538 ...

output:

1511478214

result:

ok single line: '1511478214'

Test #29:

score: 0
Accepted
time: 1ms
memory: 5804kb

input:

1000 1000 1000000000
3223 5912 8058 11954 13331 13809 21465 21712 22135 25423 29599 31876 37650 38411 43826 46446 51811 55114 56220 57514 57940 62052 63617 65159 71482 74444 76584 78302 79695 80137 83832 85766 87989 89498 90256 90558 90956 93432 93705 95206 95307 96994 97439 99028 99681 99969 100407...

output:

3987094

result:

ok single line: '3987094'

Test #30:

score: 0
Accepted
time: 1ms
memory: 5840kb

input:

1000 500 1000
0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 3 5 5 6 6 6 7 7 7 7 8 8 8 9 10 10 10 11 11 12 12 13 13 13 13 14 14 15 15 15 16 16 16 17 17 18 19 20 20 20 20 21 22 22 23 23 23 23 24 24 24 25 25 26 26 26 27 27 27 28 29 29 30 30 31 31 33 33 33 34 34 34 35 36 36 36 37 38 38 38 39 40 41 41 41 41 42 43 43 43 ...

output:

808

result:

ok single line: '808'

Test #31:

score: 0
Accepted
time: 1ms
memory: 5824kb

input:

1000 300 1000000000
999000212 999000450 999001304 999002630 999003721 999003812 999004876 999005215 999007267 999009662 999010031 999011300 999011338 999012727 999012912 999013032 999014365 999014375 999015057 999015159 999016374 999016681 999016938 999016945 999017465 999017527 999019102 999020324 ...

output:

4413460

result:

ok single line: '4413460'

Test #32:

score: 0
Accepted
time: 1ms
memory: 5772kb

input:

1000 400 1000
800 800 800 800 801 801 801 801 801 802 802 802 802 802 803 803 803 803 803 803 803 804 804 804 804 804 804 804 805 805 805 805 805 805 806 806 806 806 806 806 807 807 807 807 808 808 808 809 809 809 809 809 810 810 811 811 811 812 812 813 813 813 813 814 814 814 814 814 815 815 815 81...

output:

726

result:

ok single line: '726'

Subtask #5:

score: 20
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #33:

score: 20
Accepted
time: 19ms
memory: 25792kb

input:

1000000 3000 1000000000
2082 3073 3336 3340 3453 3868 4076 4853 4968 6521 9538 10548 11118 11250 13019 13152 13781 14336 16877 20606 20965 21051 21162 21519 22429 22775 23480 23509 23815 24742 26786 26922 26992 27852 28304 30974 31796 32890 34351 35532 35550 38326 39089 40430 41968 42792 43266 43363...

output:

167685443866

result:

ok single line: '167685443866'

Test #34:

score: 0
Accepted
time: 5ms
memory: 25848kb

input:

1000000 1500 5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

1602

result:

ok single line: '1602'

Test #35:

score: 0
Accepted
time: 7ms
memory: 26020kb

input:

1000000 4 20
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

2498280

result:

ok single line: '2498280'

Test #36:

score: 0
Accepted
time: 27ms
memory: 26780kb

input:

1000000 1500 1000000000
785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625528 785625...

output:

285975545648

result:

ok single line: '285975545648'

Test #37:

score: 0
Accepted
time: 27ms
memory: 26576kb

input:

1000000 600 1000000000
32219467 32219467 32219467 32219467 32219467 32219467 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128108994 128...

output:

1121469391522

result:

ok single line: '1121469391522'

Test #38:

score: 0
Accepted
time: 19ms
memory: 24136kb

input:

1000000 600 1000000000
366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 366732368 3667323...

output:

1201094907160

result:

ok single line: '1201094907160'

Test #39:

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

input:

1000000 3000 1000000000
0 0 1 1 2 2 2 3 4 7 8 10 13 18 24 28 29 31 32 32 32 37 37 41 41 52 56 58 58 58 59 60 61 61 62 69 70 71 71 74 77 77 78 78 81 82 83 90 90 92 94 94 97 98 99 101 101 101 102 103 103 105 106 108 109 111 111 113 116 119 123 124 128 128 130 131 135 139 140 142 149 150 151 152 156 15...

output:

335268344

result:

ok single line: '335268344'

Test #40:

score: 0
Accepted
time: 14ms
memory: 27428kb

input:

1000000 1500 1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

133738

result:

ok single line: '133738'

Test #41:

score: 0
Accepted
time: 27ms
memory: 27224kb

input:

1000000 900 1000000000
999000001 999000002 999000002 999000003 999000003 999000005 999000006 999000006 999000011 999000011 999000011 999000015 999000015 999000017 999000017 999000019 999000019 999000020 999000021 999000023 999000023 999000024 999000024 999000027 999000027 999000028 999000028 9990000...

output:

1111918678

result:

ok single line: '1111918678'

Test #42:

score: 0
Accepted
time: 11ms
memory: 26476kb

input:

1000000 1200 1000
800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 80...

output:

167768

result:

ok single line: '167768'

Subtask #6:

score: 30
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #43:

score: 30
Accepted
time: 229ms
memory: 199028kb

input:

10000000 1000000 1000000000
2 211 243 369 549 560 638 754 861 1095 1138 1338 1507 1526 1684 1686 1835 1842 1868 1945 1959 2140 2209 2306 2366 2580 2624 2690 2750 2788 2794 2830 2981 3128 3195 3337 3452 3953 4051 4059 4111 4152 4221 4391 4702 4745 4759 4879 4946 5051 5099 5151 5180 5360 5367 5419 545...

output:

5999136942

result:

ok single line: '5999136942'

Test #44:

score: 0
Accepted
time: 75ms
memory: 199056kb

input:

10000000 500000 5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

51

result:

ok single line: '51'

Test #45:

score: 0
Accepted
time: 88ms
memory: 199072kb

input:

10000000 4 50
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

62507476

result:

ok single line: '62507476'

Test #46:

score: 0
Accepted
time: 213ms
memory: 199024kb

input:

10000000 500000 1000000000
435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435208913 435...

output:

17408356520

result:

ok single line: '17408356520'

Test #47:

score: 0
Accepted
time: 224ms
memory: 199124kb

input:

10000000 200000 1000000000
38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 38165091 381...

output:

7485407778

result:

ok single line: '7485407778'

Test #48:

score: 0
Accepted
time: 208ms
memory: 199244kb

input:

10000000 2000 1000000000
644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 644539186 64453...

output:

2865628572480

result:

ok single line: '2865628572480'

Test #49:

score: 0
Accepted
time: 203ms
memory: 199056kb

input:

10000000 1000000 1000000000
0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 9 9 9 9 9 9 10 10 10 10 11 11 12 12 12 12 12 12 13 13 13 14 15 15 15 15 15 15 15 15 16 16 16 16 16 17 17 17 18 18 18 19 19 19 19 19 19 19 19 20 20 20 20 20 21 21 21 22 22 22 22 22 22 23 24 2...

output:

11999394

result:

ok single line: '11999394'

Test #50:

score: 0
Accepted
time: 96ms
memory: 199072kb

input:

10000000 500000 1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

4402

result:

ok single line: '4402'

Test #51:

score: 0
Accepted
time: 227ms
memory: 199080kb

input:

10000000 300000 1000000000
999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000000 999000001 999000001 999000001 999000001 999000001 999000001 999000001 999000001 999000002 999000002 999000002 999000002 999000002 999...

output:

34342984

result:

ok single line: '34342984'

Test #52:

score: 0
Accepted
time: 109ms
memory: 199052kb

input:

10000000 400000 1000
800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800...

output:

5222

result:

ok single line: '5222'