Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x,a,b,y,c,d;
- cin>>x>>a>>b>>y>>c>>d;
- if(a>b)
- swap(a,b);
- if(c>d)
- swap(c,d);
- if(a%x!=0)
- a=a+x-a%x; /// val de start pt a trebuie sa fie multiplu a lui x
- int kI=0;
- kI=b/x-(a-1)/x;
- if(c%y!=0)
- c=c+y-c%y; /// val de start pt c trebuie sa fie multiplu c lui y
- int kM=0;
- kM=d/y-(c-1)/y;
- if(kI>=kM)
- {
- if(kI==kM)
- cout<<"Egalitate "<<kI<<'\n';
- else
- cout<<"Ioana "<<kI<<'\n';
- }
- else
- cout<<"Maria "<<kM<<'\n';
- return 0;
- }
Add Comment
Please, Sign In to add comment