Codeforces 1272A. Three Friends Solution

  1. Solve in C++:
  2. ///**********ALLAH IS ALMIGHTY************///
  3. ///AH Tonmoy
  4. ///Department of CSE,23rd batch
  5. ///Islamic University,Bangladesh
  6. #include<bits/stdc++.h>
  7. using namespace std;
  8. int main()
  9. {
  10. int a,b,c,t;
  11. cin>>t;
  12. while(t--)
  13. {
  14. cin>>a>>b>>c;
  15. cout<<max((abs(a-b)+abs(a-c)+abs(b-c))-4,0)<<endl;
  16. }
  17. }

No comments

Most View Post

Recent post

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.