本文共 212 字,大约阅读时间需要 1 分钟。
每 k + 1 k+1 k+1 个商品就会有一个免费,剩下的没个 x x x 元,代进去即可。
#include #include using namespace std;int T;int n,k,x;int main(){ cin>>T; while(T--) { cin>>n>>k>>x; cout<<(n-n/(k+1))*x<
转载地址:http://ewel.baihongyu.com/