CF812C Sagheer and Nubian Market
题目描述
Sagheer在去Luxor和 Aswan的旅途中去了Nubian市场给它的朋友和亲戚买纪念品。这个市场有一些奇怪的规则。市场上有$n$件商品,标号为$1$到$n$。第$i$件商品有一个基本花费为$a_{i}$埃及镑。如果Sagheer买了$k$件下标分别为$x_{1},x_{2},...,x_{k}$的商品,那么第$j$件商品的实际花费就是$a_{xj}+x_{j}·k(1
输入格式
无
输出格式
无
说明/提示
In the first example, he cannot take the three items because they will cost him $ [5,9,14] $ with total cost $ 28 $ . If he decides to take only two items, then the costs will be $ [4,7,11] $ . So he can afford the first and second items.
In the second example, he can buy all items as they will cost him $ [5,10,17,22] $ .
In the third example, there is only one souvenir in the market which will cost him $ 8 $ pounds, so he cannot buy it.