Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
261 B
1
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	int a, b, n, c;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b;
		cout << "\n";
		if (a % b != 0) {
			c = a / b;
			cout << ((c + 1) * b) - a << "\n";
		}
		else cout << 0;
	}
}