返回小组 开始 2024-04-26 16:00:00

QL-小学-第二次测试

结束 2024-04-28 21:00:00
Contest is over.
当前 2024-11-22 06:49:05

C

include

include

using namespace std;

struct pencil {

int x, y, m;

} p[3];

bool cmp(pencil a, pencil b) {

return a.m < b.m;

}

int main() {

int n, b;
cin >> n;
for (int i = 0; i < 3; i++) {
	cin >> p[i].x >> p[i].y;
	b = (double)n / p[i].x + 0.9999999;
	p[i].m = p[i].y * b;
}
sort(p, p + 3, cmp);
cout << p[0].m;
return 0;

}


lalala  •  6个月前

比赛已结束。