Skip to content

Commit b55937d

Browse files
committed
60% minimo
1 parent 1a2b738 commit b55937d

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

Free/laOtraParte.cpp

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#include <bits/stdc++.h>
2+
#define all(x) x.begin(),x.end()
3+
#define msg(str,str2) cout << str << str2<< endl
4+
using namespace std;
5+
6+
using ll = long long;
7+
using ld = long double;
8+
using uint = unsigned int;
9+
using ull = unsigned long long;
10+
template<typename T>
11+
using pair2 = pair<T, T>;
12+
using pii = pair<int, int>;
13+
using pli = pair<ll, int>;
14+
using pll = pair<ll, ll>;
15+
16+
#define pb push_back
17+
#define mp make_pair
18+
19+
int gcd(int a,int b){
20+
if(a%b==0) return b;
21+
else return gcd(b,a%b);
22+
}
23+
24+
clock_t startTime;
25+
double getCurrentTime() {
26+
return (double)(clock() - startTime) / CLOCKS_PER_SEC;
27+
}
28+
29+
void solve(){
30+
vector<int> ans;
31+
int x,y,z,n;
32+
cin>>x>>y>>z>>n;
33+
int needed = x*y*3;
34+
if(needed % 5 == 0) needed /= 5;
35+
else needed = needed/5 +1;
36+
37+
int lograrMaximo = (x-z)*y;
38+
if(n+lograrMaximo >= needed){
39+
cout << "Yes" << endl;
40+
if(n >= needed){
41+
for(int e = 0 ; e < (x-z); e++){
42+
cout << 0 << " ";
43+
}cout << endl;
44+
}else{
45+
int meta = needed - n;
46+
while(meta >= y){
47+
ans.pb(y);
48+
meta -=y;
49+
}
50+
if(meta != 0) ans.pb(meta);
51+
sort(all(ans));
52+
if(ans.size()>=(x-z)){
53+
for(int e = 0; e < (x-z); e++){
54+
cout << ans[e] << " ";
55+
}cout << endl;
56+
}else{
57+
int restante = (x-z)-ans.size();
58+
for(int e = 0 ; e < restante; e++){
59+
cout << 0 << " ";
60+
}
61+
for(int e = 0 ;e < ans.size() ; e++){
62+
cout << ans[e] << " ";
63+
}cout << endl;
64+
}
65+
66+
}
67+
}else{
68+
cout << "No" << endl;
69+
}
70+
}
71+
72+
int main(){
73+
ios_base::sync_with_stdio(false);
74+
cin.tie(0);
75+
solve();
76+
return 0;
77+
}

0 commit comments

Comments
 (0)