fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a,b,c,d,e=0,f=0;
  6. cin>>a;
  7. for(b=0;b<a;b++){
  8. cin>>c>>d;
  9. e+=c;
  10. f+=d;
  11. }
  12. e-=e/10;
  13. if(e>=f){
  14. cout<<f;
  15. }
  16. else{
  17. cout<<e;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 5520KB
stdin
2
999 899
10 5
stdout
904