思路

六年级记忆,但是这道题更简单一些,动物越多也就是鸡尽量多就好了,动物越少也就是兔子尽量多就好了。但是总脚数肯定是偶数。

#include <iostream>
#include <vector>

using namespace std;

int main(){
    int a, minNum, maxNum;
    while(cin >> a){
        minNum = maxNum = 0;
        if(a % 2 == 0){
            int rabbit = a / 4;
            minNum =  rabbit + (a - rabbit * 4) / 2;
            maxNum = a / 2;
        }
        cout << minNum << " " << maxNum << endl;
    }
    return 0;
}