Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- double n,h,v;
- cin>>n;
- cin>>h;
- cin>>v;
- if( h>=n/2 && v>=n/2 )
- {
- cout<< v*h*4<<endl;
- }
- else if(v>=n/2 && h<=n/2)
- {
- cout<<v*(n-h)*4<<endl;
- }else if(v<=n/2 && h>=n/2) {
- cout<<h*(n-v)*4<<endl;
- }else if(v<=n/2 && h<=n/2){
- cout<<(n-v)*(n-h)*4<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment