fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. float N, X, a, s=1, d=0;
  6. cin>>N>>X;
  7. for(int i=0; i<N; i++){
  8. cin>>a;
  9. d=(a/100.0)+d;
  10. if(d>a){
  11. s=(d/a)+s;
  12. d=round(d)-a;
  13. cout<<d<<" ";
  14. }
  15. }
  16. if((s*a)+d>X){
  17. cout<<"stonks";
  18. }
  19. else{
  20. cout<<"not stonks";
  21. }
  22. cout<<s<<" "<<round(d);
  23. }
Success #stdin #stdout 0.01s 5260KB
stdin
5 100
120 140 80 90 70
stdout
not stonks1 5