The window of Vinod's room has a width of 'A'. There are two screens hung over the window, each of which has a horizontal length of 'B'. (Vertically, the screens are long enough to cover the whole window.)We will close the window so as to minimize the total horizontal length of the uncovered part of the window. Find the total horizontal length of the uncovered parts of the window then.
#include <stdio.h>
int main()
{int A,B;
scanf("%d %d",&A,&B);
if(2*B<A){printf("%d",A-2*B);}
else{printf("%d",0);}
return 0;}
Comments
Post a Comment