LAWRENCE - Lawrence of Arabia
题意翻译
题目大意:给定一个长度为n的序列,至多将序列分成m+1段,每段序列都有权值,权值为序列内两个数两两相乘之和。求序列权值和最小为多少?
题目描述
.center {
margin-right: auto;
margin-left: auto;
}
.center-text {
text-align: center ! important;
}
.example-table {
margin-top: 10px;
text-align: left;
width: 100%;
}
.example-table td {
max-width: 0;
word-wrap: break-word;
vertical-align: top;
}
.example-table .vertical-spacer {
height: 5px;
}
.inline {
display: inline;
}
.section {
margin-top: 19px;
margin-bottom:19px;
}
.section:first-child, .section:first-child > h3:first-child {
margin-top: 0;
}
.paragraph {
margin-top: 10px;
margin-bottom: 10px;
text-align: left;
}
.paragraph ul, .paragraph pre {
margin-top: 3px;
margin-bottom: 3px;
}
ul.padded > li, ol.padded > li {
margin-bottom: 13px;
}
ul.padded > li:last-child, ol.padded > li:last-child {
margin-bottom: 0;
}
pre {
tab-size: 4;
}
.billboard {
line-height: 1em;
outline: solid 1px black;
}
输入输出格式
输入格式
The first line is the number of outposts, 0 < P <= 500.
The second line is the number of railroad segments Lawrence can destroy, 0 <= N < P.
The third line is the space-separated values of the S outposts. Each value is an integer from 0 to 20, inclusive.
输出格式
The minimum possible stategic value of the railroad after Lawrence's attack.