#include <iostream>
#include <windows.h>
using namespace std;
//global variable
int picior_gaina=2;
int picior_porc=4;
int main()
{
int picioare;
int capete;
int gaini=0;
int porci;
cout<<"numarul de picioare: ";cin>>picioare;cout<<endl;
cout<<"numarul de capete: ";cin>>capete;cout<<endl;
while(picioare%4!=0)
{
gaini = gaini + 1;
picioare=picioare-1;
}
porci=picioare/4;
cout<<"porci: "<<porci<<endl;
cout<<"gaini: "<<gaini<<endl;
return 0;
}