diff --git a/800 Codeforces Solutions/1715_B_beutifull_array.cpp b/800 Codeforces Solutions/1715_B_beutifull_array.cpp new file mode 100644 index 0000000..d8edcd7 --- /dev/null +++ b/800 Codeforces Solutions/1715_B_beutifull_array.cpp @@ -0,0 +1,41 @@ +#include +#define int long long +using namespace std; +int32_t main(){ + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int e; + cin>>e; + while (e--){ + int n , k, b , s; + cin>>n>>k>>b>>s; + int z=s-(b*k); + if(s/k==b){ + for(int i=0;i=0; i--){ + if(z>k-1){ + a[i]+=k-1; + z-=(k-1); + } + else{ + if(z!=0){ + a[i]+=z; + z=0; + } + } + } + for(int i=0;i