题解:B4467 分摊水费 / bill
B4467 分摊水费 / bill
solution
分支结构的应用。
::::info[当
::::info[当
做完了。
AC code
#include <bits/stdc++.h>
#define debug(a) cerr << (#a) << " = " << (a) << endl;
#define int long long
#define maxn 100010
#define endl '\n'
using namespace std;
int a, b;
void solve() {
int sum = a + b;
if (sum <= 10) {
cout << 4 * sum / 2.0 << " " << 4 * sum / 2.0 << endl;
}
else if (sum > 10) {
if (a > b) {
cout << 4 * 5 + 5 * (sum - 10) << " " << 4 * 5 << endl;
}
else {
cout << 4 * 5 << " " << 4 * 5 + 5 * (sum - 10) << endl;
}
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int t; t = 1;
while (t--) {
cin >> a >> b;
solve();
}
return 0;
}