Untitled

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

int main()
{
	int n;
	int x;
	int y;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x >> y;
		if (y % x == 0){
			if (y == x) {
				cout << 1 << " " << 1 << endl;
			}
			else {
				cout << 1 << " " << y / x << endl;
			}
		}
		if (y % x != 0) {
			cout << 0 << " " << 0 << endl;
		}
	}
}
Leave a Comment