Code Festival A If you cannot solve this by

#include <stdio.h>

int main(int argc, char *argv[]) {
\x09int i;
\x09int n;

\x09while (~scanf("%d", &n)) {
\x09\x09int a1, sum;

\x09\x09scanf("%d", &a1);

\x09\x09sum = a1;
\x09\x09for (i = 1; i < n; i++) {
\x09\x09\x09int t;
\x09\x09\x09scanf("%d", &t);
\x09\x09\x09sum += t;
\x09\x09}

\x09\x09puts(a1 <= sum / n / 2 ? "Fail" : "Pass");
\x09}
}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page