#include<stdio.h>
#include<math.h>

int best3(){

    int i,sum=0,smallest,ary[4],best_3;

    for ( i = 0; i < 4; i++)
    {
        printf("Enter %dst CT Marks: ",i+1);
        scanf("%d", &ary[i]);
    }

    smallest = ary[0];

    for ( i = 1; i < 4; i++)
    {
        if ( ary[i]<smallest)
        {
            smallest=ary[i];
        }
        
    }

    for ( i = 0; i < 4; i++)
    {
        sum=sum+ary[i];
    }

    best_3= sum-smallest;

    return best_3;
    
}

int main(){

    int best_3;
    float avg;

    best_3 = best3();

    avg= best_3/3;

    printf("Average of Best 3 CT Marks: %.2f",avg);
}
 