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