Advertisement
Saleh127

cf 1428A

Oct 19th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. test
  11. {
  12. ll a,c,d,e,i,j,k,l;
  13. cin>>a>>c>>d>>e;
  14. k=abs(a-d);
  15. l=abs(c-e);
  16. if(k && l) cout<<k+l+2<<endl;
  17. else cout<<k+l<<endl;
  18. }
  19.  
  20.  
  21. return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement