#include<iostream>
using namespace std; int n,k,w; long long lis[1000010]; long long sum; int ans; int main(){ freopen("transit.in","r",stdin); freopen("transit.out","w",stdout); scanf("%d%d%d",&n,&k,&w); for(int i=1;i<=n;i++){ long long p;scanf("%lld",&p); lis[i%k]+=p; sum+=p; } ans=w/sum*k; w=w%sum; for(int i=1;i<=k;i++){ if(w<=0) break; w-=lis[i
题目 3976 运送粮食
2024-06-11 19:48:48
|