Codeforces 1409B. Minimum Product Solution

   ///La ilaha illellahu muhammadur rasulullah

///******Bismillahir-Rahmanir-Rahim******///

///Abul Hasnat  Tonmoy

///Department of CSE,23rd batch

    ///Islamic University,Bangladesh

    1. #include <bits/stdc++.h>
    2. using namespace std;
    3. int main()
    4. {
    5. long long t,a,b,x,y,n,m,d1,d2,z=0;
    6. cin>>t;
    7. while(t--)
    8. {
    9. cin>>a>>b>>x>>y>>n;
    10. d1=a-x;
    11. d2=b-y;
    12. m=(a-min(d1,n))*(b-min(d2,max(n-d1,z)));
    13. n=(a-min(d1,max(n-d2,z)))*(b-min(d2,n));
    14. cout<<min(m,n)<<endl;
    15. }
    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.