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

    Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

      Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

    Powered by Blogger.