返回小组 开始 2025-02-13 14:00:00

1.20集训测试

结束 2025-02-13 18:05:00
Contest is over.
当前 2025-02-23 00:04:13

132

include <stdio.h>

int main() {

double n, m, a, b, c=0, d=0, e, f=0,t;
scanf("%lf %lf", &n, &m);

for (int i=1;i<=n;i++) {
	scanf("%lf %lf", &a, &b);
	if (a == 1) {
		c = c + b;
	} else {
		d = d + b;
	}
}
f = m * (c / (c + d));
printf("%.3lf", f);
return 0;

}


zytong  •  1个月前

比赛已结束。