Advertisement
Guest User

123

a guest
Feb 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int S,N,x,y,i,mic,magazin;
  5. int main()
  6. { cin>>S;
  7. cin>>N;
  8. for(i=1;i<=N;i++)
  9. {
  10. cin>>x;
  11. if(i==1) {mic=x; magazin=1;}
  12. else if(x<mic)
  13. {mic=x;
  14. magazin=i;}
  15. }
  16.  
  17. cout<<S/mic<<" "<<magazin;
  18. return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement