Saleh127

Untitled

Apr 24th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int a[1000],b,c,d,e=0,f=0,i,j,k,l;
  6. cin>>b>>c;
  7. for(i=1; i<=b; i++)
  8. {
  9. cin>>a[i];
  10. }
  11. for(i=1; i<=b; i++)
  12. {
  13. if((a[i]+c-1)/c>=e)
  14. {
  15. e=(a[i]+c-1)/c;
  16. f=i;
  17. }
  18. }
  19. cout<<f<<endl;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment