mhdew

URI 2551

Dec 23rd, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int i, n;
  6. double t[100];
  7. double d[100];
  8. double s[100];
  9. int ans[100];
  10. int j, k, temp, m;
  11.  
  12. while(scanf("%d", &n)!=EOF){
  13. for(i=0;i<n;i++){
  14. scanf("%lf%lf", &t[i],&d[i]);
  15.  
  16. s[i]=d[i]/t[i];
  17. }
  18. m=0;
  19. for(j=0;j<n;j++){
  20. temp=0;
  21. for(k=0;k<=j;k++){
  22. if(s[k]>s[j]){
  23. temp=1;
  24. break;
  25. }
  26. }
  27. if(temp==0){
  28. ans[m]=j;
  29. m++;
  30. }
  31. }
  32.  
  33. for(j=0;j<m;j++){
  34. printf("%d\n", ans[j]+1);
  35. }
  36. }
  37.  
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment