#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t,x,y,a,b;
    
    cin >> t;
    while(t--){
        cin >> x >> y;
        if(x>y){
            cout<< "0 " << "0" << endl;
        }
        else if(x==y){
            cout << "1 " << "1" << endl;
        }
        else{
            if(y%x!=0){
                cout << "0 " << "0" << endl;
            }else {
                cout <<"1 " << y/x << endl;
            }
        }
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: