CF810B Summer sell-off
题目描述
商店在n天中出售商品。对于第i天,出售ki件商品,会有有li个顾客购买商品。每个顾客买且只买一件商品。
商店的老板会选择f天。在这f天中,每天出售的商品数量为原来出售商品数量的两倍。老板想知道,如何选择这f天,能使出售的商品最多
输入格式
第一行两个整数n和f(1
输出格式
一行一个整数,表示商店在选择f天后,可销售产品的最大数量。
## 输入输出样例
无
说明/提示
In the first example we can choose days with numbers $ 2 $ and $ 4 $ for sell-out. In this case new numbers of products for sale would be equal to $ [2,6,2,2] $ respectively. So on the first day shop will sell $ 1 $ product, on the second — $ 5 $ , on the third — $ 2 $ , on the fourth — $ 2 $ . In total $ 1+5+2+2=10 $ product units.
In the second example it is possible to sell $ 5 $ products, if you choose third day for sell-out.