红酒会馆

  Farmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needs N ( ≤ N ≤ ,) planks of wood, each having some integer length Li ( ≤ Li ≤ ,) units. He then purchases a single long board just long enough to saw into the N planks (i.e., whose length is the sum of the lengths Li). FJ is ignoring the "kerf", the extra length lost to sawdust when a sawcut is made; you should ignore it, too.

  FJ sadly realizes that he doesn't own a saw with which to cut the wood, so he mosies over to Farmer Don's Farm with this long board and politely asks if he may borrow a saw.

  Farmer Don, a closet capitalist, doesn't lend FJ a saw but instead offers to charge Farmer John for each of the N- cuts in the plank. The charge to cut a piece of wood is exactly equal to its length. Cutting a plank of length costs cents.

  Farmer Don then lets Farmer John decide the order and locations to cut the plank. Help Farmer John determine the minimum amount of money he can spend to create the N planks. FJ knows that he can cut the board in various different orders which will result in different charges since the resulting intermediate planks are of different lengths.

猜你喜欢

“扶”出山村幸福路——大安市两家子镇抓党建促脱贫工作侧记

5岁女童幼儿园遭同班男孩侵犯老师全程在玩手机...

江苏淘宝村花式招聘打包工,日薪过百管饭管对象!

大道至简习近平告诉你中国为什么坚持开放...

保备战、促改革,确保各项工作落在实处

【百城百县百企调研行——庆祝改革开放40年】延安:山地增绿群众致富...

最高法首次发布司法救助典型案例

山西两大煤炭集团交流:焦煤副总经理任阳煤总经理...

冰葬走红网友评:活的越来越单调死的越来越花哨

中国工艺美术大师陈玉树:中国古典家具中的佛法留痕...

商务部:1-10月我国进出口总额超25万亿元人民币同比增长11.3%

花式“秀车技”!探秘武警国宾护卫队...

山火致79人遇难1300人失踪,特朗普加州视察遭举牌抗议“我们的错?”

美国削减10%驻非洲士兵被指转移兵力对抗中俄...

由怒转喜,退伍军人连拨两次12345

北约军舰与油轮相撞致7伤127人紧急撤离可能沉没...

生态环境部通报:辽源市整改敷衍应对,仙人河黑臭问题仍突出

林奕华张艾嘉的《聊斋》没有鬼,只有害怕...

昌乐加快“四个对接”借势借力融入中心城市

买“一体机”解决刷脸问题小心被“打脸”...