Decrease the Sum of Digits SOLUTION
You are given a positive number n. In one move, you can build n by one (for example make n:=n+1). Your assignment is to locate the base number of moves you have to act so as to cause the total of digits of n to be not exactly or equivalent to s.
You need to answer t free experiments.
The primary line of the info contains one whole number t (1≤t≤2⋅104) — the quantity of experiments. At that point t experiments follow.
The main line of the experiment contains two numbers n and s (1≤n≤1018; 1≤s≤162).
For each experiment, print the appropriate response: the base number of moves you have to act so as to cause the entirety of digits of n to be not exactly or equivalent to s.