Language: C

int main(){
    int W,H,x,y;
    scanf("%d", &W);
    scanf("%d", &H);
    scanf("%d", &x);
    scanf("%d", &y);
    int a,b;
    double s1,s11,s2,s21,S,s;
    a=W-x;
    b=H-y;
        if(x==0||y==0){
            if(x==0){
                if(b>=y)
                    S=dientich(y,W);
                else    
                    S=dientich(b,W);
                printf("%lf",S);
                printf(" 1");
            }else if(y==0){
                if(a>=x) 
                    S=dientich(x,H);
                else 
                    S=dientich(a,H);
                printf("%lf",S);
                printf(" 1");
                }
        
        
            }
        else if(x==W){
            if(b>=y)
                    S=dientich(y,W);
                else    
                    S=dientich(b,W);
                printf("%lf",S);
                printf(" 1");
        }
        else if(y==H){
            if(a>=x) 
                    S=dientich(x,H);
                else 
                    S=dientich(a,H);
                printf("%lf",S);
                printf(" 1");
                }
        else{
            s1=dientich(x,H);
    
            s11=dientich(a,H);
            if(s1>s11)
                S=s11;
            else S=s1;
    
   
                s2=dientich(y,W);
                s21=dientich(b,W);
            if(s2>s21)
                s=s21;
            else 
                s=s2;
            if(S>=s)
                printf("%lf ",S);
            else 
                printf("%lf ",s);
            if(S==s)
                printf(" 1");
            else 
                printf(" 0");
    }
    return 0;    
}

Compiler output:
main.c: In function 'main':
main.c:3:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |     scanf("%d", &W);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:3:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 |     scanf("%d", &W);
      |     ^~~~~
main.c:3:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:23: error: implicit declaration of function 'dientich' [-Wimplicit-function-declaration]
   14 |                     S=dientich(y,W);
      |                       ^~~~~~~~
main.c:17:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |                 printf("%lf",S);
      |                 ^~~~~~
main.c:17:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   24 |                 printf("%lf",S);
      |                 ^~~~~~
main.c:24:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:35:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   35 |                 printf("%lf",S);
      |                 ^~~~~~
main.c:35:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:43:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   43 |                 printf("%lf",S);
      |                 ^~~~~~
main.c:43:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:62:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   62 |                 printf("%lf ",S);
      |                 ^~~~~~
main.c:62:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:64:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   64 |                 printf("%lf ",s);
      |                 ^~~~~~
main.c:64:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:66:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   66 |                 printf(" 1");
      |                 ^~~~~~
main.c:66:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:68:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   68 |                 printf(" 0");
      |                 ^~~~~~
main.c:68:17: note: include '<stdio.h>' or provide a declaration of 'printf'