# ZeroJudge - f818: 物競天擇 (Survival) ### 題目連結:https://zerojudge.tw/ShowProblem?problemid=f818 ###### tags: `ZeroJudge` ```cpp= #include <iostream> using namespace std; int main() { cin.sync_with_stdio(false); cin.tie(nullptr); int lions, weights[2000], heights[2000], minimumValue, weakWeight, weakHeight; while (cin >> lions) { minimumValue = 2147483647; for (int i = 0; i < lions; ++i) cin >> heights[i]; for (int i = 0; i < lions; ++i) { cin >> weights[i]; if (minimumValue > heights[i] * weights[i]) { minimumValue = heights[i] * weights[i]; weakHeight = heights[i]; weakWeight = weights[i]; } } cout << weakHeight << ' ' << weakWeight << '\n'; } } ```