// checker 由 AI 从下面的 testlib 格式 checker 转换而来。

/*
#include <bits/stdc++.h>
#include "testlib.h"
using namespace std;
int main(int argc, char** argv)
{
	registerTestlibCmd(argc, argv);
	long double x0 = ouf.readReal(0, 1000), y0 = ouf.readReal(0, 1000), r0 = ouf.readReal(0, 1000);
	long double xx = ans.readReal(0, 1000), yy = ans.readReal(0, 1000), rr = ans.readReal(0, 1000);
	bool k1 = false, k2 = false;
	if ((xx - x0) * (xx - x0) + (yy - y0) * (yy - y0) <= 100) k1 = true;
	if ((rr - r0) * (rr - r0) <= 100) k2 = true;
	quitp(0.5 * k1 + 0.5 * k2, "Center difference is %.3Lf (%s) / Radius difference is %.3Lf (%s)",
			sqrtl((xx - x0) * (xx - x0) + (yy - y0) * (yy - y0)), (k1 ? "Correct" : "Incorrect"),
			fabsl(rr - r0), (k2 ? "Correct" : "Incorrect"));
	return 0;
}
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    FILE* user_file = fopen("user_out", "r");
    FILE* ans_file = fopen("answer", "r");

    if (!user_file || !ans_file) {
        fprintf(stderr, "Failed to open file.\n");
        printf("0\n");
        fclose(user_file);
        fclose(ans_file);
        return 0;
    }

    long double x0, y0, r0;
    long double xx, yy, rr;

    // 读取用户输出：第一行 x y，第二行 r
    if (fscanf(user_file, "%Lf %Lf", &x0, &y0) != 2) {
        fprintf(stderr, "Failed to read user output (center).\n");
        printf("0\n");
        fclose(user_file);
        fclose(ans_file);
        return 0;
    }
    if (fscanf(user_file, "%Lf", &r0) != 1) {
        fprintf(stderr, "Failed to read user output (radius).\n");
        printf("0\n");
        fclose(user_file);
        fclose(ans_file);
        return 0;
    }

    // 读取标准答案：第一行 x y，第二行 r
    if (fscanf(ans_file, "%Lf %Lf", &xx, &yy) != 2) {
        fprintf(stderr, "Failed to read answer (center).\n");
        printf("0\n");
        fclose(user_file);
        fclose(ans_file);
        return 0;
    }
    if (fscanf(ans_file, "%Lf", &rr) != 1) {
        fprintf(stderr, "Failed to read answer (radius).\n");
        printf("0\n");
        fclose(user_file);
        fclose(ans_file);
        return 0;
    }

    // 检查数值范围（与原始 testlib 逻辑一致）
    if (x0 < 0 || x0 > 1000 || y0 < 0 || y0 > 1000 || r0 < 0 || r0 > 1000) {
        fprintf(stderr, "User output out of range [0, 1000].\n");
        printf("0\n");
        fclose(user_file);
        fclose(ans_file);
        return 0;
    }

    bool k1 = false, k2 = false;
    if ((xx - x0) * (xx - x0) + (yy - y0) * (yy - y0) <= 100) 
        k1 = true;
    if ((rr - r0) * (rr - r0) <= 100) 
        k2 = true;

    double score = 0.5 * k1 + 0.5 * k2;
    int int_score = (int)(score * 100);  // 转为 0~100 整数

    fprintf(stderr, "Center difference is %.3Lf (%s) / Radius difference is %.3Lf (%s)\n",
            sqrtl((xx - x0) * (xx - x0) + (yy - y0) * (yy - y0)), 
            (k1 ? "Correct" : "Incorrect"),
            fabsl(rr - r0), 
            (k2 ? "Correct" : "Incorrect"));

    printf("%d\n", int_score);

    fclose(user_file);
    fclose(ans_file);
    return 0;
}