#include <stdio.h>
int main(int argc, char *argv[])
{
int a[100][4];
int n;
int i;
int sum=0,avg=0;
printf("Please input number of the student,N=");
scanf("%d",&n);
printf("\n");
for(i=0;i<n;i++)
{
printf("S%d=",i+1);
scanf("%d %d %d",&a[i][0],&a[i][1],&a[i][2]);
a[i][3]=(a[i][0]+a[i][1]+a[i][2])/3;
printf("\n");
}
for(i=0;i<n;i++)
sum+=a[i][3];
avg=sum/n;
printf("No MAT PHY CHM AVG Y/N\n");
for(i=0;i<n;i++)
printf("%d
%d
%d
%d
%d
%c\n",i+1,a[i][0],a[i][1],a[i][2],a[i][3],a[i][3]>avg?'Y':'N');
return 0;
}