#include <iostream>#include <vector>#include <algorithm>#include <iomanip>using namespace std;double computePay(int n, double a[], double sv) {double total = 0.0;for (int i = 0; i < n; ++i) {total += a[i];}if (n >= 5 &amp;&amp; total >= sv) {double minPrice = *std::min_element(a, a + n);total -= minPrice;}return total;}int main() {int n;double sv;cin >> n >> sv;vector<double> prices(n);for (int i = 0; i < n; ++i) {std::cin >> prices[i];}double result = computePay(n, prices.data(), sv);cout << fixed << setprecision(2) << result <<endl;return 0;}computePay 函数参数:n: 商品的数量。a: 商品价格的数组。sv: 最低支付金额。功能:计算所有商品的总价格。如果 n 大于等于5且总价格大于等于 sv,则从总价格中减去最便宜的商品的价格。返回最终的支付金额。main 函数功能:从用户输入中读取商品数量 n 和最低支付金额 sv。读取每个商品的价格并存储在 vector<double> 中。调用 computePay 函数计算最终支付金额。以固定的小数点后两位格式输出最终支付金额。