#include <stdio.h>
int main()
{
int bangou[10];
int tokuten[10];
int hyouka[10];
int i, goukei = 0, heikin, sa, h;
for (i = 0; i < 10; i++) {
scanf("%d %d", &bangou
[i
], &tokuten
[i
]); goukei += tokuten[i];
}
heikin = goukei / 10;
for (i = 0; i < 10; i++) {
sa = tokuten[i] - heikin;
if (20 <= sa) h = 0;
else if (10 <= sa) h = 1;
else if (0 <= sa) h = 2;
else if (-20 <= sa) h = 3;
else h = 4;
hyouka[i] = h;
}
for (h = 0; h < 5; h++) {
printf("\n評価:%c\n", "SABCF"[h
]); for (i = 0; i < 10; i++) {
if (hyouka[i] == h) {
printf("%d %d\n", bangou
[i
], tokuten
[i
]); }
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpCnsKCWludAliYW5nb3VbMTBdOwoJaW50CXRva3V0ZW5bMTBdOwoJaW50CWh5b3VrYVsxMF07CglpbnQJaSwgZ291a2VpID0gMCwgaGVpa2luLCBzYSwgaDsKCglmb3IgKGkgPSAwOyBpIDwgMTA7IGkrKykgewoJCXNjYW5mKCIlZCAlZCIsICZiYW5nb3VbaV0sICZ0b2t1dGVuW2ldKTsKCQlnb3VrZWkgKz0gdG9rdXRlbltpXTsKCX0KCWhlaWtpbiA9IGdvdWtlaSAvIDEwOwoJZm9yIChpID0gMDsgaSA8IDEwOyBpKyspIHsKCQlzYSA9IHRva3V0ZW5baV0gLSBoZWlraW47CgoJCWlmICgyMCA8PSBzYSkgaCA9IDA7CgkJZWxzZSBpZiAoMTAgPD0gc2EpIGggPSAxOwoJCWVsc2UgaWYgKDAgPD0gc2EpIGggPSAyOwoJCWVsc2UgaWYgKC0yMCA8PSBzYSkgaCA9IDM7CgkJZWxzZSBoID0gNDsKCgkJaHlvdWthW2ldID0gaDsKCX0KCWZvciAoaCA9IDA7IGggPCA1OyBoKyspIHsKCQlwcmludGYoIlxu6KmV5L6hOiVjXG4iLCAiU0FCQ0YiW2hdKTsKCQlmb3IgKGkgPSAwOyBpIDwgMTA7IGkrKykgewoJCQlpZiAoaHlvdWthW2ldID09IGgpIHsKCQkJCXByaW50ZigiJWQgJWRcbiIsIGJhbmdvdVtpXSwgdG9rdXRlbltpXSk7CgkJCX0KCQl9Cgl9CglyZXR1cm4gMDsKfQo=