#include <iostream> using namespace std; int main() { int n,a=0,b=0,x1,x2,y1,y2; cin>>n; for(int i=0;i<n;i++) { cin>>x1>>x2>>y1>>y2; if(x2!=y2) { if(x2==x1+y1) b++; else if(y2==x1+y1) a++; } } cout<<a<<" "<<b<<endl; return 0; }
#include <iostream> using namespace std; int main() { int n,a=0,b=0,x1,x2,y1,y2; cin>>n; for(int i=0;i<n;i++) { cin>>x1>>x2>>y1>>y2; if(x2!=y2) { if(x2==x1+y1) b++; else if(y2==x1+y1) a++; } } cout<<a<<" "<<b<<endl; return 0; }