View Code of Problem 87

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main() {
	int a,min,max;
	scanf("%d",&a);
	if(a%4==0){
		min=a/4;
		max=a/2;
	}
	else if(a%2==0 && a%4!=0){
		max=a/2;
		min=a/4+1;
	}
	else{
		min=0;max=0;
	}
	printf("%d %d",min,max);
}

Double click to view unformatted code.


Back to problem 87