a53

joc12

a53
Nov 19th, 2020 (edited)
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int x,a,b,y,c,d;
  7. cin>>x>>a>>b>>y>>c>>d;
  8. if(a>b)
  9. swap(a,b);
  10. if(c>d)
  11. swap(c,d);
  12. if(a%x!=0)
  13. a=a+x-a%x; /// val de start pt a trebuie sa fie multiplu a lui x
  14. int kI=0;
  15. kI=b/x-(a-1)/x;
  16. if(c%y!=0)
  17. c=c+y-c%y; /// val de start pt c trebuie sa fie multiplu c lui y
  18. int kM=0;
  19. kM=d/y-(c-1)/y;
  20. if(kI>=kM)
  21. {
  22. if(kI==kM)
  23. cout<<"Egalitate "<<kI<<'\n';
  24. else
  25. cout<<"Ioana "<<kI<<'\n';
  26. }
  27. else
  28. cout<<"Maria "<<kM<<'\n';
  29. return 0;
  30. }
  31.  
Add Comment
Please, Sign In to add comment