Files
python/TangDou/Mkx/202412C1/1224.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

19 lines
468 B
C++

#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d, x, y;
cin >> a >> b >> c >> d >> x >> y;
for (int p = 100; p >= 0; p--) {
int m = p + x;//数学
int e = p - y;//英语
if (m > 100) continue;
if (e < 0) continue;
int sum = a + b + c + d + m + e;
if (sum % 6 == 0 && sum / 6 == p) {
cout << p << endl;
break;
}
}
return 0;
}