Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
283 B
0
Indexable
Never
#include <iostream>

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

	std::cin >> n;

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