#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,f=0,g=0,h=0;
long long b,c,d,e;
cin>>a;
for(long long i=1;i<=a;i++){
cin>>b>>c>>d>>e;
if(b/c==d/e){
f=0;cout<<f<<endl;
}
if(b/c!=d/e && b!=d ){
g=1;cout<<g<<endl;
}
if(b/c!=d/e && b!=d && c!=e){
h=2;cout<<h<<endl;
}
if(b/c!=d/e && b!=d && c!=e && c/e==0 ) {
g=1;cout<<g<<endl;
}
if(b/c!=d/e && b!=d && c!=e && e/c==0 ) {
g=1;cout<<g<<endl;
}
if(b/c!=d/e && b==0){
g=1;cout<<g<<endl;
}
if(b/c!=d/e && d==0){
g=1;cout<<g<<endl;
}
}
return 0;
}
大佬们帮帮我,怎么让所有的输出统一在最后输出来。