Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,m;
- cin>>n>>m;
- int r,k;
- cin>>r>>k;
- int a=r-1;
- int b=k-1;
- int c=n-1;
- int d=m-1;
- int maks=0;
- int rez=0;
- if((d-b)+(c-a)>maks)
- {
- maks=(d-b)+(c-a);
- }
- if(b+(c-a)>maks)
- {
- maks=b+(c-a);
- }
- if(b+a>maks)
- {
- maks=b+a;
- }
- if((d-b)+a>maks)
- {
- maks=(d-b)+a;
- }
- cout<<maks<<endl;
- if((d-b)+(c-a)==maks)
- {
- rez++;
- }
- if(b+(c-a)==maks)
- {
- rez++;
- }
- if(b+a==maks)
- {
- rez++;
- }
- if((d-b)+a==maks)
- {
- rez++;
- }
- cout<<rez;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement