#include<iostream> using namespace std; int main(){ int n; while(cin>>n){ if(n%2!=0){ cout<<0<<' '<<0<<endl; continue; } int ma,mi; int c,r; c=n/4; r=(n-c*4)/2; mi=(c+r); r=n/2; c=(n-r*2)/4; ma=(r+c); cout<<mi<<' '<<ma<<endl; } } |
Double click to view unformatted code.