Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
349 B
0
Indexable
Never
#include <iostream>
using namespace std;

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