Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- int c=0,c1=0;
- cin>>t;
- while(t--)
- {
- int x1,y1,x2,y2;
- cin>>x1>>y1>>x2>>y2;
- if(x1++==x2 && y1==y2)
- cout<<"1"<<endl;
- else if(y1++==y2 && x1==x2)
- cout<<"1"<<endl;
- else
- {
- while(x1!=x2)
- {
- x1++;
- c++;
- //if(x1==x2)
- //break;
- //printf("c=%d ",c);
- }
- while(y1!=y2-1)
- {
- y1++;
- c1++;
- //if(y1==y2)
- //break;
- //cout<<"c="<<c1<<" ";
- }
- }
- cout<<c+c1+3<<endl;
- }
- return 0;
- }
- wht is wrong my code why it did not get ac ?
Add Comment
Please, Sign In to add comment